#ifndef DEAL_II_WITH_MPI
return true;
#else
- if (is_artificial())
- return false;
-
- const parallel::TriangulationBase<dim, spacedim> *pt =
- dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
- this->tria);
- if (pt == nullptr)
- return true;
- else
- return (this->subdomain_id() == pt->locally_owned_subdomain());
+ return (this->tria->locally_owned_subdomain() ==
+ numbers::invalid_subdomain_id ||
+ this->subdomain_id() == this->tria->locally_owned_subdomain());
#endif
}
return true;
#else
- const parallel::TriangulationBase<dim, spacedim> *pt =
- dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
- this->tria);
-
- if (pt == nullptr)
- return true;
- else
- return (this->level_subdomain_id() == pt->locally_owned_subdomain());
+ return (this->tria->locally_owned_subdomain() ==
+ numbers::invalid_subdomain_id ||
+ this->level_subdomain_id() == this->tria->locally_owned_subdomain());
#endif
}
{
Assert(this->active(),
ExcMessage("is_ghost() can only be called on active cells!"));
- if (is_artificial() || this->has_children())
+ if (this->has_children())
return false;
#ifndef DEAL_II_WITH_MPI
return false;
#else
- const parallel::TriangulationBase<dim, spacedim> *pt =
- dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
- this->tria);
-
- if (pt == nullptr)
- return false;
- else
- return (this->subdomain_id() != pt->locally_owned_subdomain());
+ return (this->tria->locally_owned_subdomain() !=
+ numbers::invalid_subdomain_id &&
+ this->subdomain_id() != this->tria->locally_owned_subdomain() &&
+ this->subdomain_id() != numbers::artificial_subdomain_id);
#endif
}
return false;
#else
- const parallel::TriangulationBase<dim, spacedim> *pt =
- dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
- this->tria);
-
- if (pt == nullptr)
- return false;
- else
- return this->subdomain_id() == numbers::artificial_subdomain_id;
+ return (this->tria->locally_owned_subdomain() !=
+ numbers::invalid_subdomain_id &&
+ this->subdomain_id() == numbers::artificial_subdomain_id);
#endif
}