Commit 5ed38a45 authored by Lukas Riedel's avatar Lukas Riedel 📝

adapted to PDELab interface changes since 2.4. integrated dune-uggrid

parent b44dc25c
......@@ -5,7 +5,6 @@ FIND_PACKAGE(HDF5 REQUIRED COMPONENTS C)
FIND_PACKAGE(FFTW REQUIRED)
FIND_PACKAGE(SuperLU REQUIRED)
FIND_PACKAGE(MPI REQUIRED)
FIND_PACKAGE(UG REQUIRED)
FIND_PACKAGE(METIS)
FIND_PACKAGE(ParMETIS)
......
......@@ -7,5 +7,5 @@ Module: dorie
Version: 0.9
Maintainer: dorieteam@iup.uni-heidelberg.de
#depending on
Depends: dune-common dune-geometry dune-grid dune-istl dune-localfunctions dune-typetree dune-pdelab dune-python
Depends: dune-python dune-uggrid dune-pdelab
Suggests: dune-testtools
......@@ -114,7 +114,7 @@ int main(int argc, char** argv)
if (dim==2)
{
typedef Dune::UGGrid<2> GridType;
typedef GridType::Partition<Dune::All_Partition>::LeafGridView GV;
typedef GridType::LeafGridView GV;
if (gtype == "gmsh"){
auto grid = Dune::Dorie::build_grid_gmsh<GridType>(inifile,helper);
......@@ -157,7 +157,7 @@ int main(int argc, char** argv)
else if (dim==3)
{
typedef Dune::UGGrid<3> GridType;
typedef GridType::Partition<Dune::All_Partition>::LeafGridView GV;
typedef GridType::LeafGridView GV;
if (gtype == "gmsh"){
auto grid = Dune::Dorie::build_grid_gmsh<GridType>(inifile,helper);
......
......@@ -59,6 +59,7 @@
#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>
......
......@@ -99,7 +99,7 @@ void RichardsSolver (GridType& grid, GV& gv,
// --- Define Adaptivity Operator ---
typedef Dune::Dorie::FluxErrorEstimator<TRAITS,PARAM,AFEM> ESTLOP;
typedef Dune::PDELab::EmptyTransformation NoTrafo;
typedef typename Dune::PDELab::BackendVectorSelector<AGFS,RF>::Type U0;
typedef typename Dune::PDELab::Backend::impl::BackendVectorSelector<AGFS,RF>::Type U0;
typedef Dune::PDELab::GridOperator<GFS,AGFS,ESTLOP,MBE,RF,RF,RF,NoTrafo,NoTrafo> ESTGO;
typedef Dune::Dorie::AdaptivityController<PARAM,AFEM,AGFS,ESTLOP,ESTGO,GV,GFS,GridType,U0,U> AC;
......@@ -133,27 +133,32 @@ void RichardsSolver (GridType& grid, GV& gv,
std::cout << "::: setup time " << std::setw(12) << timer.elapsed() << std::endl;
// --- Set Up VTK Plotting ---
Dune::VTKSequenceWriter<GV> vtkwriter(gv,filename,filepath,"vtk");
typedef Dune::PDELab::DiscreteGridFunction<GFS,U> UDGF;
UDGF udgf(gfs,unew);
vtkwriter.addCellData(new Dune::PDELab::VTKGridFunctionAdapter<UDGF>(udgf,"head"));
auto udgf_vtk = std::make_shared<Dune::PDELab::VTKGridFunctionAdapter<UDGF>>(udgf,"head");
typedef Dune::Dorie::GradientFluxAdapter<GFS,U,PARAM> FluxDGF;
FluxDGF fluxdgf(gfs,unew,param,udgf);
vtkwriter.addCellData(new Dune::PDELab::VTKGridFunctionAdapter<FluxDGF>(fluxdgf,"flux"));
auto fluxdgf_vtk = std::make_shared<Dune::PDELab::VTKGridFunctionAdapter<FluxDGF>>(fluxdgf,"flux");
typedef Dune::Dorie::ConductivityAdapter<TRAITS,PARAM> ConDGF;
ConDGF condgf(gv,param);
vtkwriter.addCellData(new Dune::PDELab::VTKGridFunctionAdapter<ConDGF>(condgf,"K_0"));
auto condgf_vtk = std::make_shared<Dune::PDELab::VTKGridFunctionAdapter<ConDGF>>(condgf,"K_0");
typedef Dune::Dorie::WaterContentAdapter<TRAITS,PARAM,UDGF> WaterDGF;
WaterDGF waterdgf(gv,param,udgf);
vtkwriter.addCellData(new Dune::PDELab::VTKGridFunctionAdapter<WaterDGF>(waterdgf,"theta_w"));
auto waterdgf_vtk = std::make_shared<Dune::PDELab::VTKGridFunctionAdapter<WaterDGF>>(waterdgf,"theta_w");
typedef Dune::Dorie::SaturationAdapter<TRAITS,PARAM,UDGF> SatDGF;
SatDGF satdgf(gv,param,udgf);
vtkwriter.addCellData(new Dune::PDELab::VTKGridFunctionAdapter<SatDGF>(satdgf,"Theta"));
auto satdgf_vtk = std::make_shared<Dune::PDELab::VTKGridFunctionAdapter<SatDGF>>(satdgf,"Theta");
Dune::VTKSequenceWriter<GV> vtkwriter(gv,filename,filepath,"vtk");
vtkwriter.addCellData(udgf_vtk);
vtkwriter.addCellData(fluxdgf_vtk);
vtkwriter.addCellData(condgf_vtk);
vtkwriter.addCellData(waterdgf_vtk);
vtkwriter.addCellData(satdgf_vtk);
try{ // VTK Plotter has very bad exception handling
RF t = CCon.getTime();
......
......@@ -91,10 +91,11 @@ namespace Dune {
t_est = timer3.elapsed();
timer3.reset();
maxeta = eta.base()[0];
using Dune::PDELab::Backend::native;
maxeta = native(eta)[0];
for (unsigned int i=0; i<eta.flatsize(); i++) {
eta.base()[i] = sqrt(eta.base()[i]); // eta contains squares
if (eta.base()[i] > maxeta) maxeta = eta.base()[i];
native(eta)[i] = sqrt(native(eta)[i]); // eta contains squares
if (native(eta)[i] > maxeta) maxeta = native(eta)[i];
}
if (verbose>1) {
std::cout << "Max Local Error: " << maxeta << " " << std::endl;
......
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