SpECTRE  v2024.09.29
domain::creators::Sphere Class Reference

A 3D cubed sphere. More...

#include <Sphere.hpp>

Classes

struct  EquatorialCompression
 
struct  EquatorialCompressionOptions
 Options for the EquatorialCompression map. More...
 
struct  InitialGridPoints
 
struct  InitialRefinement
 
struct  InnerRadius
 
struct  Interior
 
struct  OuterBoundaryCondition
 
struct  OuterRadius
 
struct  RadialDistribution
 
struct  RadialPartitioning
 
struct  TimeDependentMaps
 
struct  UseEquiangularMap
 
struct  WhichWedges
 

Public Types

using maps_list = tmpl::append< tmpl::list< domain::CoordinateMap< Frame::BlockLogical, Frame::Inertial, BulgedCube >, domain::CoordinateMap< Frame::BlockLogical, Frame::Inertial, Affine3D >, domain::CoordinateMap< Frame::BlockLogical, Frame::Inertial, Equiangular3D >, domain::CoordinateMap< Frame::BlockLogical, Frame::Inertial, CoordinateMaps::Wedge< 3 > >, domain::CoordinateMap< Frame::BlockLogical, Frame::Inertial, CoordinateMaps::Wedge< 3 >, CoordinateMaps::EquatorialCompression > >, typename sphere::TimeDependentMapOptions::maps_list >
 
using Excision = detail::Excision
 
using InnerCube = detail::InnerCube
 
using TimeDepOptionType = std::variant< sphere::TimeDependentMapOptions, std::unique_ptr< domain::creators::time_dependence::TimeDependence< 3 > > >
 
using basic_options = tmpl::list< InnerRadius, OuterRadius, Interior, InitialRefinement, InitialGridPoints, UseEquiangularMap, EquatorialCompression, RadialPartitioning, RadialDistribution, WhichWedges, TimeDependentMaps >
 
template<typename Metavariables >
using options = tmpl::conditional_t< domain::BoundaryConditions::has_boundary_conditions_base_v< typename Metavariables::system >, tmpl::push_back< basic_options, OuterBoundaryCondition< domain::BoundaryConditions::get_boundary_conditions_base< typename Metavariables::system > > >, basic_options >
 

Public Member Functions

 Sphere (double inner_radius, double outer_radius, std::variant< Excision, InnerCube > interior, const typename InitialRefinement::type &initial_refinement, const typename InitialGridPoints::type &initial_number_of_grid_points, bool use_equiangular_map, std::optional< EquatorialCompressionOptions > equatorial_compression={}, std::vector< double > radial_partitioning={}, const typename RadialDistribution::type &radial_distribution=domain::CoordinateMaps::Distribution::Linear, ShellWedges which_wedges=ShellWedges::All, std::optional< TimeDepOptionType > time_dependent_options=std::nullopt, std::unique_ptr< domain::BoundaryConditions::BoundaryCondition > outer_boundary_condition=nullptr, const Options::Context &context={})
 
 Sphere (const Sphere &)=delete
 
 Sphere (Sphere &&)=default
 
Sphereoperator= (const Sphere &)=delete
 
Sphereoperator= (Sphere &&)=default
 
Domain< 3 > create_domain () const override
 
std::unordered_map< std::string, tnsr::I< double, 3, Frame::Grid > > grid_anchors () const override
 A set of named coordinates in the grid frame, like the center of the domain or the positions of specific objects in a domain. More...
 
std::vector< DirectionMap< 3, std::unique_ptr< domain::BoundaryConditions::BoundaryCondition > > > external_boundary_conditions () const override
 The set of external boundary condition for every block in the domain. More...
 
std::vector< std::array< size_t, 3 > > initial_extents () const override
 Obtain the initial grid extents of the Elements in each block. More...
 
std::vector< std::array< size_t, 3 > > initial_refinement_levels () const override
 Obtain the initial refinement levels of the blocks. More...
 
std::vector< std::stringblock_names () const override
 A human-readable name for every block, or empty if the domain creator doesn't support block names (yet). More...
 
std::unordered_map< std::string, std::unordered_set< std::string > > block_groups () const override
 Labels to refer to groups of blocks. The groups can overlap, and they don't have to cover all blocks in the domain. The groups can be used to refer to multiple blocks at once when specifying input-file options. More...
 
auto functions_of_time (const std::unordered_map< std::string, double > &initial_expiration_times={}) const -> std::unordered_map< std::string, std::unique_ptr< domain::FunctionsOfTime::FunctionOfTime > > override
 Retrieve the functions of time used for moving meshes. More...
 
- Public Member Functions inherited from DomainCreator< 3 >
 DomainCreator (const DomainCreator< VolumeDim > &)=delete
 
 DomainCreator (DomainCreator< VolumeDim > &&)=default
 
DomainCreator< VolumeDim > & operator= (const DomainCreator< VolumeDim > &)=delete
 
DomainCreator< VolumeDim > & operator= (DomainCreator< VolumeDim > &&)=default
 
virtual Domain< VolumeDim > create_domain () const=0
 
virtual std::unordered_map< std::string, tnsr::I< double, VolumeDim, Frame::Grid > > grid_anchors () const
 A set of named coordinates in the grid frame, like the center of the domain or the positions of specific objects in a domain. More...
 
virtual std::vector< DirectionMap< VolumeDim, std::unique_ptr< domain::BoundaryConditions::BoundaryCondition > > > external_boundary_conditions () const=0
 The set of external boundary condition for every block in the domain. More...
 
virtual std::vector< std::stringblock_names () const
 A human-readable name for every block, or empty if the domain creator doesn't support block names (yet). More...
 
