dune-grid  2.6-git
agrid.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 #ifndef DUNE_ALBERTAGRID_IMP_HH
4 #define DUNE_ALBERTAGRID_IMP_HH
5 
11 #if HAVE_ALBERTA || DOXYGEN
12 
13 #include <cassert>
14 #include <cstddef>
15 
16 #include <algorithm>
17 #include <iostream>
18 #include <fstream>
19 #include <memory>
20 #include <vector>
21 
22 // Dune includes
23 #include <dune/common/deprecated.hh>
24 #include <dune/common/fvector.hh>
25 #include <dune/common/fmatrix.hh>
26 #include <dune/common/stdstreams.hh>
27 #include <dune/common/parallel/collectivecommunication.hh>
28 
29 #include <dune/grid/common/grid.hh>
33 
34 //- Local includes
35 // some cpp defines and include of alberta.h
36 #include "albertaheader.hh"
37 
41 
49 
50 #include "indexsets.hh"
51 #include "geometry.hh"
52 #include "entity.hh"
53 #include "hierarchiciterator.hh"
54 #include "treeiterator.hh"
55 #include "leveliterator.hh"
56 #include "leafiterator.hh"
57 
58 namespace Dune
59 {
60 
61  // External Forward Declarations
62  // -----------------------------
63 
64  template< class Grid >
66 
67 
68 
69  // AlbertaGrid
70  // -----------
71 
135  template< int dim, int dimworld = Alberta::dimWorld >
138  < dim, dimworld, Alberta::Real, AlbertaGridFamily< dim, dimworld > >
139  {
142  < dim, dimworld, Alberta::Real, AlbertaGridFamily< dim, dimworld > >
143  Base;
144 
145  template< int, int, class > friend class AlbertaGridEntity;
146  template< class > friend class AlbertaLevelGridView;
147  template< class > friend class AlbertaLeafGridView;
148  template< int, class, bool > friend class AlbertaGridTreeIterator;
149  template< class > friend class AlbertaGridHierarchicIterator;
150 
151  friend class GridFactory< This >;
152  friend struct DGFGridFactory< This >;
153 
154  friend class AlbertaGridIntersectionBase< const This >;
155  friend class AlbertaGridLeafIntersection< const This >;
156 
157  friend class AlbertaMarkerVector< dim, dimworld >;
158 #if (__GNUC__ < 4) && !(defined __ICC)
159  // add additional friend decls for gcc 3.4
160  friend struct AlbertaMarkerVector< dim, dimworld >::MarkSubEntities<true>;
161  friend struct AlbertaMarkerVector< dim, dimworld >::MarkSubEntities<false>;
162 #endif
163  friend class AlbertaGridIndexSet< dim, dimworld >;
164  friend class AlbertaGridHierarchicIndexSet< dim, dimworld >;
165 
166  template< class, class >
167  friend class Alberta::AdaptRestrictProlongHandler;
168 
169  public:
171  typedef AlbertaGridFamily< dim, dimworld > GridFamily;
172 
173  typedef typename GridFamily::ctype ctype;
174 
175  static const int dimension = GridFamily::dimension;
176  static const int dimensionworld = GridFamily::dimensionworld;
177 
178  // the Traits
179  typedef typename AlbertaGridFamily< dim, dimworld >::Traits Traits;
180 
182  typedef typename Traits::LeafIndexSet LeafIndexSet;
184  typedef typename Traits::LevelIndexSet LevelIndexSet;
185 
187  typedef typename Traits::HierarchicIndexSet HierarchicIndexSet;
188 
190  typedef typename Traits::GlobalIdSet GlobalIdSet;
192  typedef typename Traits::LocalIdSet LocalIdSet;
193 
195  typedef typename Traits::CollectiveCommunication CollectiveCommunication;
196 
197  private:
199  typedef typename Traits::template Codim<0>::LeafIterator LeafIterator;
200 
202  typedef AlbertaGridIdSet<dim,dimworld> IdSetImp;
203 
205  struct AdaptationState
206  {
207  enum Phase { ComputationPhase, PreAdaptationPhase, PostAdaptationPhase };
208 
209  private:
210  Phase phase_;
211  int coarsenMarked_;
212  int refineMarked_;
213 
214  public:
215  AdaptationState ()
216  : phase_( ComputationPhase ),
217  coarsenMarked_( 0 ),
218  refineMarked_( 0 )
219  {}
220 
221  void mark ( int count )
222  {
223  if( count < 0 )
224  ++coarsenMarked_;
225  if( count > 0 )
226  refineMarked_ += (2 << count);
227  }
228 
229  void unmark ( int count )
230  {
231  if( count < 0 )
232  --coarsenMarked_;
233  if( count > 0 )
234  refineMarked_ -= (2 << count);
235  }
236 
237  bool coarsen () const
238  {
239  return (coarsenMarked_ > 0);
240  }
241 
242  int refineMarked () const
243  {
244  return refineMarked_;
245  }
246 
247  void preAdapt ()
248  {
249  if( phase_ != ComputationPhase )
250  error( "preAdapt may only be called in computation phase." );
251  phase_ = PreAdaptationPhase;
252  }
253 
254  void adapt ()
255  {
256  if( phase_ != PreAdaptationPhase )
257  error( "adapt may only be called in preadapdation phase." );
258  phase_ = PostAdaptationPhase;
259  }
260 
261  void postAdapt ()
262  {
263  if( phase_ != PostAdaptationPhase )
264  error( "postAdapt may only be called in postadaptation phase." );
265  phase_ = ComputationPhase;
266 
267  coarsenMarked_ = 0;
268  refineMarked_ = 0;
269  }
270 
271  private:
272  void error ( const std::string &message )
273  {
274  DUNE_THROW( InvalidStateException, message );
275  }
276  };
277 
278  template< class DataHandler >
279  struct AdaptationCallback;
280 
281  // max number of allowed levels is 64
282  static const int MAXL = 64;
283 
284  typedef Alberta::ElementInfo< dimension > ElementInfo;
285  typedef Alberta::MeshPointer< dimension > MeshPointer;
286  typedef Alberta::HierarchyDofNumbering< dimension > DofNumbering;
287  typedef AlbertaGridLevelProvider< dimension > LevelProvider;
288 
289  public:
290  AlbertaGrid ( const This & ) = delete;
291  This &operator= ( const This & ) = delete;
292 
294  AlbertaGrid ();
295 
301  AlbertaGrid ( const Alberta::MacroData< dimension > &macroData,
302  const std::shared_ptr< DuneBoundaryProjection< dimensionworld > > &projection
303  = std::shared_ptr< DuneBoundaryProjection< dimensionworld > >() );
304 
305  template< class Proj, class Impl >
306  AlbertaGrid ( const Alberta::MacroData< dimension > &macroData,
307  const Alberta::ProjectionFactoryInterface< Proj, Impl > &projectionFactory );
308 
313  AlbertaGrid ( const std::string &macroGridFileName );
314 
316  ~AlbertaGrid ();
317 
320  int maxLevel () const;
321 
323  template<int cd, PartitionIteratorType pitype>
324  typename Traits::template Codim<cd>::template Partition<pitype>::LevelIterator
325  lbegin (int level) const;
326 
328  template<int cd, PartitionIteratorType pitype>
329  typename Traits::template Codim<cd>::template Partition<pitype>::LevelIterator
330  lend (int level) const;
331 
333  template< int codim >
334  typename Traits::template Codim< codim >::LevelIterator
335  lbegin ( int level ) const;
336 
338  template< int codim >
339  typename Traits::template Codim< codim >::LevelIterator
340  lend ( int level ) const;
341 
343  template< int codim, PartitionIteratorType pitype >
344  typename Traits
345  ::template Codim< codim >::template Partition< pitype >::LeafIterator
346  leafbegin () const;
347 
349  template< int codim, PartitionIteratorType pitype >
350  typename Traits
351  ::template Codim< codim >::template Partition< pitype >::LeafIterator
352  leafend () const;
353 
355  template< int codim >
356  typename Traits::template Codim< codim >::LeafIterator
357  leafbegin () const;
358 
360  template< int codim >
361  typename Traits::template Codim< codim >::LeafIterator
362  leafend () const;
363 
368  int size (int level, int codim) const;
369 
371  int size (int level, GeometryType type) const;
372 
374  int size (int codim) const;
375 
377  int size (GeometryType type) const;
378 
380  std::size_t numBoundarySegments () const
381  {
382  return numBoundarySegments_;
383  }
384 
386  typename Traits::LevelGridView levelGridView ( int level ) const
387  {
388  typedef typename Traits::LevelGridView View;
389  typedef typename View::GridViewImp ViewImp;
390  return View( ViewImp( *this, level ) );
391  }
392 
394  typename Traits::LeafGridView leafGridView () const
395  {
396  typedef typename Traits::LeafGridView View;
397  typedef typename View::GridViewImp ViewImp;
398  return View( ViewImp( *this ) );
399  }
400 
401  public:
402  //***************************************************************
403  // Interface for Adaptation
404  //***************************************************************
405  using Base::getMark;
406  using Base::mark;
407 
409  int getMark ( const typename Traits::template Codim< 0 >::Entity &e ) const;
410 
412  bool mark ( int refCount, const typename Traits::template Codim< 0 >::Entity &e );
413 
415  void globalRefine ( int refCount );
416 
417  template< class DataHandle >
418  void globalRefine ( int refCount, AdaptDataHandleInterface< This, DataHandle > &handle );
419 
421  bool adapt ();
422 
424  template< class DataHandle >
426 
428  bool preAdapt ();
429 
431  void postAdapt();
432 
436  {
437  return comm_;
438  }
439 
440  static std::string typeName ()
441  {
442  std::ostringstream s;
443  s << "AlbertaGrid< " << dim << ", " << dimworld << " >";
444  return s.str();
445  }
446 
448  template< class EntitySeed >
449  typename Traits::template Codim< EntitySeed::codimension >::Entity
450  entity ( const EntitySeed &seed ) const
451  {
452  typedef typename Traits::template Codim< EntitySeed::codimension >::EntityImpl EntityImpl;
453  return EntityImpl( *this, this->getRealImplementation(seed).elementInfo( meshPointer() ), this->getRealImplementation(seed).subEntity() );
454  }
455 
456  //**********************************************************
457  // End of Interface Methods
458  //**********************************************************
460  bool writeGrid( const std::string &filename, ctype time ) const;
461 
463  bool readGrid( const std::string &filename, ctype &time );
464 
465  // return hierarchic index set
466  const HierarchicIndexSet & hierarchicIndexSet () const { return hIndexSet_; }
467 
469  const typename Traits :: LevelIndexSet & levelIndexSet (int level) const;
470 
472  const typename Traits :: LeafIndexSet & leafIndexSet () const;
473 
475  const GlobalIdSet &globalIdSet () const
476  {
477  return idSet_;
478  }
479 
481  const LocalIdSet &localIdSet () const
482  {
483  return idSet_;
484  }
485 
486  // access to mesh pointer, needed by some methods
487  ALBERTA MESH* getMesh () const
488  {
489  return mesh_;
490  };
491 
492  const MeshPointer &meshPointer () const
493  {
494  return mesh_;
495  }
496 
497  const DofNumbering &dofNumbering () const
498  {
499  return dofNumbering_;
500  }
501 
502  const LevelProvider &levelProvider () const
503  {
504  return levelProvider_;
505  }
506 
507  int dune2alberta ( int codim, int i ) const
508  {
509  return numberingMap_.dune2alberta( codim, i );
510  }
511 
512  int alberta2dune ( int codim, int i ) const
513  {
514  return numberingMap_.alberta2dune( codim, i );
515  }
516 
517  int generic2alberta ( int codim, int i ) const
518  {
519  return genericNumberingMap_.dune2alberta( codim, i );
520  }
521 
522  int alberta2generic ( int codim, int i ) const
523  {
524  return genericNumberingMap_.alberta2dune( codim, i );
525  }
526 
527  // write ALBERTA mesh file
528  bool
529  DUNE_DEPRECATED_MSG("Deprecated in Dune 3.0, use writeGrid instead.")
530  writeGridXdr ( const std::string &filename, ctype time ) const;
531 
533  bool
534  DUNE_DEPRECATED_MSG("Deprecated in Dune 3.0, use readGrid instead.")
535  readGridXdr ( const std::string &filename, ctype &time );
536 
537  private:
538  using Base::getRealImplementation;
539 
540  typedef std::vector<int> ArrayType;
541 
542  void setup ();
543 
544  // make the calculation of indexOnLevel and so on.
545  // extra method because of Reihenfolge
546  void calcExtras();
547 
548  private:
549  // delete mesh and all vectors
550  void removeMesh();
551 
552  //***********************************************************************
553  // MemoryManagement for Entitys and Geometrys
554  //**********************************************************************
555  typedef MakeableInterfaceObject< typename Traits::template Codim< 0 >::Entity >
556  EntityObject;
557 
558  public:
559  friend class AlbertaGridLeafIntersectionIterator< const This >;
560 
561  template< int codim >
562  static int
563  getTwist ( const typename Traits::template Codim< codim >::Entity &entity )
564  {
565  return getRealImplementation( entity ).twist();
566  }
567 
568  template< int codim >
569  static int
570  getTwist ( const typename Traits::template Codim< 0 >::Entity &entity, int subEntity )
571  {
572  return getRealImplementation( entity ).template twist< codim >( subEntity );
573  }
574 
575  static int
576  getTwistInInside ( const typename Traits::LeafIntersection &intersection )
577  {
578  return getRealImplementation( intersection ).twistInInside();
579  }
580 
581  static int
582  getTwistInOutside ( const typename Traits::LeafIntersection &intersection )
583  {
584  return getRealImplementation( intersection ).twistInOutside();
585  }
586 
588  getRealIntersection ( const typename Traits::LeafIntersection &intersection ) const
589  {
590  return getRealImplementation( intersection );
591  }
592 
593  public:
594  // read global element number from elNumbers_
595  const Alberta::GlobalVector &
596  getCoord ( const ElementInfo &elementInfo, int vertex ) const;
597 
598  private:
599  // pointer to an Albert Mesh, which contains the data
600  MeshPointer mesh_;
601 
602  // collective communication
604 
605  // maximum level of the mesh
606  int maxlevel_;
607 
608  // number of boundary segments within the macro grid
609  size_t numBoundarySegments_;
610 
611  // map between ALBERTA and DUNE numbering
612  Alberta::NumberingMap< dimension, Alberta::Dune2AlbertaNumbering > numberingMap_;
613  Alberta::NumberingMap< dimension, Alberta::Generic2AlbertaNumbering > genericNumberingMap_;
614 
615  DofNumbering dofNumbering_;
616 
617  LevelProvider levelProvider_;
618 
619  // hierarchical numbering of AlbertaGrid, unique per codim
620  HierarchicIndexSet hIndexSet_;
621 
622  // the id set of this grid
623  IdSetImp idSet_;
624 
625  // the level index set, is generated from the HierarchicIndexSet
626  // is generated, when accessed
627  mutable std::vector< typename GridFamily::LevelIndexSetImp * > levelIndexVec_;
628 
629  // the leaf index set, is generated from the HierarchicIndexSet
630  // is generated, when accessed
631  mutable typename GridFamily::LeafIndexSetImp* leafIndexSet_;
632 
633  SizeCache< This > sizeCache_;
634 
635  typedef AlbertaMarkerVector< dim, dimworld > MarkerVector;
636 
637  // needed for VertexIterator, mark on which element a vertex is treated
638  mutable MarkerVector leafMarkerVector_;
639 
640  // needed for VertexIterator, mark on which element a vertex is treated
641  mutable std::vector< MarkerVector > levelMarkerVector_;
642 
643 #if DUNE_ALBERTA_CACHE_COORDINATES
644  Alberta::CoordCache< dimension > coordCache_;
645 #endif
646 
647  // current state of adaptation
648  AdaptationState adaptationState_;
649  };
650 
651 } // namespace Dune
652 
653 #include "albertagrid.cc"
654 
655 // undef all dangerous defines
656 #undef DIM
657 #undef DIM_OF_WORLD
658 
659 #ifdef _ABS_NOT_DEFINED_
660 #undef ABS
661 #endif
662 
663 #ifdef _MIN_NOT_DEFINED_
664 #undef MIN
665 #endif
666 
667 #ifdef _MAX_NOT_DEFINED_
668 #undef MAX
669 #endif
670 
671 #ifdef obstack_chunk_alloc
672 #undef obstack_chunk_alloc
673 #endif
674 #ifdef obstack_chunk_free
675 #undef obstack_chunk_free
676 #endif
678 
679 // We use MEM_ALLOC, so undefine it here.
680 #undef MEM_ALLOC
681 
682 // We use MEM_REALLOC, so undefine it here.
683 #undef MEM_REALLOC
684 
685 // We use MEM_CALLOC, so undefine it here.
686 #undef MEM_CALLOC
687 
688 // We use MEM_FREE, so undefine it here.
689 #undef MEM_FREE
690 
691 // Macro ERROR may be defined by alberta_util.h. If so, undefine it.
692 #ifdef ERROR
693 #undef ERROR
694 #endif // #ifdef ERROR
695 
696 // Macro ERROR_EXIT may be defined by alberta_util.h. If so, undefine it.
697 #ifdef ERROR_EXIT
698 #undef ERROR_EXIT
699 #endif // #ifdef ERROR_EXIT
700 
701 // Macro WARNING may be defined by alberta_util.h. If so, undefine it.
702 #ifdef WARNING
703 #undef WARNING
704 #endif // #ifdef WARNING
705 
706 // Macro TEST may be defined by alberta_util.h. If so, undefine it.
707 #ifdef TEST
708 #undef TEST
709 #endif // #ifdef TEST
710 
711 // Macro TEST_EXIT may be defined by alberta_util.h. If so, undefine it.
712 #ifdef TEST_EXIT
713 #undef TEST_EXIT
714 #endif // #ifdef TEST_EXIT
715 
716 // Macro DEBUG_TEST may be defined by alberta_util.h. If so, undefine it.
717 #ifdef DEBUG_TEST
718 #undef DEBUG_TEST
719 #endif // #ifdef DEBUG_TEST
720 
721 // Macro DEBUG_TEST_EXIT may be defined by alberta_util.h. If so, undefine it.
722 #ifdef DEBUG_TEST_EXIT
723 #undef DEBUG_TEST_EXIT
724 #endif // #ifdef DEBUG_TEST_EXIT
725 
726 // Macro INFO may be defined by alberta_util.h. If so, undefine it.
727 #ifdef INFO
728 #undef INFO
729 #endif // #ifdef INFO
730 
731 // Macro PRINT_INFO may be defined by alberta_util.h. If so, undefine it.
732 #ifdef PRINT_INFO
733 #undef PRINT_INFO
734 #endif // #ifdef PRINT_INFO
735 
736 // Macro PRINT_INT_VEC may be defined by alberta_util.h. If so, undefine it.
737 #ifdef PRINT_INT_VEC
738 #undef PRINT_INT_VEC
739 #endif // #ifdef PRINT_INT_VEC
740 
741 // Macro PRINT_REAL_VEC may be defined by alberta_util.h. If so, undefine it.
742 #ifdef PRINT_REAL_VEC
743 #undef PRINT_REAL_VEC
744 #endif // #ifdef PRINT_REAL_VEC
745 
746 // Macro WAIT may be defined by alberta_util.h. If so, undefine it.
747 #ifdef WAIT
748 #undef WAIT
749 #endif // #ifdef WAIT
750 
751 // Macro WAIT_REALLY may be defined by alberta_util.h. If so, undefine it.
752 #ifdef WAIT_REALLY
753 #undef WAIT_REALLY
754 #endif // #ifdef WAIT_REALLY
755 
756 // Macro GET_WORKSPACE may be defined by alberta_util.h. If so, undefine it.
757 #ifdef GET_WORKSPACE
758 #undef GET_WORKSPACE
759 #endif // #ifdef GET_WORKSPACE
760 
761 // Macro FREE_WORKSPACE may be defined by alberta_util.h. If so, undefine it.
762 #ifdef FREE_WORKSPACE
763 #undef FREE_WORKSPACE
764 #endif // #ifdef FREE_WORKSPACE
765 
766 // Macro MAT_ALLOC may be defined by alberta_util.h. If so, undefine it.
767 #ifdef MAT_ALLOC
768 #undef MAT_ALLOC
769 #endif // #ifdef MAT_ALLOC
770 
771 // Macro MAT_FREE may be defined by alberta_util.h. If so, undefine it.
772 #ifdef MAT_FREE
773 #undef MAT_FREE
774 #endif // #ifdef MAT_FREE
775 
776 // Macro NAME may be defined by alberta_util.h. If so, undefine it.
777 #ifdef NAME
778 #undef NAME
779 #endif // #ifdef NAME
780 
781 // Macro GET_STRUCT may be defined by alberta_util.h. If so, undefine it.
782 #ifdef GET_STRUCT
783 #undef GET_STRUCT
784 #endif // #ifdef GET_STRUCT
785 
786 // Macro ADD_PARAMETER may be defined by alberta_util.h. If so, undefine it.
787 #ifdef ADD_PARAMETER
788 #undef ADD_PARAMETER
789 #endif // #ifdef ADD_PARAMETER
790 
791 // Macro GET_PARAMETER may be defined by alberta_util.h. If so, undefine it.
792 #ifdef GET_PARAMETER
793 #undef GET_PARAMETER
794 #endif // #ifdef GET_PARAMETER
795 
796 #define _ALBERTA_H_
797 
798 #endif // HAVE_ALBERTA || DOXYGEN
799 
800 #endif
Dune::Entity
Wrapper class for entities.
Definition: common/entity.hh:63
Dune::AlbertaGrid::~AlbertaGrid
~AlbertaGrid()
desctructor
Definition: albertagrid.cc:194
Dune::AlbertaGrid::AlbertaGridLeafIntersection< const This >
friend class AlbertaGridLeafIntersection< const This >
Definition: agrid.hh:155
grid.hh
Different resources needed by all grid implementations.
Dune::AlbertaGrid::meshPointer
const MeshPointer & meshPointer() const
Definition: agrid.hh:492
Dune::AlbertaGrid::globalIdSet
const GlobalIdSet & globalIdSet() const
return global IdSet
Definition: agrid.hh:475
Dune::AlbertaGrid::GridFamily
AlbertaGridFamily< dim, dimworld > GridFamily
the grid family of AlbertaGrid
Definition: agrid.hh:171
entity.hh
Dune::AlbertaGrid::dimensionworld
static const int dimensionworld
Definition: agrid.hh:176
Dune::AlbertaGrid::readGrid
bool readGrid(const std::string &filename, ctype &time)
read Grid from file filename and store time of mesh in time
Definition: albertagrid.cc:599
entityseed.hh
Dune::AlbertaGrid::getCoord
const Alberta::GlobalVector & getCoord(const ElementInfo &elementInfo, int vertex) const
Definition: albertagrid.cc:469
Dune::AlbertaGrid::Traits
AlbertaGridFamily< dim, dimworld >::Traits Traits
Definition: agrid.hh:179
Dune::VTK::GeometryType
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178
Dune::AlbertaGrid::leafIndexSet
const Traits ::LeafIndexSet & leafIndexSet() const
return leaf index set
Definition: albertagrid.cc:533
gridfactory.hh
Provide a generic factory class for unstructured grids.
Dune::AlbertaGrid::typeName
static std::string typeName()
Definition: agrid.hh:440
sizecache.hh
Provides size cache classes to implement the grids size method efficiently.
Dune::AlbertaGrid::lbegin
Traits::template Codim< cd >::template Partition< pitype >::LevelIterator lbegin(int level) const
Iterator to first entity of given codim on level.
Definition: albertagrid.cc:204
leafiterator.hh
indexsets.hh
undefine-3.0.hh
Contains #undefs for all preprocessor macros defined by alberta.
Dune::GridDefaultImplementation::getMark
int getMark(const typename Traits::template Codim< 0 >::Entity &e) const
returns adaptation mark for given entity, i.e. here the default implementation returns 0.
Definition: common/grid.hh:920
Dune::DGFGridFactory
Definition: agrid.hh:65
hierarchiciterator.hh
backuprestore.hh
Dune::AlbertaGrid::AlbertaMarkerVector< dim, dimworld >
friend class AlbertaMarkerVector< dim, dimworld >
Definition: agrid.hh:157
Dune::AlbertaGrid::GlobalIdSet
Traits::GlobalIdSet GlobalIdSet
type of global id set
Definition: agrid.hh:190
Dune::VTK::vertex
@ vertex
Definition: common.hh:179
Dune::AlbertaGrid::localIdSet
const LocalIdSet & localIdSet() const
return local IdSet
Definition: agrid.hh:481
Dune::AlbertaGrid::alberta2generic
int alberta2generic(int codim, int i) const
Definition: agrid.hh:522
Dune::AlbertaGrid::AlbertaLeafGridView
friend class AlbertaLeafGridView
Definition: agrid.hh:147
Dune::AlbertaGrid::levelIndexSet
const Traits ::LevelIndexSet & levelIndexSet(int level) const
return level index set for given level
Definition: albertagrid.cc:518
Dune::AlbertaGrid::getMark
int getMark(const typename Traits::template Codim< 0 >::Entity &e) const
returns adaptation mark for given entity
Definition: albertagrid.cc:406
gridfamily.hh
provides the GridFamily for AlbertaGrid
Dune::AlbertaGrid::size
int size(int level, int codim) const
Number of grid entities per level and codim because lbegin and lend are none const,...
Definition: albertagrid.cc:488
intersection.hh
Dune::AlbertaGrid::dune2alberta
int dune2alberta(int codim, int i) const
Definition: agrid.hh:507
Dune::AlbertaGrid::maxLevel
int maxLevel() const
Definition: albertagrid.cc:481
Dune::AlbertaGrid::CollectiveCommunication
Traits::CollectiveCommunication CollectiveCommunication
type of collective communication
Definition: agrid.hh:195
Dune::AlbertaGrid::getTwist
static int getTwist(const typename Traits::template Codim< 0 >::Entity &entity, int subEntity)
Definition: agrid.hh:570
Dune::AlbertaGrid::ctype
GridFamily::ctype ctype
Definition: agrid.hh:173
treeiterator.hh
Dune::AlbertaGrid::getTwistInInside
static int getTwistInInside(const typename Traits::LeafIntersection &intersection)
Definition: agrid.hh:576
Dune::AlbertaGrid::mark
bool mark(int refCount, const typename Traits::template Codim< 0 >::Entity &e)
Marks an entity to be refined/coarsened in a subsequent adapt.
Definition: albertagrid.cc:383
Dune::GridFactory
Provide a generic factory class for unstructured grids.
Definition: common/gridfactory.hh:263
Dune::AlbertaGrid::leafend
Traits ::template Codim< codim >::template Partition< pitype >::LeafIterator leafend() const
return LeafIterator which points behind last leaf entity
albertagrid.cc
Dune::GridDefaultImplementation::mark
bool mark(int refCount, const typename Traits ::template Codim< 0 >::Entity &e)
Marks an entity to be refined/coarsened in a subsequent adapt.
Definition: common/grid.hh:908
Dune::DuneBoundaryProjection
Interface class for vertex projection at the boundary.
Definition: boundaryprojection.hh:23
Dune::AlbertaGrid::AlbertaGrid
AlbertaGrid()
create an empty grid
Definition: albertagrid.cc:40
Dune::DUNE_DEPRECATED_MSG
struct DUNE_DEPRECATED_MSG("The MCMG layout classes have been deprecated. Pass `mcmgElementLayout()` to the constructor instead") MCMGElementLayout
Layout template for elements.
Definition: mcmgmapper.hh:49
Dune::AlbertaGrid::leafbegin
Traits ::template Codim< codim >::template Partition< pitype >::LeafIterator leafbegin() const
return LeafIterator which points to first leaf entity
Dune::AlbertaGrid::getTwist
static int getTwist(const typename Traits::template Codim< codim >::Entity &entity)
Definition: agrid.hh:563
Dune::GridDefaultImplementation< dim, Alberta::dimWorld, Alberta::Real, AlbertaGridFamily< dim, Alberta::dimWorld > >::getRealImplementation
static std::conditional< std::is_reference< InterfaceType >::value, typename std::add_lvalue_reference< typename ReturnImplementationType< typename std::remove_reference< InterfaceType >::type >::ImplementationType >::type, typename std::remove_const< typename ReturnImplementationType< typename std::remove_reference< InterfaceType >::type >::ImplementationType >::type >::type getRealImplementation(InterfaceType &&i)
return real implementation of interface class
Definition: common/grid.hh:1026
Dune::AlbertaGrid
[ provides Dune::Grid ]
Definition: agrid.hh:136
Dune::SizeCache
organizes the caching of sizes for one grid and one GeometryType
Definition: sizecache.hh:30
Dune::AlbertaGrid::getMesh
ALBERTA MESH * getMesh() const
Definition: agrid.hh:487
Dune::AlbertaGrid::LevelIndexSet
Traits::LevelIndexSet LevelIndexSet
type of level index sets
Definition: agrid.hh:184
Dune::AlbertaGrid::comm
const CollectiveCommunication & comm() const
return reference to collective communication, if MPI found this is specialisation for MPI
Definition: agrid.hh:435
Dune::AlbertaGrid::levelGridView
Traits::LevelGridView levelGridView(int level) const
View for a grid level for All_Partition.
Definition: agrid.hh:386
Dune::AlbertaGrid::adapt
bool adapt()
Refine all positive marked leaf entities, coarsen all negative marked entities if possible.
Definition: albertagrid.cc:413
Dune::AlbertaGrid::postAdapt
void postAdapt()
clean up some markers
Definition: albertagrid.cc:354
Dune::AlbertaGrid::AlbertaGridTreeIterator
friend class AlbertaGridTreeIterator
Definition: agrid.hh:148
Dune::AlbertaGrid::levelProvider
const LevelProvider & levelProvider() const
Definition: agrid.hh:502
Dune::AlbertaGrid::getRealIntersection
const AlbertaGridLeafIntersection< const This > & getRealIntersection(const typename Traits::LeafIntersection &intersection) const
Definition: agrid.hh:588
Dune::AdaptDataHandleInterface
Interface class for the Grid's adapt method where the parameter is a AdaptDataHandleInterface.
Definition: adaptcallback.hh:30
Dune::AlbertaGrid::AlbertaGridHierarchicIterator
friend class AlbertaGridHierarchicIterator
Definition: agrid.hh:149
geometry.hh
Dune::AlbertaGrid::dofNumbering
const DofNumbering & dofNumbering() const
Definition: agrid.hh:497
Dune::AlbertaGrid::numBoundarySegments
std::size_t numBoundarySegments() const
number of boundary segments within the macro grid
Definition: agrid.hh:380
Dune::AlbertaGrid::entity
Traits::template Codim< EntitySeed::codimension >::Entity entity(const EntitySeed &seed) const
obtain Entity from EntitySeed.
Definition: agrid.hh:450
Dune::AlbertaGrid::AlbertaGridEntity
friend class AlbertaGridEntity
Definition: agrid.hh:145
Dune::AlbertaGrid::lend
Traits::template Codim< cd >::template Partition< pitype >::LevelIterator lend(int level) const
one past the end on this level
Definition: albertagrid.cc:224
albertaheader.hh
Dune::AlbertaGrid::alberta2dune
int alberta2dune(int codim, int i) const
Definition: agrid.hh:512
misc.hh
capabilities.hh
Dune::MakeableInterfaceObject
Definition: common/grid.hh:1171
coordcache.hh
Dune::AlbertaGrid::HierarchicIndexSet
Traits::HierarchicIndexSet HierarchicIndexSet
type of hierarchic index set
Definition: agrid.hh:187
Dune::EntitySeed
Store a reference to an entity with a minimal memory footprint.
Definition: common/entityseed.hh:23
Dune::AlbertaGrid::AlbertaLevelGridView
friend class AlbertaLevelGridView
Definition: agrid.hh:146
Dune::AlbertaGrid::operator=
This & operator=(const This &)=delete
Dune::AlbertaGrid::LocalIdSet
Traits::LocalIdSet LocalIdSet
type of local id set
Definition: agrid.hh:192
intersectioniterator.hh
Implementation of the IntersectionIterator for AlbertaGrid.
Dune::AlbertaGrid::hierarchicIndexSet
const HierarchicIndexSet & hierarchicIndexSet() const
Definition: agrid.hh:466
Dune::AlbertaGrid::leafGridView
Traits::LeafGridView leafGridView() const
View for the leaf grid for All_Partition.
Definition: agrid.hh:394
level.hh
Dune
Include standard header files.
Definition: agrid.hh:58
Dune::AlbertaGrid::globalRefine
void globalRefine(int refCount)
uses the interface, mark on entity and refineLocal
Definition: albertagrid.cc:302
Dune::AlbertaGrid::writeGrid
bool writeGrid(const std::string &filename, ctype time) const
write Grid to file in Xdr
Definition: albertagrid.cc:589
adaptcallback.hh
interfaces and wrappers needed for the callback adaptation provided by AlbertaGrid and dune-ALUGrid
Dune::AlbertaGrid::preAdapt
bool preAdapt()
returns true, if a least one element is marked for coarsening
Definition: albertagrid.cc:346
datahandle.hh
Dune::GridDefaultImplementation
Definition: common/geometry.hh:24
Dune::AlbertaGrid::dimension
static const int dimension
Definition: agrid.hh:175
leveliterator.hh
Dune::AlbertaGrid::LeafIndexSet
Traits::LeafIndexSet LeafIndexSet
type of leaf index set
Definition: agrid.hh:182
Dune::AlbertaGrid::getTwistInOutside
static int getTwistInOutside(const typename Traits::LeafIntersection &intersection)
Definition: agrid.hh:582
Dune::AlbertaGrid::generic2alberta
int generic2alberta(int codim, int i) const
Definition: agrid.hh:517