Commit 8363ffc4 authored by Lukas Riedel's avatar Lukas Riedel 📝

[cleanup] removed sim.cc

parent 7c5abe96
......@@ -3,7 +3,4 @@ add_subdirectory(solver)
add_subdirectory(impl)
add_executable("dorie" dorie.cc)
dune_target_link_libraries(dorie doriesim)
add_executable("sim" EXCLUDE_FROM_ALL sim.cc)
target_link_dune_default_libraries(sim)
\ No newline at end of file
dune_target_link_libraries(dorie doriesim)
\ No newline at end of file
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <dune/dorie/dorie.hh>
#include <dune/dorie/interface/simulation.cc>
template<int dim>
using YaspGrid = Dune::YaspGrid<dim>;
int main(int argc, char **argv)
{
try{
//Initialize Mpi
Dune::MPIHelper& helper = Dune::MPIHelper::instance(argc, argv);
// Read ini file
if (argc!=2)
DUNE_THROW(Dune::IOError,"No parameter file specified!");
const std::string inifilename = argv[1];
Dune::ParameterTree inifile;
Dune::ParameterTreeParser ptreeparser;
ptreeparser.readINITree(inifilename,inifile);
// Read necessary variables
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 bool adaptivity = inifile.get<bool>("adaptivity.useAdaptivity");
auto yasp_grid = Dune::Dorie::build_grid_cube<Dune::YaspGrid<2>>(inifile,helper);
auto ug_grid = Dune::Dorie::build_grid_cube<Dune::UGGrid<2>>(inifile,helper);
Dune::Dorie::Simulation<Dune::Dorie::BaseTraits<YaspGrid,Dune::GeometryType::BasicType::cube,2,1,true,false>> sim(helper,yasp_grid,inifile);
//sim.run();
Dune::Dorie::KnoFuInterface<Dune::Dorie::BaseTraits<Dune::UGGrid,Dune::GeometryType::BasicType::cube,2,2,true,false>> kfs(helper,ug_grid,inifile);
//kfs.run();
/*
Dune::Dorie::KnoFuSim<Dune::Dorie::BaseTraits<Dune::UGGrid,Dune::GeometryType::BasicType::cube,2,1>> kfs(helper,ug_grid,inifile);
*/
kfs.solution_to_water_content();
auto start = kfs.cache_water_content();
Dune::FieldVector<double,2> pos1({0.5,1.8});
Dune::FieldVector<double,2> pos2({0.5,0.2});
auto obs = kfs.observation_operator(pos2);
obs = kfs.observation_operator(pos1);
double val = .0;
for(std::size_t i=0; i<obs.size(); ++i){
val += start[i]*obs[i];
}
std::cout << "value = " << val << std::endl;
for(int i=0; i<20; i++){
kfs.compute_time_step();
kfs.solution_to_water_content();
start = kfs.cache_water_content();
double val = .0;
for(std::size_t i=0; i<obs.size(); ++i){
val += start[i]*obs[i];
}
std::cout << "value = " << val << std::endl;
}
//auto stop = kfs.propagate(start,1.0E4,2.0E4);
//Dune::Dorie::SimpleSimulation<Dune::Dorie::BaseTraits<YaspGrid,Dune::GeometryType::BasicType::cube,2,1>> sim1(helper,yasp_grid,inifile);
//sim1.run();
//Dune::Dorie::AdaptiveSimulation<Dune::Dorie::BaseTraits<Dune::UGGrid,Dune::GeometryType::BasicType::cube,2,1>> sim2(helper,ug_grid,inifile);
//sim2.run();
return 0;
}
catch(Dune::Exception& e)
{
std::cerr << e << std::endl;
throw;
}
catch(...)
{
throw;
}
//Simulation<Dune::Dorie::BaseTraits<YaspGrid,Dune::GeometryType::BasicType::cube,3,3>> sim2;
}
\ 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