Commit 5e9f3361 authored by Dion Haefner's avatar Dion Haefner

Merge branch 'feature/dune-uggrid' !3

parents ae66090c 7b65c235
......@@ -9,7 +9,11 @@ endif()
FIND_PACKAGE (FFTW REQUIRED)
FIND_PACKAGE (SuperLU REQUIRED)
FIND_PACKAGE (MPI REQUIRED)
FIND_PACKAGE (UG REQUIRED)
if(NOT dune-uggrid_FOUND)
MESSAGE(STATUS "Module dune-uggrid was not found. Falling back to external UG grid manager")
FIND_PACKAGE(UG REQUIRED)
endif()
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
Suggests: dune-testtools
Depends: dune-python dune-pdelab
Suggests: dune-testtools dune-uggrid
......@@ -60,6 +60,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>
......
......@@ -110,7 +110,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;
......@@ -144,27 +144,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 @@ class AdaptivityController
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