virtual std::unordered_map< std::string, std::unordered_set< std::string > > block_groups () const
 Labels to refer to groups of blocks. The groups can overlap, and they don't have to cover all blocks in the domain. The groups can be used to refer to multiple blocks at once when specifying input-file options. More...
 
virtual std::vector< std::array< size_t, VolumeDim > > initial_extents () const=0
 Obtain the initial grid extents of the Elements in each block. More...
 
virtual std::vector< std::array< size_t, VolumeDim > > initial_refinement_levels () const=0
 Obtain the initial refinement levels of the blocks. More...
 
virtual auto functions_of_time (const std::unordered_map< std::string, double > &initial_expiration_times={}) const -> std::unordered_map< std::string, std::unique_ptr< domain::FunctionsOfTime::FunctionOfTime > >
 Retrieve the functions of time used for moving meshes. More...
 

Static Public Attributes

static constexpr Options::String help
 
- Static Public Attributes inherited from DomainCreator< 3 >
static constexpr size_t volume_dim
 

Detailed Description

A 3D cubed sphere.

Six wedges surround an interior region, which is either excised or filled in with a seventh block. The interior region is a (possibly deformed) sphere when excised, or a (possibly deformed) cube when filled in. Additional spherical shells, each composed of six wedges, can be added with the 'RadialPartitioning' option.

The orientation of each wedge in a cubed

sphere." This domain creator offers one grid anchor "Center" at the origin.

Inner cube sphericity

The inner cube is a BulgedCube except if the inner cube sphericity is exactly 0. Then an Equiangular or Affine map is used (depending on if it's equiangular or not) to avoid a root find in the BulgedCube map.

Time dependent maps

There are two ways to add time dependent maps to the Sphere domain creator. In the input file, these are specified under the TimeDependentMaps: block.

TimeDependence

You can use a simple TimeDependence (e.g. domain::creators::time_dependence::UniformTranslation or domain::creators::time_dependence::RotationAboutZAxis) to add time dependent maps. This method will add the same maps to all blocks in the domain. This method can be used with an inner cube or with an excision surface.

Hard-coded time dependent maps

The Sphere domain creator also has the option to use some hard coded time dependent maps that may be useful in certain scenarios. This method adds the maps in domain::creators::sphere::TimeDependentMapOptions to the domain. Currently, the first (inner-most) shell has maps between Frame::Grid, Frame::Distorted, and Frame::Inertial while all subsequent shells only have maps between Frame::Grid and Frame::Inertial.

Note
You can only use hard-coded time dependent maps if you have an excision surface. You cannot have a inner cube.

None

To not have any time dependent maps, pass a std::nullopt to appropriate argument in the constructor. In the input file, simple have TimeDependentMaps: None.

Member Function Documentation

◆ block_groups()

std::unordered_map< std::string, std::unordered_set< std::string > > domain::creators::Sphere::block_groups ( ) const
inlineoverridevirtual

Labels to refer to groups of blocks. The groups can overlap, and they don't have to cover all blocks in the domain. The groups can be used to refer to multiple blocks at once when specifying input-file options.

Reimplemented from DomainCreator< 3 >.

◆ block_names()

std::vector< std::string > domain::creators::Sphere::block_names ( ) const
inlineoverridevirtual

A human-readable name for every block, or empty if the domain creator doesn't support block names (yet).

Reimplemented from DomainCreator< 3 >.

◆ create_domain()

Domain< 3 > domain::creators::Sphere::create_domain ( ) const
overridevirtual

Implements DomainCreator< 3 >.

◆ external_boundary_conditions()

std::vector< DirectionMap< 3, std::unique_ptr< domain::BoundaryConditions::BoundaryCondition > > > domain::creators::Sphere::external_boundary_conditions ( ) const
overridevirtual

The set of external boundary condition for every block in the domain.

Implements DomainCreator< 3 >.

◆ functions_of_time()

auto domain::creators::Sphere::functions_of_time ( const std::unordered_map< std::string, double > &  initial_expiration_times = {}) const -> std::unordered_map< std::string, std::unique_ptr<domain::FunctionsOfTime::FunctionOfTime>>
overridevirtual

Retrieve the functions of time used for moving meshes.

Reimplemented from DomainCreator< 3 >.

◆ grid_anchors()

std::unordered_map< std::string, tnsr::I< double, 3, Frame::Grid > > domain::creators::Sphere::grid_anchors ( ) const
inlineoverridevirtual

A set of named coordinates in the grid frame, like the center of the domain or the positions of specific objects in a domain.

Reimplemented from DomainCreator< 3 >.

◆ initial_extents()

std::vector< std::array< size_t, 3 > > domain::creators::Sphere::initial_extents ( ) const
inlineoverridevirtual

Obtain the initial grid extents of the Elements in each block.

Implements DomainCreator< 3 >.

◆ initial_refinement_levels()

std::vector< std::array< size_t, 3 > > domain::creators::Sphere::initial_refinement_levels ( ) const
inlineoverridevirtual

Obtain the initial refinement levels of the blocks.

Implements DomainCreator< 3 >.

Member Data Documentation

◆ help

constexpr Options::String domain::creators::Sphere::help
staticconstexpr
Initial value:
{
"A 3D cubed sphere. Six wedges surround an interior region, which is "
"either excised or filled in with a seventh block. The interior region "
"is a (possibly deformed) sphere when excised, or a (possibly deformed) "
"cube when filled in. Additional spherical shells, each composed of six "
"wedges, can be added with the 'RadialPartitioning' option."}

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