Skip to content

Commit

Permalink
fixup: keep domain backwards compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
iago-mendes committed Aug 14, 2024
1 parent aa13c9f commit c445b25
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Domain/Creators/BinaryCompactObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,11 +357,11 @@ Domain<3> BinaryCompactObject::create_domain() const {
Maps maps{};

// ObjectA/B is on the right/left, respectively.
const Translation translation_A{
const Affine3D translation_A{
Affine{-1.0, 1.0, -1.0 + x_coord_a_, 1.0 + x_coord_a_},
Affine{-1.0, 1.0, -1.0 + y_offset_, 1.0 + y_offset_},
Affine{-1.0, 1.0, -1.0 + z_offset_, 1.0 + z_offset_}};
const Translation translation_B{
const Affine3D translation_B{
Affine{-1.0, 1.0, -1.0 + x_coord_b_, 1.0 + x_coord_b_},
Affine{-1.0, 1.0, -1.0 + y_offset_, 1.0 + y_offset_},
Affine{-1.0, 1.0, -1.0 + z_offset_, 1.0 + z_offset_}};
Expand Down
10 changes: 9 additions & 1 deletion src/Domain/Creators/BinaryCompactObject.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ class BinaryCompactObject : public DomainCreator<3> {
using Affine = CoordinateMaps::Affine;
using Affine3D = CoordinateMaps::ProductOf3Maps<Affine, Affine, Affine>;
using Identity2D = CoordinateMaps::Identity<2>;
using Translation = CoordinateMaps::ProductOf3Maps<Affine, Affine, Affine>;
// The Translation type is no longer needed, but it is kept here for backwards
// compatibility with old domains.
using Translation = CoordinateMaps::ProductOf2Maps<Affine, Identity2D>;
using Equiangular = CoordinateMaps::Equiangular;
using Equiangular3D =
CoordinateMaps::ProductOf3Maps<Equiangular, Equiangular, Equiangular>;
Expand All @@ -175,6 +177,12 @@ class BinaryCompactObject : public DomainCreator<3> {
CoordinateMaps::Wedge<3>>,
domain::CoordinateMap<Frame::BlockLogical, Frame::Inertial,
CoordinateMaps::Wedge<3>, Translation>,
domain::CoordinateMap<Frame::BlockLogical, Frame::Inertial, Affine3D,
Affine3D>,
domain::CoordinateMap<Frame::BlockLogical, Frame::Inertial, Equiangular3D,
Affine3D>,
domain::CoordinateMap<Frame::BlockLogical, Frame::Inertial,
CoordinateMaps::Wedge<3>, Affine3D>,
bco::TimeDependentMapOptions<false>::maps_list>>;

/// Options for an excision region in the domain
Expand Down
2 changes: 1 addition & 1 deletion src/PointwiseFunctions/AnalyticData/Xcts/Binary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ class Binary : public elliptic::analytic_data::Background,
inv_jacobian,
tmpl::list<RequestedTags...> /*meta*/) const {
std::array<tnsr::I<DataVector, 3>, 2> x_isolated{{x, x}};
std::array<std::array<double, 3>, 2> coords_isolated{
const std::array<std::array<double, 3>, 2> coords_isolated{
{{{xcoords_[0], y_offset_, z_offset_}},
{{xcoords_[1], y_offset_, z_offset_}}}};
std::array<DataVector, 2> euclidean_distance{};
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Domain/Test_Domain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1145,8 +1145,8 @@ Domain<3> create_serialized_domain() {

const double x_coord_a = object_A.x_coord;
const double x_coord_b = object_B.x_coord;
const double y_offset = 0.1;
const double z_offset = 0.2;
const double y_offset = 0.;
const double z_offset = 0.;
const double envelope_radius = 100.0;
const double outer_radius = 300.0;
const double inner_sphericity_A = 1.0;
Expand Down

0 comments on commit c445b25

Please sign in to comment.