Commit 15692c83 authored by Santiago Ospina's avatar Santiago Ospina

Update API

* Use Richards scope in system tests
* Added verbosity keyword for global output
* Modified API for setup of ini files
Signed-off-by: Santiago Ospina De Los Ríos's avatarSantiago Ospina <santiago.ospina@iup.uni-heidelberg.de>
parent 40158ecb
......@@ -79,17 +79,11 @@ adding an empty line, make text **bold** or ``monospaced``.
</category>
<category name="adaptivity">
<parameter name="useAdaptivity">
<definition> Switches adaptive grid refinement (h-adaptivity) on (``true``) or
off (``false``). If enabled, an unstructured grid manager with higher computational
cost is used when using rectangular / cubic grids. </definition>
<values> true, false </values>
<suggestion> false </suggestion>
</parameter>
<parameter name="policy">
<definition> Defines the target policy to do adaptive grid refinement (h-adaptivity).
Only one policy available at the moment. </definition>
<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>
<values> waterFlux </values>
<suggestion> waterFlux </suggestion>
</parameter>
......@@ -156,6 +150,14 @@ adding an empty line, make text **bold** or ``monospaced``.
</parameter>
</category>
<category name="output">
<parameter name="verbose">
<definition> Overall verbosity of the program </definition>
<suggestion> 0 </suggestion>
<values> 0, 1, 2, 3 </values>
</parameter>
</category>
<category name="misc">
<parameter name="debugMode">
<definition> Switches debug mode on (``true``) or off (``false``). In debug mode,
......
......@@ -33,7 +33,7 @@ adding an empty line, make text **bold** or ``monospaced``.
<dorie>
<category name="richards.output">
<parameter name="verbose">
<definition> Overall verbosity of the program </definition>
<definition> Verbosity of the Richards simulation </definition>
<suggestion> 0 </suggestion>
<values> 0, 1, 2, 3 </values>
</parameter>
......
......@@ -18,6 +18,7 @@
#include "interface/richards_simulation.hh"
#include "solver/util_grid_creator.hh"
#include "interface/setup_inifile.hh"
// #include <dune/dorie/dorie.hh> // System and DUNE Headers
......@@ -101,10 +102,8 @@ int main(int argc, char** argv)
sleep(5);
}
Dune::Dorie::Setup::inifile(inifile);
// extract richards configuration
Dune::ParameterTree richards_config = inifile.sub("richards");
Dune::ParameterTree richards_config = Dune::Dorie::Setup::prep_ini_for_richards(inifile);
// Read necessary variables
const std::string gtype = inifile.get<std::string>("grid.gridType");
......
#include <iostream>
#include <memory>
#include <vector>
#include <dune/common/exceptions.hh>
#include <dune/common/parametertree.hh>
namespace Dune{
namespace Dorie{
/**
* @brief Helper namespace to configurate/setup input files
*/
namespace Setup
{
/*------------------------------------------------------------------------*//**
* @brief Set up the configuration keys for Richards simulations
*
* @param ini The inifile
*/
Dune::ParameterTree prep_ini_for_richards(const Dune::ParameterTree& ini)
{
Dune::ParameterTree richards_ini(ini.sub("richards"));
// move grid extensions into richards category (needed for reading parameters)
richards_ini["grid.extensions"] = ini["grid.extensions"];
// copy adaptivity keywords into richards category
if (ini.get<std::string>("adaptivity.policy") == "waterFlux")
richards_ini.sub("richards.adaptivity") = ini.sub("adaptivity");
else
DUNE_THROW(NotImplemented, "Not known adaptativity policy ("
<< ini.get<std::string>("adaptivity.policy") << ")!");
return richards_ini;
}
};
}
}
\ No newline at end of file
......@@ -227,35 +227,6 @@ struct BaseTraits
};
/**
* @brief Helper object to configurate input files
*/
struct Setup
{
/*------------------------------------------------------------------------*//**
* @brief Set up the configuration keys for the simulations
*
* @param ini The inifile
*/
static void inifile(Dune::ParameterTree& ini)
{
// move grid extensions into richards category (needed for reading parameters)
ini["richards.grid.extensions"] = ini["grid.extensions"];
// configure a global verbose level
ini["output.verbose"] = ini["richards.output.verbose"];
if (ini.get<std::string>("adaptivity.policy") == "waterFlux")
// copy adaptivity keywords into richards category
ini.sub("richards.adaptivity") = ini.sub("adaptivity");
else
DUNE_THROW(NotImplemented, "Not known adaptativity policy ("
<< ini.get<std::string>("adaptivity.policy") << ")!");
}
};
}
}
......
......@@ -25,15 +25,17 @@ grid.initialLevel = 2
grid.cells = 20 20
grid.gridFile = {_asset_path}/meshes/square.msh
richards.output.fileName = mass_conservation | unique
richards.output.outputPath = mass_conservation | unique
[richards]
richards.boundary.file = "{_asset_path}/bcs/mass_conservation_2d.dat"
output.fileName = mass_conservation | unique
output.outputPath = mass_conservation | unique
richards.parameters.arrayFile = "{_asset_path}/parfields/sand.h5"
boundary.file = "{_asset_path}/bcs/mass_conservation_2d.dat"
richards.time.end = 1E4
richards.time.maxTimestep = 1E4
richards.time.startTimestep = 1E2
parameters.arrayFile = "{_asset_path}/parfields/sand.h5"
richards.numerics.FEorder = 1
\ No newline at end of file
time.end = 1E4
time.maxTimestep = 1E4
time.startTimestep = 1E2
numerics.FEorder = 1
\ No newline at end of file
......@@ -16,15 +16,17 @@ grid.gridType = rectangular
grid.cells = 50 200
grid.extensions = 1 1
richards.output.fileName = muphi | unique name
richards.output.outputPath = muphi | unique name
[richards]
richards.time.end = 1.5E5
richards.time.maxTimestep = 1E5
richards.time.startTimestep = 1E3
output.fileName = muphi | unique name
output.outputPath = muphi | unique name
richards.boundary.file = "{_asset_path}/bcs/muphi2d.dat"
time.end = 1.5E5
time.maxTimestep = 1E5
time.startTimestep = 1E3
richards.parameters.arrayFile = fft_field_muphi.h5
boundary.file = "{_asset_path}/bcs/muphi2d.dat"
parameters.arrayFile = fft_field_muphi.h5
......@@ -12,26 +12,27 @@ grid.cells = 1 160, 1 40, 1 20 | expand prec
adaptivity.useAdaptivity = false
richards.output.fileName = ode_homogeneous_sand | unique
richards.output.outputPath = ode_homogeneous_sand | unique
[richards]
richards.boundary.file = "{_asset_path}/bcs/infiltration_2d.dat"
output.fileName = ode_homogeneous_sand | unique
output.outputPath = ode_homogeneous_sand | unique
richards.parameters.arrayFile = "{_asset_path}/parfields/sand.h5"
boundary.file = "{_asset_path}/bcs/infiltration_2d.dat"
richards.time.end = 1E7
richards.time.maxTimestep = 1E7
richards.time.startTimestep = 1E4
parameters.arrayFile = "{_asset_path}/parfields/sand.h5"
time.end = 1E7
time.maxTimestep = 1E7
time.startTimestep = 1E4
NewtonParameters.AbsoluteLimit = 1E-10
NewtonParameters.Reduction = 1E-10
numerics.penaltyFactor = 10
numerics.FEorder = 1, 2, 3 | expand prec
[_ode]
flux = -5.55e-6
head_abstol = 3E-6, 2E-8, 6E-8 | expand prec
flux_abstol = 5E-11, 1E-9, 3E-12 | expand prec
[richards.NewtonParameters]
AbsoluteLimit = 1E-10
Reduction = 1E-10
[richards.numerics]
penaltyFactor = 10
FEorder = 1, 2, 3 | expand prec
\ No newline at end of file
......@@ -12,26 +12,27 @@ grid.cells = 1 160, 1 40, 1 20 | expand prec
adaptivity.useAdaptivity = false
richards.output.fileName = ode_homogeneous_silt | unique
richards.output.outputPath = ode_homogeneous_silt | unique
[richards]
richards.boundary.file = "{_asset_path}/bcs/infiltration_2d.dat"
output.fileName = ode_homogeneous_silt | unique
output.outputPath = ode_homogeneous_silt | unique
richards.parameters.arrayFile = "{_asset_path}/parfields/silt.h5"
boundary.file = "{_asset_path}/bcs/infiltration_2d.dat"
richards.time.end = 1E7
richards.time.maxTimestep = 1E7
richards.time.startTimestep = 1E4
parameters.arrayFile = "{_asset_path}/parfields/silt.h5"
time.end = 1E7
time.maxTimestep = 1E7
time.startTimestep = 1E4
NewtonParameters.AbsoluteLimit = 1E-10
NewtonParameters.Reduction = 1E-10
numerics.penaltyFactor = 10
numerics.FEorder = 1, 2, 3 | expand prec
[_ode]
flux = -5.55e-6
head_abstol = 6E-6, 4E-6, 9E-6 | expand prec
flux_abstol = 2E-9, 2E-8, 3E-9 | expand prec
[richards.NewtonParameters]
AbsoluteLimit = 1E-10
Reduction = 1E-10
[richards.numerics]
penaltyFactor = 10
FEorder = 1, 2, 3 | expand prec
\ No newline at end of file
flux_abstol = 2E-9, 2E-8, 3E-9 | expand prec
\ No newline at end of file
......@@ -12,26 +12,27 @@ grid.cells = 1 160, 1 40, 1 20 | expand prec
adaptivity.useAdaptivity = false
richards.output.fileName = ode_layered | unique
richards.output.outputPath = ode_layered | unique
[richards]
richards.boundary.file = "{_asset_path}/bcs/infiltration_2d.dat"
output.fileName = ode_layered | unique
output.outputPath = ode_layered | unique
richards.parameters.arrayFile = "{_asset_path}/parfields/layered.h5"
boundary.file = "{_asset_path}/bcs/infiltration_2d.dat"
richards.time.end = 1E7
richards.time.maxTimestep = 1E7
richards.time.startTimestep = 1E4
parameters.arrayFile = "{_asset_path}/parfields/layered.h5"
time.end = 1E7
time.maxTimestep = 1E7
time.startTimestep = 1E4
NewtonParameters.AbsoluteLimit = 1E-10
NewtonParameters.Reduction = 1E-10
numerics.penaltyFactor = 10
numerics.FEorder = 1, 2, 3 | expand prec
[_ode]
flux = -5.55e-6
head_abstol = 3E-5, 4E-8, 4E-6 | expand prec
flux_abstol = 5E-10, 4E-9, 5E-11 | expand prec
[richards.NewtonParameters]
AbsoluteLimit = 1E-10
Reduction = 1E-10
[richards.numerics]
penaltyFactor = 10
FEorder = 1, 2, 3 | expand prec
\ No newline at end of file
......@@ -15,15 +15,17 @@ grid.extensions = 1 1, 1 1 1 | expand dim
adaptivity.useAdaptivity = false
richards.output.fileName = parallel_reference_{_dimension}
richards.output.outputPath = parallel_reference_{_dimension}
[richards]
richards.time.end = 1E5
richards.time.maxTimestep = 1E5
richards.time.startTimestep = 1E3
output.fileName = parallel_reference_{_dimension}
output.outputPath = parallel_reference_{_dimension}
richards.boundary.file = "{_asset_path}/bcs/infiltration_2d.dat", "{_asset_path}/bcs/infiltration_3d.dat" | expand dim
time.end = 1E5
time.maxTimestep = 1E5
time.startTimestep = 1E3
richards.parameters.arrayFile = "{_asset_path}/parfields/fft_2d_miller.h5", "{_asset_path}/parfields/fft_3d_miller.h5" | expand dim
richards.parameters.scale = 1 1, 1 1 1 | expand dim
richards.parameters.offset = 0 0, 0 0 0 | expand dim
\ No newline at end of file
boundary.file = "{_asset_path}/bcs/infiltration_2d.dat", "{_asset_path}/bcs/infiltration_3d.dat" | expand dim
parameters.arrayFile = "{_asset_path}/parfields/fft_2d_miller.h5", "{_asset_path}/parfields/fft_3d_miller.h5" | expand dim
parameters.scale = 1 1, 1 1 1 | expand dim
parameters.offset = 0 0, 0 0 0 | expand dim
\ No newline at end of file
......@@ -21,15 +21,17 @@ grid.extensions = 1 1, 1 1 1 | expand dim
adaptivity.useAdaptivity = false
richards.output.fileName = parallel_reference_compare | unique
richards.output.outputPath = parallel_reference_compare | unique
[richards]
richards.time.end = 1E5
richards.time.maxTimestep = 1E5
richards.time.startTimestep = 1E3
output.fileName = parallel_reference_compare | unique
output.outputPath = parallel_reference_compare | unique
richards.boundary.file = "{_asset_path}/bcs/infiltration_2d.dat", "{_asset_path}/bcs/infiltration_3d.dat" | expand dim
time.end = 1E5
time.maxTimestep = 1E5
time.startTimestep = 1E3
richards.parameters.arrayFile = "{_asset_path}/parfields/fft_2d_miller.h5", "{_asset_path}/parfields/fft_3d_miller.h5" | expand dim
richards.parameters.scale = 1 1, 1 1 1 | expand dim
richards.parameters.offset = 0 0, 0 0 0 | expand dim
\ No newline at end of file
boundary.file = "{_asset_path}/bcs/infiltration_2d.dat", "{_asset_path}/bcs/infiltration_3d.dat" | expand dim
parameters.arrayFile = "{_asset_path}/parfields/fft_2d_miller.h5", "{_asset_path}/parfields/fft_3d_miller.h5" | expand dim
parameters.scale = 1 1, 1 1 1 | expand dim
parameters.offset = 0 0, 0 0 0 | expand dim
\ No newline at end of file
......@@ -19,13 +19,15 @@ adaptivity.threshold = 5E-8
adaptivity.refinementFraction = 0.05
adaptivity.maxLevel = 7
richards.output.fileName = reference_2d | unique name
richards.output.outputPath = reference_2d | unique name
[richards]
richards.time.end = 1E5
richards.time.maxTimestep = 1E5
richards.time.startTimestep = 1E3
output.fileName = reference_2d | unique name
output.outputPath = reference_2d | unique name
richards.boundary.file = "{_asset_path}/bcs/infiltration_2d.dat"
time.end = 1E5
time.maxTimestep = 1E5
time.startTimestep = 1E3
richards.parameters.arrayFile = "{_asset_path}/parfields/fft_2d.h5", "{_asset_path}/parfields/fft_2d_miller.h5" | expand distribution
boundary.file = "{_asset_path}/bcs/infiltration_2d.dat"
parameters.arrayFile = "{_asset_path}/parfields/fft_2d.h5", "{_asset_path}/parfields/fft_2d_miller.h5" | expand distribution
......@@ -16,16 +16,18 @@ grid.gridFile = "{_asset_path}/meshes/3dcube.msh"
adaptivity.useAdaptivity = false
adaptivity.threshold = 1E-6
richards.fileName = reference_3d | unique name
richards.outputPath = reference_3d | unique name
[richards]
richards.time.end = 1E5
richards.time.maxTimestep = 1E5
richards.time.startTimestep = 1E4
fileName = reference_3d | unique name
outputPath = reference_3d | unique name
richards.boundary.file = "{_asset_path}/bcs/infiltration_3d.dat"
time.end = 1E5
time.maxTimestep = 1E5
time.startTimestep = 1E4
richards.parameters.arrayFile = "{_asset_path}/parfields/fft_3d.h5", "{_asset_path}/parfields/fft_3d_miller.h5" | expand
richards.parameters.scale = 1 1 1
richards.parameters.offset = 0 0 0
richards.parameters.interpolation = linear
boundary.file = "{_asset_path}/bcs/infiltration_3d.dat"
parameters.arrayFile = "{_asset_path}/parfields/fft_3d.h5", "{_asset_path}/parfields/fft_3d_miller.h5" | expand
parameters.scale = 1 1 1
parameters.offset = 0 0 0
parameters.interpolation = linear
......@@ -18,13 +18,15 @@ grid.gridFile = "{_asset_path}/meshes/square.msh"
adaptivity.useAdaptivity = false
adaptivity.threshold = 1E-7
richards.output.fileName = reference_evaporation | unique name
richards.output.outputPath = reference_evaporation | unique name
[richards]
richards.time.end = 1E6
richards.time.maxTimestep = 1E6
richards.time.startTimestep = 1E3
output.fileName = reference_evaporation | unique name
output.outputPath = reference_evaporation | unique name
richards.boundary.file = "{_asset_path}/bcs/infiltration_evaporation_2d.dat"
time.end = 1E6
time.maxTimestep = 1E6
time.startTimestep = 1E3
richards.parameters.arrayFile = "{_asset_path}/parfields/fft_2d.h5"
boundary.file = "{_asset_path}/bcs/infiltration_evaporation_2d.dat"
parameters.arrayFile = "{_asset_path}/parfields/fft_2d.h5"
......@@ -18,14 +18,16 @@ grid.gridFile = "{_asset_path}/meshes/square.msh"
adaptivity.useAdaptivity = true
adaptivity.threshold = 7E-8
richards.output.fileName = reference_interpolators | unique name
richards.output.outputPath = reference_interpolators | unique name
[richards]
richards.time.end = 1E5
richards.time.maxTimestep = 1E5
richards.time.startTimestep = 1E3
output.fileName = reference_interpolators | unique name
output.outputPath = reference_interpolators | unique name
richards.boundary.file = "{_asset_path}/bcs/infiltration_2d.dat"
time.end = 1E5
time.maxTimestep = 1E5
time.startTimestep = 1E3
richards.parameters.arrayFile = "{_asset_path}/parfields/fft_2d_miller.h5"
richards.parameters.interpolation = linear, cubic | expand
boundary.file = "{_asset_path}/bcs/infiltration_2d.dat"
parameters.arrayFile = "{_asset_path}/parfields/fft_2d_miller.h5"
parameters.interpolation = linear, cubic | expand
......@@ -14,15 +14,17 @@ grid.extensions = 1 1
adaptivity.useAdaptivity = false
richards.output.fileName = run | unique name
richards.output.outputPath = run | unique name
[richards]
richards.time.end = 1E4
richards.time.maxTimestep = 1E4
richards.time.startTimestep = 5E2
output.fileName = run | unique name
output.outputPath = run | unique name
richards.boundary.file = "{_asset_path}/bcs/infiltration_2d.dat"
time.end = 1E4
time.maxTimestep = 1E4
time.startTimestep = 5E2
richards.parameters.arrayFile = ${CMAKE_CURRENT_BINARY_DIR}/csv.h5
boundary.file = "{_asset_path}/bcs/infiltration_2d.dat"
parameters.arrayFile = ${CMAKE_CURRENT_BINARY_DIR}/csv.h5
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