dune-pdelab  2.0.0
pdelab.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 // vi: set et ts=4 sw=4 sts=4:
3 #ifndef DUNE_PDELAB_HH
4 #define DUNE_PDELAB_HH
5 
16 // first of all we include a lot of dune grids and pdelab files
17 #include <iostream>
18 
19 #include <dune/common/parallel/mpihelper.hh> // include mpi helper class
20 #include <dune/common/parametertreeparser.hh>
21 #include <dune/common/shared_ptr.hh>
22 #include <dune/common/classname.hh>
23 #include <dune/common/exceptions.hh>
24 #include <dune/common/fvector.hh>
25 
26 #include <dune/geometry/type.hh>
27 #include <dune/geometry/quadraturerules.hh>
28 
29 #include <dune/grid/sgrid.hh> // load sgrid definition
30 #include <dune/grid/onedgrid.hh>
31 #include <dune/grid/io/file/vtk/subsamplingvtkwriter.hh>
32 #include <dune/grid/yaspgrid.hh>
33 #if HAVE_UG
34 #include <dune/grid/uggrid.hh>
35 #endif
36 #if HAVE_ALBERTA
37 #include<dune/grid/albertagrid.hh>
38 #include <dune/grid/albertagrid/dgfparser.hh>
39 #endif
40 #if HAVE_UG
41 #include<dune/grid/uggrid.hh>
42 #endif
43 #if HAVE_ALUGRID
44 #include<dune/grid/alugrid.hh>
45 #include<dune/grid/io/file/dgfparser/dgfalu.hh>
46 #include<dune/grid/io/file/dgfparser/dgfparser.hh>
47 #endif
48 #include <dune/grid/utility/structuredgridfactory.hh>
49 #include <dune/grid/io/file/gmshreader.hh>
50 
51 #include <dune/istl/bvector.hh>
52 #include <dune/istl/operators.hh>
53 #include <dune/istl/solvers.hh>
54 #include <dune/istl/solvercategory.hh>
55 #include <dune/istl/preconditioners.hh>
56 #include <dune/istl/io.hh>
57 
58 #include <dune/istl/paamg/amg.hh>
85 
86 namespace Dune {
87  namespace PDELab {
88 
89  // make grids
90  template<typename T>
92  {
93  public:
94  // export types
95  typedef T Grid;
96  typedef typename T::ctype ctype;
97  static const int dim = T::dimension;
98  static const int dimworld = T::dimensionworld;
99 
100  // constructors
101  StructuredGrid (Dune::GeometryType::BasicType meshtype, unsigned int cells)
102  {
103  FieldVector<ctype,dimworld> lowerLeft(0.0);
104  FieldVector<ctype,dimworld> upperRight(1.0);
105  array<unsigned int,dim> elements; elements.fill(cells);
106 
107  StructuredGridFactory<T> factory;
108 
109  if (meshtype==Dune::GeometryType::cube)
110  gridp = factory.createCubeGrid(lowerLeft,upperRight,elements);
111  else if (meshtype==Dune::GeometryType::simplex)
112  gridp = factory.createSimplexGrid(lowerLeft,upperRight,elements);
113  else
114  {
115  DUNE_THROW(GridError, className<StructuredGrid>()
116  << "::StructuredGrid(): grid type must be simplex or cube ");
117  }
118  }
119 
120 
121  StructuredGrid (Dune::GeometryType::BasicType meshtype,
122  array<double,dimworld> lower_left, array<double,dimworld> upper_right,
123  array<unsigned int,dim> cells)
124  {
125  FieldVector<ctype,dimworld> lowerLeft;
126  FieldVector<ctype,dimworld> upperRight;
127  array<unsigned int,dim> elements;
128 
129  // copy data to correct types for StructuredGridFactory
130  for (size_t i=0; i<dimworld; i++)
131  {
132  lowerLeft[i] = lower_left[i];
133  upperRight[i] = upper_right[i];
134  }
135  for (size_t i=0; i<dim; i++)
136  {
137  elements[i] = cells[i];
138  }
139 
140  StructuredGridFactory<T> factory;
141 
142  if (meshtype==Dune::GeometryType::cube)
143  gridp = factory.createCubeGrid(lowerLeft,upperRight,elements);
144  else if (meshtype==Dune::GeometryType::simplex)
145  gridp = factory.createSimplexGrid(lowerLeft,upperRight,elements);
146  else
147  {
148  DUNE_THROW(GridError, className<StructuredGrid>()
149  << "::StructuredGrid(): grid type must be simplex or cube ");
150  }
151  }
152 
153  // return shared pointer
154  Dune::shared_ptr<T> getSharedPtr ()
155  {
156  return gridp;
157  }
158 
159  // return grid reference
160  T& getGrid ()
161  {
162  return *gridp;
163  }
164 
165  // return grid reference const version
166  const T& getGrid () const
167  {
168  return *gridp;
169  }
170 
172  {
173  return *gridp;
174  }
175 
177  {
178  return gridp.operator->();
179  }
180 
181  const T& operator*() const
182  {
183  return *gridp;
184  }
185 
186  const T* operator->() const
187  {
188  return gridp.operator->();
189  }
190 
191 
192  private:
193  Dune::shared_ptr<T> gridp; // hold a shared pointer to a grid
194  };
195 
196  // specialization for yaspgrid; treats paralle case right
197  template<int dim>
198  class StructuredGrid<YaspGrid<dim> >
199  {
200  public:
201 
202  // export types
203  typedef YaspGrid<dim> Grid;
204  typedef typename Grid::ctype ctype;
205  static const int dimworld = Grid::dimensionworld;
206 
207  // simple constructor for the unit cube
208  StructuredGrid (Dune::GeometryType::BasicType meshtype, unsigned int cells, int overlap=1)
209  {
210  // check element type
211  if (meshtype!=Dune::GeometryType::cube)
212  std::cout << "StructuredGrid(): element type " << meshtype << " is ignored" << std::endl;
213 
214  // copy data to correct types for YaspGrid
215  Dune::FieldVector<double,dimworld> L(1.0);
216  Dune::array<int,dimworld> N(Dune::fill_array<int,dimworld>(cells));
217  std::bitset<dimworld> B(false);
218 
219  // instantiate the grid
220 #if HAVE_MPI
221  gridp = shared_ptr<Grid>(new Grid(Dune::MPIHelper::getCommunicator(),L,N,B,overlap));
222 #else
223  gridp = shared_ptr<Grid>(new Grid(L,N,B,overlap));
224 #endif
225  }
226 
227  // constructor with sizes given
228  StructuredGrid (Dune::GeometryType::BasicType meshtype,
229  array<double,dimworld> lower_left, array<double,dimworld> upper_right,
230  array<unsigned int,dim> cells, int overlap=1)
231  {
232  // check that lower right corner is the origin
233  for(int d = 0; d < dimworld; ++d)
234  if(std::abs(lower_left[d]) > std::abs(upper_right[d])*1e-10)
235  DUNE_THROW(GridError, className<StructuredGrid>()
236  << "::createCubeGrid(): The lower coordinates "
237  "must be at the origin for YaspGrid.");
238 
239  // check element type
240  if (meshtype!=Dune::GeometryType::cube)
241  std::cout << "StructuredGrid(): element type " << meshtype << " is ignored" << std::endl;
242 
243  // copy data to correct types for YaspGrid
244  Dune::FieldVector<double,dimworld> L;
245  Dune::array<int,dimworld> N;
246  std::bitset<dimworld> B(false);
247  for (size_t i=0; i<dimworld; i++)
248  {
249  L[i] = upper_right[i];
250  N[i] = cells[i];
251  }
252 
253  // instantiate the grid
254 #if HAVE_MPI
255  gridp = shared_ptr<Grid>(new Grid(Dune::MPIHelper::getCommunicator(),L,N,B,overlap));
256 #else
257  gridp = shared_ptr<Grid>(new Grid(L,N,B,overlap));
258 #endif
259  }
260 
261  // constructor with periodicity argument
262  StructuredGrid (Dune::GeometryType::BasicType meshtype,
263  array<double,dimworld> lower_left, array<double,dimworld> upper_right,
264  array<unsigned int,dim> cells, array<bool,dim> periodic, int overlap=1)
265  {
266  // check that lower right corner is the origin
267  for(int d = 0; d < dimworld; ++d)
268  if(std::abs(lower_left[d]) > std::abs(upper_right[d])*1e-10)
269  DUNE_THROW(GridError, className<StructuredGrid>()
270  << "::createCubeGrid(): The lower coordinates "
271  "must be at the origin for YaspGrid.");
272 
273  // check element type
274  if (meshtype!=Dune::GeometryType::cube)
275  std::cout << "StructuredGrid(): element type " << meshtype << " is ignored" << std::endl;
276 
277  // copy data to correct types for YaspGrid
278  Dune::FieldVector<double,dimworld> L;
279  Dune::array<int,dimworld> N;
280  std::bitset<dimworld> B(false);
281  for (size_t i=0; i<dimworld; i++)
282  {
283  L[i] = upper_right[i];
284  N[i] = cells[i];
285  B[i] = periodic[i];
286  }
287 
288  // instantiate the grid
289 #if HAVE_MPI
290  gridp = shared_ptr<Grid>(new Grid(Dune::MPIHelper::getCommunicator(),L,N,B,overlap));
291 #else
292  gridp = shared_ptr<Grid>(new Grid(L,N,B,overlap));
293 #endif
294  }
295 
296  // return shared pointer
297  Dune::shared_ptr<Grid> getSharedPtr ()
298  {
299  return gridp;
300  }
301 
302  // return grid reference
304  {
305  return *gridp;
306  }
307 
308  // return grid reference const version
309  const Grid& getGrid () const
310  {
311  return *gridp;
312  }
313 
315  {
316  return *gridp;
317  }
318 
320  {
321  return gridp.operator->();
322  }
323 
324  const Grid& operator*() const
325  {
326  return *gridp;
327  }
328 
329  const Grid* operator->() const
330  {
331  return gridp.operator->();
332  }
333 
334  private:
335  Dune::shared_ptr<Grid> gridp; // hold a shared pointer to a grid
336  };
337 
338  // unstructured grid read from gmsh file
339  template<typename T>
341  {
342  public:
343  // export types
344  typedef T Grid;
345  typedef typename T::ctype ctype;
346  static const int dim = T::dimension;
347  static const int dimworld = T::dimensionworld;
348 
349  // constructors
350  UnstructuredGrid (std::string filename, bool verbose = true, bool insert_boundary_segments=true)
351  {
352  Dune::GridFactory<T> factory;
353  Dune::GmshReader<T>::read(factory,filename,verbose,insert_boundary_segments);
354  gridp = shared_ptr<T>(factory.createGrid());
355  }
356 
357  // return shared pointer
358  Dune::shared_ptr<T> getSharedPtr ()
359  {
360  return gridp;
361  }
362 
363  // return grid reference
364  T& getGrid ()
365  {
366  return *gridp;
367  }
368 
369  // return grid reference const version
370  const T& getGrid () const
371  {
372  return *gridp;
373  }
374 
376  {
377  return *gridp;
378  }
379 
381  {
382  return gridp.operator->();
383  }
384 
385  const T& operator*() const
386  {
387  return *gridp;
388  }
389 
390  const T* operator->() const
391  {
392  return gridp.operator->();
393  }
394 
395  private:
396  Dune::shared_ptr<T> gridp; // hold a shared pointer to a grid
397  };
398 
399 
400  //============================================================================
401  // Continuous Lagrange Finite Element Space
402  //============================================================================
403 
404  // finite element map base template
405  template<typename GV, typename C, typename R, unsigned int degree, unsigned int dim, Dune::GeometryType::BasicType gt>
406  class CGFEMBase
407  {};
408 
409  template<typename GV, typename C, typename R, unsigned int degree, unsigned int dim>
410  class CGFEMBase<GV,C,R,degree,dim,Dune::GeometryType::simplex>
411  {
412  public:
414 
415  CGFEMBase (const GV& gridview)
416  {
417  femp = shared_ptr<FEM>(new FEM(gridview));
418  }
419 
420  FEM& getFEM() {return *femp;}
421  const FEM& getFEM() const {return *femp;}
422 
423  private:
424  shared_ptr<FEM> femp;
425  };
426 
427  template<typename GV, typename C, typename R, unsigned int degree, unsigned int dim>
428  class CGFEMBase<GV,C,R,degree,dim,Dune::GeometryType::cube>
429  {
430  public:
432 
433  CGFEMBase (const GV& gridview)
434  {
435  femp = shared_ptr<FEM>(new FEM(gridview));
436  }
437 
438  FEM& getFEM() {return *femp;}
439  const FEM& getFEM() const {return *femp;}
440 
441  private:
442  shared_ptr<FEM> femp;
443  };
444 
445  //============================================================================
446 
447  // define enumeration type that differentiate conforming and nonconforming meshes
448  enum MeshType {
451  };
452 
453  // constraints base template
454  template<typename Grid, unsigned int degree, Dune::GeometryType::BasicType gt, MeshType mt, SolverCategory::Category st, typename BCType, typename GV = typename Grid::LeafGridView>
455  class CGCONBase
456  {};
457 
458  template<typename Grid, typename BCType, typename GV>
459  class CGCONBase<Grid,1,Dune::GeometryType::simplex,MeshType::nonconforming,SolverCategory::sequential,BCType,GV>
460  {
461  public:
463 
464  CGCONBase (Grid& grid, const BCType& bctype, const GV& gv)
465  {
466  conp = shared_ptr<CON>(new CON(grid,true,bctype));
467  }
468 
469  CGCONBase (Grid& grid, const BCType& bctype)
470  {
471  conp = shared_ptr<CON>(new CON(grid,true,bctype));
472  }
473 
474  template<typename GFS>
475  void postGFSHook (const GFS& gfs) {}
476  CON& getCON() {return *conp;}
477  const CON& getCON() const {return *conp;}
478  template<typename GFS, typename DOF>
479  void make_consistent (const GFS& gfs, DOF& x) const {}
480  private:
481  shared_ptr<CON> conp;
482  };
483 
484  template<typename Grid, typename BCType, typename GV>
485  class CGCONBase<Grid,1,Dune::GeometryType::cube,MeshType::nonconforming,SolverCategory::sequential,BCType,GV>
486  {
487  public:
489 
490  CGCONBase (Grid& grid, const BCType& bctype, const GV& gv)
491  {
492  conp = shared_ptr<CON>(new CON(grid,true,bctype));
493  }
494 
495  CGCONBase (Grid& grid, const BCType& bctype)
496  {
497  conp = shared_ptr<CON>(new CON(grid,true,bctype));
498  }
499 
500  template<typename GFS>
501  void postGFSHook (const GFS& gfs) {}
502  CON& getCON() {return *conp;}
503  const CON& getCON() const {return *conp;}
504  template<typename GFS, typename DOF>
505  void make_consistent (const GFS& gfs, DOF& x) const {}
506  private:
507  shared_ptr<CON> conp;
508  };
509 
510  template<typename Grid, unsigned int degree, Dune::GeometryType::BasicType gt,typename BCType, typename GV>
511  class CGCONBase<Grid,degree,gt,MeshType::conforming,SolverCategory::sequential,BCType,GV>
512  {
513  public:
515 
516  CGCONBase (Grid& grid, const BCType& bctype, const GV& gv)
517  {
518  conp = shared_ptr<CON>(new CON());
519  }
520 
521  CGCONBase (Grid& grid, const BCType& bctype)
522  {
523  conp = shared_ptr<CON>(new CON());
524  }
525 
526  template<typename GFS>
527  void postGFSHook (const GFS& gfs) {}
528  CON& getCON() {return *conp;}
529  const CON& getCON() const {return *conp;}
530  template<typename GFS, typename DOF>
531  void make_consistent (const GFS& gfs, DOF& x) const {}
532  private:
533  shared_ptr<CON> conp;
534  };
535 
536  template<typename Grid, unsigned int degree, Dune::GeometryType::BasicType gt,typename BCType, typename GV>
537  class CGCONBase<Grid,degree,gt,MeshType::conforming,SolverCategory::overlapping,BCType,GV>
538  {
539  public:
541 
542  CGCONBase (Grid& grid, const BCType& bctype, const GV& gv)
543  {
544  conp = shared_ptr<CON>(new CON());
545  }
546 
547  CGCONBase (Grid& grid, const BCType& bctype)
548  {
549  conp = shared_ptr<CON>(new CON());
550  }
551 
552  template<typename GFS>
553  void postGFSHook (const GFS& gfs) {}
554  CON& getCON() {return *conp;}
555  const CON& getCON() const {return *conp;}
556  template<typename GFS, typename DOF>
557  void make_consistent (const GFS& gfs, DOF& x) const
558  {
559  // make vector consistent; this is needed for all overlapping solvers
560  istl::ParallelHelper<GFS> helper(gfs);
561  helper.maskForeignDOFs(istl::raw(x));
563  if (gfs.gridView().comm().size()>1)
564  gfs.gridView().communicate(adddh,Dune::InteriorBorder_All_Interface,Dune::ForwardCommunication);
565  }
566  private:
567  shared_ptr<CON> conp;
568  };
569 
570  template<typename Grid, unsigned int degree, Dune::GeometryType::BasicType gt,typename BCType, typename GV>
571  class CGCONBase<Grid,degree,gt,MeshType::conforming,SolverCategory::nonoverlapping,BCType,GV>
572  {
573  public:
575 
576  CGCONBase (Grid& grid, const BCType& bctype, const GV& gv)
577  {
578  conp = shared_ptr<CON>(new CON(gv));
579  }
580 
581  CGCONBase (Grid& grid, const BCType& bctype)
582  {
583  conp = shared_ptr<CON>(new CON(grid.leafGridView()));
584  }
585 
586  template<typename GFS>
587  void postGFSHook (const GFS& gfs) { conp->compute_ghosts(gfs); }
588  CON& getCON() {return *conp;}
589  const CON& getCON() const {return *conp;}
590  template<typename GFS, typename DOF>
591  void make_consistent (const GFS& gfs, DOF& x) const {}
592  private:
593  shared_ptr<CON> conp;
594  };
595 
596 
597  // continuous Lagrange finite elements
598  template<typename T, typename N, unsigned int degree, typename BCType,
599  Dune::GeometryType::BasicType gt, MeshType mt, SolverCategory::Category st = SolverCategory::sequential,
600  typename VBET=ISTLVectorBackend<> >
601  class CGSpace {
602  public:
603 
604  // export types
605  typedef T Grid;
606  typedef typename T::LeafGridView GV;
607  typedef typename T::ctype ctype;
608  static const int dim = T::dimension;
609  static const int dimworld = T::dimensionworld;
610 
613 
614  typedef typename FEMB::FEM FEM;
615  typedef typename CONB::CON CON;
616 
617  typedef VBET VBE;
619 
620  typedef N NT;
623  typedef typename GFS::template ConstraintsContainer<N>::Type CC;
625 
626  // constructor making the grid function space an all that is needed
627  CGSpace (Grid& grid, const BCType& bctype)
628  : gv(grid.leafGridView()), femb(gv), conb(grid,bctype)
629  {
630  gfsp = shared_ptr<GFS>(new GFS(gv,femb.getFEM(),conb.getCON()));
631  gfsp->name("cgspace");
632  // initialize ordering
633  gfsp->update();
634  conb.postGFSHook(*gfsp);
635  ccp = shared_ptr<CC>(new CC());
636  }
637 
639  {
640  return femb.getFEM();
641  }
642 
643  const FEM& getFEM() const
644  {
645  return femb.getFEM();
646  }
647 
648  // return gfs reference
650  {
651  return *gfsp;
652  }
653 
654  // return gfs reference const version
655  const GFS& getGFS () const
656  {
657  return *gfsp;
658  }
659 
660  // return gfs reference
661  CC& getCC ()
662  {
663  return *ccp;
664  }
665 
666  // return gfs reference const version
667  const CC& getCC () const
668  {
669  return *ccp;
670  }
671 
672  void assembleConstraints (const BCType& bctype)
673  {
674  ccp->clear();
675  constraints(bctype,*gfsp,*ccp);
676  }
677 
679  {
680  ccp->clear();
681  }
682 
683  void setConstrainedDOFS (DOF& x, NT nt) const
684  {
685  set_constrained_dofs(*ccp,nt,x);
686  conb.make_consistent(*gfsp,x);
687  }
688 
689  void setNonConstrainedDOFS (DOF& x, NT nt) const
690  {
691  set_nonconstrained_dofs(*ccp,nt,x);
692  conb.make_consistent(*gfsp,x);
693  }
694 
695  void copyConstrainedDOFS (const DOF& xin, DOF& xout) const
696  {
697  copy_constrained_dofs(*ccp,xin,xout);
698  conb.make_consistent(*gfsp,xout);
699  }
700 
701  void copyNonConstrainedDOFS (const DOF& xin, DOF& xout) const
702  {
703  copy_nonconstrained_dofs(*ccp,xin,xout);
704  conb.make_consistent(*gfsp,xout);
705  }
706 
707  private:
708  GV gv; // need this object here because FEM and GFS store a const reference !!
709  FEMB femb;
710  CONB conb;
711  shared_ptr<GFS> gfsp;
712  shared_ptr<CC> ccp;
713  };
714 
715 
716  //============================================================================
717  // Discontinuous Finite Element Space
718  //============================================================================
719 
720  // constraints base template
721  template<SolverCategory::Category st>
722  class DGCONBase
723  {};
724 
725  template<>
726  class DGCONBase<SolverCategory::sequential>
727  {
728  public:
731  {
732  conp = shared_ptr<CON>(new CON());
733  }
734  CON& getCON() {return *conp;}
735  const CON& getCON() const {return *conp;}
736  template<typename GFS, typename DOF>
737  void make_consistent (const GFS& gfs, DOF& x) const {}
738  private:
739  shared_ptr<CON> conp;
740  };
741 
742  template<>
743  class DGCONBase<SolverCategory::nonoverlapping>
744  {
745  public:
748  {
749  conp = shared_ptr<CON>(new CON());
750  }
751  CON& getCON() {return *conp;}
752  const CON& getCON() const {return *conp;}
753  template<typename GFS, typename DOF>
754  void make_consistent (const GFS& gfs, DOF& x) const {}
755  private:
756  shared_ptr<CON> conp;
757  };
758 
759  template<>
760  class DGCONBase<SolverCategory::overlapping>
761  {
762  public:
765  {
766  conp = shared_ptr<CON>(new CON());
767  }
768  CON& getCON() {return *conp;}
769  const CON& getCON() const {return *conp;}
770  template<typename GFS, typename DOF>
771  void make_consistent (const GFS& gfs, DOF& x) const
772  {
773  // make vector consistent; this is needed for all overlapping solvers
774  istl::ParallelHelper<GFS> helper(gfs);
775  helper.maskForeignDOFs(istl::raw(x));
777  if (gfs.gridView().comm().size()>1)
778  gfs.gridView().communicate(adddh,Dune::InteriorBorder_All_Interface,Dune::ForwardCommunication);
779  }
780  private:
781  shared_ptr<CON> conp;
782  };
783 
784  // Discontinuous space
785  // default implementation, use only specializations below
786  template<typename T, typename N, unsigned int degree,
787  Dune::GeometryType::BasicType gt, SolverCategory::Category st = SolverCategory::sequential,
789  class DGPkSpace
790  {
791  public:
792 
793  // export types
794  typedef T Grid;
795  typedef typename T::LeafGridView GV;
796  typedef typename T::ctype ctype;
797  static const int dim = T::dimension;
798  static const int dimworld = T::dimensionworld;
799  typedef N NT;
800 #if HAVE_GMP
802 #else
804 #endif
806  typedef typename CONB::CON CON;
807  typedef VBET VBE;
811  typedef typename GFS::template ConstraintsContainer<N>::Type CC;
813 
814  // constructor making the grid function space an all that is needed
815  DGPkSpace (const GV& gridview) : gv(gridview), conb()
816  {
817  femp = shared_ptr<FEM>(new FEM());
818  gfsp = shared_ptr<GFS>(new GFS(gv,*femp));
819  // initialize ordering
820  gfsp->update();
821  ccp = shared_ptr<CC>(new CC());
822  }
823 
824  FEM& getFEM() { return *femp; }
825  const FEM& getFEM() const { return *femp; }
826 
827  // return gfs reference
828  GFS& getGFS () { return *gfsp; }
829 
830  // return gfs reference const version
831  const GFS& getGFS () const {return *gfsp;}
832 
833  // return gfs reference
834  CC& getCC () { return *ccp;}
835 
836  // return gfs reference const version
837  const CC& getCC () const { return *ccp;}
838 
839  template<class BCTYPE>
840  void assembleConstraints (const BCTYPE& bctype)
841  {
842  ccp->clear();
843  constraints(bctype,*gfsp,*ccp);
844  }
845 
847  {
848  ccp->clear();
849  }
850 
851  void setConstrainedDOFS (DOF& x, NT nt) const
852  {
853  set_constrained_dofs(*ccp,nt,x);
854  conb.make_consistent(*gfsp,x);
855  }
856 
857  void setNonConstrainedDOFS (DOF& x, NT nt) const
858  {
859  set_nonconstrained_dofs(*ccp,nt,x);
860  conb.make_consistent(*gfsp,x);
861  }
862 
863  void copyConstrainedDOFS (const DOF& xin, DOF& xout) const
864  {
865  copy_constrained_dofs(*ccp,xin,xout);
866  conb.make_consistent(*gfsp,xout);
867  }
868 
869  void copyNonConstrainedDOFS (const DOF& xin, DOF& xout) const
870  {
871  copy_nonconstrained_dofs(*ccp,xin,xout);
872  conb.make_consistent(*gfsp,xout);
873  }
874 
875  private:
876  GV gv; // need this object here because FEM and GFS store a const reference !!
877  CONB conb;
878  shared_ptr<FEM> femp;
879  shared_ptr<GFS> gfsp;
880  shared_ptr<CC> ccp;
881  };
882 
883  // Discontinuous space
884  // default implementation, use only specializations below
885  template<typename T, typename N, unsigned int degree,
886  Dune::GeometryType::BasicType gt, SolverCategory::Category st = SolverCategory::sequential,
887  //typename VBET=ISTLVectorBackend<ISTLParameters::static_blocking,Dune::PB::PkSize<degree,T::dimension>::value> >
888  typename VBET=ISTLVectorBackend<> >
890  {
891  public:
892 
893  // export types
894  typedef T Grid;
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;
899  typedef N NT;
900 #if HAVE_GMP
902 #else
904 #endif
906  typedef typename CONB::CON CON;
907  typedef VBET VBE;
911  typedef typename GFS::template ConstraintsContainer<N>::Type CC;
913 
914  // constructor making the grid function space an all that is needed
915  DGQkOPBSpace (const GV& gridview) : gv(gridview), conb()
916  {
917  femp = shared_ptr<FEM>(new FEM());
918  gfsp = shared_ptr<GFS>(new GFS(gv,*femp));
919  // initialize ordering
920  gfsp->update();
921  ccp = shared_ptr<CC>(new CC());
922  }
923 
924  FEM& getFEM() { return *femp; }
925  const FEM& getFEM() const { return *femp; }
926 
927  // return gfs reference
928  GFS& getGFS () { return *gfsp; }
929 
930  // return gfs reference const version
931  const GFS& getGFS () const {return *gfsp;}
932 
933  // return gfs reference
934  CC& getCC () { return *ccp;}
935 
936  // return gfs reference const version
937  const CC& getCC () const { return *ccp;}
938 
939  template<class BCTYPE>
940  void assembleConstraints (const BCTYPE& bctype)
941  {
942  ccp->clear();
943  constraints(bctype,*gfsp,*ccp);
944  }
945 
947  {
948  ccp->clear();
949  }
950 
951  void setConstrainedDOFS (DOF& x, NT nt) const
952  {
953  set_constrained_dofs(*ccp,nt,x);
954  conb.make_consistent(*gfsp,x);
955  }
956 
957  void setNonConstrainedDOFS (DOF& x, NT nt) const
958  {
959  set_nonconstrained_dofs(*ccp,nt,x);
960  conb.make_consistent(*gfsp,x);
961  }
962 
963  void copyConstrainedDOFS (const DOF& xin, DOF& xout) const
964  {
965  copy_constrained_dofs(*ccp,xin,xout);
966  conb.make_consistent(*gfsp,xout);
967  }
968 
969  void copyNonConstrainedDOFS (const DOF& xin, DOF& xout) const
970  {
971  copy_nonconstrained_dofs(*ccp,xin,xout);
972  conb.make_consistent(*gfsp,xout);
973  }
974 
975  private:
976  GV gv; // need this object here because FEM and GFS store a const reference !!
977  CONB conb;
978  shared_ptr<FEM> femp;
979  shared_ptr<GFS> gfsp;
980  shared_ptr<CC> ccp;
981  };
982 
983  // Discontinuous space
984  // default implementation, use only specializations below
985  template<typename T, typename N, unsigned int degree,
986  Dune::GeometryType::BasicType gt, SolverCategory::Category st = SolverCategory::sequential,
988  class DGQkSpace
989  {
990  public:
991 
992  // export types
993  typedef T Grid;
994  typedef typename T::LeafGridView GV;
995  typedef typename T::ctype ctype;
996  static const int dim = T::dimension;
997  static const int dimworld = T::dimensionworld;
998  typedef N NT;
1001  typedef typename CONB::CON CON;
1002  typedef VBET VBE;
1006  typedef typename GFS::template ConstraintsContainer<N>::Type CC;
1008 
1009  // constructor making the grid function space an all that is needed
1010  DGQkSpace (const GV& gridview) : gv(gridview), conb()
1011  {
1012  femp = shared_ptr<FEM>(new FEM());
1013  gfsp = shared_ptr<GFS>(new GFS(gv,*femp));
1014  // initialize ordering
1015  gfsp->update();
1016  ccp = shared_ptr<CC>(new CC());
1017  }
1018 
1019  FEM& getFEM() { return *femp; }
1020  const FEM& getFEM() const { return *femp; }
1021 
1022  // return gfs reference
1023  GFS& getGFS () { return *gfsp; }
1024 
1025  // return gfs reference const version
1026  const GFS& getGFS () const {return *gfsp;}
1027 
1028  // return gfs reference
1029  CC& getCC () { return *ccp;}
1030 
1031  // return gfs reference const version
1032  const CC& getCC () const { return *ccp;}
1033 
1034  template<class BCTYPE>
1035  void assembleConstraints (const BCTYPE& bctype)
1036  {
1037  ccp->clear();
1038  constraints(bctype,*gfsp,*ccp);
1039  }
1040 
1042  {
1043  ccp->clear();
1044  }
1045 
1046  void setConstrainedDOFS (DOF& x, NT nt) const
1047  {
1048  set_constrained_dofs(*ccp,nt,x);
1049  conb.make_consistent(*gfsp,x);
1050  }
1051 
1052  void setNonConstrainedDOFS (DOF& x, NT nt) const
1053  {
1054  set_nonconstrained_dofs(*ccp,nt,x);
1055  conb.make_consistent(*gfsp,x);
1056  }
1057 
1058  void copyConstrainedDOFS (const DOF& xin, DOF& xout) const
1059  {
1060  copy_constrained_dofs(*ccp,xin,xout);
1061  conb.make_consistent(*gfsp,xout);
1062  }
1063 
1064  void copyNonConstrainedDOFS (const DOF& xin, DOF& xout) const
1065  {
1066  copy_nonconstrained_dofs(*ccp,xin,xout);
1067  conb.make_consistent(*gfsp,xout);
1068  }
1069 
1070  private:
1071  GV gv; // need this object here because FEM and GFS store a const reference !!
1072  CONB conb;
1073  shared_ptr<FEM> femp;
1074  shared_ptr<GFS> gfsp;
1075  shared_ptr<CC> ccp;
1076  };
1077 
1078 
1079  // Discontinuous space using QK with Gauss Lobatto points (use only for cube elements)
1080  template<typename T, typename N, unsigned int degree,
1081  Dune::GeometryType::BasicType gt, SolverCategory::Category st = SolverCategory::sequential,
1082  //typename VBET=ISTLVectorBackend<ISTLParameters::static_blocking,Dune::QkStuff::QkSize<degree,T::dimension>::value> >
1083  typename VBET=ISTLVectorBackend<> >
1085  {
1086  public:
1087 
1088  // export types
1089  typedef T Grid;
1090  typedef typename T::LeafGridView GV;
1091  typedef typename T::ctype ctype;
1092  static const int dim = T::dimension;
1093  static const int dimworld = T::dimensionworld;
1094  typedef N NT;
1097  typedef typename CONB::CON CON;
1098  typedef VBET VBE;
1102  typedef typename GFS::template ConstraintsContainer<N>::Type CC;
1104 
1105  // constructor making the grid function space an all that is needed
1106  DGQkGLSpace (const GV& gridview) : gv(gridview), conb()
1107  {
1108  femp = shared_ptr<FEM>(new FEM());
1109  gfsp = shared_ptr<GFS>(new GFS(gv,*femp));
1110  // initialize ordering
1111  gfsp->update();
1112  ccp = shared_ptr<CC>(new CC());
1113  }
1114 
1115  FEM& getFEM() { return *femp; }
1116  const FEM& getFEM() const { return *femp; }
1117 
1118  // return gfs reference
1119  GFS& getGFS () { return *gfsp; }
1120 
1121  // return gfs reference const version
1122  const GFS& getGFS () const {return *gfsp;}
1123 
1124  // return gfs reference
1125  CC& getCC () { return *ccp;}
1126 
1127  // return gfs reference const version
1128  const CC& getCC () const { return *ccp;}
1129 
1130  template<class BCTYPE>
1131  void assembleConstraints (const BCTYPE& bctype)
1132  {
1133  ccp->clear();
1134  constraints(bctype,*gfsp,*ccp);
1135  }
1136 
1138  {
1139  ccp->clear();
1140  }
1141 
1142  void setConstrainedDOFS (DOF& x, NT nt) const
1143  {
1144  set_constrained_dofs(*ccp,nt,x);
1145  conb.make_consistent(*gfsp,x);
1146  }
1147 
1148  void setNonConstrainedDOFS (DOF& x, NT nt) const
1149  {
1150  set_nonconstrained_dofs(*ccp,nt,x);
1151  conb.make_consistent(*gfsp,x);
1152  }
1153 
1154  void copyConstrainedDOFS (const DOF& xin, DOF& xout) const
1155  {
1156  copy_constrained_dofs(*ccp,xin,xout);
1157  conb.make_consistent(*gfsp,xout);
1158  }
1159 
1160  void copyNonConstrainedDOFS (const DOF& xin, DOF& xout) const
1161  {
1162  copy_nonconstrained_dofs(*ccp,xin,xout);
1163  conb.make_consistent(*gfsp,xout);
1164  }
1165 
1166  private:
1167  GV gv; // need this object here because FEM and GFS store a const reference !!
1168  CONB conb;
1169  shared_ptr<FEM> femp;
1170  shared_ptr<GFS> gfsp;
1171  shared_ptr<CC> ccp;
1172  };
1173 
1174 
1175 
1176  // Discontinuous P0 space
1177  template<typename T, typename N,
1178  Dune::GeometryType::BasicType gt, SolverCategory::Category st = SolverCategory::sequential,
1179  typename VBET=ISTLVectorBackend<> >
1180  class P0Space
1181  {
1182  public:
1183 
1184  // export types
1185  typedef T Grid;
1186  typedef typename T::LeafGridView GV;
1187  typedef typename T::ctype ctype;
1188  static const int dim = T::dimension;
1189  static const int dimworld = T::dimensionworld;
1190  typedef N NT;
1193  typedef typename CONB::CON CON;
1194  typedef VBET VBE;
1198  typedef typename GFS::template ConstraintsContainer<N>::Type CC;
1200 
1201  // constructor making the grid function space an all that is needed
1202  P0Space (const GV& gridview) : gv(gridview), conb()
1203  {
1204  femp = shared_ptr<FEM>(new FEM(Dune::GeometryType(gt,dim)));
1205  gfsp = shared_ptr<GFS>(new GFS(gv,*femp));
1206  // initialize ordering
1207  gfsp->update();
1208  ccp = shared_ptr<CC>(new CC());
1209  }
1210 
1211  FEM& getFEM() { return *femp; }
1212  const FEM& getFEM() const { return *femp; }
1213 
1214  // return gfs reference
1215  GFS& getGFS () { return *gfsp; }
1216 
1217  // return gfs reference const version
1218  const GFS& getGFS () const {return *gfsp;}
1219 
1220  // return gfs reference
1221  CC& getCC () { return *ccp;}
1222 
1223  // return gfs reference const version
1224  const CC& getCC () const { return *ccp;}
1225 
1226  template<class BCTYPE>
1227  void assembleConstraints (const BCTYPE& bctype)
1228  {
1229  ccp->clear();
1230  constraints(bctype,*gfsp,*ccp);
1231  }
1232 
1234  {
1235  ccp->clear();
1236  }
1237 
1238  void setConstrainedDOFS (DOF& x, NT nt) const
1239  {
1240  set_constrained_dofs(*ccp,nt,x);
1241  conb.make_consistent(*gfsp,x);
1242  }
1243 
1244  void setNonConstrainedDOFS (DOF& x, NT nt) const
1245  {
1246  set_nonconstrained_dofs(*ccp,nt,x);
1247  conb.make_consistent(*gfsp,x);
1248  }
1249 
1250  void copyConstrainedDOFS (const DOF& xin, DOF& xout) const
1251  {
1252  copy_constrained_dofs(*ccp,xin,xout);
1253  conb.make_consistent(*gfsp,xout);
1254  }
1255 
1256  void copyNonConstrainedDOFS (const DOF& xin, DOF& xout) const
1257  {
1258  copy_nonconstrained_dofs(*ccp,xin,xout);
1259  conb.make_consistent(*gfsp,xout);
1260  }
1261 
1262  private:
1263  GV gv; // need this object here because FEM and GFS store a const reference !!
1264  CONB conb;
1265  shared_ptr<FEM> femp;
1266  shared_ptr<GFS> gfsp;
1267  shared_ptr<CC> ccp;
1268  };
1269 
1270 
1271  // how can we most easily specify a grid function
1272  // pass a function space as parameter
1273  template<typename FS, typename Functor>
1275  : public GridFunctionBase<GridFunctionTraits<typename FS::GV, typename FS::NT,
1276  1,FieldVector<typename FS::NT,1> >
1277  ,UserFunction<FS,Functor> >
1278  {
1279  public:
1280  typedef GridFunctionTraits<typename FS::GV, typename FS::NT,
1281  1,FieldVector<typename FS::NT,1> > Traits;
1282 
1284  UserFunction (const FS& fs_, const Functor& f_)
1285  : fs(fs_), f(f_)
1286  {}
1287 
1289  inline void evaluate (const typename Traits::ElementType& e,
1290  const typename Traits::DomainType& x,
1291  typename Traits::RangeType& y) const
1292  {
1293  typename Traits::DomainType x_ = e.geometry().global(x);
1294  std::vector<double> x__(x.size());
1295  for (size_t i=0; i<x.size(); ++i) x__[i]=x_[i];
1296  y = f(x__);
1297  }
1298 
1299  inline const typename FS::GV& getGridView () const
1300  {
1301  return fs.getGFS().gridView();
1302  }
1303 
1304  private:
1305  const FS fs; // store a copy of the function space
1306  const Functor f;
1307  };
1308 
1309 
1310  template<typename FS, typename LOP, SolverCategory::Category st = SolverCategory::sequential>
1312  {
1313  public:
1314  // export types
1316  typedef Dune::PDELab::GridOperator<typename FS::GFS,typename FS::GFS,LOP,MBE,
1317  typename FS::NT,typename FS::NT,typename FS::NT,
1318  typename FS::CC,typename FS::CC> GO;
1319  typedef typename GO::Jacobian MAT;
1320 
1321  GalerkinGlobalAssembler (const FS& fs, LOP& lop)
1322  {
1323  gop = shared_ptr<GO>(new GO(fs.getGFS(),fs.getCC(),fs.getGFS(),fs.getCC(),lop));
1324  }
1325 
1326  // return grid reference
1327  GO& getGO ()
1328  {
1329  return *gop;
1330  }
1331 
1332  // return grid reference const version
1333  const GO& getGO () const
1334  {
1335  return *gop;
1336  }
1337 
1339  {
1340  return *gop;
1341  }
1342 
1344  {
1345  return gop.operator->();
1346  }
1347 
1348  const GO& operator*() const
1349  {
1350  return *gop;
1351  }
1352 
1353  const GO* operator->() const
1354  {
1355  return gop.operator->();
1356  }
1357 
1358  private:
1359  shared_ptr<GO> gop;
1360  };
1361 
1362  // nonoverlapping variant
1363  template<typename FS, typename LOP>
1364  class GalerkinGlobalAssembler<FS,LOP,SolverCategory::nonoverlapping>
1365  {
1366  public:
1367  // export types
1369  typedef Dune::PDELab::GridOperator<typename FS::GFS,typename FS::GFS,LOP,MBE,
1370  typename FS::NT,typename FS::NT,typename FS::NT,
1371  typename FS::CC,typename FS::CC,true> GO;
1372  typedef typename GO::Jacobian MAT;
1373 
1374  GalerkinGlobalAssembler (const FS& fs, LOP& lop)
1375  {
1376  gop = shared_ptr<GO>(new GO(fs.getGFS(),fs.getCC(),fs.getGFS(),fs.getCC(),lop));
1377  }
1378 
1379  // return grid reference
1380  GO& getGO ()
1381  {
1382  return *gop;
1383  }
1384 
1385  // return grid reference const version
1386  const GO& getGO () const
1387  {
1388  return *gop;
1389  }
1390 
1392  {
1393  return *gop;
1394  }
1395 
1397  {
1398  return gop.operator->();
1399  }
1400 
1401  const GO& operator*() const
1402  {
1403  return *gop;
1404  }
1405 
1406  const GO* operator->() const
1407  {
1408  return gop.operator->();
1409  }
1410 
1411  private:
1412  shared_ptr<GO> gop;
1413  };
1414 
1415 
1416  template<typename FS, typename LOP, SolverCategory::Category st = SolverCategory::sequential>
1418  {
1419  public:
1420  // export types
1422  typedef Dune::PDELab::GridOperator<typename FS::GFS,typename FS::GFS,LOP,MBE,
1423  typename FS::NT,typename FS::NT,typename FS::NT,
1424  typename FS::CC,typename FS::CC> GO;
1425  typedef typename GO::Jacobian MAT;
1426 
1427  GalerkinGlobalAssemblerNewBackend (const FS& fs, LOP& lop, const MBE& mbe)
1428  {
1429  gop = shared_ptr<GO>(new GO(fs.getGFS(),fs.getCC(),fs.getGFS(),fs.getCC(),lop,mbe));
1430  }
1431 
1432  // return grid reference
1433  GO& getGO ()
1434  {
1435  return *gop;
1436  }
1437 
1438  // return grid reference const version
1439  const GO& getGO () const
1440  {
1441  return *gop;
1442  }
1443 
1445  {
1446  return *gop;
1447  }
1448 
1450  {
1451  return gop.operator->();
1452  }
1453 
1454  const GO& operator*() const
1455  {
1456  return *gop;
1457  }
1458 
1459  const GO* operator->() const
1460  {
1461  return gop.operator->();
1462  }
1463 
1464  private:
1465  shared_ptr<GO> gop;
1466  };
1467 
1468  // nonoverlapping variant
1469  template<typename FS, typename LOP>
1470  class GalerkinGlobalAssemblerNewBackend<FS,LOP,SolverCategory::nonoverlapping>
1471  {
1472  public:
1473  // export types
1475  typedef Dune::PDELab::GridOperator<typename FS::GFS,typename FS::GFS,LOP,MBE,
1476  typename FS::NT,typename FS::NT,typename FS::NT,
1477  typename FS::CC,typename FS::CC,true> GO;
1478  typedef typename GO::Jacobian MAT;
1479 
1480  GalerkinGlobalAssemblerNewBackend (const FS& fs, LOP& lop, const MBE& mbe)
1481  {
1482  gop = shared_ptr<GO>(new GO(fs.getGFS(),fs.getCC(),fs.getGFS(),fs.getCC(),lop,mbe));
1483  }
1484 
1485  // return grid reference
1486  GO& getGO ()
1487  {
1488  return *gop;
1489  }
1490 
1491  // return grid reference const version
1492  const GO& getGO () const
1493  {
1494  return *gop;
1495  }
1496 
1498  {
1499  return *gop;
1500  }
1501 
1503  {
1504  return gop.operator->();
1505  }
1506 
1507  const GO& operator*() const
1508  {
1509  return *gop;
1510  }
1511 
1512  const GO* operator->() const
1513  {
1514  return gop.operator->();
1515  }
1516 
1517  private:
1518  shared_ptr<GO> gop;
1519  };
1520 
1521 
1522 
1523 
1524  // variant with two different function spaces
1525  template<typename FSU, typename FSV, typename LOP, SolverCategory::Category st>
1527  {
1528  public:
1529  // export types
1531  typedef Dune::PDELab::GridOperator<typename FSU::GFS,typename FSV::GFS,LOP,MBE,
1532  typename FSU::NT,typename FSU::NT,typename FSU::NT,
1533  typename FSU::CC,typename FSV::CC> GO;
1534  typedef typename GO::Jacobian MAT;
1535 
1536  GlobalAssembler (const FSU& fsu, const FSV& fsv, LOP& lop)
1537  {
1538  gop = shared_ptr<GO>(new GO(fsu.getGFS(),fsu.getCC(),fsv.getGFS(),fsv.getCC(),lop));
1539  }
1540 
1541  // return grid reference
1542  GO& getGO ()
1543  {
1544  return *gop;
1545  }
1546 
1547  // return grid reference const version
1548  const GO& getGO () const
1549  {
1550  return *gop;
1551  }
1552 
1554  {
1555  return *gop;
1556  }
1557 
1559  {
1560  return gop.operator->();
1561  }
1562 
1563  const GO& operator*() const
1564  {
1565  return *gop;
1566  }
1567 
1568  const GO* operator->() const
1569  {
1570  return gop.operator->();
1571  }
1572 
1573  private:
1574  shared_ptr<GO> gop;
1575  };
1576 
1577  // nonoverlapping variant
1578  template<typename FSU, typename FSV, typename LOP>
1579  class GlobalAssembler<FSU,FSV,LOP,SolverCategory::nonoverlapping>
1580  {
1581  public:
1582  // export types
1584  typedef Dune::PDELab::GridOperator<typename FSU::GFS,typename FSV::GFS,LOP,MBE,
1585  typename FSU::NT,typename FSU::NT,typename FSU::NT,
1586  typename FSU::CC,typename FSV::CC,true> GO;
1587  typedef typename GO::Jacobian MAT;
1588 
1589  GlobalAssembler (const FSU& fsu, const FSV& fsv, LOP& lop)
1590  {
1591  gop = shared_ptr<GO>(new GO(fsu.getGFS(),fsu.getCC(),fsv.getGFS(),fsv.getCC(),lop));
1592  }
1593 
1594  // return grid reference
1595  GO& getGO ()
1596  {
1597  return *gop;
1598  }
1599 
1600  // return grid reference const version
1601  const GO& getGO () const
1602  {
1603  return *gop;
1604  }
1605 
1607  {
1608  return *gop;
1609  }
1610 
1612  {
1613  return gop.operator->();
1614  }
1615 
1616  const GO& operator*() const
1617  {
1618  return *gop;
1619  }
1620 
1621  const GO* operator->() const
1622  {
1623  return gop.operator->();
1624  }
1625 
1626  private:
1627  shared_ptr<GO> gop;
1628  };
1629 
1630 
1631 
1632  template<typename GO1, typename GO2, bool implicit = true>
1634  {
1635  public:
1636  // export types
1639  typedef typename GO::Jacobian MAT;
1640 
1641  OneStepGlobalAssembler (GO1& go1, GO2& go2)
1642  {
1643  gop = shared_ptr<GO>(new GO(*go1,*go2));
1644  }
1645 
1646  // return grid reference
1647  GO& getGO ()
1648  {
1649  return *gop;
1650  }
1651 
1652  // return grid reference const version
1653  const GO& getGO () const
1654  {
1655  return *gop;
1656  }
1657 
1659  {
1660  return *gop;
1661  }
1662 
1664  {
1665  return gop.operator->();
1666  }
1667 
1668  const GO& operator*() const
1669  {
1670  return *gop;
1671  }
1672 
1673  const GO* operator->() const
1674  {
1675  return gop.operator->();
1676  }
1677 
1678  private:
1679  shared_ptr<GO> gop;
1680  };
1681 
1682 
1683  // packaging of the CG_AMG_SSOR solver: default version is sequential
1684  template<typename FS, typename ASS, SolverCategory::Category st = SolverCategory::sequential>
1686  {
1687  public:
1688  // types exported
1690 
1691  ISTLSolverBackend_CG_AMG_SSOR (const FS& fs, const ASS& ass, unsigned maxiter_=5000,
1692  int verbose_=1, bool reuse_=false, bool usesuperlu_=true)
1693  {
1694  lsp = shared_ptr<LS>(new LS(maxiter_,verbose_,reuse_,usesuperlu_));
1695  }
1696 
1697  LS& getLS () {return *lsp;}
1698  const LS& getLS () const { return *lsp;}
1699  LS& operator*(){return *lsp;}
1700  LS* operator->() { return lsp.operator->(); }
1701  const LS& operator*() const{return *lsp;}
1702  const LS* operator->() const{ return lsp.operator->();}
1703 
1704  private:
1705  shared_ptr<LS> lsp;
1706  };
1707 
1708  // packaging of the CG_AMG_SSOR solver: nonoverlapping version
1709  template<typename FS, typename ASS>
1710  class ISTLSolverBackend_CG_AMG_SSOR<FS,ASS, SolverCategory::nonoverlapping>
1711  {
1712  public:
1713  // types exported
1715 
1716  ISTLSolverBackend_CG_AMG_SSOR (const FS& fs, const ASS& ass, unsigned maxiter_=5000,
1717  int verbose_=1, bool reuse_=false, bool usesuperlu_=true)
1718  {
1719  lsp = shared_ptr<LS>(new LS(fs.getGFS(),maxiter_,verbose_,reuse_,usesuperlu_));
1720  }
1721 
1722  LS& getLS () {return *lsp;}
1723  const LS& getLS () const { return *lsp;}
1724  LS& operator*(){return *lsp;}
1725  LS* operator->() { return lsp.operator->(); }
1726  const LS& operator*() const{return *lsp;}
1727  const LS* operator->() const{ return lsp.operator->();}
1728 
1729  private:
1730  shared_ptr<LS> lsp;
1731  };
1732 
1733  // packaging of the CG_AMG_SSOR solver: overlapping version
1734  template<typename FS, typename ASS>
1735  class ISTLSolverBackend_CG_AMG_SSOR<FS,ASS, SolverCategory::overlapping>
1736  {
1737  public:
1738  // types exported
1740 
1741  ISTLSolverBackend_CG_AMG_SSOR (const FS& fs, const ASS& ass, unsigned maxiter_=5000,
1742  int verbose_=1, bool reuse_=false, bool usesuperlu_=true)
1743  {
1744  lsp = shared_ptr<LS>(new LS(fs.getGFS(),maxiter_,verbose_,reuse_,usesuperlu_));
1745  }
1746 
1747  LS& getLS () {return *lsp;}
1748  const LS& getLS () const { return *lsp;}
1749  LS& operator*(){return *lsp;}
1750  LS* operator->() { return lsp.operator->(); }
1751  const LS& operator*() const{return *lsp;}
1752  const LS* operator->() const{ return lsp.operator->();}
1753 
1754  private:
1755  shared_ptr<LS> lsp;
1756  };
1757 
1758  // packaging of the CG_SSOR solver: default version is sequential
1759  template<typename FS, typename ASS, SolverCategory::Category st = SolverCategory::sequential>
1761  {
1762  public:
1763  // types exported
1765 
1766  ISTLSolverBackend_CG_SSOR (const FS& fs, const ASS& ass, unsigned maxiter_=5000,
1767  int steps_=5, int verbose_=1)
1768  {
1769  lsp = shared_ptr<LS>(new LS(maxiter_,verbose_));
1770  }
1771 
1772  LS& getLS () {return *lsp;}
1773  const LS& getLS () const { return *lsp;}
1774  LS& operator*(){return *lsp;}
1775  LS* operator->() { return lsp.operator->(); }
1776  const LS& operator*() const{return *lsp;}
1777  const LS* operator->() const{ return lsp.operator->();}
1778 
1779  private:
1780  shared_ptr<LS> lsp;
1781  };
1782 
1783  // packaging of the CG_SSOR solver: nonoverlapping version
1784  template<typename FS, typename ASS>
1785  class ISTLSolverBackend_CG_SSOR<FS,ASS,SolverCategory::nonoverlapping>
1786  {
1787  public:
1788  // types exported
1790 
1791  ISTLSolverBackend_CG_SSOR (const FS& fs, const ASS& ass, unsigned maxiter_=5000,
1792  int steps_=5, int verbose_=1)
1793  {
1794  lsp = shared_ptr<LS>(new LS(fs.getGFS(),maxiter_,steps_,verbose_));
1795  }
1796 
1797  LS& getLS () {return *lsp;}
1798  const LS& getLS () const { return *lsp;}
1799  LS& operator*(){return *lsp;}
1800  LS* operator->() { return lsp.operator->(); }
1801  const LS& operator*() const{return *lsp;}
1802  const LS* operator->() const{ return lsp.operator->();}
1803 
1804  private:
1805  shared_ptr<LS> lsp;
1806  };
1807 
1808  // packaging of the CG_SSOR solver: overlapping version
1809  template<typename FS, typename ASS>
1810  class ISTLSolverBackend_CG_SSOR<FS,ASS,SolverCategory::overlapping>
1811  {
1812  public:
1813  // types exported
1815 
1816  ISTLSolverBackend_CG_SSOR (const FS& fs, const ASS& ass, unsigned maxiter_=5000,
1817  int steps_=5, int verbose_=1)
1818  {
1819  lsp = shared_ptr<LS>(new LS(fs.getGFS(),fs.getCC(),maxiter_,steps_,verbose_));
1820  }
1821 
1822  LS& getLS () {return *lsp;}
1823  const LS& getLS () const { return *lsp;}
1824  LS& operator*(){return *lsp;}
1825  LS* operator->() { return lsp.operator->(); }
1826  const LS& operator*() const{return *lsp;}
1827  const LS* operator->() const{ return lsp.operator->();}
1828 
1829  private:
1830  shared_ptr<LS> lsp;
1831  };
1832 
1833 
1834  // packaging of a default solver that should always work
1835  // in the sequential case : BCGS SSOR
1836  template<typename FS, typename ASS, SolverCategory::Category st = SolverCategory::sequential>
1838  {
1839  public:
1840  // types exported
1842 
1843  ISTLSolverBackend_IterativeDefault (const FS& fs, const ASS& ass, unsigned maxiter_=5000, int verbose_=1)
1844  {
1845  lsp = shared_ptr<LS>(new LS(maxiter_,verbose_));
1846  }
1847 
1848  LS& getLS () {return *lsp;}
1849  const LS& getLS () const { return *lsp;}
1850  LS& operator*(){return *lsp;}
1851  LS* operator->() { return lsp.operator->(); }
1852  const LS& operator*() const{return *lsp;}
1853  const LS* operator->() const{ return lsp.operator->();}
1854 
1855  private:
1856  shared_ptr<LS> lsp;
1857  };
1858 
1859  // in the nonoverlapping case : BCGS Jacobi
1860  template<typename FS, typename ASS>
1861  class ISTLSolverBackend_IterativeDefault<FS,ASS,SolverCategory::nonoverlapping>
1862  {
1863  public:
1864  // types exported
1866 
1867  ISTLSolverBackend_IterativeDefault (const FS& fs, const ASS& ass, unsigned maxiter_=5000, int verbose_=1)
1868  {
1869  lsp = shared_ptr<LS>(new LS(fs.getGFS(),maxiter_,verbose_));
1870  }
1871 
1872  LS& getLS () {return *lsp;}
1873  const LS& getLS () const { return *lsp;}
1874  LS& operator*(){return *lsp;}
1875  LS* operator->() { return lsp.operator->(); }
1876  const LS& operator*() const{return *lsp;}
1877  const LS* operator->() const{ return lsp.operator->();}
1878 
1879  private:
1880  shared_ptr<LS> lsp;
1881  };
1882 
1883  // in the overlapping case : BCGS SSORk
1884  template<typename FS, typename ASS>
1885  class ISTLSolverBackend_IterativeDefault<FS,ASS,SolverCategory::overlapping>
1886  {
1887  public:
1888  // types exported
1890 
1891  ISTLSolverBackend_IterativeDefault (const FS& fs, const ASS& ass, unsigned maxiter_=5000, int verbose_=1)
1892  {
1893  lsp = shared_ptr<LS>(new LS(fs.getGFS(),fs.getCC(),maxiter_,3,verbose_));
1894  }
1895 
1896  LS& getLS () {return *lsp;}
1897  const LS& getLS () const { return *lsp;}
1898  LS& operator*(){return *lsp;}
1899  LS* operator->() { return lsp.operator->(); }
1900  const LS& operator*() const{return *lsp;}
1901  const LS* operator->() const{ return lsp.operator->();}
1902 
1903  private:
1904  shared_ptr<LS> lsp;
1905  };
1906 
1907  // packaging of a default solver that should always work
1908  // in the sequential case : BCGS SSOR
1909  template<typename FS, typename ASS, SolverCategory::Category st = SolverCategory::sequential>
1911  {
1912  public:
1913  // types exported
1915 
1916  ISTLSolverBackend_ExplicitDiagonal (const FS& fs, const ASS& ass, unsigned maxiter_=5000, int verbose_=1)
1917  {
1918  lsp = shared_ptr<LS>(new LS());
1919  }
1920 
1921  LS& getLS () {return *lsp;}
1922  const LS& getLS () const { return *lsp;}
1923  LS& operator*(){return *lsp;}
1924  LS* operator->() { return lsp.operator->(); }
1925  const LS& operator*() const{return *lsp;}
1926  const LS* operator->() const{ return lsp.operator->();}
1927 
1928  private:
1929  shared_ptr<LS> lsp;
1930  };
1931 
1932  // packaging of a default solver that should always work
1933  // in the sequential case : BCGS SSOR
1934  template<typename FS, typename ASS>
1935  class ISTLSolverBackend_ExplicitDiagonal<FS,ASS,SolverCategory::overlapping>
1936  {
1937  public:
1938  // types exported
1940 
1941  ISTLSolverBackend_ExplicitDiagonal (const FS& fs, const ASS& ass, unsigned maxiter_=5000, int verbose_=1)
1942  {
1943  lsp = shared_ptr<LS>(new LS(fs.getGFS()));
1944  }
1945 
1946  LS& getLS () {return *lsp;}
1947  const LS& getLS () const { return *lsp;}
1948  LS& operator*(){return *lsp;}
1949  LS* operator->() { return lsp.operator->(); }
1950  const LS& operator*() const{return *lsp;}
1951  const LS* operator->() const{ return lsp.operator->();}
1952 
1953  private:
1954  shared_ptr<LS> lsp;
1955  };
1956 
1957  // packaging of a default solver that should always work
1958  // in the sequential case : BCGS SSOR
1959  template<typename FS, typename ASS>
1960  class ISTLSolverBackend_ExplicitDiagonal<FS,ASS,SolverCategory::nonoverlapping>
1961  {
1962  public:
1963  // types exported
1965 
1966  ISTLSolverBackend_ExplicitDiagonal (const FS& fs, const ASS& ass, unsigned maxiter_=5000, int verbose_=1)
1967  {
1968  lsp = shared_ptr<LS>(new LS(fs.getGFS()));
1969  }
1970 
1971  LS& getLS () {return *lsp;}
1972  const LS& getLS () const { return *lsp;}
1973  LS& operator*(){return *lsp;}
1974  LS* operator->() { return lsp.operator->(); }
1975  const LS& operator*() const{return *lsp;}
1976  const LS* operator->() const{ return lsp.operator->();}
1977 
1978  private:
1979  shared_ptr<LS> lsp;
1980  };
1981 
1982 
1983 } // end namespace PDELab
1984  } // end namespace Dune
1985 
1986 #endif
ISTLSolverBackend_CG_SSOR(const FS &fs, const ASS &ass, unsigned maxiter_=5000, int steps_=5, int verbose_=1)
Definition: pdelab.hh:1766
DGPkSpace(const GV &gridview)
Definition: pdelab.hh:815
void setNonConstrainedDOFS(DOF &x, NT nt) const
Definition: pdelab.hh:689
const T * operator->() const
Definition: pdelab.hh:390
void clearConstraints()
Definition: pdelab.hh:1233
const LS & getLS() const
Definition: pdelab.hh:1698
void maskForeignDOFs(X &x) const
Mask out all DOFs not owned by the current process with 0.
Definition: parallelhelper.hh:106
const T & operator*() const
Definition: pdelab.hh:181
void make_consistent(const GFS &gfs, DOF &x) const
Definition: pdelab.hh:754
const FS::GV & getGridView() const
Definition: pdelab.hh:1299
T::LeafGridView GV
Definition: pdelab.hh:895
T::ctype ctype
Definition: pdelab.hh:896
T::ctype ctype
Definition: pdelab.hh:1091
const LS * operator->() const
Definition: pdelab.hh:1853
const CON & getCON() const
Definition: pdelab.hh:752
HangingNodesDirichletConstraints< Grid, HangingNodesConstraintsAssemblers::CubeGridQ1Assembler, BCType > CON
Definition: pdelab.hh:488
Definition: pdelab.hh:455
Dune::PDELab::OneStepGridOperator< typename GO1::GO, typename GO2::GO, implicit > GO
Definition: pdelab.hh:1638
VBET VBE
Definition: pdelab.hh:807
void evaluate(const typename Traits::ElementType &e, const typename Traits::DomainType &x, typename Traits::RangeType &y) const
Evaluate the GridFunction at given position.
Definition: pdelab.hh:1289
const CON & getCON() const
Definition: pdelab.hh:735
DGCONBase< st > CONB
Definition: pdelab.hh:1096
DGCONBase< st > CONB
Definition: pdelab.hh:1000
void setConstrainedDOFS(DOF &x, NT nt) const
Definition: pdelab.hh:851
Definition: noconstraints.hh:16
T * operator->()
Definition: pdelab.hh:380
LS & operator*()
Definition: pdelab.hh:1923
const GO & operator*() const
Definition: pdelab.hh:1348
StructuredGrid(Dune::GeometryType::BasicType meshtype, array< double, dimworld > lower_left, array< double, dimworld > upper_right, array< unsigned int, dim > cells)
Definition: pdelab.hh:121
OPBLocalFiniteElementMap< ctype, NT, degree, dim, gt > FEM
Definition: pdelab.hh:803
static const int dimworld
Definition: pdelab.hh:609
BackendVectorSelector< GFS, N >::Type DOF
Definition: pdelab.hh:909
OneStepGlobalAssembler(GO1 &go1, GO2 &go2)
Definition: pdelab.hh:1641
Dune::PDELab::GridOperator< typename FS::GFS, typename FS::GFS, LOP, MBE, typename FS::NT, typename FS::NT, typename FS::NT, typename FS::CC, typename FS::CC > GO
Definition: pdelab.hh:1424
GFS & getGFS()
Definition: pdelab.hh:1215
GO & getGO()
Definition: pdelab.hh:1327
void setNonConstrainedDOFS(DOF &x, NT nt) const
Definition: pdelab.hh:857
Definition: l2orthonormal.hh:247
GalerkinGlobalAssembler(const FS &fs, LOP &lop)
Definition: pdelab.hh:1374
void setConstrainedDOFS(DOF &x, NT nt) const
Definition: pdelab.hh:1238
CC & getCC()
Definition: pdelab.hh:661
DGQkOPBSpace(const GV &gridview)
Definition: pdelab.hh:915
T Grid
Definition: pdelab.hh:794
void setNonConstrainedDOFS(DOF &x, NT nt) const
Definition: pdelab.hh:1148
Solver to be used for explicit time-steppers with (block-)diagonal mass matrix.
Definition: novlpistlsolverbackend.hh:629
GridFunctionTraits< typename FS::GV, typename FS::NT, 1, FieldVector< typename FS::NT, 1 > > Traits
Definition: pdelab.hh:1281
CONB::CON CON
Definition: pdelab.hh:806
void copyConstrainedDOFS(const DOF &xin, DOF &xout) const
Definition: pdelab.hh:1250
CC & getCC()
Definition: pdelab.hh:1125
DGCONBase< st > CONB
Definition: pdelab.hh:905
const GO & getGO() const
Definition: pdelab.hh:1439
const GFS & getGFS() const
Definition: pdelab.hh:1122
const T & operator*() const
Definition: pdelab.hh:385
T::LeafGridView GV
Definition: pdelab.hh:795
T Grid
Definition: pdelab.hh:894
Parallel P0 constraints for nonoverlapping grids with ghosts.
Definition: p0ghost.hh:16
N NT
Definition: pdelab.hh:998
static const int dimworld
Definition: pdelab.hh:347
void assembleConstraints(const BCTYPE &bctype)
Definition: pdelab.hh:1227
LS * operator->()
Definition: pdelab.hh:1924
GFS::template ConstraintsContainer< N >::Type CC
Definition: pdelab.hh:911
void clearConstraints()
Definition: pdelab.hh:846
void setConstrainedDOFS(DOF &x, NT nt) const
Definition: pdelab.hh:951
MeshType
Definition: pdelab.hh:448
Definition: pdelab.hh:1526
CONB::CON CON
Definition: pdelab.hh:906
BackendVectorSelector< GFS, N >::Type DOF
Definition: pdelab.hh:1004
const FEM & getFEM() const
Definition: pdelab.hh:1020
GO * operator->()
Definition: pdelab.hh:1663
GO::Jacobian MAT
Definition: pdelab.hh:1534
LS * operator->()
Definition: pdelab.hh:1700
GV::Traits::template Codim< 0 >::Entity ElementType
codim 0 entity
Definition: function.hh:118
StructuredGrid(Dune::GeometryType::BasicType meshtype, unsigned int cells)
Definition: pdelab.hh:101
const Grid * operator->() const
Definition: pdelab.hh:329
LS * operator->()
Definition: pdelab.hh:1775
void assembleConstraints(const BCTYPE &bctype)
Definition: pdelab.hh:1035
static const int dim
Definition: pdelab.hh:346
PkLocalFiniteElementMap< GV, C, R, degree > FEM
Definition: pdelab.hh:413
Nonoverlapping parallel BiCGStab solver with Jacobi preconditioner.
Definition: novlpistlsolverbackend.hh:554
const Grid & operator*() const
Definition: pdelab.hh:324
void setNonConstrainedDOFS(DOF &x, NT nt) const
Definition: pdelab.hh:957
T Grid
Definition: pdelab.hh:993
Definition: pdelab.hh:1633
T::ctype ctype
Definition: pdelab.hh:1187
HangingNodesDirichletConstraints< Grid, HangingNodesConstraintsAssemblers::SimplexGridP1Assembler, BCType > CON
Definition: pdelab.hh:462
void copyConstrainedDOFS(const DOF &xin, DOF &xout) const
Definition: pdelab.hh:1154
ISTLBackend_SEQ_CG_SSOR LS
Definition: pdelab.hh:1764
OPBLocalFiniteElementMap< ctype, NT, degree, dim, gt, N, Dune::PB::BasisType::Qk > FEM
Definition: pdelab.hh:903
P0ParallelConstraints CON
Definition: pdelab.hh:763
LS & getLS()
Definition: pdelab.hh:1697
const CC & getCC() const
Definition: pdelab.hh:837
const CC & getCC() const
Definition: pdelab.hh:1224
Overlapping parallel CGS solver with SSOR preconditioner.
Definition: ovlpistlsolverbackend.hh:637
DGCONBase< st > CONB
Definition: pdelab.hh:1192
GridFunctionSpace< GV, FEM, CON, VBE > GFS
Definition: pdelab.hh:908
void set_constrained_dofs(const CG &cg, typename XG::ElementType x, XG &xg)
construct constraints from given boundary condition function
Definition: common/constraints.hh:772
const GFS & getGFS() const
Definition: pdelab.hh:931
void setNonConstrainedDOFS(DOF &x, NT nt) const
Definition: pdelab.hh:1244
const GO & operator*() const
Definition: pdelab.hh:1454
Backend using ISTL matrices.
Definition: istl/descriptors.hh:69
void clearConstraints()
Definition: pdelab.hh:946
GFS::template ConstraintsContainer< N >::Type CC
Definition: pdelab.hh:623
void copyNonConstrainedDOFS(const DOF &xin, DOF &xout) const
Definition: pdelab.hh:701
Dune::PDELab::GridOperator< typename FS::GFS, typename FS::GFS, LOP, MBE, typename FS::NT, typename FS::NT, typename FS::NT, typename FS::CC, typename FS::CC > GO
Definition: pdelab.hh:1318
ISTLBackend_OVLP_BCGS_SSORk< typename FS::GFS, typename FS::CC > LS
Definition: pdelab.hh:1889
Dune::shared_ptr< T > getSharedPtr()
Definition: pdelab.hh:358
ISTLSolverBackend_ExplicitDiagonal(const FS &fs, const ASS &ass, unsigned maxiter_=5000, int verbose_=1)
Definition: pdelab.hh:1941
Definition: pdelab.hh:1760
GO::Jacobian MAT
Definition: pdelab.hh:1319
CONB::CON CON
Definition: pdelab.hh:615
T Grid
Definition: pdelab.hh:95
Backend using (possibly nested) ISTL BCRSMatrices.
Definition: bcrsmatrixbackend.hh:187
Dune::PDELab::istl::BCRSMatrixBackend MBE
Definition: pdelab.hh:1474
GridFunctionSpace< GV, FEM, CON, VBE > GFS
Definition: pdelab.hh:1099
Definition: pdelab.hh:889
GO & getGO()
Definition: pdelab.hh:1647
void copy_nonconstrained_dofs(const CG &cg, const XG &xgin, XG &xgout)
Definition: common/constraints.hh:976
Definition: pdelab.hh:91
Dune::PDELab::ISTLBackend_CG_AMG_SSOR< typename ASS::GO > LS
Definition: pdelab.hh:1739
VTKGridFunctionAdapter< DGF > VTKF
Definition: pdelab.hh:812
static const int dim
Definition: adaptivity.hh:82
Grid * operator->()
Definition: pdelab.hh:319
Backend for sequential conjugate gradient solver with SSOR preconditioner.
Definition: seqistlsolverbackend.hh:333
static const int dim
Definition: pdelab.hh:797
Nonoverlapping parallel CG solver preconditioned by block SSOR.
Definition: novlpistlsolverbackend.hh:842
void copyNonConstrainedDOFS(const DOF &xin, DOF &xout) const
Definition: pdelab.hh:1064
static const int dimworld
Definition: pdelab.hh:1093
BackendVectorSelector< GFS, N >::Type DOF
Definition: pdelab.hh:1100
void clearConstraints()
Definition: pdelab.hh:1137
VBET VBE
Definition: pdelab.hh:907
Standard grid operator implementation.
Definition: gridoperator.hh:34
GFS & getGFS()
Definition: pdelab.hh:1023
const GFS & getGFS() const
Definition: pdelab.hh:1026
StructuredGrid(Dune::GeometryType::BasicType meshtype, array< double, dimworld > lower_left, array< double, dimworld > upper_right, array< unsigned int, dim > cells, int overlap=1)
Definition: pdelab.hh:228
FEMB::FEM FEM
Definition: pdelab.hh:614
BackendVectorSelector< GFS, N >::Type DOF
Definition: pdelab.hh:1196
const GFS & getGFS() const
Definition: pdelab.hh:1218
Dune::FieldVector< GV::Grid::ctype, GV::dimension > DomainType
domain type in dim-size coordinates
Definition: function.hh:49
N NT
Definition: pdelab.hh:1094
Grid & operator*()
Definition: pdelab.hh:314
const CC & getCC() const
Definition: pdelab.hh:937
ISTLSolverBackend_ExplicitDiagonal(const FS &fs, const ASS &ass, unsigned maxiter_=5000, int verbose_=1)
Definition: pdelab.hh:1966
Dune::PDELab::DiscreteGridFunction< GFS, DOF > DGF
Definition: pdelab.hh:810
VTKGridFunctionAdapter< DGF > VTKF
Definition: pdelab.hh:624
GlobalAssembler(const FSU &fsu, const FSV &fsv, LOP &lop)
Definition: pdelab.hh:1589
CC & getCC()
Definition: pdelab.hh:1221
QkLocalFiniteElementMap< GV, C, R, degree > FEM
Definition: pdelab.hh:431
const GFS & getGFS() const
Definition: pdelab.hh:655
ISTLSolverBackend_CG_SSOR(const FS &fs, const ASS &ass, unsigned maxiter_=5000, int steps_=5, int verbose_=1)
Definition: pdelab.hh:1791
static const int dimworld
Definition: pdelab.hh:798
Dune::PDELab::istl::BCRSMatrixBackend MBE
Definition: pdelab.hh:1421
Nonoverlapping parallel CG solver preconditioned with AMG smoothed by SSOR.
Definition: novlpistlsolverbackend.hh:1045
ISTLMatrixBackend MBE
Definition: pdelab.hh:1315
UserFunction(const FS &fs_, const Functor &f_)
constructor
Definition: pdelab.hh:1284
LS & operator*()
Definition: pdelab.hh:1774
V & raw(V &v)
Returns the raw ISTL object associated with v, or v itself it is already an ISTL object.
Definition: backend/istl/utility.hh:26
BackendVectorSelector< GFS, N >::Type DOF
Definition: pdelab.hh:809
VTKGridFunctionAdapter< DGF > VTKF
Definition: pdelab.hh:1103
VBET VBE
Definition: pdelab.hh:617
Definition: pdelab.hh:1311
GO & getGO()
Definition: pdelab.hh:1542
void setConstrainedDOFS(DOF &x, NT nt) const
Definition: pdelab.hh:1142
ISTLSolverBackend_ExplicitDiagonal(const FS &fs, const ASS &ass, unsigned maxiter_=5000, int verbose_=1)
Definition: pdelab.hh:1916
GO & operator*()
Definition: pdelab.hh:1338
void setConstrainedDOFS(DOF &x, NT nt) const
Definition: pdelab.hh:683
VTKGridFunctionAdapter< DGF > VTKF
Definition: pdelab.hh:912
StructuredGrid(Dune::GeometryType::BasicType meshtype, unsigned int cells, int overlap=1)
Definition: pdelab.hh:208
N NT
Definition: pdelab.hh:799
CONB::CON CON
Definition: pdelab.hh:1001
GO * operator->()
Definition: pdelab.hh:1343
CGSpace(Grid &grid, const BCType &bctype)
Definition: pdelab.hh:627
Dune::shared_ptr< T > getSharedPtr()
Definition: pdelab.hh:154
GFS & getGFS()
Definition: pdelab.hh:828
ISTLSolverBackend_CG_AMG_SSOR(const FS &fs, const ASS &ass, unsigned maxiter_=5000, int verbose_=1, bool reuse_=false, bool usesuperlu_=true)
Definition: pdelab.hh:1741
void clearConstraints()
Definition: pdelab.hh:678
T::ctype ctype
Definition: pdelab.hh:345
GO::Jacobian MAT
Definition: pdelab.hh:1639
CGCONBase< Grid, degree, gt, mt, st, BCType > CONB
Definition: pdelab.hh:612
ISTLBackend_OVLP_CG_SSORk< typename FS::GFS, typename FS::CC > LS
Definition: pdelab.hh:1814
const FEM & getFEM() const
Definition: pdelab.hh:925
const LS & getLS() const
Definition: pdelab.hh:1922
void copyConstrainedDOFS(const DOF &xin, DOF &xout) const
Definition: pdelab.hh:1058
const FEM & getFEM() const
Definition: pdelab.hh:1116
N NT
Definition: pdelab.hh:899
T::LeafGridView GV
Definition: pdelab.hh:1186
GO & operator*()
Definition: pdelab.hh:1658
T Grid
Definition: pdelab.hh:1089
FEM & getFEM()
Definition: pdelab.hh:638
P0Space(const GV &gridview)
Definition: pdelab.hh:1202
const GO * operator->() const
Definition: pdelab.hh:1459
GO & operator*()
Definition: pdelab.hh:1553
Parallel P0 constraints for overlapping grids.
Definition: p0.hh:15
void constraints(const GFS &gfs, CG &cg, const bool verbose=false)
construct constraints
Definition: common/constraints.hh:723
LS & getLS()
Definition: pdelab.hh:1772
const LS & operator*() const
Definition: pdelab.hh:1776
Definition: pdelab.hh:988
T::ctype ctype
Definition: pdelab.hh:995
VBET VBE
Definition: pdelab.hh:1098
CONB::CON CON
Definition: pdelab.hh:1097
leaf of a function tree
Definition: function.hh:577
void make_consistent(const GFS &gfs, DOF &x) const
Definition: pdelab.hh:771
Definition: pdelab.hh:1084
Definition: pdelab.hh:340
const CC & getCC() const
Definition: pdelab.hh:1128
GlobalAssembler(const FSU &fsu, const FSV &fsv, LOP &lop)
Definition: pdelab.hh:1536
static const int dim
Definition: pdelab.hh:996
T::ctype ctype
Definition: pdelab.hh:796
LS & operator*()
Definition: pdelab.hh:1699
GO & getGO()
Definition: pdelab.hh:1433
void copyConstrainedDOFS(const DOF &xin, DOF &xout) const
Definition: pdelab.hh:963
const LS * operator->() const
Definition: pdelab.hh:1777
Definition: parallelhelper.hh:45
void copyConstrainedDOFS(const DOF &xin, DOF &xout) const
Definition: pdelab.hh:695
Dune::PDELab::P0LocalFiniteElementMap< ctype, NT, dim > FEM
Definition: pdelab.hh:1191
const LS & getLS() const
Definition: pdelab.hh:1849
T * operator->()
Definition: pdelab.hh:176
Overlapping parallel conjugate gradient solver preconditioned with AMG smoothed by SSOR...
Definition: ovlpistlsolverbackend.hh:1066
const GO & getGO() const
Definition: pdelab.hh:1548
N NT
Definition: pdelab.hh:620
void assembleConstraints(const BCTYPE &bctype)
Definition: pdelab.hh:840
const GO & operator*() const
Definition: pdelab.hh:1563
Definition: genericdatahandle.hh:623
void copyNonConstrainedDOFS(const DOF &xin, DOF &xout) const
Definition: pdelab.hh:969
static const int dim
Definition: pdelab.hh:97
GalerkinGlobalAssemblerNewBackend(const FS &fs, LOP &lop, const MBE &mbe)
Definition: pdelab.hh:1427
static const int dimworld
Definition: pdelab.hh:898
Dune::PDELab::ISTLBackend_SEQ_CG_AMG_SSOR< typename ASS::GO > LS
Definition: pdelab.hh:1689
GFS::template ConstraintsContainer< N >::Type CC
Definition: pdelab.hh:1102
BackendVectorSelector< GFS, N >::Type DOF
Definition: pdelab.hh:621
StructuredGrid(Dune::GeometryType::BasicType meshtype, array< double, dimworld > lower_left, array< double, dimworld > upper_right, array< unsigned int, dim > cells, array< bool, dim > periodic, int overlap=1)
Definition: pdelab.hh:262
T::LeafGridView GV
Definition: pdelab.hh:606
const T & getGrid() const
Definition: pdelab.hh:166
P0ParallelGhostConstraints CON
Definition: pdelab.hh:746
Sequential conjugate gradient solver preconditioned with AMG smoothed by SSOR.
Definition: seqistlsolverbackend.hh:613
Dune::PDELab::ISTLBackend_OVLP_ExplicitDiagonal< typename FS::GFS > LS
Definition: pdelab.hh:1939
Traits::Jacobian Jacobian
Definition: gridoperator/onestep.hh:53
static const unsigned int value
Definition: gridfunctionspace/tags.hh:175
VBET VBE
Definition: pdelab.hh:1002
Dune::PDELab::GridOperator< typename FSU::GFS, typename FSV::GFS, LOP, MBE, typename FSU::NT, typename FSU::NT, typename FSU::NT, typename FSU::CC, typename FSV::CC, true > GO
Definition: pdelab.hh:1586
Definition: l2orthonormal.hh:247
const GO & getGO() const
Definition: pdelab.hh:1333
static const int dimworld
Definition: pdelab.hh:98
Dune::PDELab::ISTLBackend_NOVLP_ExplicitDiagonal< typename FS::GFS > LS
Definition: pdelab.hh:1964
Dune::PDELab::DiscreteGridFunction< GFS, DOF > DGF
Definition: pdelab.hh:910
GalerkinGlobalAssemblerNewBackend(const FS &fs, LOP &lop, const MBE &mbe)
Definition: pdelab.hh:1480
void copyNonConstrainedDOFS(const DOF &xin, DOF &xout) const
Definition: pdelab.hh:1160
Dune::PDELab::ISTLBackend_NOVLP_CG_AMG_SSOR< typename ASS::GO > LS
Definition: pdelab.hh:1714
BackendVectorSelectorHelper< Backend, GridFunctionSpace, FieldType >::Type Type
Definition: backendselector.hh:14
DGCONBase< st > CONB
Definition: pdelab.hh:805
ISTLSolverBackend_CG_AMG_SSOR(const FS &fs, const ASS &ass, unsigned maxiter_=5000, int verbose_=1, bool reuse_=false, bool usesuperlu_=true)
Definition: pdelab.hh:1716
const LS * operator->() const
Definition: pdelab.hh:1926
Definition: pdelab.hh:450
const T & getGrid() const
Definition: pdelab.hh:370
T & operator*()
Definition: pdelab.hh:171
const GFS & getGFS() const
Definition: pdelab.hh:831
Solver to be used for explicit time-steppers with (block-)diagonal mass matrix.
Definition: ovlpistlsolverbackend.hh:831
void setNonConstrainedDOFS(DOF &x, NT nt) const
Definition: pdelab.hh:1052
const CC & getCC() const
Definition: pdelab.hh:1032
Dune::PDELab::GridOperator< typename FS::GFS, typename FS::GFS, LOP, MBE, typename FS::NT, typename FS::NT, typename FS::NT, typename FS::CC, typename FS::CC, true > GO
Definition: pdelab.hh:1477
NonoverlappingConformingDirichletConstraints< GV > CON
Definition: pdelab.hh:574
const FEM & getFEM() const
Definition: pdelab.hh:643
UnstructuredGrid(std::string filename, bool verbose=true, bool insert_boundary_segments=true)
Definition: pdelab.hh:350
ISTLSolverBackend_IterativeDefault(const FS &fs, const ASS &ass, unsigned maxiter_=5000, int verbose_=1)
Definition: pdelab.hh:1867
T Grid
Definition: pdelab.hh:605
static const int dimworld
Definition: pdelab.hh:1189
GridFunctionSpace< GV, FEM, CON, VBE > GFS
Definition: pdelab.hh:1195
T::LeafGridView GV
Definition: pdelab.hh:1090
Dune::PDELab::DiscreteGridFunction< GFS, DOF > DGF
Definition: pdelab.hh:1101
traits class holding the function signature, same as in local function
Definition: function.hh:176
ISTLBackend_NOVLP_CG_SSORk< typename ASS::GO > LS
Definition: pdelab.hh:1789
Definition: pdelab.hh:722
GalerkinGlobalAssembler(const FS &fs, LOP &lop)
Definition: pdelab.hh:1321
FEM & getFEM()
Definition: pdelab.hh:1019
GridFunctionSpace< GV, FEM, CON, VBE > GFS
Definition: pdelab.hh:808
FEM & getFEM()
Definition: pdelab.hh:924
T::ctype ctype
Definition: pdelab.hh:96
DGQkSpace(const GV &gridview)
Definition: pdelab.hh:1010
void make_consistent(const GFS &gfs, DOF &x) const
Definition: pdelab.hh:737
A grid function space.
Definition: gridfunctionspace.hh:109
const GO * operator->() const
Definition: pdelab.hh:1673
ISTLMatrixBackend MBE
Definition: pdelab.hh:1637
FEM & getFEM()
Definition: pdelab.hh:1211
GO * operator->()
Definition: pdelab.hh:1449
YaspGrid< dim > Grid
Definition: pdelab.hh:203
CC & getCC()
Definition: pdelab.hh:1029
Definition: pdelab.hh:406
LS & getLS()
Definition: pdelab.hh:1921
Dune::PDELab::DiscreteGridFunction< GFS, DOF > DGF
Definition: pdelab.hh:622
void assembleConstraints(const BCType &bctype)
Definition: pdelab.hh:672
CC & getCC()
Definition: pdelab.hh:934
GFS & getGFS()
Definition: pdelab.hh:928
wrap a GridFunction so it can be used with the VTKWriter from dune-grid.
Definition: common/vtkexport.hh:22
CGCONBase(Grid &grid, const BCType &bctype, const GV &gv)
Definition: pdelab.hh:516
Definition: pdelab.hh:449
extend conforming constraints class by processor boundary
Definition: conforming.hh:152
Dune::PDELab::DiscreteGridFunction< GFS, DOF > DGF
Definition: pdelab.hh:1005
void copy_constrained_dofs(const CG &cg, const XG &xgin, XG &xgout)
Definition: common/constraints.hh:917
const GO & getGO() const
Definition: pdelab.hh:1653
T Grid
Definition: pdelab.hh:1185
Hanging Node constraints construction.
Definition: hangingnode.hh:320
static const int dim
Definition: pdelab.hh:1092
CGFEMBase< GV, ctype, N, degree, dim, gt > FEMB
Definition: pdelab.hh:611
VTKGridFunctionAdapter< DGF > VTKF
Definition: pdelab.hh:1007
const CON & getCON() const
Definition: pdelab.hh:769
GFS::template ConstraintsContainer< N >::Type CC
Definition: pdelab.hh:1198
T Grid
Definition: pdelab.hh:344
VTKGridFunctionAdapter< DGF > VTKF
Definition: pdelab.hh:1199
T::ctype ctype
Definition: pdelab.hh:607
T::LeafGridView GV
Definition: pdelab.hh:994
GFS & getGFS()
Definition: pdelab.hh:1119
const GO * operator->() const
Definition: pdelab.hh:1568
Definition: pdelab.hh:601
const FEM & getFEM() const
Definition: pdelab.hh:1212
LS * operator->()
Definition: pdelab.hh:1851
static const int dim
Definition: pdelab.hh:608
ISTLSolverBackend_CG_AMG_SSOR(const FS &fs, const ASS &ass, unsigned maxiter_=5000, int verbose_=1, bool reuse_=false, bool usesuperlu_=true)
Definition: pdelab.hh:1691
LS & operator*()
Definition: pdelab.hh:1850
CGCONBase(Grid &grid, const BCType &bctype, const GV &gv)
Definition: pdelab.hh:542
VBET VBE
Definition: pdelab.hh:1194
const Grid & getGrid() const
Definition: pdelab.hh:309
const GO * operator->() const
Definition: pdelab.hh:1353
Backend for sequential BiCGSTAB solver with SSOR preconditioner.
Definition: seqistlsolverbackend.hh:246
const LS & operator*() const
Definition: pdelab.hh:1701
N NT
Definition: pdelab.hh:1190
ISTLSolverBackend_IterativeDefault(const FS &fs, const ASS &ass, unsigned maxiter_=5000, int verbose_=1)
Definition: pdelab.hh:1843
QkDGGLLocalFiniteElementMap< ctype, NT, degree, dim > FEM
Definition: pdelab.hh:1095
FEM & getFEM()
Definition: pdelab.hh:1115
Definition: gridoperator/onestep.hh:14
LS & getLS()
Definition: pdelab.hh:1848
ISTLSolverBackend_CG_SSOR(const FS &fs, const ASS &ass, unsigned maxiter_=5000, int steps_=5, int verbose_=1)
Definition: pdelab.hh:1816
GO & operator*()
Definition: pdelab.hh:1444
NoConstraints CON
Definition: pdelab.hh:729
void copyConstrainedDOFS(const DOF &xin, DOF &xout) const
Definition: pdelab.hh:863
T & getGrid()
Definition: pdelab.hh:160
extend conforming constraints class by processor boundary
Definition: conforming.hh:101
FEM & getFEM()
Definition: pdelab.hh:824
const LS & getLS() const
Definition: pdelab.hh:1773
const GO & operator*() const
Definition: pdelab.hh:1668
GridFunctionSpace< GV, FEM, CON, VBE > GFS
Definition: pdelab.hh:618
Definition: pdelab.hh:789
GridFunctionSpace< GV, FEM, CON, VBE > GFS
Definition: pdelab.hh:1003
GO::Jacobian MAT
Definition: pdelab.hh:1425
Dune::shared_ptr< Grid > getSharedPtr()
Definition: pdelab.hh:297
const E & e
Definition: interpolate.hh:172
void copyNonConstrainedDOFS(const DOF &xin, DOF &xout) const
Definition: pdelab.hh:869
Grid::ctype ctype
Definition: pdelab.hh:204
CONB::CON CON
Definition: pdelab.hh:1193
DGQkGLSpace(const GV &gridview)
Definition: pdelab.hh:1106
const FEM & getFEM() const
Definition: pdelab.hh:825
Dune::PDELab::GridOperator< typename FSU::GFS, typename FSV::GFS, LOP, MBE, typename FSU::NT, typename FSU::NT, typename FSU::NT, typename FSU::CC, typename FSV::CC > GO
Definition: pdelab.hh:1533
GFS & getGFS()
Definition: pdelab.hh:649
Dune::PDELab::DiscreteGridFunction< GFS, DOF > DGF
Definition: pdelab.hh:1197
void assembleConstraints(const BCTYPE &bctype)
Definition: pdelab.hh:940
T & operator*()
Definition: pdelab.hh:375
void assembleConstraints(const BCTYPE &bctype)
Definition: pdelab.hh:1131
const LS & operator*() const
Definition: pdelab.hh:1925
void copyNonConstrainedDOFS(const DOF &xin, DOF &xout) const
Definition: pdelab.hh:1256
convert a grid function space and a coefficient vector into a grid function
Definition: gridfunctionspaceutilities.hh:54
GO * operator->()
Definition: pdelab.hh:1558
CGCONBase(Grid &grid, const BCType &bctype, const GV &gv)
Definition: pdelab.hh:576
ISTLBackend_SEQ_BCGS_SSOR LS
Definition: pdelab.hh:1841
Grid & getGrid()
Definition: pdelab.hh:303
static const int dimworld
Definition: pdelab.hh:997
const CC & getCC() const
Definition: pdelab.hh:667
Definition: pdelab.hh:1180
static const int dim
Definition: pdelab.hh:897
GFS::template ConstraintsContainer< N >::Type CC
Definition: pdelab.hh:811
const T * operator->() const
Definition: pdelab.hh:186
QkDGLocalFiniteElementMap< ctype, NT, degree, dim > FEM
Definition: pdelab.hh:999
Dune::PDELab::BackendMatrixSelector< MB, Domain, Range, JF >::Type Jacobian
The type of the jacobian.
Definition: gridoperator.hh:46
ISTLSolverBackend_IterativeDefault(const FS &fs, const ASS &ass, unsigned maxiter_=5000, int verbose_=1)
Definition: pdelab.hh:1891
ISTLMatrixBackend MBE
Definition: pdelab.hh:1530
void clearConstraints()
Definition: pdelab.hh:1041
const LS * operator->() const
Definition: pdelab.hh:1702
Overlapping parallel BiCGStab solver with SSOR preconditioner.
Definition: ovlpistlsolverbackend.hh:571
void setConstrainedDOFS(DOF &x, NT nt) const
Definition: pdelab.hh:1046
GFS::template ConstraintsContainer< N >::Type CC
Definition: pdelab.hh:1006
Dune::PDELab::GridOperator< typename FS::GFS, typename FS::GFS, LOP, MBE, typename FS::NT, typename FS::NT, typename FS::NT, typename FS::CC, typename FS::CC, true > GO
Definition: pdelab.hh:1371
void set_nonconstrained_dofs(const CG &cg, typename XG::ElementType x, XG &xg)
Definition: common/constraints.hh:943
CC & getCC()
Definition: pdelab.hh:834
T & getGrid()
Definition: pdelab.hh:364
Definition: pdelab.hh:1274
static const int dim
Definition: pdelab.hh:1188
Solver to be used for explicit time-steppers with (block-)diagonal mass matrix.
Definition: seqistlsolverbackend.hh:433
ISTLBackend_NOVLP_BCGS_Jacobi< typename FS::GFS > LS
Definition: pdelab.hh:1865
Dune::PDELab::ISTLBackend_SEQ_ExplicitDiagonal LS
Definition: pdelab.hh:1914
const LS & operator*() const
Definition: pdelab.hh:1852
Dirichlet Constraints construction.
Definition: conforming.hh:36