Commit 5249d474 authored by Santiago Ospina De Los Ríos's avatar Santiago Ospina De Los Ríos 🇨🇴

Construct dummy adaptivity handler when adaptivity policy is not defined

Signed-off-by: Santiago Ospina De Los Ríos's avatarSantiago Ospina <santiago.ospina@iup.uni-heidelberg.de>
parent d3791e4d
......@@ -106,9 +106,10 @@ adding an empty line, make text **bold** or ``monospaced``.
<definition> Switches the target policy to do adaptive grid refinement
(h-adaptivity). If enabled, an unstructured grid manager with higher
computational cost is used when using rectangular / cubic grids.
Only one policy available at the moment.</definition>
</definition>
<values> none, waterFlux </values>
<suggestion> none </suggestion>
<comment> none, waterFlux </comment>
</parameter>
<parameter name="maxLevel">
......
......@@ -25,7 +25,7 @@ namespace Setup
richards_ini["grid.extensions"] = ini["grid.extensions"];
const std::string adapt_policy_str = ini.get<std::string>("adaptivity.policy");
// copy adaptivity keywords into richards category
if (adapt_policy_str == "waterFlux") {
richards_ini.sub("adaptivity") = ini.sub("adaptivity");
......@@ -34,7 +34,6 @@ namespace Setup
<< ini.get<std::string>("adaptivity.policy") << ")!");
}
richards_ini.report(std::cout);
return richards_ini;
}
};
......
......@@ -313,7 +313,11 @@ public:
std::enable_if_t<active,std::unique_ptr<AHB>> create ()
{
std::unique_ptr<AHB> p;
p = std::make_unique<AdaptivityHandler<Traits,GFS,Param,Boundary,U,order>>(inifile,grid);
if (inifile.hasSub("adaptivity") &&
inifile.get<std::string>("adaptivity.policy") != "none")
p = std::make_unique<AdaptivityHandler<Traits,GFS,Param,Boundary,U,order>>(inifile,grid);
else
p = std::make_unique<AHB>();
return p;
}
};
......
......@@ -79,7 +79,7 @@ int main (int argc, char** argv)
using TestSim = Dune::Dorie::ParameterizationTest<CubeAdaptive<2, 1>>;
Dune::Dorie::GridCreator<Dune::UGGrid<2>> grid_creator(inifile, helper);
auto grid_mapper = grid_creator.get_mapper();
TestSim sim(inifile, grid_mapper, helper);
TestSim sim(richards_config, grid_mapper, helper);
sim.set_policy(Dune::Dorie::AdaptivityPolicy::WaterFlux);
sim.test_new_parameters();
sim.test_parameter_manipulation();
......@@ -88,7 +88,7 @@ int main (int argc, char** argv)
using TestSim = Dune::Dorie::ParameterizationTest<Cube<2, 1>>;
Dune::Dorie::GridCreator<Dune::YaspGrid<2>> grid_creator(inifile, helper);
auto grid_mapper = grid_creator.get_mapper();
TestSim sim(inifile, grid_mapper, helper);
TestSim sim(richards_config, grid_mapper, helper);
sim.test_new_parameters();
sim.test_parameter_manipulation();
}
......
......@@ -27,7 +27,7 @@ grid.mappingFileDataset = parallel_reference_2d
output.fileName = parallel_reference_compare | unique
output.outputPath = parallel_reference_compare | unique
boundary.file = "{_asset_path}/bcs/infiltration_2d.dat", "{_asset_path}/bcs/infiltration_3d.dat" | expand dim
boundary.file = "{_asset_path}/bcs/infiltration_2d.dat"
parameters.file = "{_asset_path}/param/param.yml"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment