From 61f31c717f7a738f89011ab52c48e18f3d081444 Mon Sep 17 00:00:00 2001 From: Nils Vu Date: Sun, 19 Feb 2023 12:05:35 -0800 Subject: [PATCH] Remove intermediate cubed shell in BBH domain The spherical enveloping frustums are working well, so we don't need this intermediate cube anymore. Also simplify the documentation a bit. --- src/Domain/Creators/BinaryCompactObject.cpp | 134 +++--------- src/Domain/Creators/BinaryCompactObject.hpp | 195 ++++++------------ .../InputTimeDependent3D.yaml | 8 +- .../GeneralizedHarmonic/BinaryBlackHole.yaml | 8 +- tests/InputFiles/Xcts/BinaryBlackHole.yaml | 8 +- tests/InputFiles/Xcts/HeadOnBns.yaml | 8 +- .../Creators/Test_BinaryCompactObject.cpp | 158 +++++--------- .../Test_VolumeDataReaderAlgorithm3D.yaml | 12 +- 8 files changed, 164 insertions(+), 367 deletions(-) diff --git a/src/Domain/Creators/BinaryCompactObject.cpp b/src/Domain/Creators/BinaryCompactObject.cpp index e44d457686ecd..69019d4bcabee 100644 --- a/src/Domain/Creators/BinaryCompactObject.cpp +++ b/src/Domain/Creators/BinaryCompactObject.cpp @@ -60,46 +60,37 @@ bool BinaryCompactObject::Object::is_excised() const { // Time-independent constructor BinaryCompactObject::BinaryCompactObject( - Object object_A, Object object_B, const double radius_enveloping_cube, - const double outer_radius_domain, + Object object_A, Object object_B, const double envelope_radius, + const double outer_radius, const typename InitialRefinement::type& initial_refinement, const typename InitialGridPoints::type& initial_number_of_grid_points, const bool use_equiangular_map, const bool use_projective_map, - const double frustum_sphericity, - const std::optional& radius_enveloping_sphere, const CoordinateMaps::Distribution radial_distribution_outer_shell, std::unique_ptr outer_boundary_condition, const Options::Context& context) : object_A_(std::move(object_A)), object_B_(std::move(object_B)), - radius_enveloping_cube_(radius_enveloping_cube), - outer_radius_domain_(outer_radius_domain), + envelope_radius_(envelope_radius), + outer_radius_(outer_radius), use_equiangular_map_(use_equiangular_map), use_projective_map_(use_projective_map), - frustum_sphericity_(frustum_sphericity), radial_distribution_outer_shell_(radial_distribution_outer_shell), outer_boundary_condition_(std::move(outer_boundary_condition)) { // Determination of parameters for domain construction: translation_ = 0.5 * (object_B_.x_coord + object_A_.x_coord); length_inner_cube_ = abs(object_A_.x_coord - object_B_.x_coord); - length_outer_cube_ = 2.0 * radius_enveloping_cube_ / sqrt(3.0); + length_outer_cube_ = 2.0 * envelope_radius_ / sqrt(3.0); if (use_projective_map_) { projective_scale_factor_ = length_inner_cube_ / length_outer_cube_; } else { projective_scale_factor_ = 1.0; } - need_cube_to_sphere_transition_ = - frustum_sphericity != 1.0 or radius_enveloping_sphere.has_value(); // Calculate number of blocks - // Layers 1, 2, 3, 4, and 5 have 12, 12, 10, 10, and 10 blocks, respectively, - // for a total of 44, or 54 when the cube-to-sphere transition is needed. + // Object cubes and shells have 6 blocks each, for a total for 24 blocks. + // The envelope and outer shell have another 10 blocks each. number_of_blocks_ = 44; - if (need_cube_to_sphere_transition_) { - number_of_blocks_ += 10; - } - // For each object whose interior is not excised, add 1 block if (not object_A_.is_excised()) { number_of_blocks_++; @@ -162,6 +153,10 @@ BinaryCompactObject::BinaryCompactObject( "Must specify either both inner and outer boundary conditions " "or neither."); } + if (envelope_radius_ >= outer_radius_) { + PARSE_ERROR(context, + "The outer radius must be larger than the envelope radius."); + } using domain::BoundaryConditions::is_periodic; if (is_periodic(outer_boundary_condition_) or (object_A_.is_excised() and @@ -216,10 +211,7 @@ BinaryCompactObject::BinaryCompactObject( add_object_region("ObjectA", "Cube"); // 6 blocks add_object_region("ObjectB", "Shell"); // 6 blocks add_object_region("ObjectB", "Cube"); // 6 blocks - add_outer_region("EnvelopingCube"); // 10 blocks - if (need_cube_to_sphere_transition_) { - add_outer_region("CubedShell"); // 10 blocks - } + add_outer_region("Envelope"); // 10 blocks add_outer_region("OuterShell"); // 10 blocks if (not object_A_.is_excised()) { add_object_interior("ObjectA"); // 1 block @@ -246,53 +238,6 @@ BinaryCompactObject::BinaryCompactObject( } catch (const std::exception& error) { PARSE_ERROR(context, "Invalid 'InitialGridPoints': " << error.what()); } - - // Compute the inner radius of the outer spherical shell. The computation - // makes use of the refinement, so this can't be done earlier. - if (radius_enveloping_sphere.has_value()) { - radius_enveloping_sphere_ = radius_enveloping_sphere.value(); - if (radius_enveloping_sphere_ <= radius_enveloping_cube_ or - radius_enveloping_sphere_ >= outer_radius_domain_) { - PARSE_ERROR( - context, - "The 'OuterShell.InnerRadius' must be within 'EnvelopingCube.Radius' " - "(" << radius_enveloping_cube_ - << ") and 'OuterShell.OuterRadius' (" << outer_radius_domain_ - << "), but is: " << radius_enveloping_sphere_ - << ". Set it to 'Auto' so a reasonable value is chosen " - "automatically."); - } - } else if (frustum_sphericity == 1.0) { - radius_enveloping_sphere_ = radius_enveloping_cube_; - } else { - // Adjust the outer boundary of the cubed sphere to conform to the spacing - // of the spherical shells after refinement, so the cubed sphere is the same - // size as the first radial division of the spherical shell (for linear - // mapping) or smaller by the same factor as adjacent radial divisions in - // the spherical shell (for logarithmic or inverse mapping). - const size_t addition_to_outer_layer_radial_refinement_level = - initial_refinement_[44][2] - initial_refinement_[34][2]; - const size_t radial_divisions_in_outer_layers = - pow(2, addition_to_outer_layer_radial_refinement_level) + 1; - // Use the `Interval` class to divide the interval between - // `radius_enveloping_cube_` and `outer_radius_domain_` into - // `radial_divisions_in_outer_layers` pieces. Choose - // `radius_enveloping_sphere_` as the first of those pieces. - radius_enveloping_sphere_ = - domain::CoordinateMaps::Interval{// Source interval - 0., 1., - // Target interval - radius_enveloping_cube_, - outer_radius_domain_, - // Distribution in target interval - radial_distribution_outer_shell_, - // Position of the singularity for log - // and 1/r maps (in target interval) - 0.}(std::array{ - {// Inner radius in source interval that is mapped to target - // interval - 1. / static_cast(radial_divisions_in_outer_layers)}})[0]; - } } // Time-dependent constructor, with additional options for specifying @@ -306,22 +251,18 @@ BinaryCompactObject::BinaryCompactObject( std::array initial_size_map_values, std::array initial_size_map_velocities, std::array initial_size_map_accelerations, Object object_A, - Object object_B, double radius_enveloping_cube, double outer_radius_domain, + Object object_B, double envelope_radius, double outer_radius, const typename InitialRefinement::type& initial_refinement, const typename InitialGridPoints::type& initial_number_of_grid_points, const bool use_equiangular_map, bool use_projective_map, - double frustum_sphericity, - const std::optional& radius_enveloping_sphere, CoordinateMaps::Distribution radial_distribution_outer_shell, std::unique_ptr outer_boundary_condition, const Options::Context& context) : BinaryCompactObject(std::move(object_A), std::move(object_B), - radius_enveloping_cube, outer_radius_domain, - initial_refinement, initial_number_of_grid_points, - use_equiangular_map, use_projective_map, - frustum_sphericity, radius_enveloping_sphere, - radial_distribution_outer_shell, + envelope_radius, outer_radius, initial_refinement, + initial_number_of_grid_points, use_equiangular_map, + use_projective_map, radial_distribution_outer_shell, std::move(outer_boundary_condition), context) { enable_time_dependence_ = true; initial_time_ = initial_time; @@ -417,40 +358,25 @@ Domain<3> BinaryCompactObject::create_domain() const { // --- Frustums enclosing both objects (10 blocks) --- // - // The two abutting cubes are enclosed by a layer of frustums that form a cube - // (if frustum_sphericity_ is 0) or a sphere (if frustum_sphericity_ is 1) - // surrounding both objects. While the two objects can be offset from the - // origin to account for their center of mass, the enclosing frustums are + // The two abutting cubes are enclosed by a layer of frustums that form a + // sphere surrounding both objects. While the two objects can be offset from + // the origin to account for their center of mass, the enclosing frustums are // centered at the origin. Maps maps_frustums = domain::make_vector_coordinate_map_base< - Frame::BlockLogical, Frame::Inertial, 3>( - frustum_coordinate_maps(length_inner_cube_, length_outer_cube_, - use_equiangular_map_, {{-translation_, 0.0, 0.0}}, - projective_scale_factor_, frustum_sphericity_)); + Frame::BlockLogical, Frame::Inertial, 3>(frustum_coordinate_maps( + length_inner_cube_, length_outer_cube_, use_equiangular_map_, + {{-translation_, 0.0, 0.0}}, projective_scale_factor_, 1.0)); std::move(maps_frustums.begin(), maps_frustums.end(), std::back_inserter(maps)); - // --- (Optional) transition from frustums to sphere (10 blocks) --- - // - // Another layer of wedges transitions from the surrounding frustums to a - // surrounding sphere. Not needed when the surrounding frustums are already - // spherical. - if (need_cube_to_sphere_transition_) { - Maps maps_first_outer_shell = domain::make_vector_coordinate_map_base< - Frame::BlockLogical, Frame::Inertial, 3>(sph_wedge_coordinate_maps( - radius_enveloping_cube_, radius_enveloping_sphere_, frustum_sphericity_, - 1.0, use_equiangular_map_, true, {}, - {domain::CoordinateMaps::Distribution::Linear})); - std::move(maps_first_outer_shell.begin(), maps_first_outer_shell.end(), - std::back_inserter(maps)); - } - // --- Outer spherical shell (10 blocks) --- - Maps maps_second_outer_shell = domain::make_vector_coordinate_map_base< - Frame::BlockLogical, Frame::Inertial, 3>(sph_wedge_coordinate_maps( - radius_enveloping_sphere_, outer_radius_domain_, 1.0, 1.0, - use_equiangular_map_, true, {}, {radial_distribution_outer_shell_})); - std::move(maps_second_outer_shell.begin(), maps_second_outer_shell.end(), + Maps maps_outer_shell = + domain::make_vector_coordinate_map_base( + sph_wedge_coordinate_maps(envelope_radius_, outer_radius_, 1.0, 1.0, + use_equiangular_map_, true, {}, + {radial_distribution_outer_shell_})); + std::move(maps_outer_shell.begin(), maps_outer_shell.end(), std::back_inserter(maps)); // --- (Optional) object centers (0 to 2 blocks) --- @@ -682,7 +608,7 @@ BinaryCompactObject::external_boundary_conditions() const { } } // Outer boundary - const size_t offset_outer_blocks = need_cube_to_sphere_transition_ ? 44 : 34; + const size_t offset_outer_blocks = 34; for (size_t i = 0; i < 10; ++i) { boundary_conditions[i + offset_outer_blocks][Direction<3>::upper_zeta()] = outer_boundary_condition_->get_clone(); diff --git a/src/Domain/Creators/BinaryCompactObject.hpp b/src/Domain/Creators/BinaryCompactObject.hpp index 0ab99cf5ee6ce..b995125e61f97 100644 --- a/src/Domain/Creators/BinaryCompactObject.hpp +++ b/src/Domain/Creators/BinaryCompactObject.hpp @@ -79,60 +79,50 @@ namespace creators { * \image html binary_compact_object_domain.png "A BHNS domain." * * Creates a 3D Domain that represents a binary compact object solution. The - * Domain consists of 4, 5, or 6 nested layers of blocks; these layers are, - * working from the interior toward the exterior: - * - 0: (optionally) The block at the center of each compact object, if not - * excised. If present, this block is a cube. If excised, the hole left - * by its absence is spherical. - * - 1: The blocks that resolve each individual compact object. This layer has - * a spherical outer boundary - if the corresponding layer-0 block exists, - * then the layer is a cube-to-sphere transition; if the layer-0 block is - * excised, then the layer is a spherical shell. - * - 2: The blocks that surround each object with a cube. Around each compact - * object, this layer transitions from a sphere to a cube. - * - 3: The blocks that surround each cube with a half-cube. At this layer, the - * two compact objects are enclosed in a single cube-shaped grid. This - * layer can have a spherical outer shape by setting the "frustum - * sphericity" to one. - * - 4: The 10 blocks that form the first outer shell. This layer transitions - * back to spherical. The gridpoints are distributed linearly with respect - * to radius. This layer can be omitted if the "frustum sphericity" is one, - * so layer 3 is already spherical. - * - 5: The 10 blocks that form a second outer shell. This layer is - * spherical, so a logarithmic map can optionally be used in this layer. - * This allows the domain to extend to large radial distances from the - * compact objects. This layer can be h-refined radially, - * creating a layer of multiple concentric spherical shells. + * Domain consists of 4 or 5 nested layers of blocks; these layers are, working + * from the interior toward the exterior: * - * In the code and options below, `ObjectA` and `ObjectB` refer to the two - * compact objects, and by extension, also refer to the layers that immediately - * surround each compact object. Note that `ObjectA` is located to the right of - * the origin (along the positive x-axis) and `ObjectB` is located to the left - * of the origin. `enveloping cube` refers to the outer surface of Layer 3. - * `outer sphere` is the radius of the spherical outer boundary, which is - * the outer boundary of Layer 5. The `enveloping cube` and `outer sphere` - * are both centered at the origin. `cutting plane` refers to the plane along - * which the domain divides into two hemispheres. In the final coordinates, the - * cutting plane always intersects the x-axis at the origin. + * - **Object A/B interior**: (optional) The block at the center of each + * compact object, if not excised. If present, this block is a cube. If + * excised, the hole left by its absence is spherical. + * - **Object A/B shell**: The 6 blocks that resolve each individual compact + * object. This layer has a spherical outer boundary - if the corresponding + * interior block exists, then the layer is a cube-to-sphere transition; if + * the interior block is excised, then the layer is a spherical shell. + * - **Object A/B cube**: The 6 blocks that surround each object with a cube. + * Around each compact object, this layer transitions from a sphere to a cube. + * - **Envelope**: The 10 blocks that transition from the two inner cubes to a + * sphere centered at the origin. + * - **Outer shell**: The 10 blocks that form an outer shell centered at the + * origin. This layer is spherical, so a logarithmic map can optionally be + * used in this layer. This allows the domain to extend to large radial + * distances from the compact objects. This layer can be h-refined radially, + * creating a layer of multiple concentric spherical shells. * - * \note The x-coordinate locations of the `ObjectA` and `ObjectB` should be - * chosen such that the center of mass is located at x=0. + * \par Notes: * - * \note When using this domain, the - * metavariables struct can contain a struct named `domain` - * that conforms to domain::protocols::Metavariables. If - * domain::enable_time_dependent_maps is either set to `false` - * or not specified in the metavariables, then this domain will be - * time-independent. If domain::enable_time_dependent_maps is set - * to `true`, then this domain also includes a time-dependent map, along with - * additional options (and a corresponding constructor) for initializing the - * time-dependent map. These options include the `InitialTime` which specifies - * the initial time for the FunctionsOfTime controlling the map. The - * time-dependent map itself consists of a composition of a CubicScale expansion - * map and a Rotation map everywhere except possibly in layer 1; in that case, - * if `ObjectA` or `ObjectB` is excised, then the time-dependent map in the - * corresponding blocks in layer 1 is a composition of a SphericalCompression - * size map, a CubicScale expansion map, and a Rotation map. + * - Object A is located to the right of the origin (along the positive x-axis) + * and Object B is located to the left of the origin. + * - "Cutting plane" refers to the plane along which the domain divides into two + * hemispheres. The cutting plane always intersects the x-axis at the origin. + * - The x-coordinate locations of the two objects should be chosen such that + * the center of mass is located at x=0. + * + * \par Time dependence: + * When using this domain, the metavariables struct can contain a struct named + * `domain` that conforms to `domain::protocols::Metavariables`. If + * `domain::enable_time_dependent_maps` is either set to `false` or not + * specified in the metavariables, then this domain will be time-independent. If + * `domain::enable_time_dependent_maps` is set to `true`, then this domain also + * includes a time-dependent map, along with additional options (and a + * corresponding constructor) for initializing the time-dependent map. These + * options include the `InitialTime` which specifies the initial time for the + * FunctionsOfTime controlling the map. The following time-dependent maps are + * applied: + * + * - A `CubicScale` expansion and a `Rotation` applied to all blocks. + * - If an object is excised, then the corresponding shell has a + * `SphericalCompression` size map. We will also add a shape map here. */ class BinaryCompactObject : public DomainCreator<3> { private: @@ -293,17 +283,17 @@ class BinaryCompactObject : public DomainCreator<3> { "x-axis)."}; }; - struct EnvelopingCube { + struct Envelope { static constexpr Options::String help = { - "Options for the cube enveloping the two objects."}; + "Options for the sphere enveloping the two objects."}; }; - struct RadiusEnvelopingCube { - using group = EnvelopingCube; + struct EnvelopeRadius { + using group = Envelope; static std::string name() { return "Radius"; } using type = double; static constexpr Options::String help = { - "Radius of Layer 3 which circumscribes the Frustums."}; + "Radius of the sphere enveloping the two objects."}; }; struct OuterShell { @@ -313,22 +303,11 @@ class BinaryCompactObject : public DomainCreator<3> { struct OuterRadius { using group = OuterShell; + static std::string name() { return "Radius"; } using type = double; static constexpr Options::String help = {"Radius of the entire domain."}; }; - struct RadiusEnvelopingSphere { - using group = OuterShell; - static std::string name() { return "InnerRadius"; } - using type = Options::Auto; - static constexpr Options::String help = { - "Inner radius of the outer spherical shell. Set to 'Auto' to compute a " - "reasonable value automatically based on the " - "'OuterShell.RadialDistribution', or to omit the layer of blocks " - "altogether when EnvelopingCube.Sphericity is 1 and hence the " - "cube-to-sphere transition is not needed."}; - }; - struct InitialRefinement { using type = std::variant, @@ -357,27 +336,12 @@ class BinaryCompactObject : public DomainCreator<3> { }; struct UseProjectiveMap { - using group = EnvelopingCube; + using group = Envelope; using type = bool; static constexpr Options::String help = { "Use projective scaling on the frustal cloak."}; }; - struct FrustumSphericity { - using group = EnvelopingCube; - static std::string name() { return "Sphericity"; } - using type = double; - static constexpr Options::String help = { - "Sphericity of the enveloping cube. The value 0.0 corresponds " - "to a cubical envelope of frustums, the value 1.0 corresponds " - "to a spherical envelope of frustums."}; - static double lower_bound() { return 0.; } - static double upper_bound() { return 1.; } - // Suggest spherical frustums to encourage upgrading, but keep supporting - // cubical frustums until spherical frustums are sufficiently battle-tested - static double suggested_value() { return 1.; } - }; - struct RadialDistributionOuterShell { using group = OuterShell; static std::string name() { return "RadialDistribution"; } @@ -520,10 +484,9 @@ class BinaryCompactObject : public DomainCreator<3> { template using time_independent_options = tmpl::append< - tmpl::list, + UseProjectiveMap, RadialDistributionOuterShell>, tmpl::conditional_t< domain::BoundaryConditions::has_boundary_conditions_base_v< typename Metavariables::system>, @@ -547,26 +510,15 @@ class BinaryCompactObject : public DomainCreator<3> { time_independent_options>; static constexpr Options::String help{ - "The BinaryCompactObject domain is a general domain for two compact " - "objects. The user must provide the inner and outer radii of the " - "spherical shells surrounding each of the two compact objects A and B " - "(\"ObjectAShell\" and \"ObjectBShell\"). Each object is enveloped in " - "a cube (\"ObjectACube\" and \"ObjectBCube\")." - "The user must also provide the radius of the sphere that circumscribes " - "the cube containing both compact objects (\"EnvelopingCube\"). " - "A radial layer transitions from the enveloping cube to a sphere " - "(\"CubedShell\"). A final radial layer transitions to the outer " - "boundary (\"OuterShell\"). The options Object{A,B}.Interior (or " - "Object{A,B}.ExciseInterior if we're not working with boundary " - "conditions) determine whether blocks are present inside each compact " - "object (\"ObjectAInterior\" and \"ObjectBInterior\"). If set to a " - "boundary condition or 'false', the region will be excised. The user " - "specifies Object{A,B}.XCoord, the x-coordinates of the locations of the " - "centers of each compact object. In these coordinates, the location for " - "the axis of rotation is x=0. ObjectA is located on the right and ObjectB" - "is located on the left. Please make sure that your choices of " - "x-coordinate locations are such that the resulting center of mass " - "is located at zero.\n" + "A general domain for two compact objects. Each object is represented by " + "a cube along the x-axis. Object A is located on the right and Object B " + "is located on the left. Their locations should be chosen such that " + "their center of mass is located at the origin." + "The interior of each object can have a spherical excision to " + "represent a black hole." + "\n" + "The two objects are enveloped by a sphere centered at the origin, " + "and by an outer shell that can transition to large outer radii." "\n" "Both the InitialRefinement and the InitialGridPoints can be one of " "the following:\n" @@ -578,13 +530,10 @@ class BinaryCompactObject : public DomainCreator<3> { "refinement in [polar, azimuthal, radial] direction\n" " - A list, with [polar, azimuthal, radial] refinement for each block\n" "\n" - "The domain optionally includes time-dependent maps. Enabling " - "the time-dependent maps requires adding a " - "struct named domain to the Metavariables, with this " - "struct conforming to domain::protocols::Metavariables. To enable the " - "time-dependent maps, set " - "Metavariables::domain::enable_time_dependent_maps to " - "true."}; + "If time-dependent maps are enabled, the domain can rotate around the " + "z-axis and expand/compress radially. The two objects can also have a " + "spherical compression (size map), and we will add a spherical " + "distortion (shape map)."}; // Constructor for time-independent version of the domain // (i.e., for when @@ -592,13 +541,11 @@ class BinaryCompactObject : public DomainCreator<3> { // when the metavariables do not define // Metavariables::domain::enable_time_dependent_maps) BinaryCompactObject( - Object object_A, Object object_B, double radius_enveloping_cube, - double outer_radius_domain, + Object object_A, Object object_B, double envelope_radius, + double outer_radius, const typename InitialRefinement::type& initial_refinement, const typename InitialGridPoints::type& initial_number_of_grid_points, bool use_equiangular_map = true, bool use_projective_map = true, - double frustum_sphericity = 1.0, - const std::optional& radius_enveloping_sphere = std::nullopt, CoordinateMaps::Distribution radial_distribution_outer_shell = CoordinateMaps::Distribution::Linear, std::unique_ptr @@ -618,13 +565,10 @@ class BinaryCompactObject : public DomainCreator<3> { std::array initial_size_map_values, std::array initial_size_map_velocities, std::array initial_size_map_accelerations, Object object_A, - Object object_B, double radius_enveloping_cube, - double outer_radius_domain, + Object object_B, double envelope_radius, double outer_radius, const typename InitialRefinement::type& initial_refinement, const typename InitialGridPoints::type& initial_number_of_grid_points, bool use_equiangular_map = true, bool use_projective_map = true, - double frustum_sphericity = 1.0, - const std::optional& radius_enveloping_sphere = std::nullopt, CoordinateMaps::Distribution radial_distribution_outer_shell = CoordinateMaps::Distribution::Linear, std::unique_ptr @@ -669,15 +613,12 @@ class BinaryCompactObject : public DomainCreator<3> { private: Object object_A_{}; Object object_B_{}; - bool need_cube_to_sphere_transition_{}; - double radius_enveloping_cube_{}; - double radius_enveloping_sphere_{}; - double outer_radius_domain_{}; + double envelope_radius_ = std::numeric_limits::signaling_NaN(); + double outer_radius_ = std::numeric_limits::signaling_NaN(); std::vector> initial_refinement_{}; std::vector> initial_number_of_grid_points_{}; bool use_equiangular_map_ = true; bool use_projective_map_ = true; - double frustum_sphericity_{}; CoordinateMaps::Distribution radial_distribution_outer_shell_ = CoordinateMaps::Distribution::Linear; double projective_scale_factor_{}; diff --git a/tests/InputFiles/ExportCoordinates/InputTimeDependent3D.yaml b/tests/InputFiles/ExportCoordinates/InputTimeDependent3D.yaml index 7e9079fa92619..f686748f60ff4 100644 --- a/tests/InputFiles/ExportCoordinates/InputTimeDependent3D.yaml +++ b/tests/InputFiles/ExportCoordinates/InputTimeDependent3D.yaml @@ -29,13 +29,11 @@ DomainCreator: XCoord: -7.683 ExciseInterior: true UseLogarithmicMap: true - EnvelopingCube: + Envelope: Radius: 100.0 UseProjectiveMap: false - Sphericity: 1.0 OuterShell: - InnerRadius: Auto - OuterRadius: 300.0 + Radius: 300.0 RadialDistribution: Linear UseEquiangularMap: True InitialRefinement: @@ -43,7 +41,7 @@ DomainCreator: ObjectBShell: [1, 1, 1] ObjectACube: [1, 1, 0] ObjectBCube: [1, 1, 0] - EnvelopingCube: [1, 1, 1] + Envelope: [1, 1, 1] OuterShell: [1, 1, 1] InitialGridPoints: 3 TimeDependentMaps: diff --git a/tests/InputFiles/GeneralizedHarmonic/BinaryBlackHole.yaml b/tests/InputFiles/GeneralizedHarmonic/BinaryBlackHole.yaml index 5ee8720495eb2..c32da13468e23 100644 --- a/tests/InputFiles/GeneralizedHarmonic/BinaryBlackHole.yaml +++ b/tests/InputFiles/GeneralizedHarmonic/BinaryBlackHole.yaml @@ -61,13 +61,11 @@ DomainCreator: ExciseWithBoundaryCondition: DemandOutgoingCharSpeeds: UseLogarithmicMap: true - EnvelopingCube: + Envelope: Radius: 100.0 UseProjectiveMap: true - Sphericity: 0.0 OuterShell: - InnerRadius: Auto - OuterRadius: 1493.0 + Radius: 1493.0 RadialDistribution: Logarithmic BoundaryCondition: ConstraintPreservingBjorhus: @@ -78,7 +76,7 @@ DomainCreator: ObjectACube: [2, 2, 1] ObjectBShell: [3, 3, 4] ObjectBCube: [2, 2, 1] - EnvelopingCube: [2, 2, 3] + Envelope: [2, 2, 3] CubedShell: [2, 2, 2] OuterShell: [2, 2, 5] InitialGridPoints: 5 diff --git a/tests/InputFiles/Xcts/BinaryBlackHole.yaml b/tests/InputFiles/Xcts/BinaryBlackHole.yaml index b0b9418ef4a02..3b31dc572aebd 100644 --- a/tests/InputFiles/Xcts/BinaryBlackHole.yaml +++ b/tests/InputFiles/Xcts/BinaryBlackHole.yaml @@ -54,13 +54,11 @@ DomainCreator: Lapse: *kerr_left NegativeExpansion: *kerr_left UseLogarithmicMap: True - EnvelopingCube: + Envelope: Radius: 60. UseProjectiveMap: True - Sphericity: 1. OuterShell: - InnerRadius: Auto - OuterRadius: 300. + Radius: 300. RadialDistribution: Inverse BoundaryCondition: Flatness UseEquiangularMap: True @@ -99,7 +97,7 @@ DomainCreator: ObjectBShell: [6, 6, 10] ObjectACube: [6, 6, 7] ObjectBCube: [6, 6, 7] - EnvelopingCube: [6, 6, 6] + Envelope: [6, 6, 6] OuterShell: [6, 6, 6] Discretization: diff --git a/tests/InputFiles/Xcts/HeadOnBns.yaml b/tests/InputFiles/Xcts/HeadOnBns.yaml index c3e8fb0b2a2cd..187b3533f47cb 100644 --- a/tests/InputFiles/Xcts/HeadOnBns.yaml +++ b/tests/InputFiles/Xcts/HeadOnBns.yaml @@ -44,13 +44,11 @@ DomainCreator: XCoord: *x_left Interior: Auto UseLogarithmicMap: False - EnvelopingCube: + Envelope: Radius: 120. UseProjectiveMap: True - Sphericity: 1. OuterShell: - InnerRadius: Auto - OuterRadius: 600. + Radius: 600. RadialDistribution: Inverse BoundaryCondition: Flatness UseEquiangularMap: True @@ -93,7 +91,7 @@ DomainCreator: ObjectBShell: [4, 4, 5] ObjectACube: [4, 4, 5] ObjectBCube: [4, 4, 5] - EnvelopingCube: [4, 4, 4] + Envelope: [4, 4, 4] OuterShell: [4, 4, 3] Discretization: diff --git a/tests/Unit/Domain/Creators/Test_BinaryCompactObject.cpp b/tests/Unit/Domain/Creators/Test_BinaryCompactObject.cpp index ba81a88c14c06..40f478d8c4f1d 100644 --- a/tests/Unit/Domain/Creators/Test_BinaryCompactObject.cpp +++ b/tests/Unit/Domain/Creators/Test_BinaryCompactObject.cpp @@ -98,13 +98,9 @@ void test_connectivity() { constexpr double outer_radius_objectB = 1.0; constexpr double xcoord_objectB = -3.0; - // Enveloping Cube: - constexpr double radius_enveloping_cube = 25.5; + // Envelope: + constexpr double envelope_radius = 25.5; constexpr bool use_projective_map = true; - constexpr double sphericity_enveloping_cube = 0.5; - - // Enveloping sphere: - const std::optional radius_enveloping_sphere = std::nullopt; // Outer shell: constexpr double outer_radius = 32.4; @@ -133,8 +129,7 @@ void test_connectivity() { {"ObjectACube", {{1, 1, 1}}}, {"ObjectBShell", {{1, 1, 1}}}, {"ObjectBCube", {{1, 1, 1}}}, - {"EnvelopingCube", {{1, 1, 1}}}, - {"CubedShell", {{1, 1, 1}}}, + {"Envelope", {{1, 1, 1}}}, // Add some radial refinement in outer shell {"OuterShell", {{1, 1, 4}}}}; if (not excise_interiorA) { @@ -160,14 +155,12 @@ void test_connectivity() { : nullptr}) : std::nullopt, false}, - radius_enveloping_cube, + envelope_radius, outer_radius, refinement, grid_points, use_equiangular_map, use_projective_map, - sphericity_enveloping_cube, - radius_enveloping_sphere, radial_distribution_outer_shell, with_boundary_conditions ? create_outer_boundary_condition() : nullptr}; @@ -175,33 +168,28 @@ void test_connectivity() { binary_compact_object, with_boundary_conditions); std::vector expected_block_names{ - "ObjectAShellUpperZ", "ObjectAShellLowerZ", - "ObjectAShellUpperY", "ObjectAShellLowerY", - "ObjectAShellUpperX", "ObjectAShellLowerX", - "ObjectACubeUpperZ", "ObjectACubeLowerZ", - "ObjectACubeUpperY", "ObjectACubeLowerY", - "ObjectACubeUpperX", "ObjectACubeLowerX", - "ObjectBShellUpperZ", "ObjectBShellLowerZ", - "ObjectBShellUpperY", "ObjectBShellLowerY", - "ObjectBShellUpperX", "ObjectBShellLowerX", - "ObjectBCubeUpperZ", "ObjectBCubeLowerZ", - "ObjectBCubeUpperY", "ObjectBCubeLowerY", - "ObjectBCubeUpperX", "ObjectBCubeLowerX", - "EnvelopingCubeUpperZLeft", "EnvelopingCubeUpperZRight", - "EnvelopingCubeLowerZLeft", "EnvelopingCubeLowerZRight", - "EnvelopingCubeUpperYLeft", "EnvelopingCubeUpperYRight", - "EnvelopingCubeLowerYLeft", "EnvelopingCubeLowerYRight", - "EnvelopingCubeUpperX", "EnvelopingCubeLowerX", - "CubedShellUpperZLeft", "CubedShellUpperZRight", - "CubedShellLowerZLeft", "CubedShellLowerZRight", - "CubedShellUpperYLeft", "CubedShellUpperYRight", - "CubedShellLowerYLeft", "CubedShellLowerYRight", - "CubedShellUpperX", "CubedShellLowerX", - "OuterShellUpperZLeft", "OuterShellUpperZRight", - "OuterShellLowerZLeft", "OuterShellLowerZRight", - "OuterShellUpperYLeft", "OuterShellUpperYRight", - "OuterShellLowerYLeft", "OuterShellLowerYRight", - "OuterShellUpperX", "OuterShellLowerX"}; + "ObjectAShellUpperZ", "ObjectAShellLowerZ", + "ObjectAShellUpperY", "ObjectAShellLowerY", + "ObjectAShellUpperX", "ObjectAShellLowerX", + "ObjectACubeUpperZ", "ObjectACubeLowerZ", + "ObjectACubeUpperY", "ObjectACubeLowerY", + "ObjectACubeUpperX", "ObjectACubeLowerX", + "ObjectBShellUpperZ", "ObjectBShellLowerZ", + "ObjectBShellUpperY", "ObjectBShellLowerY", + "ObjectBShellUpperX", "ObjectBShellLowerX", + "ObjectBCubeUpperZ", "ObjectBCubeLowerZ", + "ObjectBCubeUpperY", "ObjectBCubeLowerY", + "ObjectBCubeUpperX", "ObjectBCubeLowerX", + "EnvelopeUpperZLeft", "EnvelopeUpperZRight", + "EnvelopeLowerZLeft", "EnvelopeLowerZRight", + "EnvelopeUpperYLeft", "EnvelopeUpperYRight", + "EnvelopeLowerYLeft", "EnvelopeLowerYRight", + "EnvelopeUpperX", "EnvelopeLowerX", + "OuterShellUpperZLeft", "OuterShellUpperZRight", + "OuterShellLowerZLeft", "OuterShellLowerZRight", + "OuterShellUpperYLeft", "OuterShellUpperYRight", + "OuterShellLowerYLeft", "OuterShellLowerYRight", + "OuterShellUpperX", "OuterShellLowerX"}; std::unordered_map> expected_block_groups{ {"ObjectAShell", @@ -218,18 +206,11 @@ void test_connectivity() { {"ObjectBCube", {"ObjectBCubeLowerY", "ObjectBCubeLowerZ", "ObjectBCubeUpperY", "ObjectBCubeUpperX", "ObjectBCubeUpperZ", "ObjectBCubeLowerX"}}, - {"EnvelopingCube", - {"EnvelopingCubeUpperZRight", "EnvelopingCubeUpperX", - "EnvelopingCubeLowerZLeft", "EnvelopingCubeLowerZRight", - "EnvelopingCubeUpperYRight", "EnvelopingCubeLowerYRight", - "EnvelopingCubeUpperYLeft", "EnvelopingCubeUpperZLeft", - "EnvelopingCubeLowerYLeft", "EnvelopingCubeLowerX"}}, - {"CubedShell", - {"CubedShellUpperZLeft", "CubedShellUpperZRight", - "CubedShellLowerZLeft", "CubedShellLowerZRight", - "CubedShellUpperYLeft", "CubedShellUpperYRight", - "CubedShellLowerYLeft", "CubedShellLowerYRight", - "CubedShellUpperX", "CubedShellLowerX"}}, + {"Envelope", + {"EnvelopeUpperZRight", "EnvelopeUpperX", "EnvelopeLowerZLeft", + "EnvelopeLowerZRight", "EnvelopeUpperYRight", + "EnvelopeLowerYRight", "EnvelopeUpperYLeft", "EnvelopeUpperZLeft", + "EnvelopeLowerYLeft", "EnvelopeLowerX"}}, {"OuterShell", {"OuterShellUpperZLeft", "OuterShellUpperZRight", "OuterShellLowerZLeft", "OuterShellLowerZRight", @@ -274,32 +255,6 @@ void test_connectivity() { } CHECK(domain.excision_spheres() == expected_excision_spheres); - // Also check whether the radius of the inner boundary of Layer 5 is - // chosen correctly. - // Compute the radius of a point in the grid frame on this boundary. - // Block 44 is one block whose -zeta face is on this boundary. - const auto map{domain.blocks()[44].stationary_map().get_clone()}; - tnsr::I logical_point( - std::array{{0.0, 0.0, -1.0}}); - const double layer_5_inner_radius = - get(magnitude(std::move(map)->operator()(logical_point))); - // The number of radial divisions in layers 4 and 5, excluding those - // resulting from InitialRefinement > 0. - const double radial_divisions_in_outer_layers = 9; - if (radial_distribution_outer_shell == Distribution::Logarithmic) { - CHECK(layer_5_inner_radius / radius_enveloping_cube == - approx(pow(outer_radius / radius_enveloping_cube, - 1.0 / radial_divisions_in_outer_layers))); - } else if (radial_distribution_outer_shell == Distribution::Inverse) { - CHECK(layer_5_inner_radius / radius_enveloping_cube == - approx(outer_radius / - (outer_radius - (outer_radius - radius_enveloping_cube) / - radial_divisions_in_outer_layers))); - } else { - CHECK(layer_5_inner_radius - radius_enveloping_cube == - approx((outer_radius - radius_enveloping_cube) / - radial_divisions_in_outer_layers)); - } if (with_boundary_conditions) { using PeriodicBc = TestHelpers::domain::BoundaryConditions:: TestPeriodicBoundaryCondition<3>; @@ -316,9 +271,8 @@ void test_connectivity() { create_inner_boundary_condition()}) : std::nullopt, false}, - radius_enveloping_cube, outer_radius, refinement, grid_points, + envelope_radius, outer_radius, refinement, grid_points, use_equiangular_map, use_projective_map, - sphericity_enveloping_cube, radius_enveloping_sphere, radial_distribution_outer_shell, std::make_unique(), Options::Context{false, {}, 1, 1}), Catch::Matchers::Contains("Cannot have periodic boundary " @@ -338,9 +292,8 @@ void test_connectivity() { std::make_unique()}) : std::nullopt, false}, - radius_enveloping_cube, outer_radius, refinement, grid_points, + envelope_radius, outer_radius, refinement, grid_points, use_equiangular_map, use_projective_map, - sphericity_enveloping_cube, radius_enveloping_sphere, radial_distribution_outer_shell, create_outer_boundary_condition(), Options::Context{false, {}, 1, 1}), @@ -360,9 +313,8 @@ void test_connectivity() { create_inner_boundary_condition()}) : std::nullopt, false}, - radius_enveloping_cube, outer_radius, refinement, grid_points, + envelope_radius, outer_radius, refinement, grid_points, use_equiangular_map, use_projective_map, - sphericity_enveloping_cube, radius_enveloping_sphere, radial_distribution_outer_shell, nullptr, Options::Context{false, {}, 1, 1}), Catch::Matchers::Contains( @@ -380,9 +332,8 @@ void test_connectivity() { excise_interiorB ? std::make_optional(Excision{nullptr}) : std::nullopt, false}, - radius_enveloping_cube, outer_radius, refinement, grid_points, + envelope_radius, outer_radius, refinement, grid_points, use_equiangular_map, use_projective_map, - sphericity_enveloping_cube, radius_enveloping_sphere, radial_distribution_outer_shell, create_outer_boundary_condition(), Options::Context{false, {}, 1, 1}), @@ -461,13 +412,11 @@ std::string create_option_string(const bool excise_A, const bool excise_B, interior_B + " UseLogarithmicMap: " + stringize(use_logarithmic_map_AB) + "\n" - " EnvelopingCube:\n" + " Envelope:\n" " Radius: 22.0\n" " UseProjectiveMap: true\n" - " Sphericity: 1.0\n" " OuterShell:\n" - " InnerRadius: Auto\n" - " OuterRadius: 25.0\n" + " Radius: 25.0\n" " RadialDistribution: Linear\n" + outer_boundary_condition + " InitialRefinement:\n" + (excise_A ? "" : " ObjectAInterior: [1, 1, 1]\n") + @@ -480,7 +429,7 @@ std::string create_option_string(const bool excise_A, const bool excise_B, "]\n" " ObjectACube: [1, 1, 1]\n" " ObjectBCube: [1, 1, 1]\n" - " EnvelopingCube: [1, 1, 1]\n" + " Envelope: [1, 1, 1]\n" " OuterShell: [1, 1, " + std::to_string(1 + additional_refinement_outer) + "]\n" @@ -660,7 +609,7 @@ void test_parse_errors() { domain::creators::BinaryCompactObject( {0.5, 1.0, -1.0, {{create_inner_boundary_condition()}}, false}, {0.3, 1.0, -1.0, {{create_inner_boundary_condition()}}, false}, 25.5, - 32.4, 2_st, 6_st, true, true, 0.0, std::nullopt, Distribution::Linear, + 32.4, 2_st, 6_st, true, true, Distribution::Linear, create_outer_boundary_condition(), Options::Context{false, {}, 1, 1}), Catch::Matchers::Contains( "The x-coordinate of ObjectA's center is expected to be positive.")); @@ -668,7 +617,7 @@ void test_parse_errors() { domain::creators::BinaryCompactObject( {0.5, 1.0, 1.0, {{create_inner_boundary_condition()}}, false}, {0.3, 1.0, 1.0, {{create_inner_boundary_condition()}}, false}, 25.5, - 32.4, 2_st, 6_st, true, true, 0.0, std::nullopt, Distribution::Linear, + 32.4, 2_st, 6_st, true, true, Distribution::Linear, create_outer_boundary_condition(), Options::Context{false, {}, 1, 1}), Catch::Matchers::Contains( "The x-coordinate of ObjectB's center is expected to be negative.")); @@ -676,7 +625,7 @@ void test_parse_errors() { domain::creators::BinaryCompactObject( {0.3, 1.0, 8.0, {{create_inner_boundary_condition()}}, false}, {0.5, 1.0, -7.0, {{create_inner_boundary_condition()}}, false}, 25.5, - 32.4, 2_st, 6_st, true, true, 0.0, std::nullopt, Distribution::Linear, + 32.4, 2_st, 6_st, true, true, Distribution::Linear, create_outer_boundary_condition(), Options::Context{false, {}, 1, 1}), Catch::Matchers::Contains("The radius for the enveloping cube is too " "small! The Frustums will be malformed.")); @@ -684,7 +633,7 @@ void test_parse_errors() { domain::creators::BinaryCompactObject( {0.3, 1.0, 1.0, {{create_inner_boundary_condition()}}, false}, {1.5, 1.0, -1.0, {{create_inner_boundary_condition()}}, false}, 25.5, - 32.4, 2_st, 6_st, true, true, 0.0, std::nullopt, Distribution::Linear, + 32.4, 2_st, 6_st, true, true, Distribution::Linear, create_outer_boundary_condition(), Options::Context{false, {}, 1, 1}), Catch::Matchers::Contains( "ObjectB's inner radius must be less than its outer radius.")); @@ -692,7 +641,7 @@ void test_parse_errors() { domain::creators::BinaryCompactObject( {3.3, 1.0, 1.0, {{create_inner_boundary_condition()}}, false}, {0.5, 1.0, -1.0, {{create_inner_boundary_condition()}}, false}, 25.5, - 32.4, 2_st, 6_st, true, true, 0.0, std::nullopt, Distribution::Linear, + 32.4, 2_st, 6_st, true, true, Distribution::Linear, create_outer_boundary_condition(), Options::Context{false, {}, 1, 1}), Catch::Matchers::Contains( "ObjectA's inner radius must be less than its outer radius.")); @@ -700,8 +649,8 @@ void test_parse_errors() { domain::creators::BinaryCompactObject( {0.3, 1.0, 1.0, {{create_inner_boundary_condition()}}, false}, {0.5, 1.0, -1.0, std::nullopt, true}, 25.5, 32.4, 2_st, 6_st, true, - true, 0.0, std::nullopt, Distribution::Linear, - create_outer_boundary_condition(), Options::Context{false, {}, 1, 1}), + true, Distribution::Linear, create_outer_boundary_condition(), + Options::Context{false, {}, 1, 1}), Catch::Matchers::Contains( "Using a logarithmically spaced radial grid in the " "part of Layer 1 enveloping Object B requires excising the interior " @@ -710,7 +659,7 @@ void test_parse_errors() { domain::creators::BinaryCompactObject( {0.3, 1.0, 1.0, std::nullopt, true}, {0.5, 1.0, -1.0, {{create_inner_boundary_condition()}}, false}, 25.5, - 32.4, 2_st, 6_st, true, true, 0.0, std::nullopt, Distribution::Linear, + 32.4, 2_st, 6_st, true, true, Distribution::Linear, create_outer_boundary_condition(), Options::Context{false, {}, 1, 1}), Catch::Matchers::Contains( "Using a logarithmically spaced radial grid in the " @@ -720,25 +669,18 @@ void test_parse_errors() { domain::creators::BinaryCompactObject( {0.3, 1.0, 1.0, {{create_inner_boundary_condition()}}, false}, {0.5, 1.0, -1.0, {{create_inner_boundary_condition()}}, false}, 25.5, - 32.4, std::vector>{}, 6_st, true, true, 0.0, - std::nullopt, Distribution::Linear, create_outer_boundary_condition(), + 32.4, std::vector>{}, 6_st, true, true, + Distribution::Linear, create_outer_boundary_condition(), Options::Context{false, {}, 1, 1}), Catch::Matchers::Contains("Invalid 'InitialRefinement'")); CHECK_THROWS_WITH( domain::creators::BinaryCompactObject( {0.3, 1.0, 1.0, {{create_inner_boundary_condition()}}, false}, {0.5, 1.0, -1.0, {{create_inner_boundary_condition()}}, false}, 25.5, - 32.4, 2_st, std::vector>{}, true, true, 0.0, - std::nullopt, Distribution::Linear, create_outer_boundary_condition(), + 32.4, 2_st, std::vector>{}, true, true, + Distribution::Linear, create_outer_boundary_condition(), Options::Context{false, {}, 1, 1}), Catch::Matchers::Contains("Invalid 'InitialGridPoints'")); - CHECK_THROWS_WITH( - domain::creators::BinaryCompactObject( - {0.3, 1.0, 1.0, {{create_inner_boundary_condition()}}, false}, - {0.5, 1.0, -1.0, {{create_inner_boundary_condition()}}, false}, 25.5, - 32.4, 2_st, 6_st, true, true, 0.0, 35., Distribution::Linear, - create_outer_boundary_condition(), Options::Context{false, {}, 1, 1}), - Catch::Matchers::Contains("The 'OuterShell.InnerRadius' must be within")); // Note: the boundary condition-related parse errors are checked in the // test_connectivity function. } diff --git a/tests/Unit/IO/Importers/Test_VolumeDataReaderAlgorithm3D.yaml b/tests/Unit/IO/Importers/Test_VolumeDataReaderAlgorithm3D.yaml index f129dbc40ec9f..0e1ce51cc270d 100644 --- a/tests/Unit/IO/Importers/Test_VolumeDataReaderAlgorithm3D.yaml +++ b/tests/Unit/IO/Importers/Test_VolumeDataReaderAlgorithm3D.yaml @@ -15,13 +15,11 @@ SourceDomainCreator: XCoord: &x_left -7.683 ExciseInterior: True UseLogarithmicMap: True - EnvelopingCube: + Envelope: Radius: 60. UseProjectiveMap: True - Sphericity: 1. OuterShell: - InnerRadius: Auto - OuterRadius: 350. + Radius: 350. RadialDistribution: Inverse UseEquiangularMap: True InitialRefinement: 1 @@ -41,13 +39,11 @@ TargetDomainCreator: XCoord: *x_left ExciseInterior: True UseLogarithmicMap: true - EnvelopingCube: + Envelope: Radius: 100. UseProjectiveMap: true - Sphericity: 1. OuterShell: - InnerRadius: Auto - OuterRadius: 300. + Radius: 300. RadialDistribution: Linear UseEquiangularMap: True InitialRefinement: 0