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