SpECTRE  v2024.04.12
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::BlockLogical, Frame::Inertial, VolumeDim > > &&stationary_map, size_t id, DirectionMap< VolumeDim, BlockNeighbor< VolumeDim > > neighbors, std::string name="")
 
 Block (const Block &)=delete
 
 Block (Block &&)=default
 
Blockoperator= (const Block &)=delete
 
Blockoperator= (Block &&)=default
 
const domain::CoordinateMapBase< Frame::BlockLogical, Frame::Inertial, VolumeDim > & stationary_map () const
 The map used when the coordinate map is time-independent. More...
 
const domain::CoordinateMapBase< Frame::BlockLogical, Frame::Grid, VolumeDim > & moving_mesh_logical_to_grid_map () const
 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
 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...
 
const domain::CoordinateMapBase< Frame::Grid, Frame::Distorted, VolumeDim > & moving_mesh_grid_to_distorted_map () const
 The map going from the last time independent frame to the distorted frame. Only used when the coordinate map is time-dependent. See Domain Concepts to see how the distorted frame is defined. More...
 
const domain::CoordinateMapBase< Frame::Distorted, Frame::Inertial, VolumeDim > & moving_mesh_distorted_to_inertial_map () const
 The map going from the distorted frame to the frame in which the equations are solved. Only used when the coordinate map is time-dependent. See Domain Concepts to see how the distorted frame is defined. More...
 
bool is_time_dependent () const
 Returns true if the block has time-dependent maps.
 
bool has_distorted_frame () const
 Returns true if the block has a distorted frame. More...
 
void inject_time_dependent_map (std::unique_ptr< domain::CoordinateMapBase< Frame::Grid, Frame::Inertial, VolumeDim > > moving_mesh_grid_to_inertial_map, std::unique_ptr< domain::CoordinateMapBase< Frame::Grid, Frame::Distorted, VolumeDim > > moving_mesh_grid_to_distorted_map=nullptr, std::unique_ptr< domain::CoordinateMapBase< Frame::Distorted, Frame::Inertial, VolumeDim > > moving_mesh_distorted_to_inertial_map=nullptr)
 Given a Block that has a time-independent map, injects the time-dependent map into the Block.
 
size_t id () const
 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
 Information about the neighboring Blocks.
 
const std::unordered_set< Direction< VolumeDim > > & external_boundaries () const
 The directions of the faces of the Block that are external boundaries.
 
const std::stringname () const
 
void pup (PUP::er &p)
 Serialization for Charm++.
 

Friends

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

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 BlockLogical Frame (i.e., block logical coordinates) and returns Points in the Inertial Frame (i.e., the global coordinate frame in which the problem to be solved is set up).

Constructor & Destructor Documentation

◆ Block()

template<size_t VolumeDim>
Block< VolumeDim >::Block ( std::unique_ptr< domain::CoordinateMapBase< Frame::BlockLogical, Frame::Inertial, VolumeDim > > &&  stationary_map,
size_t  id,
DirectionMap< VolumeDim, BlockNeighbor< VolumeDim > >  neighbors,
std::string  name = "" 
)
Parameters
stationary_mapthe CoordinateMap.
ida unique ID.
neighborsinfo about the Blocks that share a codimension 1 boundary with this Block.
nameHuman-readable name for the block

Member Function Documentation

◆ has_distorted_frame()

template<size_t VolumeDim>
bool Block< VolumeDim >::has_distorted_frame ( ) const
inline

Returns true if the block has a distorted frame.

If a block has a distorted frame, then

  • moving_mesh_grid_to_distorted_map() is non-null
  • moving_mesh_distorted_to_inertial_map() is non-null
  • moving_mesh_grid_to_inertial_map() is non-null Note in particular the last point above: If the block is time-dependent, then the block must have a grid_to_inertial map independent of whether it has a distorted frame. This allows us to write more efficient maps. In particular, we often care only about the grid_to_inertial map, so we can code that map directly instead of composing grid_to_distorted + distorted_to_inertial maps at runtime.

If a block does not have a distorted frame, then

◆ moving_mesh_distorted_to_inertial_map()

template<size_t VolumeDim>
const domain::CoordinateMapBase< Frame::Distorted, Frame::Inertial, VolumeDim > & Block< VolumeDim >::moving_mesh_distorted_to_inertial_map ( ) const

The map going from the distorted frame to the frame in which the equations are solved. Only used when the coordinate map is time-dependent. See Domain Concepts to see how the distorted frame is defined.

See also
is_time_dependent() moving_mesh_grid_to_distorted_map()

◆ moving_mesh_grid_to_distorted_map()

template<size_t VolumeDim>
const domain::CoordinateMapBase< Frame::Grid, Frame::Distorted, VolumeDim > & Block< VolumeDim >::moving_mesh_grid_to_distorted_map ( ) const

The map going from the last time independent frame to the distorted frame. Only used when the coordinate map is time-dependent. See Domain Concepts to see how the distorted frame is defined.

See also
is_time_dependent() moving_mesh_distorted_to_grid_map()

◆ 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

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::BlockLogical, Frame::Grid, VolumeDim > & Block< VolumeDim >::moving_mesh_logical_to_grid_map ( ) const

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::BlockLogical, Frame::Inertial, VolumeDim > & Block< VolumeDim >::stationary_map ( ) const

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

See also
is_time_dependent()

The documentation for this class was generated from the following file: