SpECTRE  v2026.09.05
Loading...
Searching...
No Matches
amr::projectors Namespace Reference

AMR projectors. More...

Classes

struct  CopyFromCreatorOrLeaveAsIs
 For h-refinement copy the items from the parent/child, while for p-refinement leave the items unchanged. More...
struct  DefaultInitialize
 Value initialize the items corresponding to Tags. More...
struct  ProjectTensors
 Update the Tensors corresponding to TensorTags after an AMR change. More...
struct  ProjectVariables
 Update the Variables corresponding to VariablesTags after an AMR change. More...

Functions

template<size_t Dim>
Mesh< Dim > p_refined_mesh (const Mesh< Dim > &old_mesh, const std::array< amr::Flag, Dim > &flags, const std::array< domain::Topology, Dim > &topologies)
 Given old_mesh returns a new Mesh based on the refinement flags and topologies
template<size_t Dim>
Mesh< Dim > parent_mesh (const std::vector< Mesh< Dim > > &children_meshes)
 Given the Meshes for a set of joining Elements, returns the Mesh for the newly created parent Element.
template<size_t Dim>
Mesh< Dim > child_mesh (const Mesh< Dim > &parent_mesh, const ElementId< Dim > &child_id, const std::array< amr::Flag, Dim > &flags, const std::array< domain::Topology, Dim > &topologies)
 Given the parent_mesh, returns the Mesh for the newly created child Element based on the refinement flags and topologies.
template<size_t Dim>
Mesh< Dim > new_mesh_to_communicate_to_neighbors (const Mesh< Dim > &current_mesh, const std::array< Flag, Dim > &flags, const Element< Dim > &element, const std::unordered_map< ElementId< Dim >, Info< Dim > > &neighbors_info)
 Computes the expected new Mesh of an Element after AMR that is communicated to neighboring Elements.

Detailed Description

AMR projectors.

Function Documentation

◆ new_mesh_to_communicate_to_neighbors()

template<size_t Dim>
Mesh< Dim > amr::projectors::new_mesh_to_communicate_to_neighbors ( const Mesh< Dim > & current_mesh,
const std::array< Flag, Dim > & flags,
const Element< Dim > & element,
const std::unordered_map< ElementId< Dim >, Info< Dim > > & neighbors_info )

Computes the expected new Mesh of an Element after AMR that is communicated to neighboring Elements.

Details

The returned Mesh will be that of either element or its parent or children depending upon the flags. If an Element is joining, the returned Mesh will be that given by amr::projectors::parent_mesh. If an Element is splitting, the returned Mesh will be given by amr::projectors::child_mesh for the child with Side::Upper in each split dimension. (This will be incorrect for the Side::Lower child for domain::Topology::B1Radial, domain::Topology::B2Radial, or domain::Topology::B3Radial; see the note.) Otherwise the returned Mesh will be given by amr::projectors:p_refined_mesh

Note
This function is meant to be called only by amr::Actions::EvaluateRefinementCriteria and amr::Actions::UpdateAmrDecision in order to communicate the expected post-refinement Mesh to neighboring Elements. For radially split ball topologies, the upper child Mesh is returned because any existing neighboring elements in the radial direction will have the upper child as their neighbor.
See also
child_mesh parent_mesh p_refined_mesh

◆ p_refined_mesh()

template<size_t Dim>
Mesh< Dim > amr::projectors::p_refined_mesh ( const Mesh< Dim > & old_mesh,
const std::array< amr::Flag, Dim > & flags,
const std::array< domain::Topology, Dim > & topologies )

Given old_mesh returns a new Mesh based on the refinement flags and topologies

Note
In dimensions that are h-refined, the Mesh is not changed by this function

◆ parent_mesh()

template<size_t Dim>
Mesh< Dim > amr::projectors::parent_mesh ( const std::vector< Mesh< Dim > > & children_meshes)

Given the Meshes for a set of joining Elements, returns the Mesh for the newly created parent Element.

Details

In each dimension the extent of the parent Mesh will be the maximum over the extents of each child Mesh