Commit cdb7a395 authored by Santiago Ospina De Los Ríos's avatar Santiago Ospina De Los Ríos

Merge remote-tracking branch...

Merge remote-tracking branch 'origin/98-implement-a-simulation-object-for-transport-transportsimulation' into 101-couple-the-transportsimulation-with-richardssimulation
parents 911c397d e5c13de6
......@@ -165,4 +165,4 @@ create_default_config(
"config.ini;parameters.html;parameters.rst"
${PROJECT_SOURCE_DIR}/dune/dorie
${CMAKE_CURRENT_SOURCE_DIR}/parameters.css
)
)
\ No newline at end of file
add_subdirectory("groups")
# shortcut for creating the Doxyfile.in and Doxyfile
add_doxygen_target()
......@@ -3,6 +3,7 @@
# Location of source files
INPUT += @top_srcdir@/dune/dorie/
INPUT += @top_srcdir@/doc/doxygen/groups
# extract private class members
EXTRACT_PRIVATE = YES
......@@ -18,5 +19,4 @@ USE_MATHJAX = YES
# subdirectory from a directory tree whose root is specified with the INPUT tag.
# exclude versions of the operators that are not used
# EXCLUDE += @top_srcdir@/src/operator_DG_old.hh \
# @top_srcdir@/src/operator_DG_no_upwind.hh
# EXCLUDE += @top_srcdir@/...
/**
@defgroup Common Common
@{
@todo document models
@}
**/
\ No newline at end of file
/** @defgroup LocalOperators Local operators
@{
Local operators are in many senses the heart of dorie; in them, we transform
finite element basis into a vector of residuals and a mass matrix taking into
account the specific equation and method we want to solve. In particular,
some care has been taken regarding the different frames of reference when
working with coordinates and gradients. It can get particularly messy
particularly when working with intersections because one has to express the
same position/gradient with respect to the inside, outside, and face entities,
and sometimes with respect to the grid (e.g. global coordinates). Therefore,
in dorie we try to use the following suffixes convention:
| Convention | Meaning |
|------------|---------|
| `<description>` + `_i` | `<description>` with respect to the **inside** entity. |
| `<description>` + `_o` | `<description>` with respect to the **outside** entity. |
| `<description>` + `_f` | `<description>` with respect to the **face** entity (or intersection). |
| `<description>` + `_g` | `<description>` with respect to the **global** grid. |
| `<description>` + `_n` | `<description>` in **normal** direction. |
Notice that when working with gradients, the suffix for normal direction can
be combined with the first three suffixes (`_n_i`, `_n_o`, and `_n_f`). When it's
not specified, is understood that it is with respect to the face
(`_n` \f$\equiv\f$. `_n_f`).
@todo Update Dune::Dorie::Operator::RichardsDGSpatialOperator to the convention.
@}
**/
/**
@defgroup Models Models
@{
@todo document models
@}
@defgroup RichardsModel Richards
@{
@ingroup Models
@todo document richards model
@}
@defgroup TransportModel Transport
@{
@ingroup Models
@todo document transport model
@}
**/
\ No newline at end of file
......@@ -4,11 +4,12 @@ if(dune-testtools_FOUND)
add_subdirectory("test")
endif()
add_executable("transport" transport.cc)
dune_target_link_libraries(transport dorie-impl ${DUNE_LIBS})
add_executable("richards" richards.cc)
dune_target_link_libraries(richards dorie-impl ${DUNE_LIBS})
dune_target_link_libraries(richards richards-impl ${DUNE_LIBS})
add_executable("transport" transport.cc)
dune_target_link_libraries(transport richards-impl ${DUNE_LIBS})
dune_target_link_libraries(transport transport-impl ${DUNE_LIBS})
add_custom_target("dorie" DEPENDS richards transport)
......
#install headers
install(FILES
boundary_condition.hh
cfl_condition.hh
grid_creator.hh
grid_function_writer.hh
grid_mapper.hh
h5tools.hh
interpolator.hh
setup_inifile.hh
......
......@@ -36,6 +36,27 @@ namespace Setup
return richards_ini;
}
/*------------------------------------------------------------------------*//**
* @brief Set up the configuration keys for Transport simulations
*
* @param ini The inifile
*/
Dune::ParameterTree prep_ini_for_transport(const Dune::ParameterTree& ini)
{
Dune::ParameterTree richards_ini(ini.sub("transport"));
// move grid extensions into richards category (needed for reading parameters)
richards_ini["grid.extensions"] = ini["grid.extensions"];
const std::string adapt_policy_str = ini.get<std::string>("adaptivity.policy");
if (adapt_policy_str != "none") {
DUNE_THROW(NotImplemented, "Not known adaptativity policy ("
<< ini.get<std::string>("adaptivity.policy") << ")!");
}
return richards_ini;
}
};
}
......
add_subdirectory("richards")
\ No newline at end of file
add_subdirectory("richards")
add_subdirectory("transport")
\ No newline at end of file
......@@ -15,7 +15,6 @@
#include <dune/pdelab/localoperator/defaultimp.hh>
#include <dune/pdelab/finiteelement/localbasiscache.hh>
#include <dune/dorie/model/richards/local_operator.hh>
namespace Dune {
......
add_library(dorie-impl STATIC
add_library(richards-impl STATIC
sim_yasp_2_1.cc
sim_yasp_2_2.cc
sim_ug_2_1.cc
......
......@@ -79,7 +79,7 @@ inline auto read_experimental_operator_settings(
RichardsDGUpwinding::Type upwinding;
RichardsDGWeights::Type weights;
const auto method_str = inifile.get<std::string>("numerics.experimental.method");
const auto method_str = inifile.get<std::string>("dg.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>("numerics.experimental.upwinding");
= inifile.get<std::string>("dg.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>("numerics.experimental.weights");
const auto weights_str = inifile.get<bool>("dg.experimental.weights");
if (weights_str)
weights = RichardsDGWeights::weightsOn;
else
......@@ -122,6 +122,8 @@ inline auto read_experimental_operator_settings(
* to allow for different orders of the shape functions, which should be
* enough to support p-adaptivity. (Another likely candidate would be
* differing geometry types, i.e. hybrid meshes.)
*
* @ingroup LocalOperators
*/
template<typename Traits, typename Parameter, typename Boundary, typename SourceTerm, typename FEM, bool adjoint>
class RichardsDGSpatialOperator
......@@ -966,6 +968,8 @@ private:
/**
* @brief DG local operator for the temporal derivative of the Richards equation
*
* @ingroup LocalOperators
*/
template<typename Traits, typename Parameter, typename FEM, bool adjoint>
class RichardsDGTemporalOperator
......@@ -1071,4 +1075,4 @@ template<typename Traits, typename Parameter, typename FEM, bool adjoint>
} // namespace Dune
#endif // DUNE_DORIE_RICHARDS_OPERATOR_HH
#endif // DUNE_DORIE_RICHARDS_OPERATOR_HH
\ No newline at end of file
......@@ -34,7 +34,6 @@
#include <dune/dorie/model/richards/flow_source.hh>
#include <dune/dorie/model/richards/local_operator.hh>
namespace Dune{
namespace Dorie{
......@@ -43,6 +42,8 @@ namespace Dorie{
* class extends BaseTraits to be used for the DG implementation of
* the Richards simulation
*
* @ingroup RichardsModel
*
* @tparam BaseTraits Traits defining domain and range field properties of
* the simulation.
* @tparam order Order of the polynomial degree used for the basis
......@@ -140,6 +141,8 @@ struct RichardsSimulationTraits : public BaseTraits
* for the richards equation. It can perform time-steps and print
* the solution
*
* @ingroup RichardsModel
*
* @tparam RichardsSimulationTraits Traits containing the type definitions
* for Richards Simulation
*/
......
add_subdirectory("impl")
#install headers
install(FILES
solute_boundary.hh
solute_initial.hh
solute_source.hh
local_operator_FV.hh
transport.hh
richards_coupling.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dune/dorie/model/transport)
\ No newline at end of file
add_library(transport-impl STATIC
sim_yasp_2_0.cc
# sim_yasp_2_1.cc
# sim_yasp_2_2.cc
sim_ug_2_0.cc
# sim_ug_2_1.cc
# sim_yasp_2_3.cc
sim_yasp_3_0.cc
# sim_yasp_3_1.cc
# sim_ug_2_2.cc
# sim_yasp_3_2.cc
# sim_yasp_3_3.cc
# sim_ug_2_3.cc
sim_ug_3_0.cc
# sim_ug_3_1.cc
# sim_ug_3_2.cc
# sim_ug_3_3.cc
)
\ No newline at end of file
#ifndef DUNE_DORIE_TRANSPORT_IMPL_HH
#define DUNE_DORIE_TRANSPORT_IMPL_HH
#include <dune/grid/yaspgrid.hh>
#include <dune/geometry/type.hh>
namespace Dune{
namespace Dorie{
using Geo = Dune::GeometryType::BasicType;
}
}
#endif // DUNE_DORIE_TRANSPORT_IMPL_HH
\ No newline at end of file
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <dune/dorie/model/transport/impl/impl.hh>
#include <dune/dorie/model/transport/transport.cc>
#include <dune/dorie/model/transport/richards_coupling.cc>
namespace Dune{
namespace Dorie{
template class RichardsTransportCouplingSimulation<RichardsTransportCouplingSimulationTraits<BaseTraits<UGGrid<2>,Geo::cube>,1,0>>;
template class RichardsTransportCouplingSimulation<RichardsTransportCouplingSimulationTraits<BaseTraits<UGGrid<2>,Geo::cube>,2,0>>;
template class RichardsTransportCouplingSimulation<RichardsTransportCouplingSimulationTraits<BaseTraits<UGGrid<2>,Geo::cube>,3,0>>;
template class RichardsTransportCouplingSimulation<RichardsTransportCouplingSimulationTraits<BaseTraits<UGGrid<2>,Geo::simplex>,1,0>>;
template class RichardsTransportCouplingSimulation<RichardsTransportCouplingSimulationTraits<BaseTraits<UGGrid<2>,Geo::simplex>,2,0>>;
// template class RichardsTransportCouplingSimulation<RichardsTransportCouplingSimulationTraits<BaseTraits<UGGrid<2>,Geo::simplex>,3,0>>;
} // namespace Dorie
} // namespace Dune
\ No newline at end of file
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <dune/dorie/model/transport/impl/impl.hh>
#include <dune/dorie/model/transport/transport.cc>
#include <dune/dorie/model/transport/richards_coupling.cc>
namespace Dune{
namespace Dorie{
template class RichardsTransportCouplingSimulation<RichardsTransportCouplingSimulationTraits<BaseTraits<UGGrid<3>,Geo::cube>,1,0>>;
template class RichardsTransportCouplingSimulation<RichardsTransportCouplingSimulationTraits<BaseTraits<UGGrid<3>,Geo::cube>,2,0>>;
// template class RichardsTransportCouplingSimulation<RichardsTransportCouplingSimulationTraits<BaseTraits<UGGrid<3>,Geo::cube>,3,0>>;
// template class RichardsTransportCouplingSimulation<RichardsTransportCouplingSimulationTraits<BaseTraits<UGGrid<3>,Geo::simplex>,1,0>>;
// template class RichardsTransportCouplingSimulation<RichardsTransportCouplingSimulationTraits<BaseTraits<UGGrid<3>,Geo::simplex>,2,0>>;
// template class RichardsTransportCouplingSimulation<RichardsTransportCouplingSimulationTraits<BaseTraits<UGGrid<3>,Geo::simplex>,3,0>>;
} // namespace Dorie
} // namespace Dune
\ No newline at end of file
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <dune/dorie/model/transport/impl/impl.hh>
#include <dune/dorie/model/transport/transport.cc>
#include <dune/dorie/model/transport/richards_coupling.cc>
namespace Dune{
namespace Dorie{
template class RichardsTransportCouplingSimulation<RichardsTransportCouplingSimulationTraits<BaseTraits<YaspGrid<2>,Geo::cube>,1,0>>;
template class RichardsTransportCouplingSimulation<RichardsTransportCouplingSimulationTraits<BaseTraits<YaspGrid<2>,Geo::cube>,2,0>>;
template class RichardsTransportCouplingSimulation<RichardsTransportCouplingSimulationTraits<BaseTraits<YaspGrid<2>,Geo::cube>,3,0>>;
} // namespace Dorie
} // namespace Dune
\ No newline at end of file
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <dune/dorie/model/transport/impl/impl.hh>
#include <dune/dorie/model/transport/transport.cc>
#include <dune/dorie/model/transport/richards_coupling.cc>
namespace Dune{
namespace Dorie{
template class RichardsTransportCouplingSimulation<RichardsTransportCouplingSimulationTraits<BaseTraits<YaspGrid<2>,Geo::cube>,1,1>>;
template class RichardsTransportCouplingSimulation<RichardsTransportCouplingSimulationTraits<BaseTraits<YaspGrid<2>,Geo::cube>,2,1>>;
template class RichardsTransportCouplingSimulation<RichardsTransportCouplingSimulationTraits<BaseTraits<YaspGrid<2>,Geo::cube>,3,1>>;
} // namespace Dorie
} // namespace Dune
\ No newline at end of file
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <dune/dorie/model/transport/impl/impl.hh>
#include <dune/dorie/model/transport/transport.cc>
#include <dune/dorie/model/transport/richards_coupling.cc>
namespace Dune{
namespace Dorie{
template class RichardsTransportCouplingSimulation<RichardsTransportCouplingSimulationTraits<BaseTraits<YaspGrid<2>,Geo::cube>,1,2>>;
template class RichardsTransportCouplingSimulation<RichardsTransportCouplingSimulationTraits<BaseTraits<YaspGrid<2>,Geo::cube>,2,2>>;
template class RichardsTransportCouplingSimulation<RichardsTransportCouplingSimulationTraits<BaseTraits<YaspGrid<2>,Geo::cube>,3,2>>;
} // namespace Dorie
} // namespace Dune
\ No newline at end of file
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <dune/dorie/model/transport/impl/impl.hh>
#include <dune/dorie/model/transport/transport.cc>
#include <dune/dorie/model/transport/richards_coupling.cc>
namespace Dune{
namespace Dorie{
template class RichardsTransportCouplingSimulation<RichardsTransportCouplingSimulationTraits<BaseTraits<YaspGrid<2>,Geo::cube>,1,3>>;
template class RichardsTransportCouplingSimulation<RichardsTransportCouplingSimulationTraits<BaseTraits<YaspGrid<2>,Geo::cube>,2,3>>;
template class RichardsTransportCouplingSimulation<RichardsTransportCouplingSimulationTraits<BaseTraits<YaspGrid<2>,Geo::cube>,3,3>>;
} // namespace Dorie
} // namespace Dune
\ No newline at end of file
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <dune/dorie/model/transport/impl/impl.hh>
#include <dune/dorie/model/transport/transport.cc>
#include <dune/dorie/model/transport/richards_coupling.cc>
namespace Dune{
namespace Dorie{
template class RichardsTransportCouplingSimulation<RichardsTransportCouplingSimulationTraits<BaseTraits<YaspGrid<3>,Geo::cube>,1,0>>;
template class RichardsTransportCouplingSimulation<RichardsTransportCouplingSimulationTraits<BaseTraits<YaspGrid<3>,Geo::cube>,2,0>>;
// template class RichardsTransportCouplingSimulation<RichardsTransportCouplingSimulationTraits<BaseTraits<YaspGrid<3>,Geo::cube>,3,0>>;
} // namespace Dorie
} // namespace Dune
\ No newline at end of file
#include "coupled_simulation.hh"
#include "richards_simulation.cc"
#include "transport_simulation.cc"
#include <dune/dorie/model/transport/richards_coupling.hh>
// #include <dune/pdelab/adaptivity/adaptivity.hh>
......@@ -8,7 +6,7 @@ namespace Dune{
namespace Dorie{
template<typename Traits>
CoupledSimulation<Traits>::CoupledSimulation(
RichardsTransportCouplingSimulation<Traits>::RichardsTransportCouplingSimulation(
Dune::ParameterTree& inifile_richards,
Dune::ParameterTree& inifile_transport,
std::shared_ptr<GridMapper> grid_mapper,
......@@ -38,7 +36,7 @@ CoupledSimulation<Traits>::CoupledSimulation(
// next time rule
template<typename Traits>
void CoupledSimulation<Traits>::step()
void RichardsTransportCouplingSimulation<Traits>::step()
{
auto policy = this->output_policy();
if (policy == OutputPolicy::EndOfStep || policy == OutputPolicy::None)
......@@ -86,7 +84,7 @@ void CoupledSimulation<Traits>::step()
}
// template<typename Traits>
// void CoupledSimulation<Traits>::adapt()
// void RichardsTransportCouplingSimulation<Traits>::adapt()
// {
// if constexpr (Traits::BaseTraits::adapt_grid)
// {
......
#ifndef DUNE_DORIE_COUPLED_SIMULATION_HH
#define DUNE_DORIE_COUPLED_SIMULATION_HH
#include "richards_simulation.hh"
#include "transport_simulation.hh"
#include <dune/dorie/model/richards/richards.hh>
#include <dune/dorie/model/transport/transport.hh>
#include <dune/dorie/model/transport/richards_coupling.hh>
namespace Dune{
namespace Dorie{
template<class BaseTraits, int RichardsOrder, int TransportOrder>
struct CoupledSimulationTraits : public BaseTraits
struct RichardsTransportCouplingSimulationTraits : public BaseTraits
{
private:
using RichardsSimulationTraits = Dune::Dorie::RichardsSimulationTraits<BaseTraits,RichardsOrder>;
......@@ -28,7 +29,7 @@ public:
template<class T>
class CoupledSimulation : public SimulationBase
class RichardsTransportCouplingSimulation : public SimulationBase
{
public:
using Traits = T;
......@@ -62,7 +63,7 @@ public:
* @param inifile_richards The inifile richards
* @param _inifile_transport The inifile transport
*/
CoupledSimulation (
RichardsTransportCouplingSimulation (
Dune::ParameterTree& inifile_richards,
Dune::ParameterTree& inifile_transport,
std::shared_ptr<GridMapper> grid_mapper,
......
......@@ -6,7 +6,7 @@
#include <dune/common/exceptions.hh>
#include <dune/common/parametertree.hh>
#include "util_boundary_condition.hh"
#include <dune/dorie/common/boundary_condition.hh>
namespace Dune{
namespace Dorie{
......
#include "transport_simulation.hh"
#include <dune/dorie/model/transport/transport.hh>
namespace Dune{
namespace Dorie{
......
......@@ -15,16 +15,17 @@
#include <dune/pdelab/function/product.hh>
#include <dune/pdelab/stationary/linearproblem.hh>
#include "util.hh"
#include "adaptivity.hh"
#include "simulation_base.hh"
#include "../solver/transport_initial.hh"
#include "../solver/transport_boundary.hh"
#include "../solver/transport_operator_FV.hh"
#include "../solver/util_controller.hh"
#include "../solver/util_writer.hh"
#include "../solver/util_grid_creator.hh"
#include "../solver/util_cfl_condition.hh"
#include <dune/dorie/common/simulation_base.hh>
#include <dune/dorie/common/util.hh>
#include <dune/dorie/common/interpolator.hh>
#include <dune/dorie/common/time_controller.hh>
#include <dune/dorie/common/grid_mapper.hh>
#include <dune/dorie/common/grid_function_writer.hh>
#include <dune/dorie/common/cfl_condition.hh>
#include <dune/dorie/model/transport/solute_initial.hh>
#include <dune/dorie/model/transport/solute_boundary.hh>
#include <dune/dorie/model/transport/local_operator_FV.hh>
namespace Dune{
namespace Dorie{
......@@ -34,6 +35,8 @@ namespace Dorie{
* class extends BaseTraits to be used for the DG implementation of
* the Transport simulation
*
* @ingroup TransportModel
*
* @tparam BaseTraits Traits defining domain and range field
* properties of the simulation.
* @tparam GFWaterFluxType Grid Function type of the water flux
......@@ -124,6 +127,8 @@ struct TransportSimulationTraits : public BaseTraits
* @todo Implement adaptivity.
* @todo Implement DG local operator.
*
* @ingroup TransportModel
*
* @tparam TransportSimulationTraits Traits containing the type definitions
* which this class will use.
*/
......
......@@ -11,16 +11,15 @@
#include <sys/stat.h>
#include <sys/types.h>
#include "../interface/transport_simulation.hh"
#include "../interface/transport_simulation.cc"
#include "../solver/util_grid_creator.hh"
#include "../solver/util_grid_creator.hh"
#include <dune/common/exceptions.hh>
#include <dune/common/parametertree.hh>
#include <dune/common/parametertreeparser.hh>
#include <dune/common/parallel/mpihelper.hh>
#include <dune/dorie/common/grid_creator.hh>
#include <dune/dorie/model/transport/transport.hh>
#include <dune/dorie/model/transport/transport.cc>
template<typename Traits>
using Sim = Dune::Dorie::TransportSimulation<Traits>;
......
......@@ -15,10 +15,6 @@ grid.globalIndex = 0
adaptivity.useAdaptivity = false
boundary.file = "{_asset_path}/bcs/infiltration_2d.dat", "{_asset_path}/bcs/infiltration_3d.dat" | expand dim
parameters.file = "{_asset_path}/param/param.yml"
[transport]
output.fileName = test-simulation-dummy-transport | unique
......
......@@ -16,19 +16,22 @@
#include <dune/common/parametertreeparser.hh>
#include <dune/common/parallel/mpihelper.hh>
#include <dune/dorie/interface/coupled_simulation.hh>
// #include <dune/dorie/interface/coupled_simulation.cc> // FIXME
#include <dune/dorie/solver/util_grid_creator.hh>
#include <dune/grid/yaspgrid.hh>
#include <dune/grid/uggrid.hh>
#include <dune/dorie/common/grid_creator.hh>
#include <dune/dorie/common/setup_inifile.hh>
#include <dune/dorie/model/transport/richards_coupling.hh>
template<typename Traits>
using Sim = Dune::Dorie::CoupledSimulation<Traits>;
using Sim = Dune::Dorie::RichardsTransportCouplingSimulation<Traits>;
template<int dim, int Rorder>
using Cube = Dune::Dorie::CoupledSimulationTraits<Dune::Dorie::BaseTraits<Dune::YaspGrid<dim>,
using Cube = Dune::Dorie::RichardsTransportCouplingSimulationTraits<Dune::Dorie::BaseTraits<Dune::YaspGrid<dim>,
Dune::GeometryType::BasicType::cube>,Rorder,0>;
template<int dim, int Rorder>
using CubeAdaptive = Dune::Dorie::CoupledSimulationTraits<Dune::Dorie::BaseTraits<Dune::UGGrid<dim>,
using CubeAdaptive = Dune::Dorie::RichardsTransportCouplingSimulationTraits<Dune::Dorie::BaseTraits<Dune::UGGrid<dim>,
Dune::GeometryType::BasicType::cube>,Rorder,0>;
int main(int argc, char** argv)
......@@ -46,25 +49,24 @@ using CubeAdaptive = Dune::Dorie::CoupledSimulationTraits<Dune::Dorie::BaseTrait
if (argc!=2)
DUNE_THROW(Dune::IOError,
"Call this program with arguments <config>");
const std::string inifilename = argv[1];
Dune::ParameterTree inifile, inifile_richards, inifile_transport;
const std::string config_name = argv[1];
Dune::ParameterTree config;
Dune::ParameterTreeParser ptreeparser;
ptreeparser.readINITree(inifilename,inifile);
inifile_richards = inifile;//.sub("richards"); //FIXME
inifile_transport = inifile.sub("transport");
ptreeparser.readINITree(config_name,config);
// setup richards configuration
Dune::ParameterTree richards_config = Dune::Dorie::Setup::prep_ini_for_richards(config);
Dune::ParameterTree transport_config = Dune::Dorie::Setup::prep_ini_for_transport(config);
// move grid extensions into richards category (needed for reading parameters)
inifile_transport["grid.extensions"] = inifile["grid.extensions"];
// Read necessary variables
const std::string gtype = inifile.get<std::string>("grid.gridType");
const int dim = inifile.get<int>("grid.dimensions");
const bool adaptivity = inifile.get<bool>("adaptivity.useAdaptivity");
const int FEorder_richards = inifile_richards.get<int>("grid.FEorder");
const int verbose = std::max(inifile_richards.get<int>("output.verbose"),inifile_transport.get<int>("output.verbose"));
const std::string outputPath_richards = inifile_richards.get<std::string>("output.outputPath");
const std::string outputPath_transport = inifile_transport.get<std::string>("output.outputPath");
const std::string gtype = config.get<std::string>("grid.gridType");
const int dim = config.get<int>("grid.dimensions");
const bool adaptivity = config.get<bool>("adaptivity.useAdaptivity");
const int FEorder_richards = richards_config.get<int>("numerics.FEorder");
const int verbose = std::max(richards_config.get<int>("output.verbose"),transport_config.get<int>("output.verbose"));
const std::string outputPath_richards = richards_config.get<std::string>("output.outputPath");
const std::string outputPath_transport = transport_config.get<std::string>("output.outputPath");
if (adaptivity)
......@@ -85,11 +87,11 @@ using CubeAdaptive = Dune::Dorie::CoupledSimulationTraits<Dune::Dorie::BaseTrait
Dune::Dorie::AdaptivityPolicy adapt_policy = Dune::Dorie::AdaptivityPolicy::None;
if (helper.rank()==0){
std::cout << "INPUT FILE: " << inifilename << std::endl;
std::cout << "BC FILE RICHARDS: " << inifile_richards.get<std::string>("boundary.file") << std::endl;
std::cout << "OUTPUT PATH RICHARDS: " << inifile_richards.get<std::string>("output.outputPath") << std::endl;
std::cout << "BC FILE TRANSPORT: " << inifile_transport.get<std::string>("boundary.file") << std::endl;
std::cout << "OUTPUT PATH TRANSPORT: " << inifile_transport.get<std::string>("output.outputPath") << std::endl;
std::cout << "INPUT FILE: " << config_name << std::endl;
std::cout << "BC FILE RICHARDS: " << richards_config.get<std::string>("boundary.file") << std::endl;
std::cout << "OUTPUT PATH RICHARDS: " << richards_config.get<std::string>("output.outputPath") << std::endl;
std::cout << "BC FILE TRANSPORT: " << transport_config.get<std::string>("boundary.file") << std::endl;
std::cout << "OUTPUT PATH TRANSPORT: " << transport_config.get<std::string>("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;
......@@ -102,25 +104,25 @@ using CubeAdaptive = Dune::Dorie::CoupledSimulationTraits<Dune::Dorie::BaseTrait
DUNE_THROW(Dune::NotImplemented,"Simplex grid not supported yet!");
}
else if (gtype == "rectangular"){
Dune::Dorie::GridCreator<Dune::YaspGrid<2>> grid_creator(inifile, helper);
Dune::Dorie::GridCreator<Dune::YaspGrid<2>> grid_creator(config, helper);
auto grid_mapper = grid_creator.get_mapper();
switch(FEorder_richards){
case 1:{
Sim<Cube<2,1>> sim(inifile_richards,inifile_transport,grid_mapper,helper);
Sim<Cube<2,1>> sim(richards_config,transport_config,grid_mapper,helper);
sim.set_policy(output_policy);
sim.set_policy(adapt_policy);
sim.run();
break;
}
case 2:{
Sim<Cube<2,2>> sim(inifile_richards,inifile_transport,grid_mapper,helper);
Sim<Cube<2,2>> sim(richards_config,transport_config,grid_mapper,helper);
sim.set_policy(output_policy);
sim.set_policy(adapt_policy);
sim.run();
break;
}
case 3:{
Sim<Cube<2,3>> sim(inifile_richards,inifile_transport,grid_mapper,helper);
Sim<Cube<2,3>> sim(richards_config,transport_config,grid_mapper,helper);
sim.set_policy(output_policy);
sim.set_policy(adapt_policy);
sim.run();
......@@ -140,25 +142,25 @@ using CubeAdaptive = Dune::Dorie::CoupledSimulationTraits<Dune::Dorie::BaseTrait
DUNE_THROW(Dune::NotImplemented,"Simplex grid not supported yet!"