Template Class LocalCoRefinement

Class Documentation

template<int d1, int d2, int spacedim = d1>
class LocalCoRefinement

Prepare, locally co-refine, and finalize two Domain meshes.

The first domain is called space and the second embedded; neither role depends on intrinsic dimension. Both share spacedim and congruent MPI communicators. The optional immersed partitioning policy assigns embedded cell centers to their background owners after finalizing space. It requires a full-dimensional space and a fullydistributed embedded Domain. Call run() before creating application FE spaces. Domains must be empty or explicitly prepared with Domain::prepare_grid(); an already finalized mesh is rejected, not replaced.

Each domain’s Initial refinement precedes these steps:

  1. Global pre-refinement of both meshes.

  2. Repeated intersection queries using two Boost rtrees supplied by GridTools::Cache. h_space and h_embedded are the diagonals of cell axis-aligned bounding boxes, not cell measures or exact intersections. The target is the open interval lower*h_space < h_embedded < upper*h_space. space refines only space at/below the lower bound; embedded refines only embedded at/above the upper bound; both executes a space pass followed by an embedded pass against the updated trees. Equality triggers refinement. No cells are coarsened.

  3. Each space post-refinement pass refines every space cell whose bounding box intersects an embedded cell box, then repeats step 2. Embedded post-refinement is global, followed by another complete step 2.

  4. Finalize both domains, partitioning and redistributing all input fields.

The embedded preparation mesh is replicated serially on all MPI ranks; its flags are unioned across ranks. fullydistributed domains also stay serial until step 4. Input point fields are FE_Q(1) interpolated, input cell fields are FE_DGQ(0) inherited by children. Material, boundary and manifold ids follow deal.II refinement and copying. Input fields are not reread from the original file after refinement.

Max refinement level limits only the ratio-driven passes, not Initial, global pre/post, or the requested local space post passes. A single-mesh strategy may leave the other bound violated. A narrow interval, multiple intersections with conflicting sizes, or the level cap may leave either bound violated even with both. run() returns final global pair counts and prints a nonfatal summary when violations remain. No intersections gives a satisfied report with zero intersecting pairs, not geometric coverage. Prefer upper > 2*lower for isotropic dyadic refinement; this avoids the simplest size-interval incompatibility but does not guarantee feasibility.

Public Functions

inline explicit LocalCoRefinement(const RefinementParameters<d2> &parameters)
inline LocalCoRefinementReport run(Domain<d1, spacedim> &space, Domain<d2, spacedim> &embedded) const