3#ifndef DUNE_PDELAB_BOILERPLATE_PDELAB_HH
4#define DUNE_PDELAB_BOILERPLATE_PDELAB_HH
38#include<dune/grid/albertagrid.hh>
39#include <dune/grid/albertagrid/dgfparser.hh>
45#include<dune/alugrid/grid.hh>
46#include <dune/alugrid/dgf.hh>
49#include <dune/grid/io/file/gmshreader.hh>
54#include <dune/istl/solvercategory.hh>
59#include <dune/pdelab/common/function.hh>
60#include <dune/pdelab/common/functionutilities.hh>
61#include <dune/pdelab/common/vtkexport.hh>
62#include <dune/pdelab/backend/istl.hh>
63#include <dune/pdelab/constraints/conforming.hh>
64#include <dune/pdelab/constraints/hangingnode.hh>
65#include <dune/pdelab/constraints/p0.hh>
66#include <dune/pdelab/constraints/p0ghost.hh>
67#include <dune/pdelab/constraints/common/constraints.hh>
68#include <dune/pdelab/gridfunctionspace/gridfunctionspace.hh>
69#include <dune/pdelab/gridfunctionspace/gridfunctionspaceutilities.hh>
70#include <dune/pdelab/gridfunctionspace/interpolate.hh>
71#include <dune/pdelab/gridoperator/gridoperator.hh>
72#include <dune/pdelab/gridoperator/onestep.hh>
73#include <dune/pdelab/stationary/linearproblem.hh>
74#include <dune/pdelab/finiteelementmap/pkfem.hh>
75#include <dune/pdelab/finiteelementmap/p0fem.hh>
76#include <dune/pdelab/finiteelementmap/opbfem.hh>
77#include <dune/pdelab/finiteelementmap/qkfem.hh>
78#include <dune/pdelab/finiteelementmap/qkdg.hh>
79#include <dune/pdelab/adaptivity/adaptivity.hh>
80#include <dune/pdelab/instationary/onestep.hh>
81#include <dune/pdelab/common/instationaryfilenamehelper.hh>
82#include <dune/pdelab/newton/newton.hh>
94 typedef typename T::ctype ctype;
95 static const int dim = T::dimension;
96 static const int dimworld = T::dimensionworld;
101 FieldVector<ctype,dimworld> lowerLeft(0.0);
102 FieldVector<ctype,dimworld> upperRight(1.0);
103 std::array<unsigned int,dim> elements; elements.fill(cells);
105 StructuredGridFactory<T> factory;
108 gridp = factory.createCubeGrid(lowerLeft,upperRight,elements);
110 gridp = factory.createSimplexGrid(lowerLeft,upperRight,elements);
113 DUNE_THROW(GridError, className<StructuredGrid>()
114 <<
"::StructuredGrid(): grid type must be simplex or cube ");
120 std::array<double,dimworld> lower_left, std::array<double,dimworld> upper_right,
121 std::array<unsigned int,dim> cells)
123 FieldVector<ctype,dimworld> lowerLeft;
124 FieldVector<ctype,dimworld> upperRight;
125 std::array<unsigned int,dim> elements;
128 for (
size_t i=0; i<dimworld; i++)
130 lowerLeft[i] = lower_left[i];
131 upperRight[i] = upper_right[i];
133 for (
size_t i=0; i<dim; i++)
135 elements[i] = cells[i];
138 StructuredGridFactory<T> factory;
141 gridp = factory.createCubeGrid(lowerLeft,upperRight,elements);
143 gridp = factory.createSimplexGrid(lowerLeft,upperRight,elements);
146 DUNE_THROW(GridError, className<StructuredGrid>()
147 <<
"::StructuredGrid(): grid type must be simplex or cube ");
152 std::shared_ptr<T> getSharedPtr ()
164 const T& getGrid ()
const
176 return gridp.operator->();
179 const T& operator*()
const
184 const T* operator->()
const
186 return gridp.operator->();
191 std::shared_ptr<T> gridp;
196 class StructuredGrid<YaspGrid<dim> >
201 typedef YaspGrid<dim> Grid;
210 std::cout <<
"StructuredGrid(): element type " << meshtype <<
" is ignored" << std::endl;
214 std::array<int,dimworld> N(Dune::filledArray<dimworld, int>(cells));
215 std::bitset<dimworld> B(
false);
218 gridp = std::shared_ptr<Grid>(
new Grid(L,N,B,overlap,Dune::MPIHelper::getCollectiveCommunication()));
223 std::array<double,dimworld> lower_left, std::array<double,dimworld> upper_right,
224 std::array<unsigned int,dim> cells,
int overlap=1)
227 for(
int d = 0; d < dimworld; ++d)
228 if(std::abs(lower_left[d]) > std::abs(upper_right[d])*1e-10)
229 DUNE_THROW(GridError, className<StructuredGrid>()
230 <<
"::createCubeGrid(): The lower coordinates "
231 "must be at the origin for YaspGrid.");
235 std::cout <<
"StructuredGrid(): element type " << meshtype <<
" is ignored" << std::endl;
239 std::array<int,dimworld> N;
240 std::bitset<dimworld> B(
false);
241 for (
size_t i=0; i<dimworld; i++)
243 L[i] = upper_right[i];
248 gridp = std::shared_ptr<Grid>(
new Grid(L,N,B,overlap,Dune::MPIHelper::getCollectiveCommunication()));
253 std::array<double,dimworld> lower_left, std::array<double,dimworld> upper_right,
254 std::array<unsigned int,dim> cells, std::array<bool,dim> periodic,
int overlap=1)
257 for(
int d = 0; d < dimworld; ++d)
258 if(std::abs(lower_left[d]) > std::abs(upper_right[d])*1e-10)
259 DUNE_THROW(GridError, className<StructuredGrid>()
260 <<
"::createCubeGrid(): The lower coordinates "
261 "must be at the origin for YaspGrid.");
265 std::cout <<
"StructuredGrid(): element type " << meshtype <<
" is ignored" << std::endl;
269 std::array<int,dimworld> N;
270 std::bitset<dimworld> B(
false);
271 for (
size_t i=0; i<dimworld; i++)
273 L[i] = upper_right[i];
279 gridp = std::shared_ptr<Grid>(
new Grid(L,N,B,overlap,Dune::MPIHelper::getCollectiveCommunication()));
283 std::shared_ptr<Grid> getSharedPtr ()
295 const Grid& getGrid ()
const
307 return gridp.operator->();
310 const Grid& operator*()
const
315 const Grid* operator->()
const
317 return gridp.operator->();
321 std::shared_ptr<Grid> gridp;
326 class UnstructuredGrid
331 typedef typename T::ctype ctype;
332 static const int dim = T::dimension;
333 static const int dimworld = T::dimensionworld;
336 UnstructuredGrid (std::string filename,
bool verbose =
true,
bool insert_boundary_segments=
true)
340 gridp = std::shared_ptr<T>(factory.
createGrid());
344 std::shared_ptr<T> getSharedPtr ()
356 const T& getGrid ()
const
368 return gridp.operator->();
371 const T& operator*()
const
376 const T* operator->()
const
378 return gridp.operator->();
382 std::shared_ptr<T> gridp;
391 template<
typename GV,
typename C,
typename R,
unsigned int degree,
unsigned int dim, Dune::GeometryType::BasicType gt>
395 template<
typename GV,
typename C,
typename R,
unsigned int degree,
unsigned int dim>
399 typedef PkLocalFiniteElementMap<GV,C,R,degree> FEM;
401 CGFEMBase (
const GV& gridview)
403 femp = std::shared_ptr<FEM>(
new FEM(gridview));
406 FEM& getFEM() {
return *femp;}
407 const FEM& getFEM()
const {
return *femp;}
410 std::shared_ptr<FEM> femp;
413 template<
typename GV,
typename C,
typename R,
unsigned int degree,
unsigned int dim>
417 typedef QkLocalFiniteElementMap<GV,C,R,degree> FEM;
419 CGFEMBase (
const GV& gridview)
421 femp = std::shared_ptr<FEM>(
new FEM(gridview));
424 FEM& getFEM() {
return *femp;}
425 const FEM& getFEM()
const {
return *femp;}
428 std::shared_ptr<FEM> femp;
440 template<
typename Gr
id,
unsigned int degree, Dune::GeometryType::BasicType gt, MeshType mt, SolverCategory::Category st,
typename BCType,
typename GV =
typename Gr
id::LeafGr
idView>
444 template<
typename Gr
id,
typename BCType,
typename GV>
448 typedef HangingNodesDirichletConstraints<Grid,HangingNodesConstraintsAssemblers::SimplexGridP1Assembler,BCType> CON;
450 CGCONBase (Grid& grid,
const BCType& bctype,
const GV& gv)
452 conp = std::shared_ptr<CON>(
new CON(grid,
true,bctype));
455 CGCONBase (Grid& grid,
const BCType& bctype)
457 conp = std::shared_ptr<CON>(
new CON(grid,
true,bctype));
460 template<
typename GFS>
461 void postGFSHook (
const GFS& gfs) {}
462 CON& getCON() {
return *conp;}
463 const CON& getCON()
const {
return *conp;}
464 template<
typename GFS,
typename DOF>
465 void make_consistent (
const GFS& gfs, DOF& x)
const {}
467 std::shared_ptr<CON> conp;
470 template<
typename Gr
id,
typename BCType,
typename GV>
474 typedef HangingNodesDirichletConstraints<Grid,HangingNodesConstraintsAssemblers::CubeGridQ1Assembler,BCType> CON;
476 CGCONBase (Grid& grid,
const BCType& bctype,
const GV& gv)
478 conp = std::shared_ptr<CON>(
new CON(grid,
true,bctype));
481 CGCONBase (Grid& grid,
const BCType& bctype)
483 conp = std::shared_ptr<CON>(
new CON(grid,
true,bctype));
486 template<
typename GFS>
487 void postGFSHook (
const GFS& gfs) {}
488 CON& getCON() {
return *conp;}
489 const CON& getCON()
const {
return *conp;}
490 template<
typename GFS,
typename DOF>
491 void make_consistent (
const GFS& gfs, DOF& x)
const {}
493 std::shared_ptr<CON> conp;
496 template<
typename Gr
id,
unsigned int degree, Dune::GeometryType::BasicType gt,
typename BCType,
typename GV>
500 typedef ConformingDirichletConstraints CON;
502 CGCONBase (Grid& grid,
const BCType& bctype,
const GV& gv)
504 conp = std::shared_ptr<CON>(
new CON());
507 CGCONBase (Grid& grid,
const BCType& bctype)
509 conp = std::shared_ptr<CON>(
new CON());
512 template<
typename GFS>
513 void postGFSHook (
const GFS& gfs) {}
514 CON& getCON() {
return *conp;}
515 const CON& getCON()
const {
return *conp;}
516 template<
typename GFS,
typename DOF>
517 void make_consistent (
const GFS& gfs, DOF& x)
const {}
519 std::shared_ptr<CON> conp;
522 template<
typename Gr
id,
unsigned int degree, Dune::GeometryType::BasicType gt,
typename BCType,
typename GV>
526 typedef OverlappingConformingDirichletConstraints CON;
528 CGCONBase (Grid& grid,
const BCType& bctype,
const GV& gv)
530 conp = std::shared_ptr<CON>(
new CON());
533 CGCONBase (Grid& grid,
const BCType& bctype)
535 conp = std::shared_ptr<CON>(
new CON());
538 template<
typename GFS>
539 void postGFSHook (
const GFS& gfs) {}
540 CON& getCON() {
return *conp;}
541 const CON& getCON()
const {
return *conp;}
542 template<
typename GFS,
typename DOF>
543 void make_consistent (
const GFS& gfs, DOF& x)
const
546 ISTL::ParallelHelper<GFS> helper(gfs);
547 helper.maskForeignDOFs(Backend::native(x));
548 Dune::PDELab::AddDataHandle<GFS,DOF> adddh(gfs,x);
549 if (gfs.gridView().comm().size()>1)
553 std::shared_ptr<CON> conp;
556 template<
typename Gr
id,
unsigned int degree, Dune::GeometryType::BasicType gt,
typename BCType,
typename GV>
561 CGCONBase (Grid& grid,
const BCType& bctype)
563 conp = std::shared_ptr<CON>(
new CON);
566 template<
typename GFS>
567 CON& getCON() {
return *conp;}
568 const CON& getCON()
const {
return *conp;}
569 template<
typename GFS,
typename DOF>
570 void make_consistent (
const GFS& gfs, DOF& x)
const {}
572 std::shared_ptr<CON> conp;
577 template<
typename T,
typename N,
unsigned int degree,
typename BCType,
579 typename VBET=ISTL::VectorBackend<> >
585 typedef typename T::LeafGridView GV;
586 typedef typename T::ctype ctype;
587 static const int dim = T::dimension;
588 static const int dimworld = T::dimensionworld;
590 typedef CGFEMBase<GV,ctype,N,degree,dim,gt> FEMB;
591 typedef CGCONBase<Grid,degree,gt,mt,st,BCType> CONB;
593 typedef typename FEMB::FEM FEM;
594 typedef typename CONB::CON CON;
597 typedef GridFunctionSpace<GV,FEM,CON,VBE> GFS;
600 using DOF = Backend::Vector<GFS,N>;
602 typedef typename GFS::template ConstraintsContainer<N>::Type CC;
603 typedef VTKGridFunctionAdapter<DGF> VTKF;
606 CGSpace (Grid& grid,
const BCType& bctype)
609 gfsp = std::shared_ptr<GFS>(
new GFS(gv,femb.getFEM(),conb.getCON()));
610 gfsp->name(
"cgspace");
613 conb.postGFSHook(*gfsp);
614 ccp = std::shared_ptr<CC>(
new CC());
619 return femb.getFEM();
622 const FEM& getFEM()
const
624 return femb.getFEM();
634 const GFS& getGFS ()
const
646 const CC& getCC ()
const
651 void assembleConstraints (
const BCType& bctype)
657 void clearConstraints ()
662 void setConstrainedDOFS (DOF& x, NT nt)
const
665 conb.make_consistent(*gfsp,x);
668 void setNonConstrainedDOFS (DOF& x, NT nt)
const
671 conb.make_consistent(*gfsp,x);
674 void copyConstrainedDOFS (
const DOF& xin, DOF& xout)
const
677 conb.make_consistent(*gfsp,xout);
680 void copyNonConstrainedDOFS (
const DOF& xin, DOF& xout)
const
683 conb.make_consistent(*gfsp,xout);
690 std::shared_ptr<GFS> gfsp;
691 std::shared_ptr<CC> ccp;
695 template<
typename T,
typename N,
unsigned int degree,
typename BCType,
698 class CGSpace<T, N,
degree, BCType,
gt, mt, SolverCategory::nonoverlapping, VBET> {
703 typedef typename T::LeafGridView GV;
704 typedef typename T::ctype ctype;
705 typedef typename Dune::PDELab::NonOverlappingEntitySet<GV> ES;
706 static const int dim = T::dimension;
707 static const int dimworld = T::dimensionworld;
709 typedef CGFEMBase<ES,ctype,N,degree,dim,gt> FEMB;
710 typedef CGCONBase<Grid,degree,gt,mt,SolverCategory::nonoverlapping,BCType> CONB;
712 typedef typename FEMB::FEM FEM;
713 typedef typename CONB::CON CON;
716 typedef GridFunctionSpace<ES,FEM,CON,VBE> GFS;
719 using DOF = Backend::Vector<GFS,N>;
721 typedef typename GFS::template ConstraintsContainer<N>::Type CC;
722 typedef VTKGridFunctionAdapter<DGF> VTKF;
725 CGSpace (Grid& grid,
const BCType& bctype)
726 : gv(grid.
leafGridView()), es(gv), femb(es), conb(grid,bctype)
728 gfsp = std::shared_ptr<GFS>(
new GFS(es,femb.getFEM(),conb.getCON()));
729 gfsp->name(
"cgspace");
733 ccp = std::shared_ptr<CC>(
new CC());
738 return femb.getFEM();
741 const FEM& getFEM()
const
743 return femb.getFEM();
753 const GFS& getGFS ()
const
765 const CC& getCC ()
const
770 void assembleConstraints (
const BCType& bctype)
776 void clearConstraints ()
781 void setConstrainedDOFS (DOF& x, NT nt)
const
784 conb.make_consistent(*gfsp,x);
787 void setNonConstrainedDOFS (DOF& x, NT nt)
const
790 conb.make_consistent(*gfsp,x);
793 void copyConstrainedDOFS (
const DOF& xin, DOF& xout)
const
796 conb.make_consistent(*gfsp,xout);
799 void copyNonConstrainedDOFS (
const DOF& xin, DOF& xout)
const
802 conb.make_consistent(*gfsp,xout);
810 std::shared_ptr<GFS> gfsp;
811 std::shared_ptr<CC> ccp;
821 template<SolverCategory::Category st>
826 class DGCONBase<SolverCategory::sequential>
829 typedef NoConstraints CON;
832 conp = std::shared_ptr<CON>(
new CON());
834 CON& getCON() {
return *conp;}
835 const CON& getCON()
const {
return *conp;}
836 template<
typename GFS,
typename DOF>
837 void make_consistent (
const GFS& gfs, DOF& x)
const {}
839 std::shared_ptr<CON> conp;
843 class DGCONBase<SolverCategory::nonoverlapping>
846 typedef P0ParallelGhostConstraints CON;
849 conp = std::shared_ptr<CON>(
new CON());
851 CON& getCON() {
return *conp;}
852 const CON& getCON()
const {
return *conp;}
853 template<
typename GFS,
typename DOF>
854 void make_consistent (
const GFS& gfs, DOF& x)
const {}
856 std::shared_ptr<CON> conp;
860 class DGCONBase<SolverCategory::overlapping>
863 typedef P0ParallelConstraints CON;
866 conp = std::shared_ptr<CON>(
new CON());
868 CON& getCON() {
return *conp;}
869 const CON& getCON()
const {
return *conp;}
870 template<
typename GFS,
typename DOF>
871 void make_consistent (
const GFS& gfs, DOF& x)
const
874 ISTL::ParallelHelper<GFS> helper(gfs);
875 helper.maskForeignDOFs(Backend::native(x));
876 Dune::PDELab::AddDataHandle<GFS,DOF> adddh(gfs,x);
877 if (gfs.gridView().comm().size()>1)
881 std::shared_ptr<CON> conp;
886 template<
typename T,
typename N,
unsigned int degree,
888 typename VBET=ISTL::VectorBackend<ISTL::Blocking::fixed,Dune::PB::PkSize<degree,T::dimension>::value> >
895 typedef typename T::LeafGridView GV;
896 typedef typename T::ctype ctype;
897 static const int dim = T::dimension;
898 static const int dimworld = T::dimensionworld;
901 typedef OPBLocalFiniteElementMap<ctype,NT,degree,dim,gt,Dune::GMPField<512>,Dune::PB::BasisType::Pk> FEM;
903 typedef OPBLocalFiniteElementMap<ctype,NT,degree,dim,gt> FEM;
905 typedef DGCONBase<st> CONB;
906 typedef typename CONB::CON CON;
908 typedef GridFunctionSpace<GV,FEM,CON,VBE> GFS;
909 using DOF = Backend::Vector<GFS,N>;
911 typedef typename GFS::template ConstraintsContainer<N>::Type CC;
912 typedef VTKGridFunctionAdapter<DGF> VTKF;
915 DGPkSpace (
const GV& gridview) : gv(gridview), conb()
917 femp = std::shared_ptr<FEM>(
new FEM());
918 gfsp = std::shared_ptr<GFS>(
new GFS(gv,*femp));
921 ccp = std::shared_ptr<CC>(
new CC());
924 FEM& getFEM() {
return *femp; }
925 const FEM& getFEM()
const {
return *femp; }
928 GFS& getGFS () {
return *gfsp; }
931 const GFS& getGFS ()
const {
return *gfsp;}
934 CC& getCC () {
return *ccp;}
937 const CC& getCC ()
const {
return *ccp;}
939 template<
class BCTYPE>
940 void assembleConstraints (
const BCTYPE& bctype)
946 void clearConstraints ()
951 void setConstrainedDOFS (DOF& x, NT nt)
const
954 conb.make_consistent(*gfsp,x);
957 void setNonConstrainedDOFS (DOF& x, NT nt)
const
960 conb.make_consistent(*gfsp,x);
963 void copyConstrainedDOFS (
const DOF& xin, DOF& xout)
const
966 conb.make_consistent(*gfsp,xout);
969 void copyNonConstrainedDOFS (
const DOF& xin, DOF& xout)
const
972 conb.make_consistent(*gfsp,xout);
978 std::shared_ptr<FEM> femp;
979 std::shared_ptr<GFS> gfsp;
980 std::shared_ptr<CC> ccp;
985 template<
typename T,
typename N,
unsigned int degree,
988 typename VBET=ISTL::VectorBackend<> >
995 typedef typename T::LeafGridView GV;
996 typedef typename T::ctype ctype;
997 static const int dim = T::dimension;
998 static const int dimworld = T::dimensionworld;
1001 typedef OPBLocalFiniteElementMap<ctype,NT,degree,dim,gt,Dune::GMPField<512>,Dune::PB::BasisType::Qk> FEM;
1003 typedef OPBLocalFiniteElementMap<ctype,NT,degree,dim,gt,N,Dune::PB::BasisType::Qk> FEM;
1005 typedef DGCONBase<st> CONB;
1006 typedef typename CONB::CON CON;
1008 typedef GridFunctionSpace<GV,FEM,CON,VBE> GFS;
1009 using DOF = Backend::Vector<GFS,N>;
1011 typedef typename GFS::template ConstraintsContainer<N>::Type CC;
1012 typedef VTKGridFunctionAdapter<DGF> VTKF;
1015 DGQkOPBSpace (
const GV& gridview) : gv(gridview), conb()
1017 femp = std::shared_ptr<FEM>(
new FEM());
1018 gfsp = std::shared_ptr<GFS>(
new GFS(gv,*femp));
1021 ccp = std::shared_ptr<CC>(
new CC());
1024 FEM& getFEM() {
return *femp; }
1025 const FEM& getFEM()
const {
return *femp; }
1028 GFS& getGFS () {
return *gfsp; }
1031 const GFS& getGFS ()
const {
return *gfsp;}
1034 CC& getCC () {
return *ccp;}
1037 const CC& getCC ()
const {
return *ccp;}
1039 template<
class BCTYPE>
1040 void assembleConstraints (
const BCTYPE& bctype)
1046 void clearConstraints ()
1051 void setConstrainedDOFS (DOF& x, NT nt)
const
1054 conb.make_consistent(*gfsp,x);
1057 void setNonConstrainedDOFS (DOF& x, NT nt)
const
1060 conb.make_consistent(*gfsp,x);
1063 void copyConstrainedDOFS (
const DOF& xin, DOF& xout)
const
1066 conb.make_consistent(*gfsp,xout);
1069 void copyNonConstrainedDOFS (
const DOF& xin, DOF& xout)
const
1072 conb.make_consistent(*gfsp,xout);
1078 std::shared_ptr<FEM> femp;
1079 std::shared_ptr<GFS> gfsp;
1080 std::shared_ptr<CC> ccp;
1085 template<
typename T,
typename N,
unsigned int degree,
1087 typename VBET=ISTL::VectorBackend<ISTL::Blocking::fixed,Dune::QkStuff::QkSize<degree,T::dimension>::value> >
1094 typedef typename T::LeafGridView GV;
1095 typedef typename T::ctype ctype;
1096 static const int dim = T::dimension;
1097 static const int dimworld = T::dimensionworld;
1099 typedef QkDGLocalFiniteElementMap<ctype,NT,degree,dim> FEM;
1100 typedef DGCONBase<st> CONB;
1101 typedef typename CONB::CON CON;
1103 typedef GridFunctionSpace<GV,FEM,CON,VBE> GFS;
1104 using DOF = Backend::Vector<GFS,N>;
1106 typedef typename GFS::template ConstraintsContainer<N>::Type CC;
1107 typedef VTKGridFunctionAdapter<DGF> VTKF;
1110 DGQkSpace (
const GV& gridview) : gv(gridview), conb()
1112 femp = std::shared_ptr<FEM>(
new FEM());
1113 gfsp = std::shared_ptr<GFS>(
new GFS(gv,*femp));
1116 ccp = std::shared_ptr<CC>(
new CC());
1119 FEM& getFEM() {
return *femp; }
1120 const FEM& getFEM()
const {
return *femp; }
1123 GFS& getGFS () {
return *gfsp; }
1126 const GFS& getGFS ()
const {
return *gfsp;}
1129 CC& getCC () {
return *ccp;}
1132 const CC& getCC ()
const {
return *ccp;}
1134 template<
class BCTYPE>
1135 void assembleConstraints (
const BCTYPE& bctype)
1141 void clearConstraints ()
1146 void setConstrainedDOFS (DOF& x, NT nt)
const
1149 conb.make_consistent(*gfsp,x);
1152 void setNonConstrainedDOFS (DOF& x, NT nt)
const
1155 conb.make_consistent(*gfsp,x);
1158 void copyConstrainedDOFS (
const DOF& xin, DOF& xout)
const
1161 conb.make_consistent(*gfsp,xout);
1164 void copyNonConstrainedDOFS (
const DOF& xin, DOF& xout)
const
1167 conb.make_consistent(*gfsp,xout);
1173 std::shared_ptr<FEM> femp;
1174 std::shared_ptr<GFS> gfsp;
1175 std::shared_ptr<CC> ccp;
1180 template<
typename T,
typename N,
unsigned int degree,
1183 typename VBET=ISTL::VectorBackend<> >
1190 typedef typename T::LeafGridView GV;
1191 typedef typename T::ctype ctype;
1192 static const int dim = T::dimension;
1193 static const int dimworld = T::dimensionworld;
1195 typedef QkDGLocalFiniteElementMap<ctype,NT,degree,dim,QkDGBasisPolynomial::lobatto> FEM;
1196 typedef DGCONBase<st> CONB;
1197 typedef typename CONB::CON CON;
1199 typedef GridFunctionSpace<GV,FEM,CON,VBE> GFS;
1200 using DOF = Backend::Vector<GFS,N>;
1202 typedef typename GFS::template ConstraintsContainer<N>::Type CC;
1203 typedef VTKGridFunctionAdapter<DGF> VTKF;
1206 DGQkGLSpace (
const GV& gridview) : gv(gridview), conb()
1208 femp = std::shared_ptr<FEM>(
new FEM());
1209 gfsp = std::shared_ptr<GFS>(
new GFS(gv,*femp));
1212 ccp = std::shared_ptr<CC>(
new CC());
1215 FEM& getFEM() {
return *femp; }
1216 const FEM& getFEM()
const {
return *femp; }
1219 GFS& getGFS () {
return *gfsp; }
1222 const GFS& getGFS ()
const {
return *gfsp;}
1225 CC& getCC () {
return *ccp;}
1228 const CC& getCC ()
const {
return *ccp;}
1230 template<
class BCTYPE>
1231 void assembleConstraints (
const BCTYPE& bctype)
1237 void clearConstraints ()
1242 void setConstrainedDOFS (DOF& x, NT nt)
const
1245 conb.make_consistent(*gfsp,x);
1248 void setNonConstrainedDOFS (DOF& x, NT nt)
const
1251 conb.make_consistent(*gfsp,x);
1254 void copyConstrainedDOFS (
const DOF& xin, DOF& xout)
const
1257 conb.make_consistent(*gfsp,xout);
1260 void copyNonConstrainedDOFS (
const DOF& xin, DOF& xout)
const
1263 conb.make_consistent(*gfsp,xout);
1269 std::shared_ptr<FEM> femp;
1270 std::shared_ptr<GFS> gfsp;
1271 std::shared_ptr<CC> ccp;
1276 template<
typename T,
typename N,
unsigned int degree,
1279 typename VBET=ISTL::VectorBackend<> >
1280 class DGLegendreSpace
1286 typedef typename T::LeafGridView GV;
1287 typedef typename T::ctype ctype;
1288 static const int dim = T::dimension;
1289 static const int dimworld = T::dimensionworld;
1291 typedef QkDGLocalFiniteElementMap<ctype,NT,degree,dim,QkDGBasisPolynomial::legendre> FEM;
1292 typedef DGCONBase<st> CONB;
1293 typedef typename CONB::CON CON;
1295 typedef GridFunctionSpace<GV,FEM,CON,VBE> GFS;
1296 using DOF = Backend::Vector<GFS,N>;
1298 typedef typename GFS::template ConstraintsContainer<N>::Type CC;
1299 typedef VTKGridFunctionAdapter<DGF> VTKF;
1302 DGLegendreSpace (
const GV& gridview) : gv(gridview), conb()
1304 femp = std::shared_ptr<FEM>(
new FEM());
1305 gfsp = std::shared_ptr<GFS>(
new GFS(gv,*femp));
1308 ccp = std::shared_ptr<CC>(
new CC());
1311 FEM& getFEM() {
return *femp; }
1312 const FEM& getFEM()
const {
return *femp; }
1315 GFS& getGFS () {
return *gfsp; }
1318 const GFS& getGFS ()
const {
return *gfsp;}
1321 CC& getCC () {
return *ccp;}
1324 const CC& getCC ()
const {
return *ccp;}
1326 template<
class BCTYPE>
1327 void assembleConstraints (
const BCTYPE& bctype)
1333 void clearConstraints ()
1338 void setConstrainedDOFS (DOF& x, NT nt)
const
1341 conb.make_consistent(*gfsp,x);
1344 void setNonConstrainedDOFS (DOF& x, NT nt)
const
1347 conb.make_consistent(*gfsp,x);
1350 void copyConstrainedDOFS (
const DOF& xin, DOF& xout)
const
1353 conb.make_consistent(*gfsp,xout);
1356 void copyNonConstrainedDOFS (
const DOF& xin, DOF& xout)
const
1359 conb.make_consistent(*gfsp,xout);
1365 std::shared_ptr<FEM> femp;
1366 std::shared_ptr<GFS> gfsp;
1367 std::shared_ptr<CC> ccp;
1372 template<
typename T,
typename N,
1374 typename VBET=ISTL::VectorBackend<> >
1381 typedef typename T::LeafGridView GV;
1382 typedef typename T::ctype ctype;
1383 static const int dim = T::dimension;
1384 static const int dimworld = T::dimensionworld;
1387 typedef DGCONBase<st> CONB;
1388 typedef typename CONB::CON CON;
1390 typedef GridFunctionSpace<GV,FEM,CON,VBE> GFS;
1391 using DOF = Backend::Vector<GFS,N>;
1393 typedef typename GFS::template ConstraintsContainer<N>::Type CC;
1394 typedef VTKGridFunctionAdapter<DGF> VTKF;
1397 P0Space (
const GV& gridview) : gv(gridview), conb()
1400 gfsp = std::shared_ptr<GFS>(
new GFS(gv,*femp));
1403 ccp = std::shared_ptr<CC>(
new CC());
1406 FEM& getFEM() {
return *femp; }
1407 const FEM& getFEM()
const {
return *femp; }
1410 GFS& getGFS () {
return *gfsp; }
1413 const GFS& getGFS ()
const {
return *gfsp;}
1416 CC& getCC () {
return *ccp;}
1419 const CC& getCC ()
const {
return *ccp;}
1421 template<
class BCTYPE>
1422 void assembleConstraints (
const BCTYPE& bctype)
1428 void clearConstraints ()
1433 void setConstrainedDOFS (DOF& x, NT nt)
const
1436 conb.make_consistent(*gfsp,x);
1439 void setNonConstrainedDOFS (DOF& x, NT nt)
const
1442 conb.make_consistent(*gfsp,x);
1445 void copyConstrainedDOFS (
const DOF& xin, DOF& xout)
const
1448 conb.make_consistent(*gfsp,xout);
1451 void copyNonConstrainedDOFS (
const DOF& xin, DOF& xout)
const
1454 conb.make_consistent(*gfsp,xout);
1460 std::shared_ptr<FEM> femp;
1461 std::shared_ptr<GFS> gfsp;
1462 std::shared_ptr<CC> ccp;
1468 template<
typename FS,
typename Functor>
1470 :
public GridFunctionBase<GridFunctionTraits<typename FS::GV, typename FS::NT,
1471 1,FieldVector<typename FS::NT,1> >
1472 ,UserFunction<FS,Functor> >
1475 typedef GridFunctionTraits<
typename FS::GV,
typename FS::NT,
1476 1,FieldVector<typename FS::NT,1> > Traits;
1479 UserFunction (
const FS& fs_,
const Functor& f_)
1489 std::vector<double> x__(x.size());
1490 for (
size_t i=0; i<x.size(); ++i) x__[i]=x_[i];
1494 inline const typename FS::GV& getGridView ()
const
1496 return fs.getGFS().gridView();
1505 template<
typename FS,
typename LOP, SolverCategory::Category st = SolverCategory::sequential>
1506 class GalerkinGlobalAssembler
1510 typedef ISTL::BCRSMatrixBackend<> MBE;
1512 typename FS::NT,
typename FS::NT,
typename FS::NT,
1513 typename FS::CC,
typename FS::CC> GO;
1516 GalerkinGlobalAssembler (
const FS& fs, LOP& lop,
const std::size_t nonzeros)
1518 gop = std::shared_ptr<GO>(
new GO(fs.getGFS(),fs.getCC(),fs.getGFS(),fs.getCC(),lop,MBE(nonzeros)));
1528 const GO& getGO ()
const
1540 return gop.operator->();
1543 const GO& operator*()
const
1548 const GO* operator->()
const
1550 return gop.operator->();
1554 std::shared_ptr<GO> gop;
1558 template<
typename FS,
typename LOP, SolverCategory::Category st = SolverCategory::sequential>
1559 class GalerkinGlobalAssemblerNewBackend
1565 typename FS::NT,
typename FS::NT,
typename FS::NT,
1566 typename FS::CC,
typename FS::CC> GO;
1569 GalerkinGlobalAssemblerNewBackend (
const FS& fs, LOP& lop,
const MBE& mbe)
1571 gop = std::shared_ptr<GO>(
new GO(fs.getGFS(),fs.getCC(),fs.getGFS(),fs.getCC(),lop,mbe));
1581 const GO& getGO ()
const
1593 return gop.operator->();
1596 const GO& operator*()
const
1601 const GO* operator->()
const
1603 return gop.operator->();
1607 std::shared_ptr<GO> gop;
1612 template<
typename FSU,
typename FSV,
typename LOP, SolverCategory::Category st>
1613 class GlobalAssembler
1617 typedef ISTL::BCRSMatrixBackend<> MBE;
1619 typename FSU::NT,
typename FSU::NT,
typename FSU::NT,
1620 typename FSU::CC,
typename FSV::CC> GO;
1623 GlobalAssembler (
const FSU& fsu,
const FSV& fsv, LOP& lop,
const std::size_t nonzeros)
1625 gop = std::shared_ptr<GO>(
new GO(fsu.getGFS(),fsu.getCC(),fsv.getGFS(),fsv.getCC(),lop,MBE(nonzeros)));
1635 const GO& getGO ()
const
1647 return gop.operator->();
1650 const GO& operator*()
const
1655 const GO* operator->()
const
1657 return gop.operator->();
1661 std::shared_ptr<GO> gop;
1665 template<
typename GO1,
typename GO2,
bool implicit = true>
1666 class OneStepGlobalAssembler
1670 typedef ISTL::BCRSMatrixBackend<> MBE;
1671 typedef Dune::PDELab::OneStepGridOperator<typename GO1::GO,typename GO2::GO,implicit> GO;
1672 typedef typename GO::Jacobian MAT;
1674 OneStepGlobalAssembler (GO1& go1, GO2& go2)
1676 gop = std::shared_ptr<GO>(
new GO(*go1,*go2));
1686 const GO& getGO ()
const
1698 return gop.operator->();
1701 const GO& operator*()
const
1706 const GO* operator->()
const
1708 return gop.operator->();
1712 std::shared_ptr<GO> gop;
1717 template<
typename FS,
typename ASS, SolverCategory::Category st = SolverCategory::sequential>
1718 class ISTLSolverBackend_CG_AMG_SSOR
1724 ISTLSolverBackend_CG_AMG_SSOR (
const FS& fs,
const ASS& ass,
unsigned maxiter_=5000,
1725 int verbose_=1,
bool reuse_=
false,
bool usesuperlu_=
true)
1727 lsp = std::shared_ptr<LS>(
new LS(maxiter_,verbose_,reuse_,usesuperlu_));
1730 LS& getLS () {
return *lsp;}
1731 const LS& getLS ()
const {
return *lsp;}
1732 LS& operator*(){
return *lsp;}
1733 LS* operator->() {
return lsp.operator->(); }
1734 const LS& operator*()
const{
return *lsp;}
1735 const LS* operator->()
const{
return lsp.operator->();}
1738 std::shared_ptr<LS> lsp;
1742 template<
typename FS,
typename ASS>
1743 class ISTLSolverBackend_CG_AMG_SSOR<FS,ASS, SolverCategory::nonoverlapping>
1749 ISTLSolverBackend_CG_AMG_SSOR (
const FS& fs,
const ASS& ass,
unsigned maxiter_=5000,
1750 int verbose_=1,
bool reuse_=
false,
bool usesuperlu_=
true)
1752 lsp = std::shared_ptr<LS>(
new LS(fs.getGFS(),maxiter_,verbose_,reuse_,usesuperlu_));
1755 LS& getLS () {
return *lsp;}
1756 const LS& getLS ()
const {
return *lsp;}
1757 LS& operator*(){
return *lsp;}
1758 LS* operator->() {
return lsp.operator->(); }
1759 const LS& operator*()
const{
return *lsp;}
1760 const LS* operator->()
const{
return lsp.operator->();}
1763 std::shared_ptr<LS> lsp;
1767 template<
typename FS,
typename ASS>
1768 class ISTLSolverBackend_CG_AMG_SSOR<FS,ASS, SolverCategory::overlapping>
1774 ISTLSolverBackend_CG_AMG_SSOR (
const FS& fs,
const ASS& ass,
unsigned maxiter_=5000,
1775 int verbose_=1,
bool reuse_=
false,
bool usesuperlu_=
true)
1777 lsp = std::shared_ptr<LS>(
new LS(fs.getGFS(),maxiter_,verbose_,reuse_,usesuperlu_));
1780 LS& getLS () {
return *lsp;}
1781 const LS& getLS ()
const {
return *lsp;}
1782 LS& operator*(){
return *lsp;}
1783 LS* operator->() {
return lsp.operator->(); }
1784 const LS& operator*()
const{
return *lsp;}
1785 const LS* operator->()
const{
return lsp.operator->();}
1788 std::shared_ptr<LS> lsp;
1792 template<
typename FS,
typename ASS, SolverCategory::Category st = SolverCategory::sequential>
1793 class ISTLSolverBackend_CG_SSOR
1797 typedef ISTLBackend_SEQ_CG_SSOR LS;
1799 ISTLSolverBackend_CG_SSOR (
const FS& fs,
const ASS& ass,
unsigned maxiter_=5000,
1800 int steps_=5,
int verbose_=1)
1802 lsp = std::shared_ptr<LS>(
new LS(maxiter_,verbose_));
1805 LS& getLS () {
return *lsp;}
1806 const LS& getLS ()
const {
return *lsp;}
1807 LS& operator*(){
return *lsp;}
1808 LS* operator->() {
return lsp.operator->(); }
1809 const LS& operator*()
const{
return *lsp;}
1810 const LS* operator->()
const{
return lsp.operator->();}
1813 std::shared_ptr<LS> lsp;
1817 template<
typename FS,
typename ASS>
1818 class ISTLSolverBackend_CG_SSOR<FS,ASS,SolverCategory::nonoverlapping>
1822 typedef ISTLBackend_NOVLP_CG_SSORk<typename ASS::GO> LS;
1824 ISTLSolverBackend_CG_SSOR (
const FS& fs,
const ASS& ass,
unsigned maxiter_=5000,
1825 int steps_=5,
int verbose_=1)
1827 lsp = std::shared_ptr<LS>(
new LS(fs.getGFS(),maxiter_,steps_,verbose_));
1830 LS& getLS () {
return *lsp;}
1831 const LS& getLS ()
const {
return *lsp;}
1832 LS& operator*(){
return *lsp;}
1833 LS* operator->() {
return lsp.operator->(); }
1834 const LS& operator*()
const{
return *lsp;}
1835 const LS* operator->()
const{
return lsp.operator->();}
1838 std::shared_ptr<LS> lsp;
1842 template<
typename FS,
typename ASS>
1843 class ISTLSolverBackend_CG_SSOR<FS,ASS,SolverCategory::overlapping>
1847 typedef ISTLBackend_OVLP_CG_SSORk<typename FS::GFS, typename FS::CC> LS;
1849 ISTLSolverBackend_CG_SSOR (
const FS& fs,
const ASS& ass,
unsigned maxiter_=5000,
1850 int steps_=5,
int verbose_=1)
1852 lsp = std::shared_ptr<LS>(
new LS(fs.getGFS(),fs.getCC(),maxiter_,steps_,verbose_));
1855 LS& getLS () {
return *lsp;}
1856 const LS& getLS ()
const {
return *lsp;}
1857 LS& operator*(){
return *lsp;}
1858 LS* operator->() {
return lsp.operator->(); }
1859 const LS& operator*()
const{
return *lsp;}
1860 const LS* operator->()
const{
return lsp.operator->();}
1863 std::shared_ptr<LS> lsp;
1869 template<
typename FS,
typename ASS, SolverCategory::Category st = SolverCategory::sequential>
1870 class ISTLSolverBackend_IterativeDefault
1874 typedef ISTLBackend_SEQ_BCGS_SSOR LS;
1876 ISTLSolverBackend_IterativeDefault (
const FS& fs,
const ASS& ass,
unsigned maxiter_=5000,
int verbose_=1)
1878 lsp = std::shared_ptr<LS>(
new LS(maxiter_,verbose_));
1881 LS& getLS () {
return *lsp;}
1882 const LS& getLS ()
const {
return *lsp;}
1883 LS& operator*(){
return *lsp;}
1884 LS* operator->() {
return lsp.operator->(); }
1885 const LS& operator*()
const{
return *lsp;}
1886 const LS* operator->()
const{
return lsp.operator->();}
1889 std::shared_ptr<LS> lsp;
1893 template<
typename FS,
typename ASS>
1894 class ISTLSolverBackend_IterativeDefault<FS,ASS,SolverCategory::nonoverlapping>
1900 ISTLSolverBackend_IterativeDefault (
const FS& fs,
const ASS& ass,
unsigned maxiter_=5000,
int verbose_=1)
1902 lsp = std::shared_ptr<LS>(
new LS(ass.getGO(),maxiter_,3,verbose_));
1905 LS& getLS () {
return *lsp;}
1906 const LS& getLS ()
const {
return *lsp;}
1907 LS& operator*(){
return *lsp;}
1908 LS* operator->() {
return lsp.operator->(); }
1909 const LS& operator*()
const{
return *lsp;}
1910 const LS* operator->()
const{
return lsp.operator->();}
1913 std::shared_ptr<LS> lsp;
1917 template<
typename FS,
typename ASS>
1918 class ISTLSolverBackend_IterativeDefault<FS,ASS,SolverCategory::overlapping>
1922 typedef ISTLBackend_OVLP_BCGS_SSORk<typename FS::GFS, typename FS::CC> LS;
1924 ISTLSolverBackend_IterativeDefault (
const FS& fs,
const ASS& ass,
unsigned maxiter_=5000,
int verbose_=1)
1926 lsp = std::shared_ptr<LS>(
new LS(fs.getGFS(),fs.getCC(),maxiter_,3,verbose_));
1929 LS& getLS () {
return *lsp;}
1930 const LS& getLS ()
const {
return *lsp;}
1931 LS& operator*(){
return *lsp;}
1932 LS* operator->() {
return lsp.operator->(); }
1933 const LS& operator*()
const{
return *lsp;}
1934 const LS* operator->()
const{
return lsp.operator->();}
1937 std::shared_ptr<LS> lsp;
1942 template<
typename FS,
typename ASS, SolverCategory::Category st = SolverCategory::sequential>
1943 class ISTLSolverBackend_ExplicitDiagonal
1949 ISTLSolverBackend_ExplicitDiagonal (
const FS& fs,
const ASS& ass,
unsigned maxiter_=5000,
int verbose_=1)
1951 lsp = std::shared_ptr<LS>(
new LS());
1954 LS& getLS () {
return *lsp;}
1955 const LS& getLS ()
const {
return *lsp;}
1956 LS& operator*(){
return *lsp;}
1957 LS* operator->() {
return lsp.operator->(); }
1958 const LS& operator*()
const{
return *lsp;}
1959 const LS* operator->()
const{
return lsp.operator->();}
1962 std::shared_ptr<LS> lsp;
1967 template<
typename FS,
typename ASS>
1968 class ISTLSolverBackend_ExplicitDiagonal<FS,ASS,SolverCategory::overlapping>
1974 ISTLSolverBackend_ExplicitDiagonal (
const FS& fs,
const ASS& ass,
unsigned maxiter_=5000,
int verbose_=1)
1976 lsp = std::shared_ptr<LS>(
new LS(fs.getGFS()));
1979 LS& getLS () {
return *lsp;}
1980 const LS& getLS ()
const {
return *lsp;}
1981 LS& operator*(){
return *lsp;}
1982 LS* operator->() {
return lsp.operator->(); }
1983 const LS& operator*()
const{
return *lsp;}
1984 const LS* operator->()
const{
return lsp.operator->();}
1987 std::shared_ptr<LS> lsp;
1992 template<
typename FS,
typename ASS>
1993 class ISTLSolverBackend_ExplicitDiagonal<FS,ASS,SolverCategory::nonoverlapping>
1999 ISTLSolverBackend_ExplicitDiagonal (
const FS& fs,
const ASS& ass,
unsigned maxiter_=5000,
int verbose_=1)
2001 lsp = std::shared_ptr<LS>(
new LS(fs.getGFS()));
2004 LS& getLS () {
return *lsp;}
2005 const LS& getLS ()
const {
return *lsp;}
2006 LS& operator*(){
return *lsp;}
2007 LS* operator->() {
return lsp.operator->(); }
2008 const LS& operator*()
const{
return *lsp;}
2009 const LS* operator->()
const{
return lsp.operator->();}
2012 std::shared_ptr<LS> lsp;
This file implements a vector space as a tensor product of a given vector space. The number of compon...
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:280
BasicType
Each entity can be tagged by one of these basic types plus its space dimension.
Definition: type.hh:286
@ cube
Cube element in any nonnegative dimension.
Definition: type.hh:288
@ simplex
Simplicial element in any nonnegative dimension.
Definition: type.hh:287
static ToUniquePtr< Grid > read(const std::string &fileName, bool verbose=true, bool insertBoundarySegments=true)
Definition: gmshreader.hh:788
Provide a generic factory class for unstructured grids.
Definition: gridfactory.hh:269
virtual ToUniquePtr< GridType > createGrid()
Finalize grid creation and hand over the grid.
Definition: gridfactory.hh:327
@ dimensionworld
The dimension of the world the grid lives in.
Definition: grid.hh:393
ct ctype
Define type used for coordinates in grid module.
Definition: grid.hh:522
convert a grid function space and a coefficient vector into a grid function
Definition: gridfunctionspaceutilities.hh:76
Standard grid operator implementation.
Definition: gridoperator.hh:36
Dune::PDELab::Backend::Matrix< MB, Domain, Range, JF > Jacobian
The type of the jacobian.
Definition: gridoperator.hh:47
Overlapping parallel conjugate gradient solver preconditioned with AMG smoothed by SSOR.
Definition: ovlpistlsolverbackend.hh:1258
Nonoverlapping parallel BiCGSTAB solver preconditioned by block SSOR.
Definition: novlpistlsolverbackend.hh:837
Nonoverlapping parallel CG solver preconditioned with AMG smoothed by SSOR.
Definition: novlpistlsolverbackend.hh:1075
Solver to be used for explicit time-steppers with (block-)diagonal mass matrix.
Definition: novlpistlsolverbackend.hh:636
Solver to be used for explicit time-steppers with (block-)diagonal mass matrix.
Definition: ovlpistlsolverbackend.hh:1010
Sequential conjugate gradient solver preconditioned with AMG smoothed by SSOR.
Definition: seqistlsolverbackend.hh:856
Solver to be used for explicit time-steppers with (block-)diagonal mass matrix.
Definition: seqistlsolverbackend.hh:661
A free function to provide the demangled class name of a given object or type as a string.
A few common exception classes.
@ conforming
Output conforming data.
Definition: common.hh:72
@ nonconforming
Output non-conforming data.
Definition: common.hh:80
Convenience header which includes all available VTK writers.
Some generic functions for pretty printing vectors and matrices.
Implementations of the inverse operator interface.
Utility to generate an array with a certain value.
Implements a vector constructed from a given type representing a field and a compile-time given size.
#define DUNE_THROW(E, m)
Definition: exceptions.hh:216
bool gt(const T &first, const T &second, typename EpsilonType< T >::Type epsilon)
test if first greater than second
Definition: float_cmp.cc:156
Grid< dim, dimworld, ct, GridFamily >::LeafGridView leafGridView(const Grid< dim, dimworld, ct, GridFamily > &grid)
leaf grid view for the given grid
Definition: grid.hh:809
void constraints(const GFS &gfs, CG &cg, const bool verbose=false)
construct constraints
Definition: constraints.hh:749
void set_nonconstrained_dofs(const CG &cg, typename XG::ElementType x, XG &xg)
Definition: constraints.hh:960
void set_constrained_dofs(const CG &cg, typename XG::ElementType x, XG &xg)
construct constraints from given boundary condition function
Definition: constraints.hh:796
void copy_constrained_dofs(const CG &cg, const XG &xgin, XG &xgout)
Definition: constraints.hh:936
void copy_nonconstrained_dofs(const CG &cg, const XG &xgin, XG &xgout)
Definition: constraints.hh:987
std::size_t degree(const Node &node)
Returns the degree of node as run time information.
Definition: nodeinterface.hh:71
Helpers for dealing with MPI.
Dune namespace.
Definition: alignedallocator.hh:14
Define general, extensible interface for operators. The available implementation wraps a matrix.
Various parser methods to get data into a ParameterTree object.
Define general preconditioner interface.
Dune::FieldVector< GV::Grid::ctype, GV::dimension > DomainType
domain type in dim-size coordinates
Definition: function.hh:50
R RangeType
range type
Definition: function.hh:62
Backend using (possibly nested) ISTL BCRSMatrices.
Definition: bcrsmatrixbackend.hh:188
GV::Traits::template Codim< 0 >::Entity ElementType
codim 0 entity
Definition: function.hh:119
Category
Definition: solvercategory.hh:21
@ sequential
Category for sequential solvers.
Definition: solvercategory.hh:23
@ nonoverlapping
Category for non-overlapping solvers.
Definition: solvercategory.hh:25
@ overlapping
Category for overlapping solvers.
Definition: solvercategory.hh:27
A class to construct structured cube and simplex grids using the grid factory.
A unique label for each type of element that can occur in a grid.