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