Namespaces | Classes | Enumerations | Functions
Computational Domain

The building blocks used to describe the computational domain. More...

Namespaces

 amr
 Items for adaptive mesh refinement.
 

Classes

class  Block< VolumeDim, TargetFrame >
 A Block<VolumeDim> is a region of a VolumeDim-dimensional computational domain that defines the root node of a tree which is used to construct the Elements that cover a region of the computational domain. More...
 
class  domain::BlockId
 Index a block of the computational domain. More...
 
class  BlockNeighbor< VolumeDim >
 Information about the neighbor of a Block in a particular direction. More...
 
class  Direction< VolumeDim >
 A particular Side along a particular coordinate Axis. More...
 
struct  DirectionHash< Dim >
 Provides a perfect hash if the size of the hash table is 2 * Dim. To take advantage of this, use the FixedHashMap class. More...
 
class  DirectionMap< Dim, T >
 An optimized map with Direction keys. More...
 
class  Domain< VolumeDim, TargetFrame >
 A wrapper around a vector of Blocks that represent the computational domain. More...
 
struct  PairOfFaces
 Each member in PairOfFaces holds the global corner ids of a block face. PairOfFaces is used in setting up periodic boundary conditions by identifying the two faces with each other. More...
 
class  VolumeCornerIterator< VolumeDim >
 Iterates over the corners of a VolumeDim-dimensional cube. More...
 
class  FaceCornerIterator< VolumeDim >
 Iterates over the 2^(VolumeDim-1) logical corners of the face of a VolumeDim-dimensional cube in the given direction. More...
 
class  Element< VolumeDim >
 A spectral element with knowledge of its neighbors. More...
 
class  ElementId< VolumeDim >
 An ElementId uniquely labels an Element. It is constructed from the BlockId of the Block to which the Element belongs and the VolumeDim SegmentIds that label the segments of the Block that the Element covers. More...
 
struct  ElementLogicalCoordHolder< Dim >
 Holds element logical coordinates of an arbitrary set of points on a single Element. The arbitrary set of points is assumed to be a subset of a larger set of points spanning multiple Elements, and this class holds offsets that index into that larger set of points. More...
 
class  ElementMap< Dim, TargetFrame >
 The CoordinateMap for the Element from the Logical frame to the TargetFrame More...
 
struct  Tags::InterfaceComputeItem< Tags::BoundaryDirectionsExterior< VolumeDim >, UnnormalizedFaceNormal< VolumeDim, Frame > >
 Specialisation of UnnormalizedFaceNormal for the external boundaries which inverts the normals. Since ExternalBoundariesDirections are meant to represent ghost elements, the normals should correspond to the normals in said element, which are inverted with respect to the current element. More...
 
struct  Tags::LogicalCoordinates< VolumeDim >
 The logical coordinates in the Element. More...
 
struct  Tags::MinimumGridSpacing< Dim, Frame >
 The minimum coordinate distance between grid points. More...
 
class  Neighbors< VolumeDim >
 Information about the neighbors of an Element in a particular direction. More...
 
class  SegmentId
 A SegmentId labels a segment of the interval [-1,1] and is used to identify the bounds of an Element in a Block in each dimension. More...
 
struct  Tags::SizeOfElement< VolumeDim >
 The inertial-coordinate size of an element along each of its logical directions. More...
 
struct  OptionTags::DomainCreator< Dim, TargetFrame >
 The input file tag for the DomainCreator to use. More...
 
struct  Tags::Domain< VolumeDim, Frame >
 The Domain. More...
 
struct  Tags::Element< VolumeDim >
 The Element associated with the DataBox. More...
 
struct  Tags::Mesh< VolumeDim >
 The computational grid of the Element in the DataBox. More...
 
struct  Tags::ElementMap< VolumeDim, Frame >
 The coordinate map from logical to grid coordinate. More...
 
struct  Tags::Coordinates< Dim, Frame >
 The coordinates in a given frame. More...
 
struct  Tags::MappedCoordinates< MapTag, SourceCoordsTag >
 The coordinates in the target frame of MapTag. The SourceCoordsTag's frame must be the source frame of MapTag More...
 
