Commit 18726c03 authored by Santiago Ospina's avatar Santiago Ospina

added .cc files to transport

parent a3cf7245
......@@ -2,12 +2,11 @@
#define DUNE_DORIE_DUMMY_TRANSPORT_SIMULATION_HH
#include "../interface/transport_simulation.hh"
#include "../interface/transport_simulation.cc"
#include "../solver/adapters/saturation.hh"
#include "../solver/adapters/water_content.hh"
#include "../solver/adapters/conductivity.hh"
#include <dune/pdelab/adaptivity/adaptivity.hh>
namespace Dune{
namespace Dorie{
......@@ -50,11 +49,11 @@ public:
auto gfWaterFlux = std::make_shared<ConstGridFunctionVector<BaseTraits>>(_grid->leafGridView(),flux);
auto gfSaturation = std::make_shared<ConstGridFunctionScalar<BaseTraits>>(_grid->leafGridView(),sat);
this->setWaterFlux(interval,gfWaterFlux);
this->setSaturation(interval,gfSaturation);
this->set_waterflux(interval,gfWaterFlux);
this->set_saturation(interval,gfSaturation);
// Write the flux and saturation for comparison
if (output_policy() != OutputPolicy::None)
if (this->output_policy() != OutputPolicy::None)
{
const int subsamling_lvl = _inifile.get<int>("output.subsamplingLevel", 0);
const auto subsamling_intervals = Dune::refinementLevels(subsamling_lvl);
......
......@@ -9,21 +9,20 @@
#include <dune/common/parametertreeparser.hh>
#include <dune/common/parallel/mpihelper.hh>
#include <dune/pdelab/function/callableadapter.hh>
#include "interface/coupled_simulation.hh"
#include "interface/coupled_simulation.cc" // FIXME
#include "solver/util_grid_creator.hh"
template<typename Traits>
using Sim = Dune::Dorie::CoupledSimulation<Traits>;
template<int dim>
template<int dim, int Rorder>
using Cube = Dune::Dorie::CoupledSimulationTraits<Dune::Dorie::BaseTraits<Dune::YaspGrid<dim>,
Dune::GeometryType::BasicType::cube>,1,0>;
Dune::GeometryType::BasicType::cube>,Rorder,0>;
template<int dim>
template<int dim, int Rorder>
using CubeAdaptive = Dune::Dorie::CoupledSimulationTraits<Dune::Dorie::BaseTraits<Dune::UGGrid<dim>,
Dune::GeometryType::BasicType::cube>,1,0>;
Dune::GeometryType::BasicType::cube>,Rorder,0>;
int main(int argc, char** argv)
{
......@@ -61,8 +60,8 @@ using CubeAdaptive = Dune::Dorie::CoupledSimulationTraits<Dune::Dorie::BaseTrait
const std::string outputPath_transport = inifile_transport.get<std::string>("output.outputPath");
const bool adaptivity = inifile_richards.get<bool>("adaptivity.useAdaptivity") | inifile_transport.get<bool>("adaptivity.useAdaptivity");
// if (adaptivity)
// DUNE_THROW(Dune::NotImplemented,"Adaptivity is not supported for transport simulation!");
if (adaptivity)
DUNE_THROW(Dune::NotImplemented,"Adaptivity is not supported for transport simulation yet!");
if (FEorder_transport)
DUNE_THROW(Dune::NotImplemented,"Finite Element Order (grid.FEorder) not supported for transport model yet!");
......@@ -97,51 +96,80 @@ using CubeAdaptive = Dune::Dorie::CoupledSimulationTraits<Dune::Dorie::BaseTrait
if (dim==2)
{
if (gtype == "rectangular")
{
if (gtype == "gmsh"){
DUNE_THROW(Dune::NotImplemented,"Simplex grid not supported yet!");
}
else if (gtype == "rectangular"){
if(adaptivity){
DUNE_THROW(Dune::NotImplemented,"Adaptivity not supported yet!");
// auto grid = Dune::Dorie::build_grid_cube<Dune::UGGrid<2>>(inifile_richards,helper); // FIXME
// Sim<CubeAdaptive<2>> sim(helper,grid,inifile_richards,inifile_transport);
// sim.run();
}else{
auto grid = Dune::Dorie::build_grid_cube<Dune::YaspGrid<2>>(inifile_richards,helper); // FIXME
Sim<Cube<2>> sim(helper,grid,inifile_richards,inifile_transport);
// sim.set_policy(Dune::Dorie::OutputPolicy::All);
sim.run();
}
else{ // no adaptivity
auto grid = Dune::Dorie::build_grid_cube<Dune::YaspGrid<2>>(inifile_richards,helper);
switch(FEorder_richards){
case 1:{
Sim<Cube<2,1>> sim(helper,grid,inifile_richards,inifile_transport);
sim.run();
break;
}
case 2:{
Sim<Cube<2,2>> sim(helper,grid,inifile_richards,inifile_transport);
sim.run();
break;
}
case 3:{
Sim<Cube<2,3>> sim(helper,grid,inifile_richards,inifile_transport);
}
default:
DUNE_THROW(Dune::NotImplemented,"Finite Element Order (grid.FEorder) not supported!");
}
}
}
else
{
DUNE_THROW(Dune::NotImplemented,"Grid Type not supported!");
}
}
}
else if (dim==3)
else if (dim==3)
{
if (gtype == "rectangular")
{
if (gtype == "gmsh"){
DUNE_THROW(Dune::NotImplemented,"Simplex grid not supported yet!");
}
else if (gtype == "rectangular"){
if(adaptivity){
DUNE_THROW(Dune::NotImplemented,"Adaptivity not supported yet!");
// auto grid = Dune::Dorie::build_grid_cube<Dune::UGGrid<3>>(inifile_richards,helper); // FIXME
// Sim<CubeAdaptive<3>> sim(helper,grid,inifile_richards,inifile_transport);
// sim.run();
}else{
auto grid = Dune::Dorie::build_grid_cube<Dune::YaspGrid<3>>(inifile_richards,helper); // FIXME
Sim<Cube<3>> sim(helper,grid,inifile_richards,inifile_transport);
// sim.set_policy(Dune::Dorie::OutputPolicy::All);
sim.run();
}
else{ // no adaptivity
auto grid = Dune::Dorie::build_grid_cube<Dune::YaspGrid<3>>(inifile_richards,helper);
switch(FEorder_richards){
case 1:{
Sim<Cube<3,1>> sim(helper,grid,inifile_richards,inifile_transport);
sim.run();
break;
}
case 2:{
Sim<Cube<3,2>> sim(helper,grid,inifile_richards,inifile_transport);
sim.run();
break;
}
case 3:{
Sim<Cube<3,3>> sim(helper,grid,inifile_richards,inifile_transport);
sim.run();
break;
}
default:
DUNE_THROW(Dune::NotImplemented,"Finite Element Order (grid.FEorder) not supported!");
}
}
}
else
{
DUNE_THROW(Dune::NotImplemented,"Grid Type not supported!");
}
}
else // grid_dim != 2,3
{
// grid_dim != 2,3
else{
DUNE_THROW(Dune::NotImplemented,"Number of dimensions (grid.dimensions) not supported!");
}
if(helper.rank()==0){
std::cout << "PROGRAM TERMINATED SUCCESSFULLY" << std::endl;
std::cout << "::: Execution time "
......
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