Dune Core Modules (2.4.1)

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 <iostream>
14#include <fstream>
15
16#include <algorithm>
17#include <cassert>
18#include <vector>
19
20// Dune includes
25
30
31//- Local includes
32// some cpp defines and include of alberta.h
33#include "albertaheader.hh"
34
35// grape data io
36#include <dune/grid/utility/grapedataioformattypes.hh>
37
38#include <dune/grid/albertagrid/misc.hh>
39#include <dune/grid/albertagrid/capabilities.hh>
40#include <dune/grid/albertagrid/backuprestore.hh>
41
42#include <dune/grid/albertagrid/coordcache.hh>
44#include <dune/grid/albertagrid/level.hh>
45#include <dune/grid/albertagrid/intersection.hh>
47#include <dune/grid/albertagrid/datahandle.hh>
48#include <dune/grid/albertagrid/entityseed.hh>
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
59namespace Dune
60{
61
62 // External Forward Declarations
63 // -----------------------------
64
65 template< class Grid >
66 struct DGFGridFactory;
67
68
69
70 // AlbertaGrid
71 // -----------
72
136 template< int dim, int dimworld = Alberta::dimWorld >
139 < dim, dimworld, Alberta::Real, AlbertaGridFamily< dim, dimworld > >
140 {
143 < dim, dimworld, Alberta::Real, AlbertaGridFamily< dim, dimworld > >
144 Base;
145
146 template< int, int, class > friend class AlbertaGridEntity;
147 template< int, class > friend class AlbertaGridEntityPointer;
148 template< class, PartitionIteratorType > friend class AlbertaLevelGridView;
149 template< class, PartitionIteratorType > 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 >
169 friend class Alberta::AdaptRestrictProlongHandler;
170
171 public:
173 typedef AlbertaGridFamily< dim, dimworld > GridFamily;
174
175 typedef typename GridFamily::ctype ctype;
176
177 static const int dimension = GridFamily::dimension;
178 static const int dimensionworld = GridFamily::dimensionworld;
179
180 // the Traits
181 typedef typename AlbertaGridFamily< dim, dimworld >::Traits Traits;
182
187
189 typedef typename Traits::HierarchicIndexSet HierarchicIndexSet;
190
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 {
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
286 typedef Alberta::ElementInfo< dimension > ElementInfo;
287 typedef Alberta::MeshPointer< dimension > MeshPointer;
288 typedef Alberta::HierarchyDofNumbering< dimension > DofNumbering;
289 typedef AlbertaGridLevelProvider< dimension > LevelProvider;
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 Dune::shared_ptr< DuneBoundaryProjection< dimensionworld > > &projection
306 = Dune::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 size_t numBoundarySegments () const
384 {
385 return numBoundarySegments_;
386 }
387
389 template< PartitionIteratorType pitype >
390 typename Traits::template Partition< pitype >::LevelGridView
391 levelGridView ( int level ) const
392 {
393 typedef typename Traits::template Partition< pitype >::LevelGridView View;
394 typedef typename View::GridViewImp ViewImp;
395 return View( ViewImp( *this, level ) );
396 }
397
399 template< PartitionIteratorType pitype >
400 typename Traits::template Partition< pitype >::LeafGridView leafGridView () const
401 {
402 typedef typename Traits::template Partition< pitype >::LeafGridView View;
403 typedef typename View::GridViewImp ViewImp;
404 return View( ViewImp( *this ) );
405 }
406
408 typename Traits::template Partition< All_Partition >::LevelGridView
409 levelGridView ( int level ) const
410 {
411 typedef typename Traits::template Partition< All_Partition >::LevelGridView View;
412 typedef typename View::GridViewImp ViewImp;
413 return View( ViewImp( *this, level ) );
414 }
415
417 typename Traits::template Partition< All_Partition >::LeafGridView leafGridView () const
418 {
419 typedef typename Traits::template Partition< All_Partition >::LeafGridView View;
420 typedef typename View::GridViewImp ViewImp;
421 return View( ViewImp( *this ) );
422 }
423
424 public:
425 //***************************************************************
426 // Interface for Adaptation
427 //***************************************************************
428 using Base::getMark;
429 using Base::mark;
430
432 int getMark ( const typename Traits::template Codim< 0 >::Entity &e ) const;
433
435 bool mark ( int refCount, const typename Traits::template Codim< 0 >::Entity &e );
436
438 void globalRefine ( int refCount );
439
440 template< class DataHandle >
441 void globalRefine ( int refCount, AdaptDataHandleInterface< This, DataHandle > &handle );
442
444 bool adapt ();
445
447 template< class DataHandle >
449
451 bool preAdapt ();
452
454 void postAdapt();
455
459 {
460 return comm_;
461 }
462
463 static std::string typeName ()
464 {
465 std::ostringstream s;
466 s << "AlbertaGrid< " << dim << ", " << dimworld << " >";
467 return s.str();
468 }
469
478 template< class EntitySeed >
479 DUNE_DEPRECATED_MSG("entityPointer() is deprecated and will be removed after the release of dune-grid 2.4. Use entity() instead to directly obtain an Entity object.")
480 typename Traits::template Codim< EntitySeed::codimension >::EntityPointer
481 entityPointer ( const EntitySeed &seed ) const
482 {
483 typedef typename Traits::template Codim< EntitySeed::codimension >::EntityPointerImpl EntityPointerImpl;
484 return EntityPointerImpl( *this, this->getRealImplementation(seed).elementInfo( meshPointer() ), this->getRealImplementation(seed).subEntity() );
485 }
486
488 template< class EntitySeed >
489 typename Traits::template Codim< EntitySeed::codimension >::Entity
490 entity ( const EntitySeed &seed ) const
491 {
492 typedef typename Traits::template Codim< EntitySeed::codimension >::EntityImpl EntityImpl;
493 return EntityImpl( *this, this->getRealImplementation(seed).elementInfo( meshPointer() ), this->getRealImplementation(seed).subEntity() );
494 }
495
496 //**********************************************************
497 // End of Interface Methods
498 //**********************************************************
500 template< GrapeIOFileFormatType ftype >
501 bool writeGrid( const std::string &filename, ctype time ) const;
502
504 template< GrapeIOFileFormatType ftype >
505 bool readGrid( const std::string &filename, ctype &time );
506
507 // return hierarchic index set
508 const HierarchicIndexSet & hierarchicIndexSet () const { return hIndexSet_; }
509
511 const typename Traits :: LevelIndexSet & levelIndexSet (int level) const;
512
514 const typename Traits :: LeafIndexSet & leafIndexSet () const;
515
517 const GlobalIdSet &globalIdSet () const
518 {
519 return idSet_;
520 }
521
523 const LocalIdSet &localIdSet () const
524 {
525 return idSet_;
526 }
527
528 // access to mesh pointer, needed by some methods
529 ALBERTA MESH* getMesh () const
530 {
531 return mesh_;
532 };
533
534 const MeshPointer &meshPointer () const
535 {
536 return mesh_;
537 }
538
539 const DofNumbering &dofNumbering () const
540 {
541 return dofNumbering_;
542 }
543
544 const LevelProvider &levelProvider () const
545 {
546 return levelProvider_;
547 }
548
549 int dune2alberta ( int codim, int i ) const
550 {
551 return numberingMap_.dune2alberta( codim, i );
552 }
553
554 int alberta2dune ( int codim, int i ) const
555 {
556 return numberingMap_.alberta2dune( codim, i );
557 }
558
559 int generic2alberta ( int codim, int i ) const
560 {
561 return genericNumberingMap_.dune2alberta( codim, i );
562 }
563
564 int alberta2generic ( int codim, int i ) const
565 {
566 return genericNumberingMap_.alberta2dune( codim, i );
567 }
568
569 // write ALBERTA mesh file
570 bool writeGridXdr ( const std::string &filename, ctype time ) const;
571
573 bool readGridXdr ( const std::string &filename, ctype &time );
574
575 private:
577
578 typedef std::vector<int> ArrayType;
579
580 void setup ();
581
582 // make the calculation of indexOnLevel and so on.
583 // extra method because of Reihenfolge
584 void calcExtras();
585
586 private:
587 // delete mesh and all vectors
588 void removeMesh();
589
590 //***********************************************************************
591 // MemoryManagement for Entitys and Geometrys
592 //**********************************************************************
593 typedef MakeableInterfaceObject< typename Traits::template Codim< 0 >::Entity >
594 EntityObject;
595
596 public:
597 friend class AlbertaGridLeafIntersectionIterator< const This >;
598
599 template< int codim >
600 static int
601 getTwist ( const typename Traits::template Codim< codim >::Entity &entity )
602 {
603 return getRealImplementation( entity ).twist();
604 }
605
606 template< int codim >
607 static int
608 getTwist ( const typename Traits::template Codim< 0 >::Entity &entity, int subEntity )
609 {
610 return getRealImplementation( entity ).template twist< codim >( subEntity );
611 }
612
613 static int
614 getTwistInInside ( const typename Traits::LeafIntersection &intersection )
615 {
616 return getRealImplementation( intersection ).twistInInside();
617 }
618
619 static int
620 getTwistInOutside ( const typename Traits::LeafIntersection &intersection )
621 {
622 return getRealImplementation( intersection ).twistInOutside();
623 }
624
625 const AlbertaGridLeafIntersection< const This > &
626 getRealIntersection ( const typename Traits::LeafIntersection &intersection ) const
627 {
628 return getRealImplementation( intersection );
629 }
630
631 public:
632 // read global element number from elNumbers_
633 const Alberta::GlobalVector &
634 getCoord ( const ElementInfo &elementInfo, int vertex ) const;
635
636 private:
637 // pointer to an Albert Mesh, which contains the data
638 MeshPointer mesh_;
639
640 // collective communication
642
643 // maximum level of the mesh
644 int maxlevel_;
645
646 // number of boundary segments within the macro grid
647 size_t numBoundarySegments_;
648
649 // map between ALBERTA and DUNE numbering
650 Alberta::NumberingMap< dimension, Alberta::Dune2AlbertaNumbering > numberingMap_;
651 Alberta::NumberingMap< dimension, Alberta::Generic2AlbertaNumbering > genericNumberingMap_;
652
653 DofNumbering dofNumbering_;
654
655 LevelProvider levelProvider_;
656
657 // hierarchical numbering of AlbertaGrid, unique per codim
658 HierarchicIndexSet hIndexSet_;
659
660 // the id set of this grid
661 IdSetImp idSet_;
662
663 // the level index set, is generated from the HierarchicIndexSet
664 // is generated, when accessed
665 mutable std::vector< typename GridFamily::LevelIndexSetImp * > levelIndexVec_;
666
667 // the leaf index set, is generated from the HierarchicIndexSet
668 // is generated, when accessed
669 mutable typename GridFamily::LeafIndexSetImp* leafIndexSet_;
670
671 SizeCache< This > sizeCache_;
672
673 typedef AlbertaMarkerVector< dim, dimworld > MarkerVector;
674
675 // needed for VertexIterator, mark on which element a vertex is treated
676 mutable MarkerVector leafMarkerVector_;
677
678 // needed for VertexIterator, mark on which element a vertex is treated
679 mutable std::vector< MarkerVector > levelMarkerVector_;
680
681#if DUNE_ALBERTA_CACHE_COORDINATES
682 Alberta::CoordCache< dimension > coordCache_;
683#endif
684
685 // current state of adaptation
686 AdaptationState adaptationState_;
687 };
688
689} // namespace Dune
690
691#include "albertagrid.cc"
692
693// undef all dangerous defines
694#undef DIM
695#undef DIM_OF_WORLD
696
697#ifdef _ABS_NOT_DEFINED_
698#undef ABS
699#endif
700
701#ifdef _MIN_NOT_DEFINED_
702#undef MIN
703#endif
704
705#ifdef _MAX_NOT_DEFINED_
706#undef MAX
707#endif
708
709#ifdef obstack_chunk_alloc
710#undef obstack_chunk_alloc
711#endif
712#ifdef obstack_chunk_free
713#undef obstack_chunk_free
714#endif
716
717// We use MEM_ALLOC, so undefine it here.
718#undef MEM_ALLOC
719
720// We use MEM_REALLOC, so undefine it here.
721#undef MEM_REALLOC
722
723// We use MEM_CALLOC, so undefine it here.
724#undef MEM_CALLOC
725
726// We use MEM_FREE, so undefine it here.
727#undef MEM_FREE
728
729// Macro ERROR may be defined by alberta_util.h. If so, undefine it.
730#ifdef ERROR
731#undef ERROR
732#endif // #ifdef ERROR
733
734// Macro ERROR_EXIT may be defined by alberta_util.h. If so, undefine it.
735#ifdef ERROR_EXIT
736#undef ERROR_EXIT
737#endif // #ifdef ERROR_EXIT
738
739// Macro WARNING may be defined by alberta_util.h. If so, undefine it.
740#ifdef WARNING
741#undef WARNING
742#endif // #ifdef WARNING
743
744// Macro TEST may be defined by alberta_util.h. If so, undefine it.
745#ifdef TEST
746#undef TEST
747#endif // #ifdef TEST
748
749// Macro TEST_EXIT may be defined by alberta_util.h. If so, undefine it.
750#ifdef TEST_EXIT
751#undef TEST_EXIT
752#endif // #ifdef TEST_EXIT
753
754// Macro DEBUG_TEST may be defined by alberta_util.h. If so, undefine it.
755#ifdef DEBUG_TEST
756#undef DEBUG_TEST
757#endif // #ifdef DEBUG_TEST
758
759// Macro DEBUG_TEST_EXIT may be defined by alberta_util.h. If so, undefine it.
760#ifdef DEBUG_TEST_EXIT
761#undef DEBUG_TEST_EXIT
762#endif // #ifdef DEBUG_TEST_EXIT
763
764// Macro INFO may be defined by alberta_util.h. If so, undefine it.
765#ifdef INFO
766#undef INFO
767#endif // #ifdef INFO
768
769// Macro PRINT_INFO may be defined by alberta_util.h. If so, undefine it.
770#ifdef PRINT_INFO
771#undef PRINT_INFO
772#endif // #ifdef PRINT_INFO
773
774// Macro PRINT_INT_VEC may be defined by alberta_util.h. If so, undefine it.
775#ifdef PRINT_INT_VEC
776#undef PRINT_INT_VEC
777#endif // #ifdef PRINT_INT_VEC
778
779// Macro PRINT_REAL_VEC may be defined by alberta_util.h. If so, undefine it.
780#ifdef PRINT_REAL_VEC
781#undef PRINT_REAL_VEC
782#endif // #ifdef PRINT_REAL_VEC
783
784// Macro WAIT may be defined by alberta_util.h. If so, undefine it.
785#ifdef WAIT
786#undef WAIT
787#endif // #ifdef WAIT
788
789// Macro WAIT_REALLY may be defined by alberta_util.h. If so, undefine it.
790#ifdef WAIT_REALLY
791#undef WAIT_REALLY
792#endif // #ifdef WAIT_REALLY
793
794// Macro GET_WORKSPACE may be defined by alberta_util.h. If so, undefine it.
795#ifdef GET_WORKSPACE
796#undef GET_WORKSPACE
797#endif // #ifdef GET_WORKSPACE
798
799// Macro FREE_WORKSPACE may be defined by alberta_util.h. If so, undefine it.
800#ifdef FREE_WORKSPACE
801#undef FREE_WORKSPACE
802#endif // #ifdef FREE_WORKSPACE
803
804// Macro MAT_ALLOC may be defined by alberta_util.h. If so, undefine it.
805#ifdef MAT_ALLOC
806#undef MAT_ALLOC
807#endif // #ifdef MAT_ALLOC
808
809// Macro MAT_FREE may be defined by alberta_util.h. If so, undefine it.
810#ifdef MAT_FREE
811#undef MAT_FREE
812#endif // #ifdef MAT_FREE
813
814// Macro NAME may be defined by alberta_util.h. If so, undefine it.
815#ifdef NAME
816#undef NAME
817#endif // #ifdef NAME
818
819// Macro GET_STRUCT may be defined by alberta_util.h. If so, undefine it.
820#ifdef GET_STRUCT
821#undef GET_STRUCT
822#endif // #ifdef GET_STRUCT
823
824// Macro ADD_PARAMETER may be defined by alberta_util.h. If so, undefine it.
825#ifdef ADD_PARAMETER
826#undef ADD_PARAMETER
827#endif // #ifdef ADD_PARAMETER
828
829// Macro GET_PARAMETER may be defined by alberta_util.h. If so, undefine it.
830#ifdef GET_PARAMETER
831#undef GET_PARAMETER
832#endif // #ifdef GET_PARAMETER
833
834#define _ALBERTA_H_
835
836#endif // HAVE_ALBERTA || DOXYGEN
837
838#endif
interfaces and wrappers needed for the callback adaptation provided by AlbertaGrid and ALUGrid
provides the GridFamily for AlbertaGrid
Implementation of the IntersectionIterator for AlbertaGrid.
Interface class for the Grid's adapt method where the parameter is a AdaptDataHandleInterface.
Definition: adaptcallback.hh:31
EntityPointer implementation for AlbertaGrid.
Definition: entitypointer.hh:29
Definition: entity.hh:47
Definition: hierarchiciterator.hh:29
hierarchic index set of AlbertaGrid
Definition: indexsets.hh:537
[ provides Dune::Grid ]
Definition: agrid.hh:140
Traits::template Partition< All_Partition >::LevelGridView levelGridView(int level) const
View for a grid level for All_Partition.
Definition: agrid.hh:409
const CollectiveCommunication & comm() const
return reference to collective communication, if MPI found this is specialisation for MPI
Definition: agrid.hh:458
Traits::template Codim< codim >::template Partition< pitype >::LeafIterator leafbegin() const
return LeafIterator which points to first leaf entity
Traits::template Codim< cd >::template Partition< pitype >::LevelIterator lend(int level) const
one past the end on this level
Traits::template Partition< All_Partition >::LeafGridView leafGridView() const
View for the leaf grid for All_Partition.
Definition: agrid.hh:417
int maxLevel() const
Definition: albertagrid.cc:481
AlbertaGrid()
create an empty grid
Definition: albertagrid.cc:40
Traits::template Codim< codim >::LevelIterator lbegin(int level) const
Iterator to first entity of given codim on level.
Traits::template Codim< codim >::LevelIterator lend(int level) const
one past the end on this level
bool adapt()
Refine all positive marked leaf entities, coarsen all negative marked entities if possible.
Definition: albertagrid.cc:413
bool readGridXdr(const std::string &filename, ctype &time)
reads ALBERTA mesh file
Definition: albertagrid.cc:629
void postAdapt()
clean up some markers
Definition: albertagrid.cc:354
Traits::template Codim< codim >::LeafIterator leafbegin() const
return LeafIterator which points to first leaf entity
const LocalIdSet & localIdSet() const
return local IdSet
Definition: agrid.hh:523
AlbertaGridFamily< dim, dimworld > GridFamily
the grid family of AlbertaGrid
Definition: agrid.hh:173
Traits::template Partition< pitype >::LeafGridView leafGridView() const
View for the leaf grid.
Definition: agrid.hh:400
Traits::template Codim< codim >::LeafIterator leafend() const
return LeafIterator which points behind last leaf entity
const Traits::LevelIndexSet & levelIndexSet(int level) const
return level index set for given level
Definition: albertagrid.cc:518
size_t numBoundarySegments() const
number of boundary segments within the macro grid
Definition: agrid.hh:383
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
Traits::HierarchicIndexSet HierarchicIndexSet
type of hierarchic index set
Definition: agrid.hh:189
const Traits::LeafIndexSet & leafIndexSet() const
return leaf index set
Definition: albertagrid.cc:533
Traits::template Codim< codim >::template Partition< pitype >::LeafIterator leafend() const
return LeafIterator which points behind last leaf entity
DUNE_DEPRECATED_MSG("entityPointer() is deprecated and will be removed after the release of dune-grid 2.4. Use entity() instead to directly obtain an Entity object.") typename Traits bool readGrid(const std::string &filename, ctype &time)
obtain EntityPointer from EntitySeed.
Traits::template Partition< pitype >::LevelGridView levelGridView(int level) const
View for a grid level.
Definition: agrid.hh:391
Traits::template Codim< cd >::template Partition< pitype >::LevelIterator lbegin(int level) const
Iterator to first entity of given codim on level.
const GlobalIdSet & globalIdSet() const
return global IdSet
Definition: agrid.hh:517
void globalRefine(int refCount)
uses the interface, mark on entity and refineLocal
Definition: albertagrid.cc:302
int getMark(const typename Traits::template Codim< 0 >::Entity &e) const
returns adaptation mark for given entity
Definition: albertagrid.cc:406
~AlbertaGrid()
desctructor
Definition: albertagrid.cc:194
bool preAdapt()
returns true, if a least one element is marked for coarsening
Definition: albertagrid.cc:346
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
Traits::CollectiveCommunication CollectiveCommunication
type of collective communication
Definition: agrid.hh:197
marker assigning subentities to one element containing them
Definition: treeiterator.hh:30
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:25
Definition: grid.hh:1030
static std::conditional< std::is_reference< InterfaceType >::value, typenamestd::add_lvalue_reference< typenameReturnImplementationType< typenamestd::remove_reference< InterfaceType >::type >::ImplementationType >::type, typenamestd::remove_const< typenameReturnImplementationType< typenamestd::remove_reference< InterfaceType >::type >::ImplementationType >::type >::type getRealImplementation(InterfaceType &&i)
return real implementation of interface class
Definition: grid.hh:1305
bool mark(int refCount, const typename Traits ::template Codim< 0 >::Entity &e)
Marks an entity to be refined/coarsened in a subsequent adapt.
Definition: grid.hh:1163
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: grid.hh:1175
Traits::template Codim< codim >::LevelIterator DUNE_DEPRECATED_MSG("The method lbegin( level ) is superseded by levelGridView( level ).begin.") lbegin(int level) const
Iterator to first entity of given codim on level for PartitionType All_Partition.
Definition: grid.hh:1043
Provide a generic factory class for unstructured grids.
Definition: gridfactory.hh:263
Id Set Interface.
Definition: indexidset.hh:414
Index Set Interface base class.
Definition: indexidset.hh:76
Default exception if a function was called while the object is not in a valid state for that function...
Definition: exceptions.hh:306
Implements an utility class that provides collective communication methods for sequential programs.
Wrapper and interface class for a static iterator (EntityPointer)
Different resources needed by all grid implementations.
Provide a generic factory class for unstructured grids.
Implements a matrix constructed from a given type representing a field and compile-time given number ...
Implements a vector constructed from a given type representing a field and a compile-time given size.
#define DUNE_THROW(E, m)
Definition: exceptions.hh:243
Dune namespace.
Definition: alignment.hh:10
Provides size cache classes to implement the grids size method efficiently.
Standard Dune debug streams.
Static tag representing a codimension.
Definition: dimension.hh:22
Interface class for vertex projection at the boundary.
Definition: boundaryprojection.hh:24
Contains #undefs for all preprocessor macros defined by alberta.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 22, 23:30, 2024)