Commit e4145e9e authored by Santiago Ospina's avatar Santiago Ospina

update transport test to new parametrization files

parent 840bf3a7
......@@ -5,10 +5,13 @@ namespace Dorie{
template<typename Traits>
TransportSimulation<Traits>::TransportSimulation(
Dune::MPIHelper& _helper,
std::shared_ptr<Grid> _grid,
Dune::ParameterTree& _inifile)
: helper(_helper), grid(_grid), inifile(_inifile), gv(grid->leafGridView())
Dune::ParameterTree& _inifile,
std::shared_ptr<GridMapper> _grid_mapper,
Dune::MPIHelper& _helper
) : helper(_helper)
, grid(_grid_mapper->get_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"))
......
......@@ -18,14 +18,12 @@
#include "util.hh"
#include "adaptivity.hh"
#include "simulation_base.hh"
#include "../solver/util_interpolator.hh"
#include "../solver/param_base.hh"
#include "../solver/param_factory.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"
namespace Dune{
namespace Dorie{
......@@ -67,7 +65,9 @@ struct TransportSimulationTraits : public BaseTraits
/// GFS Constraints Container
using CC = typename GFSHelper::CC;
// -- D/*ORiE Class Definitions -- //
// -- DORiE Class Definitions -- //
/// Wrapper for grid and volume & boundary mappings
using GridMapper = Dune::Dorie::GridMapper<typename BaseTraits::Grid>;
/// Class defining boundary conditions
using SoluteBoundary = Dune::Dorie::SoluteBoundary<BaseTraits>;
/// Class defining source terms
......@@ -152,6 +152,8 @@ protected:
using CC = typename Traits::CC;
// -- D/*ORiE Class Definitions -- //
/// Wrapper for grid and volume & boundary mappings
using GridMapper = typename Traits::GridMapper;
/// Class defining boundary conditions
using SoluteBoundary = typename Traits::SoluteBoundary;
/// Class defining source terms
......@@ -241,16 +243,17 @@ protected:
bool operator_setup_flag = true;
public:
/// Construct basic simulation. Prepare setup for basic simulation.
/**
* \param _helper Dune MPI instance controller
* \param _grid Shared pointer to the grid
* \param _inifile Dune parameter file parser
/*------------------------------------------------------------------------*//**
* @brief Construct basic simulation. Prepare setup for basic simulation.
*
* @param _grid_mapper Mapper for grid and volume/boundary data
* @param _helper Dune MPI instance controller
* @param _inifile Dune parameter file parser
*/
TransportSimulation(
Dune::MPIHelper& _helper,
std::shared_ptr<Grid> _grid,
Dune::ParameterTree& _inifile
TransportSimulation (
Dune::ParameterTree& _inifile,
std::shared_ptr<GridMapper> _grid_mapper,
Dune::MPIHelper& _helper
);
// TODO: Define data exchange with richards
......
......@@ -4,9 +4,17 @@
#include "config.h"
#endif
#include <string>
#include <iostream>
#include <cstdio>
#include <unistd.h>
#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>
......@@ -92,10 +100,11 @@ int main(int argc, char** argv) {
{
if (gtype == "rectangular")
{
auto grid = Dune::Dorie::build_grid_cube<Dune::YaspGrid<2>>(inifile,helper);
Dune::Dorie::GridCreator<Dune::YaspGrid<2>> grid_creator(inifile, helper);
auto grid_mapper = grid_creator.get_mapper();
using Traits = Cube<2>;
Sim<Traits> sim(helper,grid,inifile_transport);
Sim<Traits> sim(inifile_transport,grid_mapper,helper);
typename Traits::Vector flux;
typename Traits::Scalar sat;
......@@ -106,6 +115,8 @@ int main(int argc, char** argv) {
using GFFlux = typename Traits::GFWaterFlux;
using GFSat = typename Traits::GFSaturation;
auto grid = grid_mapper->get_grid();
auto gfFlux = std::make_shared<GFFlux>(grid->leafGridView(),flux);
auto gfSat = std::make_shared<GFSat>(grid->leafGridView(),sat);
......@@ -123,10 +134,11 @@ int main(int argc, char** argv) {
{
if (gtype == "rectangular")
{
auto grid = Dune::Dorie::build_grid_cube<Dune::YaspGrid<3>>(inifile,helper);
Dune::Dorie::GridCreator<Dune::YaspGrid<3>> grid_creator(inifile, helper);
auto grid_mapper = grid_creator.get_mapper();
using Traits = Cube<3>;
Sim<Traits> sim(helper,grid,inifile_transport);
Sim<Traits> sim(inifile_transport,grid_mapper,helper);
typename Traits::Vector flux;
typename Traits::Scalar sat;
......@@ -134,6 +146,8 @@ int main(int argc, char** argv) {
flux[dim-1] = inifile.get<double>("_constantWater.flux",-5.5e-8);
sat = inifile.get<double>("_constantWater.saturation",1.);
auto grid = grid_mapper->get_grid();
using GFFlux = typename Traits::GFWaterFlux;
using GFSat = typename Traits::GFSaturation;
......
......@@ -7,20 +7,29 @@ _asset_path = "${CMAKE_CURRENT_LIST_DIR}/../../../test/"
grid.gridType = rectangular
grid.initialLevel = 0
grid.cells = 40 40
grid.cells = 40 40
grid.mappingFile = none
grid.globalIndex = 0
adaptivity.useAdaptivity = false
transport.output.fileName = test-simulation-dummy-transport | unique
transport.output.outputPath = test-simulation-dummy-transport | unique
transport.output.verbose = 0
boundary.file = "{_asset_path}/bcs/infiltration_2d.dat"
parameters.file = "{_asset_path}/param/param.yml"
[transport]
output.fileName = test-simulation-dummy-transport | unique
output.outputPath = test-simulation-dummy-transport | unique
output.verbose = 0
transport.boundary.file = "{_asset_path}/bcs/solute_2d.dat"
boundary.file = "{_asset_path}/bcs/solute_2d.dat"
transport.parameters.molecularDifussion = 2E-9, 0 | expand prec
parameters.molecularDifussion = 2E-9, 0 | expand prec
transport.time.end = 1E8
transport.time.maxTimestep = 1E7
transport.time.startTimestep = 1E4
time.end = 1E8
time.maxTimestep = 1E7
time.startTimestep = 1E4
transport.numerics.timestepMethod = alex2
\ No newline at end of file
numerics.timestepMethod = alex2
\ No newline at end of file
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