Commit 6977b959 authored by Lukas Riedel's avatar Lukas Riedel

major folder restructuring. dorie-rfg remains untouched

* defined top-level headers for easy file includes
* moved previous header files into 'solver' subfolder
* moved Simulation headers and implementations into 'interface' subfolder
* moved library instantiations into 'impl' subfolder
parent 52d75a46
add_subdirectory(dorie)
add_subdirectory(dorie-rfg)
add_subdirectory(interface EXCLUDE_FROM_ALL)
\ No newline at end of file
add_subdirectory(dorie-rfg)
\ No newline at end of file
add_subdirectory("impl")
add_subdirectory("interface")
\ No newline at end of file
#ifndef DORIE_HH
#define DORIE_HH
//#pragma GCC system_header
#ifndef DUNE_DORIE_HH
#define DUNE_DORIE_HH
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <math.h>
#include <iostream>
#include <vector>
#include <map>
......@@ -22,47 +19,39 @@
#include <unistd.h>
#include <hdf5.h>
#include <dune/grid/uggrid.hh>
#include <dune/common/fvector.hh>
#include <dune/common/fmatrix.hh>
#include <dune/common/ios_state.hh>
#include <dune/common/parallel/mpihelper.hh>
#include <dune/common/exceptions.hh>
#include <dune/common/fvector.hh>
#include <dune/common/timer.hh>
#include <dune/common/parametertreeparser.hh>
#include <dune/common/std/memory.hh>
#include <dune/grid/uggrid.hh>
#include <dune/grid/yaspgrid.hh>
#include <dune/grid/io/file/vtk/vtksequencewriter.hh>
#include <dune/grid/io/file/gmshreader.hh>
#include <dune/grid/utility/structuredgridfactory.hh>
#include <dune/istl/bvector.hh>
#include <dune/istl/operators.hh>
#include <dune/istl/solvers.hh>
#include <dune/istl/preconditioners.hh>
#include <dune/istl/io.hh>
#include <dune/istl/superlu.hh>
#include <dune/istl/owneroverlapcopy.hh>
#include <dune/pdelab/newton/newton.hh>
#include <dune/geometry/type.hh>
#include <dune/pdelab/adaptivity/adaptivity.hh>
#include <dune/pdelab/backend/istl.hh>
#include <dune/pdelab/backend/interface.hh>
#include <dune/pdelab/common/function.hh>
#include <dune/pdelab/common/vtkexport.hh>
#include <dune/pdelab/finiteelementmap/qkfem.hh>
#include <dune/pdelab/finiteelementmap/p0fem.hh>
#include <dune/pdelab/finiteelementmap/pkfem.hh>
#include <dune/pdelab/finiteelementmap/qkdg.hh>
#include <dune/pdelab/constraints/p0.hh>
#include <dune/pdelab/constraints/p0ghost.hh>
#include <dune/pdelab/constraints/common/constraints.hh>
#include <dune/pdelab/constraints/conforming.hh>
#include <dune/pdelab/finiteelementmap/qkdg.hh>
#include <dune/pdelab/finiteelementmap/pkfem.hh>
#include <dune/pdelab/gridfunctionspace/gridfunctionspace.hh>
#include <dune/pdelab/gridfunctionspace/gridfunctionspaceutilities.hh>
#include <dune/pdelab/gridfunctionspace/genericdatahandle.hh>
#include <dune/pdelab/gridfunctionspace/interpolate.hh>
#include <dune/pdelab/gridfunctionspace/vtk.hh>
#include <dune/pdelab/gridfunctionspace/subspace.hh>
#include <dune/pdelab/gridoperator/gridoperator.hh>
#include <dune/pdelab/gridoperator/onestep.hh>
#include <dune/pdelab/backend/istl.hh>
#include <dune/pdelab/backend/interface.hh>
#include <dune/pdelab/stationary/linearproblem.hh>
#include <dune/pdelab/instationary/onestep.hh>
#include <dune/pdelab/adaptivity/adaptivity.hh>
#include <dune/pdelab/newton/newton.hh>
#include <dune/pdelab/stationary/linearproblem.hh>
#include <dune/dorie/solver.hh>
#include <dune/dorie/interface.hh>
#endif // DORIE_HH
#endif // DUNE_DORIE_HH
add_executable("sim" sim.cc)
dune_add_library(simulations OBJECT
sim_ug_2_1.cc
sim_ug_2_2.cc
......@@ -12,6 +10,4 @@ dune_add_library(simulations OBJECT
sim_yasp_2_3.cc
sim_yasp_3_1.cc
sim_yasp_3_2.cc
sim_yasp_3_3.cc)
dune_target_link_libraries(sim doriesim)
#target_link_dune_default_libraries("sim")
\ No newline at end of file
sim_yasp_3_3.cc)
\ No newline at end of file
#ifndef DUNE_DORIE_SIMULATION_HH
#define DUNE_DORIE_SIMULATION_HH
#include "simulation_base.hh"
#include "adaptivity.hh"
#include "output.hh"
#ifndef DUNE_DORIE_IMPL_HH
#define DUNE_DORIE_IMPL_HH
namespace Dune{
namespace Dorie{
template<typename Traits>
class AdaptiveSimulation :
public AdaptivityHandler<Traits>,
public OutputWriter<Traits>
{
private:
using Grid = typename Traits::Grid;
public:
/// Set up the simulation. Call base class constructors
AdaptiveSimulation (Dune::MPIHelper& _helper, std::shared_ptr<Grid> _grid, Dune::ParameterTree& _inifile);
/// Perform the simulation.
/** Compute a time step, adapt the grid locally, and write the VTK output
*/
void run () override;
};
template<typename Traits>
class SimpleSimulation :
public OutputWriter<Traits>
{
private:
using Grid = typename Traits::Grid;
public:
/// Set up the simulation. Call base class constructors
SimpleSimulation (Dune::MPIHelper& _helper, std::shared_ptr<Grid> _grid, Dune::ParameterTree& _inifile);
/// Perform the simulation.
/** Compute a time step, adapt the grid locally, and write the VTK output
*/
void run () override;
};
// forward declare templates
template<int dim>
using YaspGrid = Dune::YaspGrid<dim>;
// --- Forward declare templates ---
extern template class AdaptiveSimulation<BaseTraits<Dune::UGGrid,Dune::GeometryType::BasicType::cube,2,1>>;
extern template class AdaptiveSimulation<BaseTraits<Dune::UGGrid,Dune::GeometryType::BasicType::cube,2,2>>;
extern template class AdaptiveSimulation<BaseTraits<Dune::UGGrid,Dune::GeometryType::BasicType::cube,2,3>>;
......@@ -61,9 +19,7 @@ extern template class SimpleSimulation<BaseTraits<YaspGrid,Dune::GeometryType::B
extern template class SimpleSimulation<BaseTraits<YaspGrid,Dune::GeometryType::BasicType::cube,3,2>>;
extern template class SimpleSimulation<BaseTraits<YaspGrid,Dune::GeometryType::BasicType::cube,3,3>>;
}
}
} // namespace Dorie
} // namespace Dune
#endif // DUNE_DORIE_SIMULATION_HH
\ No newline at end of file
#endif // DUNE_DORIE_IMPL_HH
#include "dorie.hh"
#include "simulation.cc"
#include "output.cc"
#include "simulation_base.cc"
#include "adaptivity.cc"
#include <dune/dorie/dorie.hh>
#include <dune/dorie/impl/impl.hh>
#include <dune/dorie/interface_sources.hh>
namespace Dune{
namespace Dorie{
......
#include "dorie.hh"
#include "simulation.cc"
#include "output.cc"
#include "simulation_base.cc"
#include "adaptivity.cc"
#include <dune/dorie/dorie.hh>
#include <dune/dorie/impl/impl.hh>
#include <dune/dorie/interface_sources.hh>
namespace Dune{
namespace Dorie{
......
#include "dorie.hh"
#include "simulation.cc"
#include "output.cc"
#include "simulation_base.cc"
#include "adaptivity.cc"
#include <dune/dorie/dorie.hh>
#include <dune/dorie/impl/impl.hh>
#include <dune/dorie/interface_sources.hh>
namespace Dune{
namespace Dorie{
......
#include "dorie.hh"
#include "simulation.cc"
#include "output.cc"
#include "simulation_base.cc"
#include "adaptivity.cc"
#include <dune/dorie/dorie.hh>
#include <dune/dorie/impl/impl.hh>
#include <dune/dorie/interface_sources.hh>
namespace Dune{
namespace Dorie{
......
#include "dorie.hh"
#include "simulation.cc"
#include "output.cc"
#include "simulation_base.cc"
#include "adaptivity.cc"
#include <dune/dorie/dorie.hh>
#include <dune/dorie/impl/impl.hh>
#include <dune/dorie/interface_sources.hh>
namespace Dune{
namespace Dorie{
......
#include "dorie.hh"
#include "simulation.cc"
#include "output.cc"
#include "simulation_base.cc"
#include "adaptivity.cc"
#include <dune/dorie/dorie.hh>
#include <dune/dorie/impl/impl.hh>
#include <dune/dorie/interface_sources.hh>
namespace Dune{
namespace Dorie{
......
#include "dorie.hh"
#include "simulation.cc"
#include "output.cc"
#include "simulation_base.cc"
#include <dune/dorie/dorie.hh>
#include <dune/dorie/impl/impl.hh>
#include <dune/dorie/interface_sources.hh>
namespace Dune{
namespace Dorie{
......
#include "dorie.hh"
#include "simulation.cc"
#include "output.cc"
#include "simulation_base.cc"
#include <dune/dorie/dorie.hh>
#include <dune/dorie/impl/impl.hh>
#include <dune/dorie/interface_sources.hh>
namespace Dune{
namespace Dorie{
......
#include "dorie.hh"
#include "simulation.cc"
#include "output.cc"
#include "simulation_base.cc"
#include <dune/dorie/dorie.hh>
#include <dune/dorie/impl/impl.hh>
#include <dune/dorie/interface_sources.hh>
namespace Dune{
namespace Dorie{
......
#include "dorie.hh"
#include "simulation.cc"
#include "output.cc"
#include "simulation_base.cc"
#include <dune/dorie/dorie.hh>
#include <dune/dorie/impl/impl.hh>
#include <dune/dorie/interface_sources.hh>
namespace Dune{
namespace Dorie{
......
#include "dorie.hh"
#include "simulation.cc"
#include "output.cc"
#include "simulation_base.cc"
#include <dune/dorie/dorie.hh>
#include <dune/dorie/impl/impl.hh>
#include <dune/dorie/interface_sources.hh>
namespace Dune{
namespace Dorie{
......
#include "dorie.hh"
#include "simulation.cc"
#include "output.cc"
#include "simulation_base.cc"
#include <dune/dorie/dorie.hh>
#include <dune/dorie/impl/impl.hh>
#include <dune/dorie/interface_sources.hh>
namespace Dune{
namespace Dorie{
......
#ifndef DUNE_DORIE_INTERFACE_HH
#define DUNE_DORIE_INTERFACE_HH
#include <dune/dorie/interface/util.hh>
#include <dune/dorie/interface/simulation_base.hh>
#include <dune/dorie/interface/adaptivity.hh>
#include <dune/dorie/interface/output.hh>
#include <dune/dorie/interface/simulation.hh>
#endif // DUNE_DORIE_INTERFACE_HH
add_executable("sim" sim.cc)
dune_target_link_libraries(sim doriesim)
\ No newline at end of file
#ifndef DUNE_DORIE_ADAPTIVITY_HH
#define DUNE_DORIE_ADAPTIVITY_HH
#include "simulation_base.hh"
namespace Dune{
namespace Dorie{
......
#ifndef DUNE_DORIE_OUTPUT_WRITER_HH
#define DUNE_DORIE_OUTPUT_WRITER_HH
#include "simulation_base.hh"
namespace Dune{
namespace Dorie{
......
#include "simulation_base.hh"
#include "adaptivity.hh"
#include "output.hh"
#include "simulation.hh"
//template<int dim>
//using YaspGrid = Dune::YaspGrid<dim>;
#include <dune/dorie/dorie.hh>
int main(int argc, char **argv)
{
......
#ifndef DUNE_DORIE_SIMULATION_HH
#define DUNE_DORIE_SIMULATION_HH
namespace Dune{
namespace Dorie{
template<typename Traits>
class AdaptiveSimulation :
public AdaptivityHandler<Traits>,
public OutputWriter<Traits>
{
private:
using Grid = typename Traits::Grid;
public:
/// Set up the simulation. Call base class constructors
AdaptiveSimulation (Dune::MPIHelper& _helper, std::shared_ptr<Grid> _grid, Dune::ParameterTree& _inifile);
/// Perform the simulation.
/** Compute a time step, adapt the grid locally, and write the VTK output
*/
void run () override;
};
template<typename Traits>
class SimpleSimulation :
public OutputWriter<Traits>
{
private:
using Grid = typename Traits::Grid;
public:
/// Set up the simulation. Call base class constructors
SimpleSimulation (Dune::MPIHelper& _helper, std::shared_ptr<Grid> _grid, Dune::ParameterTree& _inifile);
/// Perform the simulation.
/** Compute a time step, adapt the grid locally, and write the VTK output
*/
void run () override;
};
} // namespace Dorie
} // namespace Dune
#endif // DUNE_DORIE_SIMULATION_HH
\ No newline at end of file
#ifndef DUNE_DORIE_SIMULATION_BASE_HH
#define DUNE_DORIE_SIMULATION_BASE_HH
#include "util.hh"
namespace Dune{
namespace Dorie{
......
......@@ -4,6 +4,13 @@
namespace Dune{
namespace Dorie{
/// Declare template for usage in the Traits template
/** It looks stupid, but YaspGrid has a second template parameter
* which is deduced automatically this way.
*/
template<int dim>
using YaspGrid = Dune::YaspGrid<dim>;
/// Return the estimation of entries per matrix row for the spatial GridOperator.
/** This supposedly decreases matrix assembly time.
* The values are empirical. The actual matrix statistics can be displayed
......
#ifndef DUNE_DORIE_INTERFACE_SRC_HH
#define DUNE_DORIE_INTERFACE_SRC_HH
#include <dune/dorie/interface/simulation_base.cc>
#include <dune/dorie/interface/adaptivity.cc>
#include <dune/dorie/interface/output.cc>
#include <dune/dorie/interface/simulation.cc>
#endif // DUNE_DORIE_INTERFACE_SRC_HH
This diff is collapsed.
#ifndef DUNE_DORIE_SOLVER_PREP_HH
#define DUNE_DORIE_SOLVER_PREP_HH
/// Define Grid Function Spaces for a simplex grid and call the Richards Solver Routine
/**
* \tparam RF Solution data type
* \tparam k Finite element order
* \param grid Shared pointer to the grid
* \param gv GridView
* \param inifile Parameter file reader
*/
template<typename RF, int k, typename GridType, typename GV>
void RichardsSolverSimplex (GridType grid, GV& gv, Dune::ParameterTree& inifile, Dune::MPIHelper& helper)
{
typedef typename GV::Grid::ctype DF;
enum { dim = GV::dimension };
// Create GFS for solving the problem
typedef Dune::PDELab::PkLocalFiniteElementMap<GV,DF,RF,k> FEM;
typedef Dune::PDELab::GridFunctionSpace<GV,FEM,
Dune::PDELab::NoConstraints,
Dune::PDELab::istl::VectorBackend<Dune::PDELab::istl::Blocking::fixed> >
GFS;
FEM fem(gv);
GFS gfs(gv,fem);
// Create GFS for adaptivity
typedef Dune::PDELab::P0LocalFiniteElementMap<DF,RF,dim> AFEM;
typedef Dune::PDELab::GridFunctionSpace<GV,AFEM,
Dune::PDELab::NoConstraints,
Dune::PDELab::istl::VectorBackend<Dune::PDELab::istl::Blocking::fixed> >
AGFS;
AFEM afem(Dune::GeometryType(Dune::GeometryType::simplex,dim));
typedef Dune::Dorie::Traits<GFS,AGFS> T;
RichardsSolver<T>(grid,gv,gfs,afem,inifile,helper);
}
/// Define Grid Function Spaces for a rectangular grid and call the Richards Solver Routine
/**
* \tparam RF Solution data type
* \tparam k Finite element order
* \param grid Shared pointer to the grid
* \param gv GridView
* \param inifile Parameter file reader
*/
template<typename RF, int k, typename GridType, typename GV>
void RichardsSolverRectangular (GridType grid, GV& gv, Dune::ParameterTree& inifile, Dune::MPIHelper& helper)
{
typedef typename GV::Grid::ctype DF;
enum { dim = GV::dimension };
// Create GFS for solving the problem
typedef Dune::PDELab::QkDGLocalFiniteElementMap<DF,RF,k,dim> FEM;
typedef Dune::PDELab::GridFunctionSpace<GV,FEM,
Dune::PDELab::NoConstraints,
Dune::PDELab::istl::VectorBackend<Dune::PDELab::istl::Blocking::fixed,
Dune::QkStuff::QkSize<k,dim>::value> >
GFS;
FEM fem;
GFS gfs(gv,fem);
// Create GFS for adaptivity
typedef Dune::PDELab::QkDGLocalFiniteElementMap<DF,RF,0,dim> AFEM;
typedef Dune::PDELab::GridFunctionSpace<GV,AFEM,
Dune::PDELab::NoConstraints,
Dune::PDELab::istl::VectorBackend<Dune::PDELab::istl::Blocking::fixed,
Dune::QkStuff::QkSize<0,dim>::value> >
AGFS;
AFEM afem;
typedef Dune::Dorie::Traits<GFS,AGFS> T;
RichardsSolver<T>(grid,gv,gfs,afem,inifile,helper);
}
#endif
#ifndef DORIE_HH
#define DORIE_HH
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <stdlib.h>
#include <fstream>
#include <cmath>
#include <memory>
#include <utility>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <hdf5.h>
#include <dune/common/fvector.hh>
#include <dune/common/fmatrix.hh>
#include <dune/common/ios_state.hh>
#include <dune/common/parallel/mpihelper.hh>
#include <dune/common/exceptions.hh>
#include <dune/common/timer.hh>
#include <dune/common/parametertreeparser.hh>
#include <dune/grid/uggrid.hh>
#include <dune/grid/yaspgrid.hh>
#include <dune/grid/io/file/vtk/vtksequencewriter.hh>
#include <dune/grid/io/file/gmshreader.hh>
#include <dune/grid/utility/structuredgridfactory.hh>
#include <dune/geometry/type.hh>
#include <dune/pdelab/adaptivity/adaptivity.hh>
#include <dune/pdelab/backend/istl.hh>
#include <dune/pdelab/backend/interface.hh>
#include <dune/pdelab/common/function.hh>
#include <dune/pdelab/constraints/p0.hh>
#include <dune/pdelab/constraints/p0ghost.hh>
#include <dune/pdelab/constraints/common/constraints.hh>
#include <dune/pdelab/finiteelementmap/qkdg.hh>
#include <dune/pdelab/finiteelementmap/pkfem.hh>
#include <dune/pdelab/gridfunctionspace/gridfunctionspace.hh>
#include <dune/pdelab/gridoperator/gridoperator.hh>
#include <dune/pdelab/gridoperator/onestep.hh>
#include <dune/pdelab/instationary/onestep.hh>
#include <dune/pdelab/newton/newton.hh>
#include <dune/pdelab/stationary/linearproblem.hh>
#include <dune/dorie/util_typedefs.hh>
#include <dune/dorie/util_vtk_adapters.hh>
#include <dune/dorie/util_grid_creator.hh>
#include <dune/dorie/util_boundary_condition.hh>
#include <dune/dorie/util_controller.hh>
#include <dune/dorie/util_adaptivity.hh>
#include <dune/dorie/util_h5tools.hh>
#include <dune/dorie/richards_initial.hh>
#include <dune/dorie/richards_boundary.hh>
#include <dune/dorie/richards_source.hh>
#include <dune/dorie/util_interpolator.hh>
#include <dune/dorie/param_base.hh>
#include <dune/dorie/param_van_genuchten.hh>
#include <dune/dorie/param_factory.hh>
#include <dune/dorie/operator_DG.hh>
#include <dune/dorie/operator_error_indicator.hh>
#include <dune/dorie/dune_implicitonestep.hh>
#include "util.hh"
#include "simulation_base.hh"
#include "adaptivity.hh"
#include "output.hh"
#include "simulation.hh"
#endif // DORIE_HH
// -*- tab-width: 2; indent-tabs-mode: nil -*-
#include <dune/interface/dorie.hh> // System and DUNE Headers
#include <dune/dorie/dorie.hh> // System and DUNE Headers
//===============================================================
// Main program with grid setup
......
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