|
SpECTRE
v2025.08.19
|
Holds entities related to the computational domain. More...
Namespaces | |
| namespace | BoundaryConditions |
| Domain support for applying boundary conditions | |
| namespace | CoordinateMaps |
| Contains all coordinate maps. | |
| namespace | creators |
| Defines classes that create Domains. | |
| namespace | FunctionsOfTime |
| Contains functions of time to support the dual frame system. | |
| namespace | Tags |
| Tags for the domain. | |
Classes | |
| class | BlockId |
| Index a block of the computational domain. More... | |
| struct | BlockZCurveProcDistribution |
Distribution strategy for assigning elements to CPUs using a Morton ('Z-order') space-filling curve to determine placement within each block, where Elements are distributed across CPUs. More... | |
| struct | CheckFunctionsOfTimeAreReadyPostprocessor |
| Dense-output postprocessor to check that functions of time are up-to-date. More... | |
| class | CoordinateMap |
| A coordinate map or composition of coordinate maps. More... | |
| class | CoordinateMapBase |
| Abstract base class for CoordinateMap. More... | |
| class | ElementSearchTree |
| Search tree for efficiently looking up elements by their bounding boxes in block-logical coordinates. More... | |
| class | ElementSearchTreeIterator |
| struct | ExpandOverBlocks |
| Produce a std::vector<T> over all blocks of the domain. More... | |
| struct | make_faces_tag |
Wrap Tag in domain::Tags::Faces, unless Tag is in the VolumeTags list. More... | |
| struct | object_list |
Similar to a tmpl::list but for ObjectLabels. More... | |
| struct | RadiallyCompressedCoordinatesOptions |
| Options for radially compressed coordinates. More... | |
Typedefs | |
| template<typename T > | |
| using | is_map_time_dependent_t = tt::is_callable_t< T, std::array< std::decay_t< T >, std::decay_t< T >::dim >, double, std::unordered_map< std::string, std::unique_ptr< domain::FunctionsOfTime::FunctionOfTime > > > |
| Check if the calls to the coordinate map and its inverse map are time-dependent. | |
| template<typename Map , typename T > | |
| using | is_jacobian_time_dependent_t = detail::is_jacobian_callable_t< Map, std::array< std::decay_t< T >, std::decay_t< Map >::dim >, double, std::unordered_map< std::string, std::unique_ptr< domain::FunctionsOfTime::FunctionOfTime > > > |
| Check if the calls to the Jacobian and inverse Jacobian of the coordinate map are time-dependent. | |
| using | FunctionsOfTimeMap = std::unordered_map< std::string, std::unique_ptr< domain::FunctionsOfTime::FunctionOfTime > > |
| template<size_t Dim, typename TagsList , typename VolumeTags = tmpl::list<>> | |
| using | make_faces_tags = tmpl::transform< TagsList, make_faces_tag< tmpl::pin< tmpl::size_t< Dim > >, tmpl::_1, tmpl::pin< VolumeTags > > > |
Wrap all tags in TagsList in domain::Tags::Faces, except those in the VolumeTags list. | |
Enumerations | |
| enum class | ElementWeight { Uniform , NumGridPoints , NumGridPointsAndGridSpacing } |
The weighting scheme for assigning computational costs to Elements for distributing balanced compuational costs per processor (see BlockZCurveProcDistribution) More... | |
| enum class | FaceType : uint8_t { Uninitialized = 0 , External , Topological , ConformingAligned , ConformingUnaligned , SingleNonconforming , MultipleNonconforming } |
| The type of face for a Block or Element. More... | |
| enum class | ObjectLabel { A , B , C , None } |
| Labels for the objects in a binary system. More... | |
| enum class | Topology : uint8_t { Uninitialized = 0 , I1 = 1 , S1 = 2 , S2Colatitude = 3 , S2Longitude = 4 , B2Radial = 5 , B2Angular = 6 , B3Radial = 7 , B3Colatitude = 8 , B3Longitude = 9 , CartoonSphere = 10 , CartoonCylinder = 11 } |
| The topology of a Block or Element in a particular dimension. More... | |
Functions | |
| template<typename SourceFrame , typename TargetFrame , typename... Maps> | |
| auto | make_coordinate_map (Maps &&... maps) -> CoordinateMap< SourceFrame, TargetFrame, std::decay_t< Maps >... > |
Creates a CoordinateMap of maps... | |
| template<typename SourceFrame , typename TargetFrame , typename... Maps> | |
| auto | make_coordinate_map_base (Maps &&... maps) -> std::unique_ptr< CoordinateMapBase< SourceFrame, TargetFrame, CoordinateMap< SourceFrame, TargetFrame, std::decay_t< Maps >... >::dim > > |
Creates a std::unique_ptr<CoordinateMapBase> of maps... | |
| template<typename SourceFrame , typename TargetFrame , typename Arg0 , typename... Args> | |
| auto | make_vector_coordinate_map_base (Arg0 &&arg_0, Args &&... remaining_args) -> std::vector< std::unique_ptr< CoordinateMapBase< SourceFrame, TargetFrame, std::decay_t< Arg0 >::dim > > > |
Creates a std::vector<std::unique_ptr<CoordinateMapBase>> containing the result of make_coordinate_map_base applied to each argument passed in. | |
| template<typename SourceFrame , typename TargetFrame , size_t Dim, typename Map , typename... Maps> | |
| auto | make_vector_coordinate_map_base (std::vector< Map > maps, const Maps &... remaining_maps) -> std::vector< std::unique_ptr< CoordinateMapBase< SourceFrame, TargetFrame, Dim > > > |
Creates a std::vector<std::unique_ptr<CoordinateMapBase>> containing the result of make_coordinate_map_base applied to each element of the vector of maps composed with the rest of the arguments passed in. | |
| template<typename SourceFrame , typename TargetFrame , typename... Maps, typename NewMap > | |
| CoordinateMap< SourceFrame, TargetFrame, Maps..., NewMap > | push_back (CoordinateMap< SourceFrame, TargetFrame, Maps... > old_map, NewMap new_map) |
Creates a CoordinateMap by appending the new map to the end of the old maps. | |
| template<typename SourceFrame , typename TargetFrame , typename... Maps, typename NewMap > | |
| CoordinateMap< SourceFrame, TargetFrame, NewMap, Maps... > | push_front (CoordinateMap< SourceFrame, TargetFrame, Maps... > old_map, NewMap new_map) |
Creates a CoordinateMap by prepending the new map to the beginning of the old maps. | |
| template<size_t VolumeDim> | |
| Element< VolumeDim > | create_initial_element (const ElementId< VolumeDim > &element_id, const std::vector< Block< VolumeDim > > &blocks, const std::vector< std::array< size_t, VolumeDim > > &initial_refinement_levels) |
| Creates an initial element of a Block. More... | |
| std::ostream & | operator<< (std::ostream &os, ElementWeight weight) |
| template<size_t Dim> | |
| std::unordered_map< ElementId< Dim >, double > | get_element_costs (const std::vector< Block< Dim > > &blocks, const std::vector< std::array< size_t, Dim > > &initial_refinement_levels, const std::vector< std::array< size_t, Dim > > &initial_extents, ElementWeight element_weight, const std::optional< Spectral::Basis > &i1_basis, const std::optional< Spectral::Quadrature > &i1_quadrature) |
Get the cost of each Element in a list of Blocks where element_weight specifies which weight distribution scheme to use. More... | |
| template<size_t Dim> | |
| std::unique_ptr< CoordinateMapBase< Frame::ElementLogical, Frame::BlockLogical, Dim > > | element_to_block_logical_map (const ElementId< Dim > &element_id) |
| Constructs the affine map from ElementLogical to BlockLogical coordinates. More... | |
| template<size_t Dim> | |
| void | flat_logical_metric (const gsl::not_null< tnsr::ii< DataVector, Dim, Frame::ElementLogical > * > result, const Jacobian< DataVector, Dim, Frame::ElementLogical, Frame::Inertial > &jacobian) |
| The "flat logical metric" \(\sum_k \frac{\partial x^k}{\partial \xi^\hat{i}} \frac{\partial x^k}{\partial \xi^\hat{j}}\), which is the flat spatial metric in element-logical coordinates. More... | |
| template<size_t Dim, typename Fr > | |
| void | jacobian_diagnostic (const gsl::not_null< tnsr::i< DataVector, Dim, typename Frame::ElementLogical > * > jacobian_diag, const Jacobian< DataVector, Dim, typename Frame::ElementLogical, Fr > &analytic_jacobian, const TensorMetafunctions::prepend_spatial_index< tnsr::I< DataVector, Dim, Fr >, Dim, UpLo::Lo, typename Frame::ElementLogical > &numeric_jacobian_transpose) |
| A diagnostic comparing the analytic and numerical Jacobians for a map. More... | |
| bool | block_is_in_group (const std::string &block_name, const std::string &block_or_group_name, const std::unordered_map< std::string, std::unordered_set< std::string > > &block_groups) |
| Check if a block is in the given group. More... | |
| std::unordered_set< std::string > | expand_block_groups_to_block_names (const std::vector< std::string > &block_or_group_names, const std::vector< std::string > &all_block_names, const std::unordered_map< std::string, std::unordered_set< std::string > > &block_groups) |
| Expand a list of block or group names into a list of block names. More... | |
| bool | operator== (const BlockId &lhs, const BlockId &rhs) |
| bool | operator!= (const BlockId &lhs, const BlockId &rhs) |
| std::ostream & | operator<< (std::ostream &os, const BlockId &block_id) |
| template<size_t Dim> | |
| Mesh< Dim > | create_initial_mesh (const std::vector< std::array< size_t, Dim > > &initial_extents, const Element< Dim > &element, Spectral::Basis i1_basis, Spectral::Quadrature i1_quadrature) |
| Construct the initial Mesh of an Element. More... | |
| template<size_t Dim> | |
| Mesh< Dim > | create_initial_mesh (const std::vector< std::array< size_t, Dim > > &initial_extents, const Block< Dim > &block, const ElementId< Dim > &element_id, Spectral::Basis i1_basis, Spectral::Quadrature i1_quadrature) |
| Construct the initial Mesh of an Element from its Block and ElementId. More... | |
| template<size_t Dim> | |
| std::map< size_t, ElementSearchTree< Dim > > | index_element_ids (const std::vector< ElementId< Dim > > &element_ids) |
Sorts element IDs into one ElementSearchTree per block for efficient searching. More... | |
| std::ostream & | operator<< (std::ostream &os, FaceType face_type) |
| Output operator for a FaceType. | |
| bool | has_boundary (domain::Topology topology, Side side) |
| Whether or not a Topology has a boundary on a given Side. More... | |
| template<size_t VolumeDim> | |
| bool | neighbor_is_conforming (const std::array< Topology, VolumeDim > &self_topologies, const std::array< Topology, VolumeDim > &neighbor_topologies, const Direction< VolumeDim > &direction_to_neighbor, const OrientationMap< VolumeDim > &orientation_of_neighbor) |
| Returns whether or not neighboring Blocks (or Elements) have conforming block logical coordinates on their interface. More... | |
| std::string | name (const ObjectLabel x) |
| std::ostream & | operator<< (std::ostream &s, const ObjectLabel x) |
| std::ostream & | operator<< (std::ostream &os, Topology topology) |
| Output operator for a Topology. | |
| template<size_t Dim, typename T > | |
| void | remove_nonexistent_neighbors (const gsl::not_null< DirectionalIdMap< Dim, T > * > map_to_trim, const Element< Dim > &element) |
Remove entries in map_to_trim that aren't face neighbors of the element | |
| template<size_t Dim> | |
| size_t | z_curve_index (const ElementId< Dim > &element_id) |
Computes the Z-curve index of a given ElementId More... | |
| template<typename Metavariables > | |
| std::string | diagnostic_info (const size_t total_number_of_blocks, const Parallel::GlobalCache< Metavariables > &cache, const std::vector< size_t > &elements_per_core, const std::vector< size_t > &elements_per_node, const std::vector< size_t > &grid_points_per_core, const std::vector< size_t > &grid_points_per_node) |
Returns a std::string with diagnostic information about how elements and grid points are distributed on the nodes and cores. | |
| template<typename CacheTag , typename SimpleAction , typename Metavariables , typename ArrayIndex , typename Component , typename... Args> | |
| bool | functions_of_time_are_ready_simple_action_callback (Parallel::GlobalCache< Metavariables > &cache, const ArrayIndex &array_index, const Component *component_p, const double time, const std::optional< std::unordered_set< std::string > > &functions_to_check, Args &&... args) |
| Check that functions of time are up-to-date. More... | |
| template<typename CacheTag , typename ThreadedAction , typename Metavariables , typename ArrayIndex , typename Component , typename... Args> | |
| bool | functions_of_time_are_ready_threaded_action_callback (Parallel::GlobalCache< Metavariables > &cache, const ArrayIndex &array_index, const Component *component_p, const double time, const std::optional< std::unordered_set< std::string > > &functions_to_check, Args &&... args) |
| Check that functions of time are up-to-date. More... | |
| template<typename CacheTag , size_t Dim, typename Metavariables , typename ArrayIndex , typename Component > | |
| bool | functions_of_time_are_ready_algorithm_callback (Parallel::GlobalCache< Metavariables > &cache, const ArrayIndex &array_index, const Component *component_p, const double time, const std::optional< std::unordered_set< std::string > > &functions_to_check=std::nullopt) |
| Check that functions of time are up-to-date. More... | |
| template<size_t Dim, typename Fr > | |
| void | jacobian_diagnostic (const gsl::not_null< tnsr::i< DataVector, Dim, Frame::ElementLogical > * > jacobian_diag, const ::Jacobian< DataVector, Dim, Frame::ElementLogical, Fr > &analytic_jacobian, const tnsr::I< DataVector, Dim, Fr > &mapped_coords, const ::Mesh< Dim > &mesh) |
| A diagnostic comparing the analytic and numerical Jacobians for a map. More... | |
| template<size_t Dim, typename Fr > | |
| tnsr::i< DataVector, Dim, Frame::ElementLogical > | jacobian_diagnostic (const ::Jacobian< DataVector, Dim, Frame::ElementLogical, Fr > &analytic_jacobian, const tnsr::I< DataVector, Dim, Fr > &mapped_coords, const ::Mesh< Dim > &mesh) |
| A diagnostic comparing the analytic and numerical Jacobians for a map. More... | |
| template<typename DataType , size_t Dim, typename CoordsFrame > | |
| void | radially_compressed_coordinates (gsl::not_null< tnsr::I< DataType, Dim, CoordsFrame > * > result, const tnsr::I< DataType, Dim, CoordsFrame > &coordinates, double inner_radius, double outer_radius, CoordinateMaps::Distribution compression) |
| Coordinates suitable for visualizing large radii by compressing them logarithmically or inversely. More... | |
| template<typename DataType , size_t Dim, typename CoordsFrame > | |
| tnsr::I< DataType, Dim, CoordsFrame > | radially_compressed_coordinates (const tnsr::I< DataType, Dim, CoordsFrame > &coordinates, double inner_radius, double outer_radius, CoordinateMaps::Distribution compression) |
| Coordinates suitable for visualizing large radii by compressing them logarithmically or inversely. More... | |
| Spectral::SegmentSize | child_size (const SegmentId &child_segment_id, const SegmentId &parent_segment_id) |
| Size of a child segment relative to its parent. More... | |
| template<size_t Dim> | |
| std::array< Spectral::SegmentSize, Dim > | child_size (const std::array< SegmentId, Dim > &child_segment_ids, const std::array< SegmentId, Dim > &parent_segment_ids) |
| Size of a child segment relative to its parent. More... | |
Variables | |
| template<typename T > | |
| constexpr bool | is_map_time_dependent_v = is_map_time_dependent_t<T>::value |
| Check if the calls to the coordinate map and its inverse map are time-dependent. | |
| template<typename Map , typename T > | |
| constexpr bool | is_jacobian_time_dependent_v |
| Check if the calls to the Jacobian and inverse Jacobian of the coordinate map are time-dependent. More... | |
Holds entities related to the computational domain.
|
strong |
The weighting scheme for assigning computational costs to Elements for distributing balanced compuational costs per processor (see BlockZCurveProcDistribution)
| Enumerator | |
|---|---|
| Uniform | A weighting scheme where each |
| NumGridPoints | A weighting scheme where each |
| NumGridPointsAndGridSpacing | A weighting scheme where each |
|
strong |
The type of face for a Block or Element.
For a face with neighboring Blocks (or Elements) the FaceType is determined by whether the block logical coordinates of the neighboring Blocks (or Elements) have conforming block logical coordinates on their interface. Block logical coordinates are considered to be conforming if they are identical (i.e. an aligned OrientationMap) or related by a discrete rotation (i.e. a valid non-aligned OrientationMap).
| Enumerator | |
|---|---|
| Uninitialized | Used to denote an uninitialized value. |
| External | Used to denote a face on an external boundary. |
| Topological | Used to denote a face that is not on the external boundary, and that has no neighboring Block or Element (e.g. the angular directions of an S2 topology). |
| ConformingAligned | Used to denote a face shared with one or more conforming, aligned neighbors. |
| ConformingUnaligned | Used to denote a face shared with one or more conforming, unaligned neighbors. |
| SingleNonconforming | Used to denote a face shared with a single non-conforming neighbor. |
| MultipleNonconforming | Used to denote a face shared with multiple non-conforming neighbors. |
|
strong |
|
strong |
The topology of a Block or Element in a particular dimension.
The Topology is used to determine the geometry of the Block or Element, which can be used to determine:
| bool domain::block_is_in_group | ( | const std::string & | block_name, |
| const std::string & | block_or_group_name, | ||
| const std::unordered_map< std::string, std::unordered_set< std::string > > & | block_groups | ||
| ) |
Check if a block is in the given group.
| block_name | The name of the block to check |
| block_or_group_name | The group name we're testing. Returns true if the block is in this group. This can also be the name of the block itself. |
| block_groups | All block groups. |
| Spectral::SegmentSize domain::child_size | ( | const SegmentId & | child_segment_id, |
| const SegmentId & | parent_segment_id | ||
| ) |
Size of a child segment relative to its parent.
Determines which part of the parent_segment_id is covered by the child_segment_id: The full segment, its lower half or its upper half.
| std::array< Spectral::SegmentSize, Dim > domain::child_size | ( | const std::array< SegmentId, Dim > & | child_segment_ids, |
| const std::array< SegmentId, Dim > & | parent_segment_ids | ||
| ) |
Size of a child segment relative to its parent.
Determines which part of the parent_segment_id is covered by the child_segment_id: The full segment, its lower half or its upper half.
| std::unique_ptr< CoordinateMapBase< Frame::ElementLogical, Frame::BlockLogical, Dim > > domain::element_to_block_logical_map | ( | const ElementId< Dim > & | element_id | ) |
Constructs the affine map from ElementLogical to BlockLogical coordinates.
An element is the result of repeatedly splitting a block in half along any of its logical axes. This map transforms from ElementLogical coordinates [-1, 1]^dim to the subset of BlockLogical coordinates [-1, 1]^dim that cover the element. For instance, the two elements at refinement level 1 in 1D cover [-1, 0] and [0, 1] in BlockLogical coordinates, respectively.
| std::unordered_set< std::string > domain::expand_block_groups_to_block_names | ( | const std::vector< std::string > & | block_or_group_names, |
| const std::vector< std::string > & | all_block_names, | ||
| const std::unordered_map< std::string, std::unordered_set< std::string > > & | block_groups | ||
| ) |
Expand a list of block or group names into a list of block names.
| block_or_group_names | Block or group names to expand |
| all_block_names | All block names in the domain |
| block_groups | Block groups used to expand the names |
Returns: std::unordered_set<std::string> List of block names that appear in all_block_names. If one of the input names was a group, then all block names from that group are included. Overlaps between groups are allowed.
| void domain::flat_logical_metric | ( | const gsl::not_null< tnsr::ii< DataVector, Dim, Frame::ElementLogical > * > | result, |
| const Jacobian< DataVector, Dim, Frame::ElementLogical, Frame::Inertial > & | jacobian | ||
| ) |
The "flat logical metric" \(\sum_k \frac{\partial x^k}{\partial \xi^\hat{i}} \frac{\partial x^k}{\partial \xi^\hat{j}}\), which is the flat spatial metric in element-logical coordinates.
We define the "flat logical metric" to be the matrix of inner products of the \(\hat{i}\)-th logical coordinate basis vector \(\partial_{\xi^\hat{i}}\) with the \(\hat{j}\)-th logical coordinate basis vector \(\partial_{\xi^\hat{j}}\), where the inner product is taken assuming a flat spatial metric. When expressed in the ("inertial") \(x\)-coordinate system, each basis vector is a column of the Jacobian.
| std::unordered_map< ElementId< Dim >, double > domain::get_element_costs | ( | const std::vector< Block< Dim > > & | blocks, |
| const std::vector< std::array< size_t, Dim > > & | initial_refinement_levels, | ||
| const std::vector< std::array< size_t, Dim > > & | initial_extents, | ||
| ElementWeight | element_weight, | ||
| const std::optional< Spectral::Basis > & | i1_basis, | ||
| const std::optional< Spectral::Quadrature > & | i1_quadrature | ||
| ) |
Get the cost of each Element in a list of Blocks where element_weight specifies which weight distribution scheme to use.
It is only necessary to pass in a value for i1_basis and i1_quadrature if the value for element_weight is ElementWeight::NumGridPointsAndGridSpacing. Otherwise, the argument isn't needed and will have no effect if it does have a value.
| bool domain::has_boundary | ( | domain::Topology | topology, |
| Side | side | ||
| ) |
Whether or not a Topology has a boundary on a given Side.
| std::map< size_t, ElementSearchTree< Dim > > domain::index_element_ids | ( | const std::vector< ElementId< Dim > > & | element_ids | ) |
Sorts element IDs into one ElementSearchTree per block for efficient searching.
Returns a map of search trees indexed by block ID. Each search tree contains all the ElementIds for that block.
| size_t domain::z_curve_index | ( | const ElementId< Dim > & | element_id | ) |
Computes the Z-curve index of a given ElementId
The Z-curve index is computed by interleaving the bits of the ElementId's Segment indices. Here is a sketch of a 2D block with 4x2 elements, with bit indices and the resulting z-curve:
| element_id | the ElementId for which to compute the Z-curve index |
|
constexpr |
Check if the calls to the Jacobian and inverse Jacobian of the coordinate map are time-dependent.