dune-grid  2.7.0
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/communication.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, seed.impl().elementInfo( meshPointer() ), seed.impl().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 entity.impl().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 entity.impl().template twist< codim >( subEntity );
573  }
574 
575  static int
576  getTwistInInside ( const typename Traits::LeafIntersection &intersection )
577  {
578  return intersection.impl().twistInInside();
579  }
580 
581  static int
582  getTwistInOutside ( const typename Traits::LeafIntersection &intersection )
583  {
584  return intersection.impl().twistInOutside();
585  }
586 
587  DUNE_DEPRECATED_MSG("use intersection.impl() instead")
588  const AlbertaGridLeafIntersection< const This > &
589  getRealIntersection ( const typename Traits::LeafIntersection &intersection ) const
590  {
591  return intersection.impl();
592  }
593 
594  public:
595  // read global element number from elNumbers_
596  const Alberta::GlobalVector &
597  getCoord ( const ElementInfo &elementInfo, int vertex ) const;
598 
599  private:
600  // pointer to an Albert Mesh, which contains the data
601  MeshPointer mesh_;
602 
603  // collective communication
605 
606  // maximum level of the mesh
607  int maxlevel_;
608 
609  // number of boundary segments within the macro grid
610  size_t numBoundarySegments_;
611 
612  // map between ALBERTA and DUNE numbering
613  Alberta::NumberingMap< dimension, Alberta::Dune2AlbertaNumbering > numberingMap_;
614  Alberta::NumberingMap< dimension, Alberta::Generic2AlbertaNumbering > genericNumberingMap_;
615 
616  DofNumbering dofNumbering_;
617 
618  LevelProvider levelProvider_;
619 
620  // hierarchical numbering of AlbertaGrid, unique per codim
621  HierarchicIndexSet hIndexSet_;
622 
623  // the id set of this grid
624  IdSetImp idSet_;
625 
626  // the level index set, is generated from the HierarchicIndexSet
627  // is generated, when accessed
628  mutable std::vector< typename GridFamily::LevelIndexSetImp * > levelIndexVec_;
629 
630  // the leaf index set, is generated from the HierarchicIndexSet
631  // is generated, when accessed
632  mutable typename GridFamily::LeafIndexSetImp* leafIndexSet_;
633 
634  SizeCache< This > sizeCache_;
635 
636  typedef AlbertaMarkerVector< dim, dimworld > MarkerVector;
637 
638  // needed for VertexIterator, mark on which element a vertex is treated
639  mutable MarkerVector leafMarkerVector_;
640 
641  // needed for VertexIterator, mark on which element a vertex is treated
642  mutable std::vector< MarkerVector > levelMarkerVector_;
643 
644 #if DUNE_ALBERTA_CACHE_COORDINATES
645  Alberta::CoordCache< dimension > coordCache_;
646 #endif
647 
648  // current state of adaptation
649  AdaptationState adaptationState_;
650  };
651 
652 } // namespace Dune
653 
654 #include "albertagrid.cc"
655 
656 // undef all dangerous defines
657 #undef DIM
658 #undef DIM_OF_WORLD
659 
660 #ifdef _ABS_NOT_DEFINED_
661 #undef ABS
662 #endif
663 
664 #ifdef _MIN_NOT_DEFINED_
665 #undef MIN
666 #endif
667 
668 #ifdef _MAX_NOT_DEFINED_
669 #undef MAX
670 #endif
671 
672 #ifdef obstack_chunk_alloc
673 #undef obstack_chunk_alloc
674 #endif
675 #ifdef obstack_chunk_free
676 #undef obstack_chunk_free
677 #endif
679 
680 // We use MEM_ALLOC, so undefine it here.
681 #undef MEM_ALLOC
682 
683 // We use MEM_REALLOC, so undefine it here.
684 #undef MEM_REALLOC
685 
686 // We use MEM_CALLOC, so undefine it here.
687 #undef MEM_CALLOC
688 
689 // We use MEM_FREE, so undefine it here.
690 #undef MEM_FREE
691 
692 // Macro ERROR may be defined by alberta_util.h. If so, undefine it.
693 #ifdef ERROR
694 #undef ERROR
695 #endif // #ifdef ERROR
696 
697 // Macro ERROR_EXIT may be defined by alberta_util.h. If so, undefine it.
698 #ifdef ERROR_EXIT
699 #undef ERROR_EXIT
700 #endif // #ifdef ERROR_EXIT
701 
702 // Macro WARNING may be defined by alberta_util.h. If so, undefine it.
703 #ifdef WARNING
704 #undef WARNING
705 #endif // #ifdef WARNING
706 
707 // Macro TEST may be defined by alberta_util.h. If so, undefine it.
708 #ifdef TEST
709 #undef TEST
710 #endif // #ifdef TEST
711 
712 // Macro TEST_EXIT may be defined by alberta_util.h. If so, undefine it.
713 #ifdef TEST_EXIT
714 #undef TEST_EXIT
715 #endif // #ifdef TEST_EXIT
716 
717 // Macro DEBUG_TEST may be defined by alberta_util.h. If so, undefine it.
718 #ifdef DEBUG_TEST
719 #undef DEBUG_TEST
720 #endif // #ifdef DEBUG_TEST
721 
722 // Macro DEBUG_TEST_EXIT may be defined by alberta_util.h. If so, undefine it.
723 #ifdef DEBUG_TEST_EXIT
724 #undef DEBUG_TEST_EXIT
725 #endif // #ifdef DEBUG_TEST_EXIT
726 
727 // Macro INFO may be defined by alberta_util.h. If so, undefine it.
728 #ifdef INFO
729 #undef INFO
730 #endif // #ifdef INFO
731 
732 // Macro PRINT_INFO may be defined by alberta_util.h. If so, undefine it.
733 #ifdef PRINT_INFO
734 #undef PRINT_INFO
735 #endif // #ifdef PRINT_INFO
736 
737 // Macro PRINT_INT_VEC may be defined by alberta_util.h. If so, undefine it.
738 #ifdef PRINT_INT_VEC
739 #undef PRINT_INT_VEC
740 #endif // #ifdef PRINT_INT_VEC
741 
742 // Macro PRINT_REAL_VEC may be defined by alberta_util.h. If so, undefine it.
743 #ifdef PRINT_REAL_VEC
744 #undef PRINT_REAL_VEC
745 #endif // #ifdef PRINT_REAL_VEC
746 
747 // Macro WAIT may be defined by alberta_util.h. If so, undefine it.
748 #ifdef WAIT
749 #undef WAIT
750 #endif // #ifdef WAIT
751 
752 // Macro WAIT_REALLY may be defined by alberta_util.h. If so, undefine it.
753 #ifdef WAIT_REALLY
754 #undef WAIT_REALLY
755 #endif // #ifdef WAIT_REALLY
756 
757 // Macro GET_WORKSPACE may be defined by alberta_util.h. If so, undefine it.
758 #ifdef GET_WORKSPACE
759 #undef GET_WORKSPACE
760 #endif // #ifdef GET_WORKSPACE
761 
762 // Macro FREE_WORKSPACE may be defined by alberta_util.h. If so, undefine it.
763 #ifdef FREE_WORKSPACE
764 #undef FREE_WORKSPACE
765 #endif // #ifdef FREE_WORKSPACE
766 
767 // Macro MAT_ALLOC may be defined by alberta_util.h. If so, undefine it.
768 #ifdef MAT_ALLOC
769 #undef MAT_ALLOC
770 #endif // #ifdef MAT_ALLOC
771 
772 // Macro MAT_FREE may be defined by alberta_util.h. If so, undefine it.
773 #ifdef MAT_FREE
774 #undef MAT_FREE
775 #endif // #ifdef MAT_FREE
776 
777 // Macro NAME may be defined by alberta_util.h. If so, undefine it.
778 #ifdef NAME
779 #undef NAME
780 #endif // #ifdef NAME
781 
782 // Macro GET_STRUCT may be defined by alberta_util.h. If so, undefine it.
783 #ifdef GET_STRUCT
784 #undef GET_STRUCT
785 #endif // #ifdef GET_STRUCT
786 
787 // Macro ADD_PARAMETER may be defined by alberta_util.h. If so, undefine it.
788 #ifdef ADD_PARAMETER
789 #undef ADD_PARAMETER
790 #endif // #ifdef ADD_PARAMETER
791 
792 // Macro GET_PARAMETER may be defined by alberta_util.h. If so, undefine it.
793 #ifdef GET_PARAMETER
794 #undef GET_PARAMETER
795 #endif // #ifdef GET_PARAMETER
796 
797 #define _ALBERTA_H_
798 
799 #endif // HAVE_ALBERTA || DOXYGEN
800 
801 #endif
Dune::AlbertaGrid::GridFamily
AlbertaGridFamily< dim, dimworld > GridFamily
the grid family of AlbertaGrid
Definition: agrid.hh:171
intersectioniterator.hh
Implementation of the IntersectionIterator for AlbertaGrid.
Dune::AlbertaGrid::AlbertaLeafGridView
friend class AlbertaLeafGridView
Definition: agrid.hh:147
Dune::AlbertaGrid::globalRefine
void globalRefine(int refCount)
uses the interface, mark on entity and refineLocal
Definition: albertagrid.cc:302
Dune::AlbertaGrid::numBoundarySegments
std::size_t numBoundarySegments() const
number of boundary segments within the macro grid
Definition: agrid.hh:380
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
Dune::AlbertaGrid::generic2alberta
int generic2alberta(int codim, int i) const
Definition: agrid.hh:517
Dune::AlbertaGrid::maxLevel
int maxLevel() const
Definition: albertagrid.cc:481
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::adapt
bool adapt()
Refine all positive marked leaf entities, coarsen all negative marked entities if possible.
Definition: albertagrid.cc:413
albertaheader.hh
Dune::AlbertaGrid::getTwist
static int getTwist(const typename Traits::template Codim< 0 >::Entity &entity, int subEntity)
Definition: agrid.hh:570
Dune::AlbertaGrid::AlbertaMarkerVector< dim, dimworld >
friend class AlbertaMarkerVector< dim, dimworld >
Definition: agrid.hh:157
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::GridDefaultImplementation< dim, Alberta::dimWorld, Alberta::Real, AlbertaGridFamily< dim, Alberta::dimWorld > >::DUNE_DEPRECATED_MSG
DUNE_DEPRECATED_MSG("use the facade class' `impl()` method instead") static typename std
return real implementation of interface class
Definition: common/grid.hh:1007
Dune::AlbertaGrid::ctype
GridFamily::ctype ctype
Definition: agrid.hh:173
Dune::DuneBoundaryProjection
Interface class for vertex projection at the boundary.
Definition: boundaryprojection.hh:24
Dune::AlbertaGrid::AlbertaGridTreeIterator
friend class AlbertaGridTreeIterator
Definition: agrid.hh:148
Dune::EntitySeed::impl
Implementation & impl()
access to the underlying implementation
Definition: common/entityseed.hh:57
Dune::AlbertaGrid::getMark
int getMark(const typename Traits::template Codim< 0 >::Entity &e) const
returns adaptation mark for given entity
Definition: albertagrid.cc:406
Dune::AlbertaGrid::entity
Traits::template Codim< EntitySeed::codimension >::Entity entity(const EntitySeed &seed) const
obtain Entity from EntitySeed.
Definition: agrid.hh:450
Dune::AlbertaGrid::leafIndexSet
const Traits ::LeafIndexSet & leafIndexSet() const
return leaf index set
Definition: albertagrid.cc:533
Dune::AlbertaGrid::typeName
static std::string typeName()
Definition: agrid.hh:440
Dune::DGFGridFactory
Definition: agrid.hh:65
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::AlbertaGrid::CollectiveCommunication
Traits::CollectiveCommunication CollectiveCommunication
type of collective communication
Definition: agrid.hh:195
leafiterator.hh
Dune::AlbertaGrid::getMesh
ALBERTA MESH * getMesh() const
Definition: agrid.hh:487
undefine-3.0.hh
Contains #undefs for all preprocessor macros defined by alberta.
datahandle.hh
Dune::AlbertaGrid::alberta2dune
int alberta2dune(int codim, int i) const
Definition: agrid.hh:512
Dune::AlbertaGrid::HierarchicIndexSet
Traits::HierarchicIndexSet HierarchicIndexSet
type of hierarchic index set
Definition: agrid.hh:187
adaptcallback.hh
interfaces and wrappers needed for the callback adaptation provided by AlbertaGrid and dune-ALUGrid
Dune::GridFactory
Provide a generic factory class for unstructured grids.
Definition: common/gridfactory.hh:269
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
Dune::AlbertaGrid::~AlbertaGrid
~AlbertaGrid()
desctructor
Definition: albertagrid.cc:194
Dune::MakeableInterfaceObject
Definition: common/grid.hh:1172
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
Dune::AlbertaGrid::globalIdSet
const GlobalIdSet & globalIdSet() const
return global IdSet
Definition: agrid.hh:475
Dune::AlbertaGrid::levelGridView
Traits::LevelGridView levelGridView(int level) const
View for a grid level for All_Partition.
Definition: agrid.hh:386
Dune::AlbertaGrid::AlbertaGridHierarchicIterator
friend class AlbertaGridHierarchicIterator
Definition: agrid.hh:149
indexsets.hh
backuprestore.hh
Dune::AlbertaGrid::AlbertaGrid
AlbertaGrid()
create an empty grid
Definition: albertagrid.cc:40
gridfactory.hh
Provide a generic factory class for unstructured grids.
Dune::AlbertaGrid::GlobalIdSet
Traits::GlobalIdSet GlobalIdSet
type of global id set
Definition: agrid.hh:190
Dune::AlbertaGrid::AlbertaGridEntity
friend class AlbertaGridEntity
Definition: agrid.hh:145
sizecache.hh
Provides size cache classes to implement the grids size method efficiently.
Dune::AlbertaGrid::localIdSet
const LocalIdSet & localIdSet() const
return local IdSet
Definition: agrid.hh:481
Dune::AlbertaGrid::getTwistInOutside
static int getTwistInOutside(const typename Traits::LeafIntersection &intersection)
Definition: agrid.hh:582
coordcache.hh
Dune::AlbertaGrid::dofNumbering
const DofNumbering & dofNumbering() const
Definition: agrid.hh:497
albertagrid.cc
Dune::Entity::impl
Implementation & impl()
access to the underlying implementation
Definition: common/entity.hh:78
Dune::AlbertaGrid::meshPointer
const MeshPointer & meshPointer() const
Definition: agrid.hh:492
leveliterator.hh
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::AlbertaGrid::leafGridView
Traits::LeafGridView leafGridView() const
View for the leaf grid for All_Partition.
Definition: agrid.hh:394
Dune::AlbertaGrid::levelProvider
const LevelProvider & levelProvider() const
Definition: agrid.hh:502
Dune::AlbertaGrid::alberta2generic
int alberta2generic(int codim, int i) const
Definition: agrid.hh:522
Dune::GridDefaultImplementation
Definition: common/geometry.hh:24
Dune::AlbertaGrid::dune2alberta
int dune2alberta(int codim, int i) const
Definition: agrid.hh:507
Dune::AlbertaGrid::Traits
AlbertaGridFamily< dim, dimworld >::Traits Traits
Definition: agrid.hh:179
Dune::AlbertaGrid::LeafIndexSet
Traits::LeafIndexSet LeafIndexSet
type of leaf index set
Definition: agrid.hh:182
intersection.hh
Dune::AlbertaGrid::levelIndexSet
const Traits ::LevelIndexSet & levelIndexSet(int level) const
return level index set for given level
Definition: albertagrid.cc:518
Dune::AdaptDataHandleInterface
Interface class for the Grid's adapt method where the parameter is a AdaptDataHandleInterface.
Definition: adaptcallback.hh:30
Dune::AlbertaGrid::AlbertaLevelGridView
friend class AlbertaLevelGridView
Definition: agrid.hh:146
Dune::VTK::vertex
@ vertex
Definition: common.hh:181
Dune::AlbertaGrid::operator=
This & operator=(const This &)=delete
Dune::EntitySeed
Store a reference to an entity with a minimal memory footprint.
Definition: common/entityseed.hh:23
gridfamily.hh
provides the GridFamily for AlbertaGrid
Dune::AlbertaGrid::leafend
Traits ::template Codim< codim >::template Partition< pitype >::LeafIterator leafend() const
return LeafIterator which points behind last leaf entity
Dune::AlbertaGrid::postAdapt
void postAdapt()
clean up some markers
Definition: albertagrid.cc:354
Dune::AlbertaGrid::getTwistInInside
static int getTwistInInside(const typename Traits::LeafIntersection &intersection)
Definition: agrid.hh:576
entityseed.hh
Dune::AlbertaGrid::getTwist
static int getTwist(const typename Traits::template Codim< codim >::Entity &entity)
Definition: agrid.hh:563
Dune::AlbertaGrid::writeGrid
bool writeGrid(const std::string &filename, ctype time) const
write Grid to file in Xdr
Definition: albertagrid.cc:589
Dune::AlbertaGrid::dimensionworld
static const int dimensionworld
Definition: agrid.hh:176
Dune::AlbertaGrid
[ provides Dune::Grid ]
Definition: agrid.hh:136
Dune::AlbertaGrid::leafbegin
Traits ::template Codim< codim >::template Partition< pitype >::LeafIterator leafbegin() const
return LeafIterator which points to first leaf entity
treeiterator.hh
misc.hh
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
Dune::AlbertaGrid::hierarchicIndexSet
const HierarchicIndexSet & hierarchicIndexSet() const
Definition: agrid.hh:466
Dune::AlbertaGrid::LevelIndexSet
Traits::LevelIndexSet LevelIndexSet
type of level index sets
Definition: agrid.hh:184
Dune::AlbertaGrid::dimension
static const int dimension
Definition: agrid.hh:175
geometry.hh
Dune::AlbertaGrid::preAdapt
bool preAdapt()
returns true, if a least one element is marked for coarsening
Definition: albertagrid.cc:346
grid.hh
Different resources needed by all grid implementations.
level.hh
capabilities.hh
Dune
Include standard header files.
Definition: agrid.hh:58
hierarchiciterator.hh
entity.hh
Dune::AlbertaGrid::LocalIdSet
Traits::LocalIdSet LocalIdSet
type of local id set
Definition: agrid.hh:192
Dune::VTK::GeometryType
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:180
Dune::Entity
Wrapper class for entities.
Definition: common/entity.hh:63