Skip to content

Commit e730fd3

Browse files
committed
Add config check to redistribution
1 parent 62c375f commit e730fd3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/atlas/redistribution/Redistribution.cc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,15 @@ Redistribution::Redistribution(): Handle(){};
2020
Redistribution::Redistribution(const FunctionSpace& sourceFunctionSpace, const FunctionSpace& targetFunctionSpace,
2121
const util::Config& config):
2222
Handle([&]() -> redistribution::detail::RedistributionImpl* {
23-
ATLAS_ASSERT(sourceFunctionSpace.type() == targetFunctionSpace.type());
23+
// If no heterogeneous_redistribution config is set, or if it is not set to "true", assert that
24+
// the source and target function spaces are the same type (default)
25+
std::string isHeteroRedistString = "false";
26+
config.get("heterogeneous_redistribution", isHeteroRedistString);
27+
bool isHeteroRedist = (isHeteroRedistString == "true");
28+
29+
if (!isHeteroRedist) {
30+
ATLAS_ASSERT(sourceFunctionSpace.type() == targetFunctionSpace.type());
31+
};
2432

2533
std::string type = redistribution::detail::RedistributeGeneric::static_type();
2634
config.get("type", type);

0 commit comments

Comments
 (0)