diff --git a/src/Domain/Block.cpp b/src/Domain/Block.cpp index 1cc92abc78be..5bc37ca41ab5 100644 --- a/src/Domain/Block.cpp +++ b/src/Domain/Block.cpp @@ -27,6 +27,31 @@ Block::Block( std::string name) : stationary_map_(std::move(stationary_map)), id_(id), + geometry_(domain::BlockGeometry::Cube), + name_(std::move(name)) { + for (auto& [direction, neighbor] : neighbors) { + neighbors_[direction].insert(std::move(neighbor)); + } + // Loop over Directions to search which Directions were not set to neighbors_, + // set these Directions to external_boundaries_. + for (const auto& direction : Direction::all_directions()) { + if (neighbors_.find(direction) == neighbors_.end()) { + external_boundaries_.emplace(direction); + } + } +} + +template +Block::Block( + std::unique_ptr>&& stationary_map, + const size_t id, + DirectionMap>> + neighbors, + std::string name) + : stationary_map_(std::move(stationary_map)), + id_(id), + geometry_(domain::BlockGeometry::SphericalShell), neighbors_(std::move(neighbors)), name_(std::move(name)) { // Loop over Directions to search which Directions were not set to neighbors_, @@ -118,7 +143,7 @@ void Block::inject_time_dependent_map( template void Block::pup(PUP::er& p) { - size_t version = 1; + size_t version = 2; p | version; // Remember to increment the version number when making changes to this // function. Retain support for unpacking data written by previous versions @@ -130,7 +155,18 @@ void Block::pup(PUP::er& p) { p | moving_mesh_grid_to_distorted_map_; p | moving_mesh_distorted_to_inertial_map_; p | id_; - p | neighbors_; + if (version < 2) { + geometry_ = domain::BlockGeometry::Cube; + DirectionMap> neighbors; + p | neighbors; + neighbors_.clear(); + for (auto& [direction, neighbor] : neighbors) { + neighbors_[direction].insert(std::move(neighbor)); + } + } else { + p | geometry_; + p | neighbors_; + } p | external_boundaries_; } if (version >= 1) { @@ -141,6 +177,7 @@ void Block::pup(PUP::er& p) { template std::ostream& operator<<(std::ostream& os, const Block& block) { os << "Block " << block.id() << " (" << block.name() << "):\n"; + os << "Geometry: " << block.geometry() << '\n'; os << "Neighbors: " << block.neighbors() << '\n'; os << "External boundaries: " << block.external_boundaries() << '\n'; os << "Is time dependent: " << std::boolalpha << block.is_time_dependent(); @@ -150,7 +187,8 @@ std::ostream& operator<<(std::ostream& os, const Block& block) { template bool operator==(const Block& lhs, const Block& rhs) { bool blocks_are_equal = - (lhs.id() == rhs.id() and lhs.neighbors() == rhs.neighbors() and + (lhs.id() == rhs.id() and lhs.geometry() == rhs.geometry() and + lhs.neighbors() == rhs.neighbors() and lhs.external_boundaries() == rhs.external_boundaries() and lhs.name() == rhs.name() and lhs.is_time_dependent() == rhs.is_time_dependent() and diff --git a/src/Domain/Block.hpp b/src/Domain/Block.hpp index 5ccad0069a04..efab9b2a0690 100644 --- a/src/Domain/Block.hpp +++ b/src/Domain/Block.hpp @@ -13,6 +13,7 @@ #include #include "Domain/CoordinateMaps/CoordinateMap.hpp" +#include "Domain/Structure/BlockGeometry.hpp" #include "Domain/Structure/BlockNeighbor.hpp" #include "Domain/Structure/Direction.hpp" #include "Domain/Structure/DirectionMap.hpp" @@ -33,7 +34,10 @@ class er; /// Elements that cover a region of the computational domain. /// /// Each codimension 1 boundary of a Block is either an external -/// boundary or identical to a boundary of one other Block. +/// boundary or an internal boundary to one or more neighboring blocks. The only +/// currently supported case where blocks can have more than one neighbor are +/// interfaces between a spherical shell and wedges. In all other cases the +/// internal boundaries between neighboring blocks must be identical. /// /// A Block has logical coordinates that go from -1 to +1 in each /// dimension. The global coordinates are obtained from the logical @@ -44,6 +48,8 @@ class er; template class Block { public: + /// Block with one neighbor per direction. Currently always a deformed cube. + /// /// \param stationary_map the CoordinateMap. /// \param id a unique ID. /// \param neighbors info about the Blocks that share a codimension 1 @@ -54,6 +60,15 @@ class Block { size_t id, DirectionMap> neighbors, std::string name = ""); + /// Block with multiple neighbors per direction. Currently only supports + /// spherical shells. + Block(std::unique_ptr>&& stationary_map, + size_t id, + DirectionMap>> + neighbors, + std::string name = ""); + Block() = default; ~Block() = default; Block(const Block&) = delete; @@ -61,6 +76,8 @@ class Block { Block& operator=(const Block&) = delete; Block& operator=(Block&&) = default; + domain::BlockGeometry geometry() const { return geometry_; } + /// \brief The map used when the coordinate map is time-independent. /// /// \see is_time_dependent() @@ -148,7 +165,8 @@ class Block { size_t id() const { return id_; } /// Information about the neighboring Blocks. - const DirectionMap>& neighbors() const { + const DirectionMap>>& + neighbors() const { return neighbors_; } @@ -186,7 +204,9 @@ class Block { moving_mesh_distorted_to_inertial_map_{nullptr}; size_t id_{0}; - DirectionMap> neighbors_; + domain::BlockGeometry geometry_{domain::BlockGeometry::Cube}; + DirectionMap>> + neighbors_; std::unordered_set> external_boundaries_; std::string name_; }; diff --git a/src/Domain/CreateInitialElement.cpp b/src/Domain/CreateInitialElement.cpp index 384b75175f32..c784c82ec823 100644 --- a/src/Domain/CreateInitialElement.cpp +++ b/src/Domain/CreateInitialElement.cpp @@ -12,6 +12,7 @@ #include "Domain/Structure/Direction.hpp" #include "Domain/Structure/Element.hpp" #include "Domain/Structure/ElementId.hpp" +#include "Domain/Structure/InitialElementIds.hpp" #include "Domain/Structure/Neighbors.hpp" #include "Domain/Structure/OrientationMap.hpp" #include "Domain/Structure/SegmentId.hpp" @@ -25,18 +26,82 @@ namespace domain::Initialization { template Element create_initial_element( - const ElementId& element_id, const Block& block, + const ElementId& element_id, + const std::vector>& blocks, const std::vector>& initial_refinement_levels) { + const auto& block = blocks[element_id.block_id()]; const auto& neighbors_of_block = block.neighbors(); const auto segment_ids = element_id.segment_ids(); // Declare two helper lambdas for setting the neighbors of an element const auto compute_element_neighbor_in_other_block = - [&block, &initial_refinement_levels, &neighbors_of_block, &segment_ids, - grid_index = - element_id.grid_index()](const Direction& direction) { - const auto& block_neighbor = neighbors_of_block.at(direction); + [&block, &blocks, &initial_refinement_levels, &neighbors_of_block, + &segment_ids, grid_index = element_id.grid_index()]( + const Direction& direction) { + const auto& block_neighbors = neighbors_of_block.at(direction); + + // Handle spherical shells. We assume that spherical shells have no + // angular h-refinement. That makes the logic here quite simple: + // The single-element shell is the neighbor of all radial neighbors. + if (block.geometry() == domain::BlockGeometry::SphericalShell or + (block_neighbors.size() == 1 and + blocks[block_neighbors.begin()->id()].geometry() == + domain::BlockGeometry::SphericalShell)) { +#ifdef SPECTRE_DEBUG + const auto check_angular_refinement = + [&initial_refinement_levels, + &direction](const Block& test_block) { + if (test_block.geometry() != + domain::BlockGeometry::SphericalShell) { + return; + } + const auto& refinement_levels = + initial_refinement_levels[test_block.id()]; + for (size_t d = 0; d < VolumeDim; ++d) { + if (d == direction.dimension()) { + continue; + } + ASSERT(refinement_levels[d] == 0, + "Spherical shells are assumed here to have no angular " + "refinement in angular directions."); + } + }; + check_angular_refinement(block); +#endif // SPECTRE_DEBUG + std::unordered_set> neighbor_ids; + for (const auto& block_neighbor : block_neighbors) { +#ifdef SPECTRE_DEBUG + check_angular_refinement(blocks[block_neighbor.id()]); +#endif // SPECTRE_DEBUG + const auto& orientation = block_neighbor.orientation(); + const auto direction_from_neighbor = + orientation(direction.opposite()); + const auto& refinement_of_neighbor = + initial_refinement_levels[block_neighbor.id()]; + const size_t index_of_neighbor = + direction_from_neighbor.side() == Side::Lower + ? 0 + : (two_to_the(refinement_of_neighbor[direction_from_neighbor + .dimension()]) - + 1); + for (const auto& neighbor_id : initial_element_ids( + block_neighbor.id(), refinement_of_neighbor, grid_index)) { + if (neighbor_id.segment_id(direction_from_neighbor.dimension()) + .index() == index_of_neighbor) { + neighbor_ids.insert(neighbor_id); + } + } + } + return std::make_pair( + direction, Neighbors( + std::move(neighbor_ids), + // TODO: may have to set this orientation + OrientationMap::create_aligned(), + blocks[block_neighbors.begin()->id()].geometry())); + } + + const auto& block_neighbor = *block_neighbors.begin(); const auto& orientation = block_neighbor.orientation(); const auto direction_in_neighbor = orientation(direction); @@ -131,29 +196,28 @@ Element create_initial_element( } return std::make_pair( direction, - Neighbors(std::move(neighbor_ids), orientation)); + Neighbors(std::move(neighbor_ids), orientation, + blocks[block_neighbor.id()].geometry())); }; - const auto compute_element_neighbor_in_same_block = [&element_id, - &segment_ids]( - const Direction< - VolumeDim>& - direction) { - auto segment_ids_of_neighbor = segment_ids; - auto& perpendicular_segment_id = - gsl::at(segment_ids_of_neighbor, direction.dimension()); - const auto index = perpendicular_segment_id.index(); - perpendicular_segment_id = - SegmentId(perpendicular_segment_id.refinement_level(), - direction.side() == Side::Upper ? index + 1 : index - 1); - return std::make_pair( - direction, - Neighbors( - {{ElementId{element_id.block_id(), - std::move(segment_ids_of_neighbor), - element_id.grid_index()}}}, - OrientationMap::create_aligned())); - }; + const auto compute_element_neighbor_in_same_block = + [&element_id, &segment_ids, + geometry = block.geometry()](const Direction& direction) { + auto segment_ids_of_neighbor = segment_ids; + auto& perpendicular_segment_id = + gsl::at(segment_ids_of_neighbor, direction.dimension()); + const auto index = perpendicular_segment_id.index(); + perpendicular_segment_id = + SegmentId(perpendicular_segment_id.refinement_level(), + direction.side() == Side::Upper ? index + 1 : index - 1); + return std::make_pair( + direction, + Neighbors( + {{ElementId{element_id.block_id(), + std::move(segment_ids_of_neighbor), + element_id.grid_index()}}}, + OrientationMap::create_aligned(), geometry)); + }; typename Element::Neighbors_t neighbors_of_element; for (size_t d = 0; d < VolumeDim; ++d) { @@ -186,10 +250,10 @@ Element create_initial_element( #define DIM(data) BOOST_PP_TUPLE_ELEM(0, data) -#define INSTANTIATE(_, data) \ - template Element \ - domain::Initialization::create_initial_element( \ - const ElementId&, const Block&, \ +#define INSTANTIATE(_, data) \ + template Element \ + domain::Initialization::create_initial_element( \ + const ElementId&, const std::vector>&, \ const std::vector>&); GENERATE_INSTANTIATIONS(INSTANTIATE, (1, 2, 3)) diff --git a/src/Domain/CreateInitialElement.hpp b/src/Domain/CreateInitialElement.hpp index e33b0796fac1..d1e3b1f68b86 100644 --- a/src/Domain/CreateInitialElement.hpp +++ b/src/Domain/CreateInitialElement.hpp @@ -29,7 +29,8 @@ namespace Initialization { */ template Element create_initial_element( - const ElementId& element_id, const Block& block, + const ElementId& element_id, + const std::vector>& blocks, const std::vector>& initial_refinement_levels); } // namespace Initialization diff --git a/src/Domain/ElementDistribution.cpp b/src/Domain/ElementDistribution.cpp index 69b39354c4cc..0501bb14cc3e 100644 --- a/src/Domain/ElementDistribution.cpp +++ b/src/Domain/ElementDistribution.cpp @@ -57,14 +57,15 @@ namespace { // local time stepping. template double get_num_points_and_grid_spacing_cost( - const ElementId& element_id, const Block& block, + const ElementId& element_id, const std::vector>& blocks, const std::vector>& initial_refinement_levels, const std::vector>& initial_extents, const Spectral::Quadrature quadrature) { + const auto& block = blocks[element_id.block_id()]; Mesh mesh = ::domain::Initialization::create_initial_mesh( initial_extents, element_id, quadrature); Element element = ::domain::Initialization::create_initial_element( - element_id, block, initial_refinement_levels); + element_id, blocks, initial_refinement_levels); ElementMap element_map{element_id, block}; const tnsr::I logical_coords = logical_coordinates(mesh); @@ -122,7 +123,7 @@ std::unordered_map, double> get_element_costs( element_costs.insert( {element_id, get_num_points_and_grid_spacing_cost( - element_id, block, initial_refinement_levels, + element_id, blocks, initial_refinement_levels, initial_extents, quadrature.value())}); } } @@ -323,7 +324,7 @@ size_t BlockZCurveProcDistribution::get_proc_for_element( template class BlockZCurveProcDistribution; \ double get_num_points_and_grid_spacing_cost( \ const ElementId& element_id, \ - const Block& block, \ + const std::vector>& blocks, \ const std::vector>& \ initial_refinement_levels, \ const std::vector>& initial_extents, \ diff --git a/src/Domain/Structure/Neighbors.cpp b/src/Domain/Structure/Neighbors.cpp index c81960df484b..8ee54ceed007 100644 --- a/src/Domain/Structure/Neighbors.cpp +++ b/src/Domain/Structure/Neighbors.cpp @@ -15,14 +15,16 @@ template Neighbors::Neighbors(std::unordered_set> ids, - OrientationMap orientation) - : ids_(std::move(ids)), orientation_(std::move(orientation)) { - // Assuming a maximum 2-to-1 refinement between neighboring elements: - ASSERT(ids_.size() <= maximum_number_of_neighbors_per_direction(VolumeDim), - "Can't have " << ids_.size() << " neighbors in " << VolumeDim - << " dimensions"); + OrientationMap orientation, + domain::BlockGeometry geometry) + : ids_(std::move(ids)), + orientation_(std::move(orientation)), + geometry_(std::move(geometry)) { ASSERT(orientation_ != OrientationMap{}, "Cannot use a default-constructed OrientationMap in Neighbors."); + if (geometry_ == domain::BlockGeometry::SphericalShell) { + ASSERT(ids_.size() == 1, "Only one spherical shell neighbor is possible."); + } } template @@ -31,10 +33,9 @@ void Neighbors::add_ids( for (const auto& id : additional_ids) { ids_.insert(id); } - // Assuming a maximum 2-to-1 refinement between neighboring elements: - ASSERT(ids_.size() <= maximum_number_of_neighbors_per_direction(VolumeDim), - "Can't have " << ids_.size() << " neighbors in " << VolumeDim - << " dimensions"); + if (geometry_ == domain::BlockGeometry::SphericalShell) { + ASSERT(ids_.size() == 1, "Only one spherical shell neighbor is possible."); + } } template @@ -46,7 +47,8 @@ std::ostream& operator<<(std::ostream& os, const Neighbors& n) { template bool operator==(const Neighbors& lhs, const Neighbors& rhs) { - return (lhs.ids() == rhs.ids() and lhs.orientation() == rhs.orientation()); + return (lhs.ids() == rhs.ids() and lhs.orientation() == rhs.orientation() and + lhs.geometry() == rhs.geometry()); } template @@ -59,6 +61,7 @@ template void Neighbors::pup(PUP::er& p) { p | ids_; p | orientation_; + p | geometry_; } #define GET_DIM(data) BOOST_PP_TUPLE_ELEM(0, data) diff --git a/src/Domain/Structure/Neighbors.hpp b/src/Domain/Structure/Neighbors.hpp index a089a8abf9ea..73d478a0a304 100644 --- a/src/Domain/Structure/Neighbors.hpp +++ b/src/Domain/Structure/Neighbors.hpp @@ -10,6 +10,7 @@ #include #include +#include "Domain/Structure/BlockGeometry.hpp" #include "Domain/Structure/OrientationMap.hpp" /// \cond @@ -34,8 +35,11 @@ class Neighbors { /// \param orientation This OrientationMap takes objects in the logical /// coordinate frame of the host Element and maps them to the logical /// coordinate frame of the neighbor Element. + /// \param geometry the geometry of the neighboring block. Neighbors(std::unordered_set> ids, - OrientationMap orientation); + OrientationMap orientation, + // todo: remove default + domain::BlockGeometry geometry = domain::BlockGeometry::Cube); /// Default constructor for Charm++ serialization. Neighbors() = default; @@ -49,6 +53,8 @@ class Neighbors { const OrientationMap& orientation() const { return orientation_; } + const domain::BlockGeometry& geometry() const { return geometry_; } + /// Reset the ids of the neighbors. void set_ids_to(const std::unordered_set> new_ids) { ids_ = std::move(new_ids); @@ -96,6 +102,7 @@ class Neighbors { private: std::unordered_set> ids_; OrientationMap orientation_; + domain::BlockGeometry geometry_; }; /// Output operator for Neighborss. diff --git a/src/Elliptic/DiscontinuousGalerkin/Initialization.cpp b/src/Elliptic/DiscontinuousGalerkin/Initialization.cpp index 762fdce403bf..ba67c55a8adc 100644 --- a/src/Elliptic/DiscontinuousGalerkin/Initialization.cpp +++ b/src/Elliptic/DiscontinuousGalerkin/Initialization.cpp @@ -106,9 +106,8 @@ void InitializeGeometry::apply( *mesh = domain::Initialization::create_initial_mesh(initial_extents, element_id, quadrature); // Element - const auto& block = domain.blocks()[element_id.block_id()]; - *element = domain::Initialization::create_initial_element(element_id, block, - initial_refinement); + *element = domain::Initialization::create_initial_element( + element_id, domain.blocks(), initial_refinement); // Neighbor meshes for (const auto& [direction, neighbors] : element->neighbors()) { for (const auto& neighbor_id : neighbors) { @@ -118,6 +117,7 @@ void InitializeGeometry::apply( } } // Element map + const auto& block = domain.blocks()[element_id.block_id()]; *element_map = ElementMap{element_id, block}; // Coordinates and Jacobians detail::initialize_coords_and_jacobians( diff --git a/src/Evolution/Initialization/DgDomain.hpp b/src/Evolution/Initialization/DgDomain.hpp index a26563410a46..e8aa5c0e35a4 100644 --- a/src/Evolution/Initialization/DgDomain.hpp +++ b/src/Evolution/Initialization/DgDomain.hpp @@ -147,7 +147,7 @@ struct Domain { *mesh = ::domain::Initialization::create_initial_mesh( initial_extents, element_id, quadrature); *element = ::domain::Initialization::create_initial_element( - element_id, my_block, initial_refinement); + element_id, domain.blocks(), initial_refinement); *element_map = ElementMap{element_id, my_block}; if (my_block.is_time_dependent()) { diff --git a/src/Executables/Examples/RandomAmr/InitializeDomain.hpp b/src/Executables/Examples/RandomAmr/InitializeDomain.hpp index e0bc500da8f1..868e041f7153 100644 --- a/src/Executables/Examples/RandomAmr/InitializeDomain.hpp +++ b/src/Executables/Examples/RandomAmr/InitializeDomain.hpp @@ -63,11 +63,10 @@ struct Domain { const std::vector>& initial_refinement, const Spectral::Quadrature& quadrature, const ElementId& element_id) { - const auto& my_block = domain.blocks()[element_id.block_id()]; *mesh = ::domain::Initialization::create_initial_mesh( initial_extents, element_id, quadrature); *element = ::domain::Initialization::create_initial_element( - element_id, my_block, initial_refinement); + element_id, domain.blocks(), initial_refinement); } }; } // namespace amr::Initialization diff --git a/tests/Unit/Domain/Test_CreateInitialElement.cpp b/tests/Unit/Domain/Test_CreateInitialElement.cpp index d83529b8806a..25f87226f629 100644 --- a/tests/Unit/Domain/Test_CreateInitialElement.cpp +++ b/tests/Unit/Domain/Test_CreateInitialElement.cpp @@ -34,11 +34,11 @@ namespace { void test_create_initial_element( - const ElementId<2>& element_id, const Block<2>& block, + const ElementId<2>& element_id, const std::vector>& blocks, const std::vector>& refinement_levels, const DirectionMap<2, Neighbors<2>>& expected_neighbors) { const auto created_element = domain::Initialization::create_initial_element( - element_id, block, refinement_levels); + element_id, blocks, refinement_levels); const Element<2> expected_element{element_id, expected_neighbors}; CHECK(created_element == expected_element); } @@ -52,16 +52,17 @@ void test_h_refinement() { const std::unordered_set>& expected_neighbors) { CAPTURE(neighbor_orientation); CAPTURE(neighbor_refinement); - const Block<3> self_block( - domain::make_coordinate_map_base( - domain::CoordinateMaps::Identity<3>{}), - 0, {{neighbor_direction, {1, neighbor_orientation}}}); + std::vector> blocks{}; + blocks.push_back({domain::make_coordinate_map_base( + domain::CoordinateMaps::Identity<3>{}), + 0, + {{neighbor_direction, {1, neighbor_orientation}}}}); const std::vector> refinement_levels{ {{1, 1, 1}}, neighbor_refinement}; const auto refined_neighbors = - domain::Initialization::create_initial_element(self_id, self_block, + domain::Initialization::create_initial_element(self_id, blocks, refinement_levels) .neighbors() .at(neighbor_direction) @@ -398,18 +399,18 @@ SPECTRE_TEST_CASE("Unit.Domain.CreateInitialElement", "[Domain][Unit]") { make_array(Direction<2>::upper_xi(), Direction<2>::upper_eta())); OrientationMap<2> unaligned( make_array(Direction<2>::lower_eta(), Direction<2>::upper_xi())); - Block<2> test_block( - domain::make_coordinate_map_base( - domain::CoordinateMaps::Identity<2>{}), - 0, - {{Direction<2>::upper_xi(), BlockNeighbor<2>{1, aligned}}, - {Direction<2>::upper_eta(), BlockNeighbor<2>{2, unaligned}}}); + std::vector> blocks{}; + blocks.push_back( + {domain::make_coordinate_map_base( + domain::CoordinateMaps::Identity<2>{}), + 0, + {{Direction<2>::upper_xi(), BlockNeighbor<2>{1, aligned}}, + {Direction<2>::upper_eta(), BlockNeighbor<2>{2, unaligned}}}}); std::vector> refinement{{{2, 3}}, {{2, 3}}, {{3, 2}}}; // interior element test_create_initial_element( - ElementId<2>{0, {{SegmentId{2, 2}, SegmentId{3, 4}}}}, test_block, - refinement, + ElementId<2>{0, {{SegmentId{2, 2}, SegmentId{3, 4}}}}, blocks, refinement, {{Direction<2>::upper_xi(), Neighbors<2>{{ElementId<2>{0, {{SegmentId{2, 3}, SegmentId{3, 4}}}}}, aligned}}, @@ -425,8 +426,7 @@ SPECTRE_TEST_CASE("Unit.Domain.CreateInitialElement", "[Domain][Unit]") { // element on external boundary test_create_initial_element( - ElementId<2>{0, {{SegmentId{2, 0}, SegmentId{3, 0}}}}, test_block, - refinement, + ElementId<2>{0, {{SegmentId{2, 0}, SegmentId{3, 0}}}}, blocks, refinement, {{Direction<2>::upper_xi(), Neighbors<2>{{ElementId<2>{0, {{SegmentId{2, 1}, SegmentId{3, 0}}}}}, aligned}}, @@ -436,8 +436,7 @@ SPECTRE_TEST_CASE("Unit.Domain.CreateInitialElement", "[Domain][Unit]") { // element bounding aligned neighbor block test_create_initial_element( - ElementId<2>{0, {{SegmentId{2, 3}, SegmentId{3, 4}}}}, test_block, - refinement, + ElementId<2>{0, {{SegmentId{2, 3}, SegmentId{3, 4}}}}, blocks, refinement, {{Direction<2>::upper_xi(), Neighbors<2>{{ElementId<2>{1, {{SegmentId{2, 0}, SegmentId{3, 4}}}}}, aligned}}, @@ -453,8 +452,7 @@ SPECTRE_TEST_CASE("Unit.Domain.CreateInitialElement", "[Domain][Unit]") { // element bounding unaligned neighbor block test_create_initial_element( - ElementId<2>{0, {{SegmentId{2, 2}, SegmentId{3, 7}}}}, test_block, - refinement, + ElementId<2>{0, {{SegmentId{2, 2}, SegmentId{3, 7}}}}, blocks, refinement, {{Direction<2>::upper_xi(), Neighbors<2>{{ElementId<2>{0, {{SegmentId{2, 3}, SegmentId{3, 7}}}}}, aligned}}, @@ -470,8 +468,7 @@ SPECTRE_TEST_CASE("Unit.Domain.CreateInitialElement", "[Domain][Unit]") { // element bounding both neighbor blocks test_create_initial_element( - ElementId<2>{0, {{SegmentId{2, 3}, SegmentId{3, 7}}}}, test_block, - refinement, + ElementId<2>{0, {{SegmentId{2, 3}, SegmentId{3, 7}}}}, blocks, refinement, {{Direction<2>::upper_xi(), Neighbors<2>{{ElementId<2>{1, {{SegmentId{2, 0}, SegmentId{3, 7}}}}}, aligned}}, @@ -490,7 +487,7 @@ SPECTRE_TEST_CASE("Unit.Domain.CreateInitialElement", "[Domain][Unit]") { const size_t grid_index = 3; test_create_initial_element( ElementId<2>{0, {{SegmentId{2, 2}, SegmentId{3, 4}}}, grid_index}, - test_block, refinement, + blocks, refinement, {{Direction<2>::upper_xi(), Neighbors<2>{ {ElementId<2>{ diff --git a/tests/Unit/Elliptic/SubdomainPreconditioners/Test_MinusLaplacian.cpp b/tests/Unit/Elliptic/SubdomainPreconditioners/Test_MinusLaplacian.cpp index ad5267684801..c1a1d44b2536 100644 --- a/tests/Unit/Elliptic/SubdomainPreconditioners/Test_MinusLaplacian.cpp +++ b/tests/Unit/Elliptic/SubdomainPreconditioners/Test_MinusLaplacian.cpp @@ -238,11 +238,11 @@ auto make_databox_with_boundary_conditions() { const ElementId right_element_id{0, {{{2, 1}, {0, 0}}}}; const ElementId bottom_element_id{1, {{{1, 0}, {1, 1}}}}; Element central_element = domain::Initialization::create_initial_element( - central_element_id, domain.blocks()[0], refinement); + central_element_id, domain.blocks(), refinement); Element right_element = domain::Initialization::create_initial_element( - right_element_id, domain.blocks()[0], refinement); + right_element_id, domain.blocks(), refinement); Element bottom_element = domain::Initialization::create_initial_element( - bottom_element_id, domain.blocks()[1], refinement); + bottom_element_id, domain.blocks(), refinement); // Subdomain LinearSolver::Schwarz::OverlapMap> overlap_elements{ {{Direction::upper_xi(), right_element_id}, @@ -270,9 +270,9 @@ auto make_databox_without_boundary_conditions() { const ElementId central_element_id{0, {{{2, 1}, {2, 1}}}}; const ElementId right_element_id{0, {{{2, 2}, {2, 1}}}}; Element central_element = domain::Initialization::create_initial_element( - central_element_id, domain.blocks()[0], refinement); + central_element_id, domain.blocks(), refinement); Element right_element = domain::Initialization::create_initial_element( - right_element_id, domain.blocks()[0], refinement); + right_element_id, domain.blocks(), refinement); LinearSolver::Schwarz::OverlapMap> overlap_elements{ {{Direction::upper_xi(), right_element_id}, std::move(right_element)}}; diff --git a/tests/Unit/Elliptic/Systems/Xcts/Events/Test_ObserveAdmIntegrals.cpp b/tests/Unit/Elliptic/Systems/Xcts/Events/Test_ObserveAdmIntegrals.cpp index 14a0080df979..8ee1fb0e53d4 100644 --- a/tests/Unit/Elliptic/Systems/Xcts/Events/Test_ObserveAdmIntegrals.cpp +++ b/tests/Unit/Elliptic/Systems/Xcts/Events/Test_ObserveAdmIntegrals.cpp @@ -105,7 +105,7 @@ void test_local_adm_integrals(const double& distance, // Get element information. const auto& current_block = blocks.at(element_id.block_id()); const auto current_element = domain::Initialization::create_initial_element( - element_id, current_block, initial_ref_levels); + element_id, blocks, initial_ref_levels); const ElementMap<3, Frame::Inertial> logical_to_inertial_map( element_id, current_block.stationary_map().get_clone()); diff --git a/tests/Unit/Evolution/DgSubcell/Test_BackgroundGrVars.cpp b/tests/Unit/Evolution/DgSubcell/Test_BackgroundGrVars.cpp index 85c1bc98f669..2eec7e9dcd67 100644 --- a/tests/Unit/Evolution/DgSubcell/Test_BackgroundGrVars.cpp +++ b/tests/Unit/Evolution/DgSubcell/Test_BackgroundGrVars.cpp @@ -166,7 +166,7 @@ void test(const gsl::not_null gen, const bool did_rollback) { const auto domain = brick.create_domain(); const auto element_id = ElementId<3>{0}; Element<3> element = domain::Initialization::create_initial_element( - element_id, domain.blocks().at(0), + element_id, domain.blocks(), std::vector>{{0, 0, 0}}); const Mesh<3> dg_mesh{num_dg_pts, Spectral::Basis::Legendre, diff --git a/tests/Unit/Evolution/DiscontinuousGalerkin/Test_BackgroundGrVars.cpp b/tests/Unit/Evolution/DiscontinuousGalerkin/Test_BackgroundGrVars.cpp index afb3193a00cc..eb79092742ad 100644 --- a/tests/Unit/Evolution/DiscontinuousGalerkin/Test_BackgroundGrVars.cpp +++ b/tests/Unit/Evolution/DiscontinuousGalerkin/Test_BackgroundGrVars.cpp @@ -131,7 +131,7 @@ void test(const gsl::not_null gen) { const auto domain = brick.create_domain(); const auto element_id = ElementId<3>{0}; Element<3> element = domain::Initialization::create_initial_element( - element_id, domain.blocks().at(0), + element_id, domain.blocks(), std::vector>{{0, 0, 0}}); const Mesh<3> mesh{num_dg_pts, Spectral::Basis::Legendre, diff --git a/tests/Unit/Evolution/Systems/Burgers/FiniteDifference/Test_BoundaryConditionGhostData.cpp b/tests/Unit/Evolution/Systems/Burgers/FiniteDifference/Test_BoundaryConditionGhostData.cpp index 3fff46dab117..07f053e6985c 100644 --- a/tests/Unit/Evolution/Systems/Burgers/FiniteDifference/Test_BoundaryConditionGhostData.cpp +++ b/tests/Unit/Evolution/Systems/Burgers/FiniteDifference/Test_BoundaryConditionGhostData.cpp @@ -94,7 +94,7 @@ void test(const BoundaryConditionType& boundary_condition) { auto domain = interval.create_domain(); auto boundary_conditions = interval.external_boundary_conditions(); const auto element = domain::Initialization::create_initial_element( - ElementId<1>{0, {SegmentId{0, 0}}}, domain.blocks().at(0), + ElementId<1>{0, {SegmentId{0, 0}}}, domain.blocks(), std::vector>{{refinement_level_x}}); // Mesh and coordinates diff --git a/tests/Unit/Evolution/Systems/CurvedScalarWave/Worldtube/ElementActions/Test_Iterations.cpp b/tests/Unit/Evolution/Systems/CurvedScalarWave/Worldtube/ElementActions/Test_Iterations.cpp index f8fd8b8c2fc4..19dc1f098c8d 100644 --- a/tests/Unit/Evolution/Systems/CurvedScalarWave/Worldtube/ElementActions/Test_Iterations.cpp +++ b/tests/Unit/Evolution/Systems/CurvedScalarWave/Worldtube/ElementActions/Test_Iterations.cpp @@ -213,7 +213,7 @@ void test_iterations(const size_t max_iterations) { for (const auto& element_id : element_ids) { const auto& my_block = blocks.at(element_id.block_id()); auto element = domain::Initialization::create_initial_element( - element_id, my_block, initial_refinements); + element_id, blocks, initial_refinements); auto mesh = domain::Initialization::create_initial_mesh( initial_extents, element_id, quadrature); const ElementMap element_map(element_id, diff --git a/tests/Unit/Evolution/Systems/CurvedScalarWave/Worldtube/ElementActions/Test_ReceiveWorldtubeData.cpp b/tests/Unit/Evolution/Systems/CurvedScalarWave/Worldtube/ElementActions/Test_ReceiveWorldtubeData.cpp index 0597c325fc7a..b569bdaf474e 100644 --- a/tests/Unit/Evolution/Systems/CurvedScalarWave/Worldtube/ElementActions/Test_ReceiveWorldtubeData.cpp +++ b/tests/Unit/Evolution/Systems/CurvedScalarWave/Worldtube/ElementActions/Test_ReceiveWorldtubeData.cpp @@ -174,7 +174,7 @@ SPECTRE_TEST_CASE("Unit.CurvedScalarWave.Worldtube.ReceiveWorldtubeData", const size_t grid_size = mesh.number_of_grid_points(); const auto& my_block = blocks.at(element_id.block_id()); auto element = domain::Initialization::create_initial_element( - element_id, my_block, initial_refinements); + element_id, blocks, initial_refinements); // we set lapse and shift to Minkowski so dt Psi = - Pi Scalar lapse(grid_size, 1.); diff --git a/tests/Unit/Evolution/Systems/CurvedScalarWave/Worldtube/ElementActions/Test_SendToWorldtube.cpp b/tests/Unit/Evolution/Systems/CurvedScalarWave/Worldtube/ElementActions/Test_SendToWorldtube.cpp index 01ec01ab6840..8617c423a0b5 100644 --- a/tests/Unit/Evolution/Systems/CurvedScalarWave/Worldtube/ElementActions/Test_SendToWorldtube.cpp +++ b/tests/Unit/Evolution/Systems/CurvedScalarWave/Worldtube/ElementActions/Test_SendToWorldtube.cpp @@ -216,7 +216,7 @@ SPECTRE_TEST_CASE("Unit.CurvedScalarWave.Worldtube.SendToWorldtube", "[Unit]") { for (const auto& element_id : element_ids) { const auto& my_block = blocks.at(element_id.block_id()); auto element = domain::Initialization::create_initial_element( - element_id, my_block, initial_refinements); + element_id, blocks, initial_refinements); auto mesh = domain::Initialization::create_initial_mesh( initial_extents, element_id, quadrature); const ElementMap element_map(element_id, diff --git a/tests/Unit/Evolution/Systems/CurvedScalarWave/Worldtube/Test_Tags.cpp b/tests/Unit/Evolution/Systems/CurvedScalarWave/Worldtube/Test_Tags.cpp index 09562b82a3ee..c169cac7fea6 100644 --- a/tests/Unit/Evolution/Systems/CurvedScalarWave/Worldtube/Test_Tags.cpp +++ b/tests/Unit/Evolution/Systems/CurvedScalarWave/Worldtube/Test_Tags.cpp @@ -137,7 +137,7 @@ void test_compute_face_coordinates_grid() { for (const auto& element_id : element_ids) { const auto& my_block = blocks.at(element_id.block_id()); const auto element = domain::Initialization::create_initial_element( - element_id, my_block, initial_refinements); + element_id, blocks, initial_refinements); const ElementMap element_map( element_id, my_block.stationary_map().get_to_grid_frame()); const auto mesh_1 = domain::Initialization::create_initial_mesh( @@ -210,7 +210,7 @@ void test_compute_face_coordinates() { for (const auto& element_id : element_ids) { const auto& my_block = blocks.at(element_id.block_id()); const auto element = domain::Initialization::create_initial_element( - element_id, my_block, initial_refinements); + element_id, blocks, initial_refinements); const auto mesh = domain::Initialization::create_initial_mesh( initial_extents, element_id, quadrature); const ElementMap element_map( @@ -544,7 +544,7 @@ void test_face_quantities_compute() { for (const auto& element_id : element_ids) { const auto& my_block = blocks.at(element_id.block_id()); const auto element = domain::Initialization::create_initial_element( - element_id, my_block, initial_refinements); + element_id, blocks, initial_refinements); const auto mesh = domain::Initialization::create_initial_mesh( initial_extents, element_id, quadrature); const ElementMap element_map(element_id, diff --git a/tests/Unit/Evolution/Systems/GrMhd/GhValenciaDivClean/FiniteDifference/Test_BoundaryConditionGhostData.cpp b/tests/Unit/Evolution/Systems/GrMhd/GhValenciaDivClean/FiniteDifference/Test_BoundaryConditionGhostData.cpp index 7eb1896a018f..129f52055e5c 100644 --- a/tests/Unit/Evolution/Systems/GrMhd/GhValenciaDivClean/FiniteDifference/Test_BoundaryConditionGhostData.cpp +++ b/tests/Unit/Evolution/Systems/GrMhd/GhValenciaDivClean/FiniteDifference/Test_BoundaryConditionGhostData.cpp @@ -105,8 +105,7 @@ void test(const BoundaryConditionType& boundary_condition, auto boundary_conditions = brick.external_boundary_conditions(); const auto element = domain::Initialization::create_initial_element( ElementId<3>{0, {SegmentId{0, 0}, SegmentId{0, 0}, SegmentId{0, 0}}}, - domain.blocks().at(0), - std::vector>{{refinement_levels}}); + domain.blocks(), std::vector>{{refinement_levels}}); // Mesh and coordinates const Mesh<3> dg_mesh{num_dg_pts, Spectral::Basis::Legendre, diff --git a/tests/Unit/Evolution/Systems/GrMhd/GhValenciaDivClean/Subcell/Test_NeighborPackagedData.cpp b/tests/Unit/Evolution/Systems/GrMhd/GhValenciaDivClean/Subcell/Test_NeighborPackagedData.cpp index 99d623519db5..a1c3e264e705 100644 --- a/tests/Unit/Evolution/Systems/GrMhd/GhValenciaDivClean/Subcell/Test_NeighborPackagedData.cpp +++ b/tests/Unit/Evolution/Systems/GrMhd/GhValenciaDivClean/Subcell/Test_NeighborPackagedData.cpp @@ -94,17 +94,19 @@ double test(const size_t num_dg_pts) { std::unordered_map> functions_of_time{}; - Block<3> block{ - domain::make_coordinate_map_base( - Affine3D{affine_map, affine_map, affine_map}), - 0, - {}}; + std::vector> blocks{}; + blocks.push_back( + {domain::make_coordinate_map_base( + Affine3D{affine_map, affine_map, affine_map}), + 0, + {}}); + const auto& block = blocks[0]; ElementMap<3, Frame::Grid> element_map{ element_id, block.is_time_dependent() ? block.moving_mesh_logical_to_grid_map().get_clone() : block.stationary_map().get_to_grid_frame()}; const auto element = domain::Initialization::create_initial_element( - element_id, block, + element_id, blocks, std::vector>{std::array{{3, 3, 3}}}); const auto moving_mesh_map = diff --git a/tests/Unit/Evolution/Systems/GrMhd/GhValenciaDivClean/Subcell/Test_TimeDerivative.cpp b/tests/Unit/Evolution/Systems/GrMhd/GhValenciaDivClean/Subcell/Test_TimeDerivative.cpp index 101cad26f9b4..acf4166f0831 100644 --- a/tests/Unit/Evolution/Systems/GrMhd/GhValenciaDivClean/Subcell/Test_TimeDerivative.cpp +++ b/tests/Unit/Evolution/Systems/GrMhd/GhValenciaDivClean/Subcell/Test_TimeDerivative.cpp @@ -131,16 +131,17 @@ double test(const size_t num_dg_pts, std::optional expansion_velocity, ::RelativisticEuler::Solutions::TovStar>>(soln)) .get_clone(); } - Block<3> block{test_non_diagonal_jacobian - ? domain::make_coordinate_map_base( - ::domain::CoordinateMaps::Rotation<3>(0.7, 0, 0.)) - : domain::make_coordinate_map_base( - Affine3D{affine_map, affine_map, affine_map}), - 0, - {}}; - + std::vector> blocks{}; + blocks.push_back({test_non_diagonal_jacobian + ? domain::make_coordinate_map_base( + ::domain::CoordinateMaps::Rotation<3>(0.7, 0, 0.)) + : domain::make_coordinate_map_base( + Affine3D{affine_map, affine_map, affine_map}), + 0, + {}}); + const auto& block = blocks[0]; std::unordered_map> functions_of_time{}; @@ -153,7 +154,7 @@ double test(const size_t num_dg_pts, std::optional expansion_velocity, ::domain::make_coordinate_map_base( ::domain::CoordinateMaps::Identity<3>{}); const auto element = domain::Initialization::create_initial_element( - element_id, block, + element_id, blocks, std::vector>{std::array{{3, 3, 3}}}); const double time = 0.0; diff --git a/tests/Unit/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/Test_BoundaryConditionGhostData.cpp b/tests/Unit/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/Test_BoundaryConditionGhostData.cpp index 149c4914ab65..921cd3808f1a 100644 --- a/tests/Unit/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/Test_BoundaryConditionGhostData.cpp +++ b/tests/Unit/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/Test_BoundaryConditionGhostData.cpp @@ -105,8 +105,7 @@ void test(const BoundaryConditionType& boundary_condition, auto boundary_conditions = brick.external_boundary_conditions(); const auto element = domain::Initialization::create_initial_element( ElementId<3>{0, {SegmentId{0, 0}, SegmentId{0, 0}, SegmentId{0, 0}}}, - domain.blocks().at(0), - std::vector>{{refinement_levels}}); + domain.blocks(), std::vector>{{refinement_levels}}); // Mesh and coordinates const Mesh<3> dg_mesh{num_dg_pts, Spectral::Basis::Legendre, diff --git a/tests/Unit/Evolution/Systems/GrMhd/ValenciaDivClean/Subcell/Test_NeighborPackagedData.cpp b/tests/Unit/Evolution/Systems/GrMhd/ValenciaDivClean/Subcell/Test_NeighborPackagedData.cpp index 7519a9c9707a..e084633897cb 100644 --- a/tests/Unit/Evolution/Systems/GrMhd/ValenciaDivClean/Subcell/Test_NeighborPackagedData.cpp +++ b/tests/Unit/Evolution/Systems/GrMhd/ValenciaDivClean/Subcell/Test_NeighborPackagedData.cpp @@ -104,17 +104,19 @@ double test(const size_t num_dg_pts) { std::unordered_map> functions_of_time{}; - Block<3> block{ - domain::make_coordinate_map_base( - Affine3D{affine_map, affine_map, affine_map}), - 0, - {}}; + std::vector> blocks{}; + blocks.push_back( + {domain::make_coordinate_map_base( + Affine3D{affine_map, affine_map, affine_map}), + 0, + {}}); + const auto& block = blocks[0]; ElementMap<3, Frame::Grid> element_map{ element_id, block.is_time_dependent() ? block.moving_mesh_logical_to_grid_map().get_clone() : block.stationary_map().get_to_grid_frame()}; const auto element = domain::Initialization::create_initial_element( - element_id, block, + element_id, blocks, std::vector>{std::array{{3, 3, 3}}}); const auto moving_mesh_map = diff --git a/tests/Unit/Evolution/Systems/GrMhd/ValenciaDivClean/Subcell/Test_TimeDerivative.cpp b/tests/Unit/Evolution/Systems/GrMhd/ValenciaDivClean/Subcell/Test_TimeDerivative.cpp index 5af78cbb1742..1b4fb7b53ff8 100644 --- a/tests/Unit/Evolution/Systems/GrMhd/ValenciaDivClean/Subcell/Test_TimeDerivative.cpp +++ b/tests/Unit/Evolution/Systems/GrMhd/ValenciaDivClean/Subcell/Test_TimeDerivative.cpp @@ -141,11 +141,12 @@ std::array test(const size_t num_dg_pts, const Affine affine_map{-1.0, 1.0, 1.0, 15.0}; const auto element = domain::Initialization::create_initial_element( ElementId<3>{0, {SegmentId{2, 2}, SegmentId{2, 2}, SegmentId{2, 2}}}, - Block<3>{domain::make_coordinate_map_base( - Affine3D{affine_map, affine_map, affine_map}), - 0, - {}}, + std::vector>{ + {domain::make_coordinate_map_base( + Affine3D{affine_map, affine_map, affine_map}), + 0, + {}}}, std::vector>{std::array{{3, 3, 3}}}); const ElementMap<3, Frame::Grid> element_map{ element.id(), diff --git a/tests/Unit/Evolution/Systems/NewtonianEuler/Subcell/Test_NeighborPackagedData.cpp b/tests/Unit/Evolution/Systems/NewtonianEuler/Subcell/Test_NeighborPackagedData.cpp index 67056983b064..3f0ea9c65c94 100644 --- a/tests/Unit/Evolution/Systems/NewtonianEuler/Subcell/Test_NeighborPackagedData.cpp +++ b/tests/Unit/Evolution/Systems/NewtonianEuler/Subcell/Test_NeighborPackagedData.cpp @@ -104,10 +104,11 @@ auto make_element<1>() { Affine affine_map{-1.0, 1.0, 2.0, 3.0}; return domain::Initialization::create_initial_element( ElementId<1>{0, {SegmentId{3, 4}}}, - Block<1>{domain::make_coordinate_map_base(affine_map), - 0, - {}}, + std::vector>{ + {domain::make_coordinate_map_base(affine_map), + 0, + {}}}, std::vector>{std::array{{3}}}); } @@ -116,11 +117,12 @@ auto make_element<2>() { Affine affine_map{-1.0, 1.0, 2.0, 3.0}; return domain::Initialization::create_initial_element( ElementId<2>{0, {SegmentId{3, 4}, SegmentId{3, 4}}}, - Block<2>{domain::make_coordinate_map_base( - Affine2D{affine_map, affine_map}), - 0, - {}}, + std::vector>{ + {domain::make_coordinate_map_base( + Affine2D{affine_map, affine_map}), + 0, + {}}}, std::vector>{std::array{{3, 3}}}); } @@ -129,11 +131,12 @@ auto make_element<3>() { Affine affine_map{-1.0, 1.0, 2.0, 3.0}; return domain::Initialization::create_initial_element( ElementId<3>{0, {SegmentId{3, 4}, SegmentId{3, 4}, SegmentId{3, 4}}}, - Block<3>{domain::make_coordinate_map_base( - Affine3D{affine_map, affine_map, affine_map}), - 0, - {}}, + std::vector>{ + {domain::make_coordinate_map_base( + Affine3D{affine_map, affine_map, affine_map}), + 0, + {}}}, std::vector>{std::array{{3, 3, 3}}}); } diff --git a/tests/Unit/Evolution/Systems/NewtonianEuler/Subcell/Test_TimeDerivative.cpp b/tests/Unit/Evolution/Systems/NewtonianEuler/Subcell/Test_TimeDerivative.cpp index 165cc10f9745..0e2158fcdc0c 100644 --- a/tests/Unit/Evolution/Systems/NewtonianEuler/Subcell/Test_TimeDerivative.cpp +++ b/tests/Unit/Evolution/Systems/NewtonianEuler/Subcell/Test_TimeDerivative.cpp @@ -97,10 +97,11 @@ auto make_element<1>() { Affine affine_map{-1.0, 1.0, 2.0, 3.0}; return domain::Initialization::create_initial_element( ElementId<1>{0, {SegmentId{2, 2}}}, - Block<1>{domain::make_coordinate_map_base(affine_map), - 0, - {}}, + std::vector>{ + {domain::make_coordinate_map_base(affine_map), + 0, + {}}}, std::vector>{std::array{{3}}}); } @@ -109,11 +110,12 @@ auto make_element<2>() { Affine affine_map{-1.0, 1.0, 2.0, 3.0}; return domain::Initialization::create_initial_element( ElementId<2>{0, {SegmentId{2, 2}, SegmentId{2, 2}}}, - Block<2>{domain::make_coordinate_map_base( - Affine2D{affine_map, affine_map}), - 0, - {}}, + std::vector>{ + {domain::make_coordinate_map_base( + Affine2D{affine_map, affine_map}), + 0, + {}}}, std::vector>{std::array{{3, 3}}}); } @@ -122,11 +124,12 @@ auto make_element<3>() { Affine affine_map{-1.0, 1.0, 2.0, 3.0}; return domain::Initialization::create_initial_element( ElementId<3>{0, {SegmentId{2, 2}, SegmentId{2, 2}, SegmentId{2, 2}}}, - Block<3>{domain::make_coordinate_map_base( - Affine3D{affine_map, affine_map, affine_map}), - 0, - {}}, + std::vector>{ + {domain::make_coordinate_map_base( + Affine3D{affine_map, affine_map, affine_map}), + 0, + {}}}, std::vector>{std::array{{3, 3, 3}}}); } diff --git a/tests/Unit/Helpers/Domain/DomainTestHelpers.cpp b/tests/Unit/Helpers/Domain/DomainTestHelpers.cpp index d012f93ec2aa..5e8047b3fb63 100644 --- a/tests/Unit/Helpers/Domain/DomainTestHelpers.cpp +++ b/tests/Unit/Helpers/Domain/DomainTestHelpers.cpp @@ -580,8 +580,7 @@ void test_initial_domain(const Domain& domain, for (const auto& element_id : element_ids) { elements.emplace(element_id, domain::Initialization::create_initial_element( - element_id, blocks[element_id.block_id()], - initial_refinement_levels)); + element_id, blocks, initial_refinement_levels)); } domain::test_domain_connectivity(domain, elements); domain::test_refinement_levels_of_neighbors<1>(elements); diff --git a/tests/Unit/Helpers/ParallelAlgorithms/LinearSolver/DistributedLinearSolverAlgorithmTestHelpers.hpp b/tests/Unit/Helpers/ParallelAlgorithms/LinearSolver/DistributedLinearSolverAlgorithmTestHelpers.hpp index 89032de8d438..81ceca2b93ab 100644 --- a/tests/Unit/Helpers/ParallelAlgorithms/LinearSolver/DistributedLinearSolverAlgorithmTestHelpers.hpp +++ b/tests/Unit/Helpers/ParallelAlgorithms/LinearSolver/DistributedLinearSolverAlgorithmTestHelpers.hpp @@ -288,9 +288,8 @@ struct InitializeElement { auto mesh = domain::Initialization::create_initial_mesh( initial_extents, element_id, Parallel::get(cache)); - const auto& block = domain.blocks()[element_id.block_id()]; auto element = domain::Initialization::create_initial_element( - element_id, block, initial_refinement); + element_id, domain.blocks(), initial_refinement); auto logical_coords = logical_coordinates(mesh); // Element data const size_t element_index = get_index(element_id); diff --git a/tests/Unit/PointwiseFunctions/Xcts/Test_AdmLinearMomentum.cpp b/tests/Unit/PointwiseFunctions/Xcts/Test_AdmLinearMomentum.cpp index 0f455943c6cf..f5d87f908410 100644 --- a/tests/Unit/PointwiseFunctions/Xcts/Test_AdmLinearMomentum.cpp +++ b/tests/Unit/PointwiseFunctions/Xcts/Test_AdmLinearMomentum.cpp @@ -72,7 +72,7 @@ void test_infinite_surface_integral(const double distance, const double mass, // Get element information const auto& current_block = blocks.at(element_id.block_id()); const auto current_element = domain::Initialization::create_initial_element( - element_id, current_block, initial_ref_levels); + element_id, blocks, initial_ref_levels); const ElementMap<3, Frame::Inertial> logical_to_inertial_map( element_id, current_block.stationary_map().get_clone()); @@ -186,7 +186,7 @@ void test_infinite_volume_integral(const double distance, const double mass, // Get element information const auto& current_block = blocks.at(element_id.block_id()); const auto current_element = domain::Initialization::create_initial_element( - element_id, current_block, initial_ref_levels); + element_id, blocks, initial_ref_levels); const ElementMap<3, Frame::Inertial> logical_to_inertial_map( element_id, current_block.stationary_map().get_clone()); diff --git a/tests/Unit/PointwiseFunctions/Xcts/Test_AdmMass.cpp b/tests/Unit/PointwiseFunctions/Xcts/Test_AdmMass.cpp index a7655108991f..6eac573d3b36 100644 --- a/tests/Unit/PointwiseFunctions/Xcts/Test_AdmMass.cpp +++ b/tests/Unit/PointwiseFunctions/Xcts/Test_AdmMass.cpp @@ -69,7 +69,7 @@ void test_infinite_surface_integral(const double distance, const double mass, // Get element information const auto& current_block = blocks.at(element_id.block_id()); const auto current_element = domain::Initialization::create_initial_element( - element_id, current_block, initial_ref_levels); + element_id, blocks, initial_ref_levels); const ElementMap<3, Frame::Inertial> logical_to_inertial_map( element_id, current_block.stationary_map().get_clone()); @@ -189,7 +189,7 @@ void test_infinite_volume_integral(const double distance, const double mass, // Get element information const auto& current_block = blocks.at(element_id.block_id()); const auto current_element = domain::Initialization::create_initial_element( - element_id, current_block, initial_ref_levels); + element_id, blocks, initial_ref_levels); const ElementMap<3, Frame::Inertial> logical_to_inertial_map( element_id, current_block.stationary_map().get_clone()); diff --git a/tests/Unit/PointwiseFunctions/Xcts/Test_CenterOfMass.cpp b/tests/Unit/PointwiseFunctions/Xcts/Test_CenterOfMass.cpp index c00f3ae7b461..32c34e091164 100644 --- a/tests/Unit/PointwiseFunctions/Xcts/Test_CenterOfMass.cpp +++ b/tests/Unit/PointwiseFunctions/Xcts/Test_CenterOfMass.cpp @@ -81,7 +81,7 @@ void test_infinite_surface_integral(const double distance, // Get element information const auto& current_block = blocks.at(element_id.block_id()); const auto current_element = domain::Initialization::create_initial_element( - element_id, current_block, initial_ref_levels); + element_id, blocks, initial_ref_levels); const ElementMap<3, Frame::Inertial> logical_to_inertial_map( element_id, current_block.stationary_map().get_clone()); @@ -169,7 +169,7 @@ void test_infinite_volume_integral(const double distance, // Get element information const auto& current_block = blocks.at(element_id.block_id()); const auto current_element = domain::Initialization::create_initial_element( - element_id, current_block, initial_ref_levels); + element_id, blocks, initial_ref_levels); const ElementMap<3, Frame::Inertial> logical_to_inertial_map( element_id, current_block.stationary_map().get_clone());