SpECTRE  2021.08.02
Block< VolumeDim > Class Template Reference

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...

#include <Block.hpp>

Public Member Functions

 Block (std::unique_ptr< domain::CoordinateMapBase< Frame::Logical, Frame::Inertial, VolumeDim > > &&stationary_map, size_t id, DirectionMap< VolumeDim, BlockNeighbor< VolumeDim > > neighbors, DirectionMap< VolumeDim, std::unique_ptr< domain::BoundaryConditions::BoundaryCondition > > external_boundary_conditions={}) noexcept
 
 Block (const Block &)=delete
 
 Block (Block &&)=default
 
Blockoperator= (const Block &)=delete
 
Blockoperator= (Block &&)=default
 
const domain::CoordinateMapBase< Frame::Logical, Frame::Inertial, VolumeDim > & stationary_map () const noexcept
 The map used when the coordinate map is time-independent. More...
 
const domain::CoordinateMapBase< Frame::Logical, Frame::Grid, VolumeDim > & moving_mesh_logical_to_grid_map () const noexcept
 The map going from the block logical frame to the last time independent frame. Only used when the coordinate map is time-dependent. More...
 
const domain::CoordinateMapBase< Frame::Grid, Frame::Inertial, VolumeDim > & moving_mesh_grid_to_inertial_map () const noexcept
 The map going from the last time independent frame to the frame in which the equations are solved. Only used when the coordinate map is time-dependent. More...
 
bool is_time_dependent () const noexcept
 Returns true if the block has time-dependent maps.
 
void inject_time_dependent_map (std::unique_ptr< domain::CoordinateMapBase< Frame::Grid, Frame::Inertial, VolumeDim > > moving_mesh_inertial_map) noexcept
 Given a Block that has a time-independent map, injects the time-dependent map into the Block.
 
size_t id () const noexcept
 A unique identifier for the Block that is in the range [0, number_of_blocks -1] where number_of_blocks is the number of Blocks that cover the computational domain.
 
const DirectionMap< VolumeDim, BlockNeighbor< VolumeDim > > & neighbors () const noexcept
 Information about the neighboring Blocks.
 
const std::unordered_set< Direction< VolumeDim > > & external_boundaries () const noexcept
 The directions of the faces of the Block that are external boundaries.
 
const DirectionMap< VolumeDim, std::unique_ptr< domain::BoundaryConditions::BoundaryCondition > > & external_boundary_conditions () const noexcept
 The boundary conditions to apply at the external boundaries of the Block.
 
void pup (PUP::er &p) noexcept
 Serialization for Charm++.
 

Friends

template<size_t LocalVolumeDim>
bool operator== (const Block< LocalVolumeDim > &lhs, const Block< LocalVolumeDim > &rhs) noexcept
 

Detailed Description

template<size_t VolumeDim>
class Block< VolumeDim >

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.

Each codimension 1 boundary of a Block<VolumeDim> is either an external boundary or identical to a boundary of one other Block.

A Block has logical coordinates that go from -1 to +1 in each dimension. The global coordinates are obtained from the logical coordinates from the Coordinatemap: CoordinateMap::operator() takes Points in the Logical Frame (i.e., logical coordinates) and returns Points in the Inertial Frame (i.e., global coordinates).

Constructor & Destructor Documentation

◆ Block()

template<size_t VolumeDim>
Block< VolumeDim >::Block ( std::unique_ptr< domain::CoordinateMapBase< Frame::Logical, Frame::Inertial, VolumeDim > > &&  stationary_map,
size_t  id,
DirectionMap< VolumeDim, BlockNeighbor< VolumeDim > >  neighbors,
DirectionMap< VolumeDim, std::unique_ptr< domain::BoundaryConditions::BoundaryCondition > >  external_boundary_conditions = {} 
)
noexcept
Parameters
stationary_mapthe CoordinateMap.
ida unique ID.
neighborsinfo about the Blocks that share a codimension 1 boundary with this Block.
external_boundary_conditionsthe boundary conditions to be applied at external boundaries. Can be either empty or one per each external boundary

Member Function Documentation

◆ moving_mesh_grid_to_inertial_map()

template<size_t VolumeDim>
const domain::CoordinateMapBase< Frame::Grid, Frame::Inertial, VolumeDim > & Block< VolumeDim >::moving_mesh_grid_to_inertial_map ( ) const
noexcept

The map going from the last time independent frame to the frame in which the equations are solved. Only used when the coordinate map is time-dependent.

See also
is_time_dependent() moving_mesh_logical_to_grid_map()

◆ moving_mesh_logical_to_grid_map()

template<size_t VolumeDim>
const domain::CoordinateMapBase< Frame::Logical, Frame::Grid, VolumeDim > & Block< VolumeDim >::moving_mesh_logical_to_grid_map ( ) const
noexcept

The map going from the block logical frame to the last time independent frame. Only used when the coordinate map is time-dependent.

See also
is_time_dependent() moving_mesh_grid_to_inertial_map()

◆ stationary_map()

template<size_t VolumeDim>
const domain::CoordinateMapBase< Frame::Logical, Frame::Inertial, VolumeDim > & Block< VolumeDim >::stationary_map ( ) const
noexcept

The map used when the coordinate map is time-independent.

See also
is_time_dependent()