SpECTRE
v2025.03.17
|
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 Element s 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... | |
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 ObjectLabel s. 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 = implementation defined |
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 = implementation defined |
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 Element s for distributing balanced compuational costs per processor (see BlockZCurveProcDistribution ) 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 } |
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. | |
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::Quadrature > &quadrature) |
Get the cost of each Element in a list of Block s 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" | |
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) |
bool | has_boundary (domain::Topology topology, Side side) |
Whether or not a Topology has a boundary on a given Side. 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::ChildSize | 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::ChildSize, 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 Element
s 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 |
|
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::ChildSize 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::ChildSize, 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"
We define the "flat logical metric" to be the matrix of inner products of the
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::Quadrature > & | quadrature | ||
) |
Get the cost of each Element
in a list of Block
s where element_weight
specifies which weight distribution scheme to use.
It is only necessary to pass in a value for 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.
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.