Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
knelli2 committed Feb 7, 2025
1 parent 80d5253 commit 389f655
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions src/Domain/Creators/TimeDependentOptions/BinaryCompactObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,13 +488,20 @@ TimeDependentMapOptions<IsCylindrical>::distorted_to_inertial_map(
: RotScaleTrans{};

if (block_has_shape_map) {
if (rot_scale_trans_map_.has_value() and
(use_rigid_map and skew_map_.has_value())) {
// The skew map is only applied within the envelope, which is also where we
// apply the rigid RotScaleTrans map, so `use_rigid_map` is a sentinel
// for where we put the skew map (if we have one).
if (not use_rigid_map) {
ERROR(
"'use_rigid_map' must be true when requesting the distorted to "
"inertial map with a shape map.");
}
if (rot_scale_trans_map_.has_value() and skew_map_.has_value()) {
return std::make_unique<detail::di_map<Skew, RotScaleTrans>>(
skew_map_.value(), rot_scale_trans);
} else if (rot_scale_trans_map_.has_value()) {
return std::make_unique<detail::di_map<RotScaleTrans>>(rot_scale_trans);
} else if (use_rigid_map and skew_map_.has_value()) {
} else if (skew_map_.has_value()) {
return std::make_unique<detail::di_map<Skew>>(skew_map_.value());
} else {
return std::make_unique<detail::di_map<Identity>>(Identity{});
Expand Down Expand Up @@ -601,20 +608,30 @@ TimeDependentMapOptions<IsCylindrical>::grid_to_inertial_map(
&gsl::at(gsl::at(shape_maps_, index), include_distorted_map.value());
}
ASSERT(shape->has_value(), "Shape map was requested but not built.");
if (rot_scale_trans_map_.has_value() and
(use_rigid_map and skew_map_.has_value())) {
// The skew map is only applied within the envelope, which is also where we
// apply the rigid RotScaleTrans map, so `use_rigid_map` is a sentinel
// for where we put the skew map (if we have one).
if (not use_rigid_map) {
ERROR(
"'use_rigid_map' must be true when requesting the grid to inertial "
"map with a shape map.");
}
if (rot_scale_trans_map_.has_value() and skew_map_.has_value()) {
return std::make_unique<detail::gi_map<Shape, Skew, RotScaleTrans>>(
shape->value(), skew_map_.value(), rot_scale_trans);
} else if (rot_scale_trans_map_.has_value()) {
return std::make_unique<detail::gi_map<Shape, RotScaleTrans>>(
shape->value(), rot_scale_trans);
} else if (use_rigid_map and skew_map_.has_value()) {
} else if (skew_map_.has_value()) {
return std::make_unique<detail::gi_map<Shape, Skew>>(shape->value(),
skew_map_.value());
} else {
return std::make_unique<detail::gi_map<Shape>>(shape->value());
}
} else {
// The skew map is only applied within the envelope, which is also where we
// apply the rigid RotScaleTrans map, so use `use_rigid_map` as a sentinel
// for where we put the skew map (if we have one).
if (rot_scale_trans_map_.has_value() and
(use_rigid_map and skew_map_.has_value())) {
return std::make_unique<detail::gi_map<Skew, RotScaleTrans>>(
Expand Down

0 comments on commit 389f655

Please sign in to comment.