Commit 61987fcf authored by Santiago Ospina's avatar Santiago Ospina

added prefix richards to ini file

parent 79a3cb0d
This diff is collapsed.
......@@ -109,8 +109,8 @@ int main(int argc, char** argv)
const std::string gtype = inifile.get<std::string>("grid.gridType");
const int dim = inifile.get<int>("grid.dimensions");
const int FEorder = inifile.get<int>("grid.FEorder");
const int verbose = inifile.get<int>("output.verbose");
const std::string outputPath = inifile.get<std::string>("output.outputPath");
const int verbose = inifile.get<int>("misc.verbose");
const std::string outputPath = inifile.get<std::string>("richards.output.outputPath");
const bool adaptivity = inifile.get<bool>("adaptivity.useAdaptivity");
// Attempt to create output directory
......@@ -121,8 +121,8 @@ int main(int argc, char** argv)
if (helper.rank()==0){
std::cout << "INPUT FILE: " << inifilename << std::endl;
std::cout << "BC FILE: " << inifile.get<std::string>("boundary.file") << std::endl;
std::cout << "OUTPUT PATH: " << inifile.get<std::string>("output.outputPath") << std::endl;
std::cout << "BC FILE: " << inifile.get<std::string>("richards.boundary.file") << std::endl;
std::cout << "OUTPUT PATH: " << inifile.get<std::string>("richards.output.outputPath") << std::endl;
if (verbose>0){
if(Dune::MPIHelper::isFake) std::cout << "MPI: SEQUENTIAL RUN" << std::endl;
else std::cout << "MPI: PARALLEL RUN ON " << helper.size() << " PROCESS(ES)" << std::endl;
......
......@@ -100,7 +100,7 @@ public:
alpha(inifile.get<float>("adaptivity.refinementFraction")),
beta(inifile.get<float>("adaptivity.coarseningFraction")),
adaptivityThreshold(inifile.get<float>("adaptivity.threshold")),
verbose(inifile.get<int>("output.verbose")),
verbose(inifile.get<int>("misc.verbose")),
total_time(0.)
{
if(strategy!="elementFraction" && strategy!="errorFraction" && strategy!="threshold")
......
......@@ -8,8 +8,8 @@ RichardsSimulation<Traits>::RichardsSimulation (Dune::MPIHelper& _helper, std::s
helper(_helper), grid(_grid), inifile(_inifile), gv(grid->leafGridView()),
mbe_slop(estimate_mbe_entries<typename MBE::size_type>(Traits::dim,Traits::GridGeometryType)),
mbe_tlop(1),
verbose(inifile.get<int>("output.verbose")),
output_type(_inifile.get<bool>("output.asciiVtk") ? Dune::VTK::OutputType::ascii : Dune::VTK::OutputType::base64)
verbose(inifile.get<int>("richards.output.verbose")),
output_type(_inifile.get<bool>("richards.output.asciiVtk") ? Dune::VTK::OutputType::ascii : Dune::VTK::OutputType::base64)
{
Dune::Timer timer;
const int verbose_low = helper.rank() == 0 ? verbose : 0;
......@@ -63,14 +63,14 @@ RichardsSimulation<Traits>::RichardsSimulation (Dune::MPIHelper& _helper, std::s
// --- Utility Class Setup --- //
if constexpr (Traits::write_output)
{
const int subsamling_lvl = _inifile.get<int>("output.subsamplingLevel", 0);
const int subsamling_lvl = _inifile.get<int>("richards.output.subsamplingLevel", 0);
const auto subsamling_intervals = Dune::refinementLevels(subsamling_lvl);
auto subsamling_vtk = std::make_shared<Dune::SubsamplingVTKWriter<GV>>(gv,
subsamling_intervals);
vtkwriter = std::make_unique<Writer>(subsamling_vtk,
inifile.get<std::string>("output.fileName"),
inifile.get<std::string>("output.outputPath"),
inifile.get<std::string>("richards.output.fileName"),
inifile.get<std::string>("richards.output.outputPath"),
"./");
}
......@@ -96,7 +96,7 @@ void RichardsSimulation<Traits>::operator_setup ()
ls = std::make_unique<LS>(*igo,*cc,*lsgfs,*lscc,1000,0,true,true);
pdesolver = std::make_unique<PDESOLVER>(*igo,*ls);
pdesolver->setParameters(inifile.sub("NewtonParameters"));
pdesolver->setParameters(inifile.sub("richards.NewtonParameters"));
pdesolver->setVerbosityLevel(verbose);
// --- Time Step Operators ---
......@@ -213,7 +213,7 @@ void RichardsSimulation<Traits>::write_data (RF time)
if constexpr (Traits::write_output)
{
update_adapters();
if (inifile.get<bool>("output.vertexData")) {
if (inifile.get<bool>("richards.output.vertexData")) {
vtkwriter->addVertexData(udgf,"head");
vtkwriter->addVertexData(fluxdgf,"flux");
vtkwriter->addVertexData(condgf,"K_0");
......
......@@ -79,7 +79,7 @@ inline auto read_experimental_operator_settings(
RichardsDGUpwinding::Type upwinding;
RichardsDGWeights::Type weights;
const auto method_str = inifile.get<std::string>("dg.experimental.method");
const auto method_str = inifile.get<std::string>("richards.numerics.experimental.method");
if (method_str == "SIPG")
method = RichardsDGMethod::SIPG;
else if (method_str == "NIPG")
......@@ -92,7 +92,7 @@ inline auto read_experimental_operator_settings(
DUNE_THROW(Dune::IOError, "Unknown DG method '" + method_str + "'!");
const auto upwinding_str
= inifile.get<std::string>("dg.experimental.upwinding");
= inifile.get<std::string>("richards.numerics.experimental.upwinding");
if (upwinding_str == "none")
upwinding = RichardsDGUpwinding::none;
else if (upwinding_str == "semiUpwind")
......@@ -102,7 +102,7 @@ inline auto read_experimental_operator_settings(
else
DUNE_THROW(Dune::IOError, "Unknown upwinding '" + upwinding_str + "'!");
const auto weights_str = inifile.get<bool>("dg.experimental.weights");
const auto weights_str = inifile.get<bool>("richards.numerics.experimental.weights");
if (weights_str)
weights = RichardsDGWeights::weightsOn;
else
......@@ -205,7 +205,7 @@ public:
param(param_), boundary(boundary_), sourceTerm(sourceTerm_), method(method_), upwinding(upwinding_), weights(weights_),
mapper(view_, Dune::mcmgElementLayout()),
intorderadd(intorderadd_), quadrature_factor(quadrature_factor_),
penalty_factor(config.get<RF>("dg.penaltyFactor")),
penalty_factor(config.get<RF>("richards.numerics.penaltyFactor")),
time(0.0),
cache(20)
{
......
......@@ -67,7 +67,7 @@ namespace Dune {
int intorderadd_ = 2, int quadrature_factor_ = 2)
: param(param_), boundary(boundary_),
intorderadd(intorderadd_), quadrature_factor(quadrature_factor_),
penalty_factor(config.get<RF>("dg.penaltyFactor")),
penalty_factor(config.get<RF>("richards.numerics.penaltyFactor")),
time(0.0)
{
if (method_ == RichardsDGMethod::OOB)
......
......@@ -120,8 +120,8 @@ namespace Dune {
, millerSimilarity(h5file.read_attribute<bool>("millerSimilarity","parameters"))
, variance(h5file.read_attribute<RF>("variance","parameters"))
, grid_extensions(config.get<Domain>("grid.extensions"))
, scale(config.get<Domain>("parameters.scale"))
, offset(config.get<Domain>("parameters.offset"))
, scale(config.get<Domain>("richards.parameters.scale"))
, offset(config.get<Domain>("richards.parameters.offset"))
, millerField("raw_field")
{
gVector=0;
......
......@@ -37,8 +37,8 @@ namespace Dune {
Interpolator& interpolator_,
const int verbose_)
: config(config_), helper(helper_), interpolator(interpolator_), verbose(verbose_)
, arrayPath(config.get<std::string>("parameters.arrayFile"))
, interpMethod(config.get<std::string>("parameters.interpolation"))
, arrayPath(config.get<std::string>("richards.parameters.arrayFile"))
, interpMethod(config.get<std::string>("richards.parameters.interpolation"))
, h5array(arrayPath,verbose)
, parType(h5array.read_attribute<std::string>("parameterization","parameters"))
{}
......
......@@ -40,9 +40,9 @@ namespace Dune{
*/
FlowBoundary(const Dune::ParameterTree& config)
{
std::string bcFileType = config.get<std::string>("boundary.fileType");
std::string bcFileType = config.get<std::string>("richards.boundary.fileType");
if(bcFileType == "rectangularGrid") {
bcDataHandler = std::make_unique<RectangularGrid<Traits>>(config);
bcDataHandler = std::make_unique<RectangularGrid<Traits>>(config,"richards");
}
else
DUNE_THROW(IOError,"unknown bcFileType specified!");
......
......@@ -40,9 +40,9 @@ namespace Dune {
/** \throw Dune::IOError BC File Type not supported
*/
FlowInitial (const Dune::ParameterTree& config, const typename T::GridView& gv)
: initialCondition(config.get<std::string>("initial.condition"))
, constGrad(config.get<typename T::RangeField>("initial.headGradient"))
, constLower(config.get<typename T::RangeField>("initial.headLower"))
: initialCondition(config.get<std::string>("richards.initial.condition"))
, constGrad(config.get<typename T::RangeField>("richards.initial.headGradient"))
, constLower(config.get<typename T::RangeField>("richards.initial.headLower"))
, g(gv)
, hydrEquilibrium(false), gravityFlow(false)
{
......
......@@ -120,13 +120,13 @@ namespace Dorie{
/// Read necessary parameters. Then read out BC data file with rectangular boundary decomposition.
/** \throw Dune::IOError BC File path not specified
*/
RectangularGrid (const ParameterTree& config)
RectangularGrid (const ParameterTree& config, std::string model)
: BCReadoutInterface<Traits>()
, extensions(config.get<Domain>("grid.extensions"))
, bcFilePath(config.get<std::string>("boundary.file"))
, tStart(config.get<RF>("time.start"))
, tEnd(config.get<RF>("time.end"))
, interpolate(config.get<bool>("boundary.interpolateBCvalues"))
, bcFilePath(config.get<std::string>(model + ".boundary.file"))
, tStart(config.get<RF>(model + ".time.start"))
, tEnd(config.get<RF>(model + ".time.end"))
, interpolate(config.get<bool>(model + ".boundary.interpolateBCvalues"))
, eps(1e-8)
{
// Check if bcFilePath is specified
......
......@@ -85,7 +85,7 @@ std::shared_ptr<GridType> build_grid_gmsh (const Dune::ParameterTree& inifile, c
Dune::Timer timer;
ios_base_all_saver restore(std::cout);
enum { dim = GridType::dimension };
const int verbose = inifile.get<int>("output.verbose");
const int verbose = inifile.get<int>("misc.verbose");
const int level = inifile.get<int>("grid.initialLevel");
const std::string meshfilename = inifile.get<std::string>("grid.gridFile");
......@@ -133,7 +133,7 @@ std::shared_ptr<GridType> build_grid_cube (const Dune::ParameterTree& inifile, c
Dune::Timer timer;
ios_base_all_saver restore(std::cout);
enum { dim = GridType::dimension };
const int verbose = inifile.get<int>("output.verbose");
const int verbose = inifile.get<int>("misc.verbose");
const int level = inifile.get<int>("grid.initialLevel");
const Dune::FieldVector<double,dim> lowerLeft(0.);
const Dune::FieldVector<double,dim> upperRight = inifile.get<Dune::FieldVector<double,dim>>("grid.extensions");
......
......@@ -520,7 +520,7 @@ namespace Dune {
explicit InterpolatorFactory(const ParameterTree& config_,
const Dune::MPIHelper& helper_, const int verbose_)
: config(config_), helper(helper_), verbose(verbose_)
, interpMethod(config.get<std::string>("parameters.interpolation"))
, interpMethod(config.get<std::string>("richards.parameters.interpolation"))
{}
std::unique_ptr<IB> create()
......
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