struct  Tags::InverseJacobian< MapTag, SourceCoordsTag >
 Computes the inverse Jacobian of the map held by MapTag at the coordinates held by SourceCoordsTag. The coordinates must be in the source frame of the map. More...
 
struct  Tags::InternalDirections< VolumeDim >
 The set of directions to neighboring Elements. More...
 
struct  Tags::BoundaryDirectionsInterior< VolumeDim >
 The set of directions which correspond to external boundaries. Used for representing data on the interior side of the external boundary faces. More...
 
struct  Tags::BoundaryDirectionsExterior< VolumeDim >
 The set of directions which correspond to external boundaries. To be used to represent data which exists on the exterior side of the external boundary faces. More...
 
struct  Tags::Interface< DirectionsTag, Tag >
 Tag which is either a SimpleTag for quantities on an interface, base tag to a compute item which acts on tags on an interface, or base tag to a compute item which slices a tag from the volume to an interface. More...
 
struct  Tags::Direction< VolumeDim >
 Direction to an interface More...
 
struct  Tags::InterfaceMesh< VolumeDim >
 Computes the VolumeDim-1 dimensional mesh on an interface from the volume mesh. Tags::InterfaceComputeItem<Dirs, InterfaceMesh<VolumeDim>> is retrievable as Tags::Interface<Dirs, Mesh<VolumeDim>>` from the DataBox. More...
 
struct  Tags::InterfaceComputeItem< DirectionsTag, Tag >
 Derived tag for representing a compute item which acts on Tags on an interface. Can be retrieved using Tags::Interface<DirectionsTag, Tag> More...
 
struct  Tags::Slice< DirectionsTag, VarsTag >
 Derived tag for representing a compute item which slices a Tag containing a Variables from the volume to an interface. Retrievable from the DataBox using Tags::Interface<DirectionsTag, VarsTag> More...
 

Enumerations

enum  amr::Flag {
  amr::Flag::Undefined, amr::Flag::Join, amr::Flag::DecreaseResolution, amr::Flag::DoNothing,
  amr::Flag::IncreaseResolution, amr::Flag::Split
}
 Flags that represent decisions about mesh refinement. More...
 
enum  ShellWedges { ShellWedges::All, ShellWedges::FourOnEquator, ShellWedges::OneAlongMinusX }
 The number of wedges to include in the Shell domain. More...
 
enum  Side { Lower, Upper }
 A label for the side of a manifold. More...
 

Functions

template<size_t VolumeDim>
std::array< size_t, VolumeDim > amr::desired_refinement_levels (const ElementId< VolumeDim > &id, const std::array< amr::Flag, VolumeDim > &flags) noexcept
 Computes the desired refinement level of the Element with ElementId id given the desired amr::Flags flags
 
template<size_t VolumeDim>
std::array< size_t, VolumeDim > amr::desired_refinement_levels_of_neighbor (const ElementId< VolumeDim > &neighbor_id, const std::array< amr::Flag, VolumeDim > &neighbor_flags, const OrientationMap< VolumeDim > &orientation) noexcept
 Computes the desired refinement level of a neighboring Element with ElementId neighbor_id given its desired amr::Flags neighbor_flags taking into account the OrientationMap orientation of the neighbor. More...
 
template<size_t VolumeDim>
bool amr::has_potential_sibling (const ElementId< VolumeDim > &element_id, const Direction< VolumeDim > &direction) noexcept
 Whether or not the Element with element_id can have a sibling in the given direction
 
template<size_t VolumeDim>
bool amr::update_amr_decision (gsl::not_null< std::array< amr::Flag, VolumeDim > * > my_current_amr_flags, const Element< VolumeDim > &element, const ElementId< VolumeDim > &neighbor_id, const std::array< amr::Flag, VolumeDim > &neighbor_amr_flags) noexcept
 Updates the AMR decisions my_current_amr_flags of the Element element based on the AMR decisions neighbor_amr_flags of a neighbor Element with ElementId neighbor_id. More...
 
template<size_t Dim, typename Frame >
auto block_logical_coordinates (const Domain< Dim, Frame > &domain, const tnsr::I< DataVector, Dim, Frame > &x) noexcept -> std::vector< IdPair< domain::BlockId, tnsr::I< double, Dim, typename ::Frame::Logical >>>
 Computes the block logical coordinates and the containing BlockId of a set of points, given coordinates in the Frame frame. More...
 
template<typename SourceFrame , typename TargetFrame , typename... Maps>
constexpr 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) noexcept -> 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) noexcept -> 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) noexcept -> 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<size_t VolumeDim, typename TargetFrame >
Element< VolumeDim > create_initial_element (const ElementId< VolumeDim > &element_id, const Block< VolumeDim, TargetFrame > &block) noexcept
 Creates an initial element of a Block.
 
template<size_t VolumeDim>
void set_internal_boundaries (const std::vector< std::array< size_t, two_to_the(VolumeDim)>> &corners_of_all_blocks, gsl::not_null< std::vector< DirectionMap< VolumeDim, BlockNeighbor< VolumeDim >>> *> neighbors_of_all_blocks) noexcept
 Sets up the BlockNeighbors using the corner numbering scheme to deduce the correct neighbors and orientations. Does not set up periodic boundary conditions.
 
template<size_t VolumeDim>
void set_identified_boundaries (const std::vector< PairOfFaces > &identifications, const std::vector< std::array< size_t, two_to_the(VolumeDim)>> &corners_of_all_blocks, gsl::not_null< std::vector< DirectionMap< VolumeDim, BlockNeighbor< VolumeDim >>> *> neighbors_of_all_blocks) noexcept
 Sets up additional BlockNeighbors corresponding to any identifications of faces provided by the user. Can be used for manually setting up periodic boundary conditions.
 
template<size_t VolumeDim>
auto corners_for_rectilinear_domains (const Index< VolumeDim > &domain_extents, const std::vector< Index< VolumeDim >> &block_indices_to_exclude={}) noexcept -> std::vector< std::array< size_t, two_to_the(VolumeDim)>>
 The corners for a rectilinear domain made of n-cubes. More...
 
template<typename TargetFrame >
auto wedge_coordinate_maps (double inner_radius, double outer_radius, double inner_sphericity, double outer_sphericity, bool use_equiangular_map, double x_coord_of_shell_center=0.0, bool use_half_wedges=false, double aspect_ratio=1.0, bool use_logarithmic_map=false, ShellWedges which_wedges=ShellWedges::All, size_t number_of_layers=1) noexcept -> std::vector< std::unique_ptr< CoordinateMapBase< Frame::Logical, TargetFrame, 3 >>>
 These are the CoordinateMaps of the Wedge3Ds used in the Sphere, Shell, and binary compact object DomainCreators. This function can also be used to wrap the Sphere or Shell in a cube made of six Wedge3Ds. The argument x_coord_of_shell_center specifies a translation of the Shell in the x-direction in the TargetFrame. For example, the BBH DomainCreator uses this to set the position of each BH. When the argument use_half_wedges is set to true, the wedges in the +z,-z,+y,-y directions are cut in half along their xi-axes. The resulting ten CoordinateMaps are used for the outermost Blocks of the BBH Domain. The argument aspect_ratio sets the equatorial compression factor, used by the EquatorialCompression maps which get composed with the Wedges. This is done if aspect_ratio is set to something other than the default value of one. When the argument use_logarithmic_map is set to true, the radial gridpoints of the wedge map are set to be spaced logarithmically. The number_of_layers is used when the user wants to have multiple layers of Blocks in the radial direction.
 
template<typename TargetFrame >
auto frustum_coordinate_maps (double length_inner_cube, double length_outer_cube, bool use_equiangular_map) noexcept -> std::vector< std::unique_ptr< CoordinateMapBase< Frame::Logical, TargetFrame, 3 >>>
 These are the ten Frustums used in the DomainCreators for binary compact objects. The cubes enveloping the two Shells each have a side length of length_inner_cube. The ten frustums also make up a cube of their own, of side length length_outer_cube.
 
std::vector< std::array< size_t, 8 > > corners_for_radially_layered_domains (size_t number_of_layers, bool include_central_block, const std::array< size_t, 8 > &central_block_corners={{1, 2, 3, 4, 5, 6, 7, 8}}, ShellWedges which_wedges=ShellWedges::All) noexcept
 The corners for a domain with radial layers. More...
 
std::vector< std::array< size_t, 8 > > corners_for_biradially_layered_domains (size_t number_of_radial_layers, size_t number_of_biradial_layers, bool include_central_block_lhs, bool include_central_block_rhs, const std::array< size_t, 8 > &central_block_corners_lhs={ {1, 2, 3, 4, 5, 6, 7, 8}}) noexcept
 The corners for a domain with biradial layers. More...
 
template<size_t VolumeDim>
std::array< size_t, two_to_the(VolumeDim)> discrete_rotation (const OrientationMap< VolumeDim > &orientation, const std::array< size_t, two_to_the(VolumeDim)> &corners_of_aligned) noexcept
 Permutes the corner numbers of an n-cube. More...
 
template<typename TargetFrame , size_t VolumeDim>
auto maps_for_rectilinear_domains (const Index< VolumeDim > &domain_extents, const std::array< std::vector< double >, VolumeDim > &block_demarcations, const std::vector< Index< VolumeDim >> &block_indices_to_exclude={}, const std::vector< OrientationMap< VolumeDim >> &orientations_of_all_blocks={}, bool use_equiangular_map=false) noexcept -> std::vector< std::unique_ptr< CoordinateMapBase< Frame::Logical, TargetFrame, VolumeDim >>>
 The CoordinateMaps for a rectilinear domain of n-cubes. More...
 
template<size_t VolumeDim, typename TargetFrame >
Domain< VolumeDim, TargetFrame > rectilinear_domain (const Index< VolumeDim > &domain_extents, const std::array< std::vector< double >, VolumeDim > &block_demarcations, const std::vector< Index< VolumeDim >> &block_indices_to_exclude={}, const std::vector< OrientationMap< VolumeDim >> &orientations_of_all_blocks={}, const std::array< bool, VolumeDim > &dimension_is_periodic=make_array< VolumeDim >(false), const std::vector< PairOfFaces > &identifications={}, bool use_equiangular_map=false) noexcept
 Create a rectilinear Domain of multicubes. More...
 
template<size_t Dim>
auto element_logical_coordinates (const std::vector< ElementId< Dim >> &element_ids, const std::vector< IdPair< domain::BlockId, tnsr::I< double, Dim, typename Frame::Logical >>> &block_coord_holders) noexcept -> std::unordered_map< ElementId< Dim >, ElementLogicalCoordHolder< Dim >>
 Given a set of points in block logical coordinates and their BlockIds, as returned from the function block_logical_coordinates, determines which Elements in a list of ElementIds contains each point, and determines the element logical coordinates of each point. More...
 
template<size_t Dim>
size_t index_to_slice_at (const Index< Dim > &extents, const Direction< Dim > &direction) noexcept
 Finds the index in the perpendicular dimension of an element boundary.
 
template<size_t VolumeDim>
std::vector< ElementId< VolumeDim > > initial_element_ids (size_t block_id, std::array< size_t, VolumeDim > initial_ref_levs) noexcept
 Create the ElementIds of the a single Block.
 
template<size_t VolumeDim>
std::vector< ElementId< VolumeDim > > initial_element_ids (const std::vector< std::array< size_t, VolumeDim >> &initial_refinement_levels) noexcept
 Create the ElementIds of the initial computational domain.
 
template<size_t VolumeDim>
tnsr::I< DataVector, VolumeDim, Frame::Logicallogical_coordinates (const Mesh< VolumeDim > &mesh) noexcept
 Compute the logical coordinates in an Element. More...
 
template<size_t VolumeDim>
tnsr::I< DataVector, VolumeDim, Frame::Logicalinterface_logical_coordinates (const Mesh< VolumeDim - 1 > &mesh, const Direction< VolumeDim > &direction) noexcept
 Compute the logical coordinates on a face of an Element. More...
 
constexpr size_t maximum_number_of_neighbors (const size_t dim)
 Returns the maximum number of neighbors an element can have in dim dimensions. More...
 
template<size_t Dim, typename Frame >
double minimum_grid_spacing (const Index< Dim > &extents, const tnsr::I< DataVector, Dim, Frame > &coords) noexcept
 Finds the minimum coordinate distance between grid points.
 
template<size_t VolumeDim>
std::array< double, VolumeDim > size_of_element (const Mesh< VolumeDim > &mesh, const tnsr::I< DataVector, VolumeDim > &inertial_coords) noexcept
 Compute the inertial-coordinate size of an element along each of its logical directions. More...
 
template<size_t VolumeDim, typename TargetFrame >
tnsr::i< DataVector, VolumeDim, TargetFrame > unnormalized_face_normal (const Mesh< VolumeDim - 1 > &interface_mesh, const ElementMap< VolumeDim, TargetFrame > &map, const Direction< VolumeDim > &direction) noexcept
 Compute the outward grid normal on a face of an Element. More...
 
template<size_t VolumeDim, typename TargetFrame >
tnsr::i< DataVector, VolumeDim, TargetFrame > unnormalized_face_normal (const Mesh< VolumeDim - 1 > &interface_mesh, const CoordinateMapBase< Frame::Logical, TargetFrame, VolumeDim > &map, const Direction< VolumeDim > &direction) noexcept
 Compute the outward grid normal on a face of an Element. More...
 

Detailed Description

The building blocks used to describe the computational domain.

Description

The VolumeDim-dimensional computational Domain is constructed from a set of non-overlapping Blocks. Each Block is a distorted VolumeDim-dimensional hyperrcube Each codimension-1 boundary of a Block is either part of the external boundary of the computational domain, or is identical to a boundary of one other Block. Each Block is subdivided into one or more Elements that may be changed dynamically if AMR is enabled.

Enumeration Type Documentation

◆ Flag

enum amr::Flag
strong

Flags that represent decisions about mesh refinement.

In order to support anisotropic mesh refinement, a flag is specified for each dimension.

Enumerator
Undefined 

used to initialize flags before a decision is made

Join 

join the sibling of an Element

DecreaseResolution 

decrease number of points in an Element

DoNothing 

stay the same

IncreaseResolution 

increase number of points in an Element

Split 

split the Element into two smaller elements

◆ ShellWedges

enum ShellWedges
strong

The number of wedges to include in the Shell domain.

Enumerator
All 

Use the entire shell.

FourOnEquator 

Use only the four equatorial wedges.

OneAlongMinusX 

Use only the single wedge along -x.

◆ Side

enum Side
strong

A label for the side of a manifold.

Lower and Upper are with respect to the logical coordinate whose axis is normal to the side, i.e. beyond the Upper (Lower) side, the logical coordinate is increasing (decreasing).

Function Documentation

◆ block_logical_coordinates()

template<size_t Dim, typename Frame >
auto block_logical_coordinates ( const Domain< Dim, Frame > &  domain,
const tnsr::I< DataVector, Dim, Frame > &  x 
) -> std::vector< IdPair< domain::BlockId, tnsr::I< double, Dim, typename ::Frame::Logical >>>
noexcept

Computes the block logical coordinates and the containing BlockId of a set of points, given coordinates in the Frame frame.

Details

Returns a std::vector<IdPair<BlockId,coords>>, where the vector runs over the points and is indexed in the same order as the input coordinates x. For each point, the IdPair holds the block logical coords of that point and the BlockId of the Block that contains that point. If a point is on a shared boundary of two or more Blocks, it is returned only once, and is considered to belong to the Block with the smaller BlockId.

◆ corners_for_biradially_layered_domains()

std::vector<std::array<size_t, 8> > corners_for_biradially_layered_domains ( size_t  number_of_radial_layers,
size_t  number_of_biradial_layers,
bool  include_central_block_lhs,
bool  include_central_block_rhs,
const std::array< size_t, 8 > &  central_block_corners_lhs = { {1, 2, 3, 4, 5, 6, 7, 8}} 
)
noexcept

The corners for a domain with biradial layers.

Generates the corners for a BBH-like Domain which is made of one or more layers of Blocks fully enveloping two interior volumes. The number_of_radial_layers gives the number of layers that fully envelop each interior volume with six Blocks each. The number_of_biradial_layers gives the number of layers that fully envelop both volumes at once, using ten Blocks per layer as opposed to six. The central_block_corners_lhs are used as seed values to generate the corners for the surrounding Blocks.

◆ corners_for_radially_layered_domains()

std::vector<std::array<size_t, 8> > corners_for_radially_layered_domains ( size_t  number_of_layers,
bool  include_central_block,
const std::array< size_t, 8 > &  central_block_corners = {{1, 2, 3, 4, 5, 6, 7, 8}},
ShellWedges  which_wedges = ShellWedges::All 
)
noexcept

The corners for a domain with radial layers.

Generates the corners for a Domain which is made of one or more layers of Blocks fully enveloping an interior volume, e.g. Shell or Sphere. The number_of_layers specifies how many of these layers of Blocks to have in the final domain. include_central_block is set to true in Sphere, where the interior volume is filled with a central Block, and false in Shell, where the interior volume is left empty. The central_block_corners are used as seed values to generate the corners for the surrounding Blocks.

◆ corners_for_rectilinear_domains()

template<size_t VolumeDim>
auto corners_for_rectilinear_domains ( const Index< VolumeDim > &  domain_extents,
const std::vector< Index< VolumeDim >> &  block_indices_to_exclude = {} 
) -> std::vector< std::array< size_t, two_to_the(VolumeDim)>>
noexcept

The corners for a rectilinear domain made of n-cubes.

The domain_extents argument holds the number of blocks to have in each dimension. The blocks all have aligned orientations by construction. The block_indices_to_exclude argument allows the user to selectively exclude blocks from the resulting domain. This allows for the creation of non-trivial shapes such as the net for a tesseract.

◆ desired_refinement_levels_of_neighbor()

template<size_t VolumeDim>
std::array< size_t, VolumeDim > amr::desired_refinement_levels_of_neighbor ( const ElementId< VolumeDim > &  neighbor_id,
const std::array< amr::Flag, VolumeDim > &  neighbor_flags,
const OrientationMap< VolumeDim > &  orientation 
)
noexcept

Computes the desired refinement level of a neighboring Element with ElementId neighbor_id given its desired amr::Flags neighbor_flags taking into account the OrientationMap orientation of the neighbor.

Details

The OrientationMap orientation is that from the Element that has a neighbor with ElementId neighbor_id

◆ discrete_rotation()

template<size_t VolumeDim>
std::array<size_t, two_to_the(VolumeDim)> discrete_rotation ( const OrientationMap< VolumeDim > &  orientation,
const std::array< size_t, two_to_the(VolumeDim)> &  corners_of_aligned 
)
noexcept

Permutes the corner numbers of an n-cube.

Returns the correct ordering of global corner numbers for a rotated block in an otherwise aligned edifice of blocks, given the OrientationMap a block aligned with the edifice has relative to this one, and given the corner numbering the rotated block would have if it were aligned. This is useful in creating domains for testing purposes, e.g. RotatedIntervals, RotatedRectangles, and RotatedBricks.

◆ element_logical_coordinates()

template<size_t Dim>
auto element_logical_coordinates ( const std::vector< ElementId< Dim >> &  element_ids,
const std::vector< IdPair< domain::BlockId, tnsr::I< double, Dim, typename Frame::Logical >>> &  block_coord_holders 
) -> std::unordered_map< ElementId< Dim >, ElementLogicalCoordHolder< Dim >>
noexcept

Given a set of points in block logical coordinates and their BlockIds, as returned from the function block_logical_coordinates, determines which Elements in a list of ElementIds contains each point, and determines the element logical coordinates of each point.

Details

Returns a std::unordered_map from ElementIds to ElementLogicalCoordHolders. It is expected that only a subset of the points will be found in the given Elements. If a point is on a shared boundary of two or more Elements, it will be returned only once, and will be considered to belong to the first Element in the list of ElementIds.

◆ interface_logical_coordinates()

template<size_t VolumeDim>
tnsr::I<DataVector, VolumeDim, Frame::Logical> interface_logical_coordinates ( const Mesh< VolumeDim - 1 > &  mesh,
const Direction< VolumeDim > &  direction 
)
noexcept

Compute the logical coordinates on a face of an Element.

Returns: logical-frame vector holding coordinates

Example

const Mesh<2> mesh_3d_zbdry{
{{5, 3}}, Spectral::Basis::Legendre, Spectral::Quadrature::GaussLobatto};
const auto x_3d_lb_zeta = map_3d(

◆ logical_coordinates()

template<size_t VolumeDim>
tnsr::I<DataVector, VolumeDim, Frame::Logical> logical_coordinates ( const Mesh< VolumeDim > &  mesh)
noexcept

Compute the logical coordinates in an Element.

Details

The logical coordinates are the collocation points associated to the spectral basis functions and quadrature of the mesh.

Returns: logical-frame vector holding coordinates

Example

const Mesh<3> mesh_3d{{{5, 3, 2}},
Spectral::Basis::Legendre,
Spectral::Quadrature::GaussLobatto};
const CoordinateMaps::Affine x_map{-1.0, 1.0, -3.0, 7.0};
const CoordinateMaps::Affine y_map{-1.0, 1.0, -13.0, 47.0};
const CoordinateMaps::Affine z_map{-1.0, 1.0, -32.0, 74.0};
const auto map_3d = make_coordinate_map<Frame::Logical, Frame::Grid>(
Affine3d{x_map, y_map, z_map});
const auto x_3d = map_3d(logical_coordinates(mesh_3d));

◆ maps_for_rectilinear_domains()

template<typename TargetFrame , size_t VolumeDim>
auto maps_for_rectilinear_domains ( const Index< VolumeDim > &  domain_extents,
const std::array< std::vector< double >, VolumeDim > &  block_demarcations,
const std::vector< Index< VolumeDim >> &  block_indices_to_exclude = {},
const std::vector< OrientationMap< VolumeDim >> &  orientations_of_all_blocks = {},
bool  use_equiangular_map = false 
) -> std::vector< std::unique_ptr< CoordinateMapBase< Frame::Logical, TargetFrame, VolumeDim >>>
noexcept

The CoordinateMaps for a rectilinear domain of n-cubes.

Allows for both Affine and Equiangular maps.

◆ maximum_number_of_neighbors()

constexpr size_t maximum_number_of_neighbors ( const size_t  dim)

Returns the maximum number of neighbors an element can have in dim dimensions.

Note
Assumes a maximum 2-to-1 refinement between two adjacent Elements.

◆ rectilinear_domain()

template<size_t VolumeDim, typename TargetFrame >
Domain<VolumeDim, TargetFrame> rectilinear_domain ( const Index< VolumeDim > &  domain_extents,
const std::array< std::vector< double >, VolumeDim > &  block_demarcations,
const std::vector< Index< VolumeDim >> &  block_indices_to_exclude = {},
const std::vector< OrientationMap< VolumeDim >> &  orientations_of_all_blocks = {},
const std::array< bool, VolumeDim > &  dimension_is_periodic = make_array< VolumeDim >(false),
const std::vector< PairOfFaces > &  identifications = {},
bool  use_equiangular_map = false 
)
noexcept

Create a rectilinear Domain of multicubes.

Details

Useful for constructing domains for testing non-trivially connected rectilinear domains made up of cubes. We refer to a domain of this type as an edifice. The domain_extents provides the size (in the number of blocks) of the initial aligned edifice to construct. The block_indices_to_exclude parameter is used in refining the shape of the edifice from a cube to sometime more non-trivial, such as an L-shape or the net of a tesseract. The block_demarcations and use_equiangular_map parameters determine the CoordinateMaps to be used. orientations_of_all_blocks contains the OrientationMap of the edifice relative to each block.

The identifications parameter is used when identifying the faces of blocks in an edifice. This is used to identify the 1D boundaries in the 2D net for a 3D cube to construct a domain with topology S2. Note: If the user wishes to rotate the blocks as well as manually identify their faces, the user must provide the PairOfFaces corresponding to the rotated corners.

◆ size_of_element()

template<size_t VolumeDim>
std::array<double, VolumeDim> size_of_element ( const Mesh< VolumeDim > &  mesh,
const tnsr::I< DataVector, VolumeDim > &  inertial_coords 
)
noexcept

Compute the inertial-coordinate size of an element along each of its logical directions.

For each logical direction, compute the mean position (in inertial coordinates) of the element's lower and upper faces in that direction. This is done by simply averaging the coordinates of the face grid points. The size of the element along this logical direction is then the distance between the mean positions of the lower and upper faces. Note that for curved elements, this is an approximate measurement of size.

Details

Because this quantity is defined in terms of specific coordinates, it is not well represented by a Tensor, so we use a std::array.

◆ unnormalized_face_normal() [1/2]

template<size_t VolumeDim, typename TargetFrame >
tnsr::i<DataVector, VolumeDim, TargetFrame> unnormalized_face_normal ( const Mesh< VolumeDim - 1 > &  interface_mesh,
const ElementMap< VolumeDim, TargetFrame > &  map,
const Direction< VolumeDim > &  direction 
)
noexcept

Compute the outward grid normal on a face of an Element.

Returns: outward grid-frame one-form holding the normal

Details

Computes the grid-frame normal by taking the logical-frame unit one-form in the given Direction and mapping it to the grid frame with the given map.

Example

const Mesh<0> mesh_0d;
const auto map_1d = make_coordinate_map<Frame::Logical, Frame::Grid>(
CoordinateMaps::Affine(-1.0, 1.0, -3.0, 7.0));
const auto normal_1d_lower =

◆ unnormalized_face_normal() [2/2]

template<size_t VolumeDim, typename TargetFrame >
tnsr::i<DataVector, VolumeDim, TargetFrame> unnormalized_face_normal ( const Mesh< VolumeDim - 1 > &  interface_mesh,
const CoordinateMapBase< Frame::Logical, TargetFrame, VolumeDim > &  map,
const Direction< VolumeDim > &  direction 
)
noexcept

Compute the outward grid normal on a face of an Element.

Returns: outward grid-frame one-form holding the normal

Details

Computes the grid-frame normal by taking the logical-frame unit one-form in the given Direction and mapping it to the grid frame with the given map.

Example

const Mesh<0> mesh_0d;
const auto map_1d = make_coordinate_map<Frame::Logical, Frame::Grid>(
CoordinateMaps::Affine(-1.0, 1.0, -3.0, 7.0));
const auto normal_1d_lower =

◆ update_amr_decision()

template<size_t VolumeDim>
bool amr::update_amr_decision ( gsl::not_null< std::array< amr::Flag, VolumeDim > * >  my_current_amr_flags,
const Element< VolumeDim > &  element,
const ElementId< VolumeDim > &  neighbor_id,
const std::array< amr::Flag, VolumeDim > &  neighbor_amr_flags 
)
noexcept

Updates the AMR decisions my_current_amr_flags of the Element element based on the AMR decisions neighbor_amr_flags of a neighbor Element with ElementId neighbor_id.

Details

This function is called by each element when it receives the AMR decisions of one of its neighbors. If any of its flags are updated, the element should send its new decisions to each of its neighbors. The following changes are made to the current flags of the element:

  • If the neighbor wants to be two or more refinement levels higher than the element, the flag is updated to bring the element to within one level
  • If the element wants to join, and the neighbor is a potential sibling but wants to be at a different refinement level in any dimension, the flag is updated to not do h-refinement.

Returns: true if any flag is changed

Note
Modifies my_current_amr_flags which are the AMR decisions of element.