Struct mesh_adapt_context_base

Inheritance Relationships

Derived Type

Struct Documentation

struct mesh_adapt_context_base

Virtual base class for mesh adaptation contexts.

We need this base class and not only mesh_adapt_context for the adapt_registry. adapt_registry should not be templated because we need to access registered contexts in mesh_adapt_callback_wrapper, where we do not know the type of the mesh. Therefore, we work with a map of forests to instances of this base class to remain template free.

Subclassed by t8_mesh_handle::detail::mesh_adapt_context< TMeshClass >

Public Functions

virtual ~mesh_adapt_context_base() = default

Virtual destructor for safe polymorphic deletion.

virtual int adapt_mesh(const t8_locidx_t lelement_handle_id, const int num_elements) = 0

Pure virtual callback for mesh adaptation.

Parameters:
  • lelement_handle_id[in] Local flat element ID in the mesh handle of the first element selected for adaptation.

  • num_elements[in] The number of elements that should be considered. If >1, the elements are expected to form a family that can be coarsened.

Returns:

1 if the element with index lelement_handle_id should be refined, -1 if the family shall be coarsened, 0 else.