SpECTRE  v2025.08.19
amr::protocols::AmrMetavariables Struct Reference

Compile-time information for AMR projectors. More...

#include <AmrMetavariables.hpp>

Classes

struct  test
 

Detailed Description

Compile-time information for AMR projectors.

A class conforming to this protocol is placed in the metavariables to provide the following:

  • element_array: The array component on which AMR is performed.
  • projectors: A type list of AMR projectors (each of which must conform to amr::protocols::Projector) that will be applied by:
  • p_refine_only_in_event: A boolean indicating that only h-refinement criteria should be evaluated in amr::Actions::EvaluateRefinementCriteria. Only h-refinement will be done in Phase::AdjustDomain; p-refinement will only be done via amr::Events::RefineMesh.
  • keep_coarse_grids: A boolean indicating that AMR should create a completely new grid at each AMR step with an incremented grid index, and keep the old grid around. This is useful for multigrid solvers. If this is true, then the element_array must include amr::Actions::RegisterElement in the registration phase action list and in Metavariables::registration::element_registrars. You must also ensure to visit Phase::UpdateSections in the default phase order after registration, and in each AMR step after Phase::EvaluateRefinementCriteria and Phase::AdjustDomain. When this is enabled, you can use amr::Tags::ParentId and amr::Tags::ChildIds to traverse the grid hierarchy. However, you cannot rely on these tags to be up-to-date in the AMR projectors, as they are sometime updated after the projectors are run.

Here is an example for a class conforming to this protocol:

struct amr : tt::ConformsTo<::amr::protocols::AmrMetavariables> {
using element_array = ElementArray;
using projectors =
tmpl::list<Initialization::ProjectTimeStepping<1>,
[[maybe_unused]] static constexpr bool keep_coarse_grids = false;
};
Items for adaptive mesh refinement.
Definition: Amr.hpp:8
Initialize/update items related to coordinate maps after an AMR change.
Definition: DgDomain.hpp:192
Indicate a class conforms to the Protocol.
Definition: ProtocolHelpers.hpp:22

The documentation for this struct was generated from the following file: