Classes | Enumerations | Functions
DomainHelpers.hpp File Reference

Defines DomainHelper functions. More...

#include <array>
#include <cstddef>
#include <iosfwd>
#include <limits>
#include <memory>
#include <vector>
#include "DataStructures/Index.hpp"
#include "DataStructures/Tensor/Tensor.hpp"
#include "Domain/Direction.hpp"
#include "Domain/Side.hpp"
#include "Utilities/ConstantExpressions.hpp"
#include "Utilities/Gsl.hpp"
#include "Utilities/MakeArray.hpp"

Go to the source code of this file.

Classes

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...
 
struct  create_from_yaml< ShellWedges >
 

Enumerations

enum  ShellWedges { ShellWedges::All, ShellWedges::FourOnEquator, ShellWedges::OneAlongMinusX }
 The number of wedges to include in the Shell domain. More...
 

Functions

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...
 
std::ostreamoperator<< (std::ostream &os, const ShellWedges &which_wedges) noexcept
 

Detailed Description

Defines DomainHelper functions.