Skip to content

Commit 389f655

Browse files
committed
fixup
1 parent 80d5253 commit 389f655

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

src/Domain/Creators/TimeDependentOptions/BinaryCompactObject.cpp

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -488,13 +488,20 @@ TimeDependentMapOptions<IsCylindrical>::distorted_to_inertial_map(
488488
: RotScaleTrans{};
489489

490490
if (block_has_shape_map) {
491-
if (rot_scale_trans_map_.has_value() and
492-
(use_rigid_map and skew_map_.has_value())) {
491+
// The skew map is only applied within the envelope, which is also where we
492+
// apply the rigid RotScaleTrans map, so `use_rigid_map` is a sentinel
493+
// for where we put the skew map (if we have one).
494+
if (not use_rigid_map) {
495+
ERROR(
496+
"'use_rigid_map' must be true when requesting the distorted to "
497+
"inertial map with a shape map.");
498+
}
499+
if (rot_scale_trans_map_.has_value() and skew_map_.has_value()) {
493500
return std::make_unique<detail::di_map<Skew, RotScaleTrans>>(
494501
skew_map_.value(), rot_scale_trans);
495502
} else if (rot_scale_trans_map_.has_value()) {
496503
return std::make_unique<detail::di_map<RotScaleTrans>>(rot_scale_trans);
497-
} else if (use_rigid_map and skew_map_.has_value()) {
504+
} else if (skew_map_.has_value()) {
498505
return std::make_unique<detail::di_map<Skew>>(skew_map_.value());
499506
} else {
500507
return std::make_unique<detail::di_map<Identity>>(Identity{});
@@ -601,20 +608,30 @@ TimeDependentMapOptions<IsCylindrical>::grid_to_inertial_map(
601608
&gsl::at(gsl::at(shape_maps_, index), include_distorted_map.value());
602609
}
603610
ASSERT(shape->has_value(), "Shape map was requested but not built.");
604-
if (rot_scale_trans_map_.has_value() and
605-
(use_rigid_map and skew_map_.has_value())) {
611+
// The skew map is only applied within the envelope, which is also where we
612+
// apply the rigid RotScaleTrans map, so `use_rigid_map` is a sentinel
613+
// for where we put the skew map (if we have one).
614+
if (not use_rigid_map) {
615+
ERROR(
616+
"'use_rigid_map' must be true when requesting the grid to inertial "
617+
"map with a shape map.");
618+
}
619+
if (rot_scale_trans_map_.has_value() and skew_map_.has_value()) {
606620
return std::make_unique<detail::gi_map<Shape, Skew, RotScaleTrans>>(
607621
shape->value(), skew_map_.value(), rot_scale_trans);
608622
} else if (rot_scale_trans_map_.has_value()) {
609623
return std::make_unique<detail::gi_map<Shape, RotScaleTrans>>(
610624
shape->value(), rot_scale_trans);
611-
} else if (use_rigid_map and skew_map_.has_value()) {
625+
} else if (skew_map_.has_value()) {
612626
return std::make_unique<detail::gi_map<Shape, Skew>>(shape->value(),
613627
skew_map_.value());
614628
} else {
615629
return std::make_unique<detail::gi_map<Shape>>(shape->value());
616630
}
617631
} else {
632+
// The skew map is only applied within the envelope, which is also where we
633+
// apply the rigid RotScaleTrans map, so use `use_rigid_map` as a sentinel
634+
// for where we put the skew map (if we have one).
618635
if (rot_scale_trans_map_.has_value() and
619636
(use_rigid_map and skew_map_.has_value())) {
620637
return std::make_unique<detail::gi_map<Skew, RotScaleTrans>>(

0 commit comments

Comments
 (0)