Dune Core Modules (2.9.0)

gridfactory.hh
1 #ifndef DUNE_ALU3DGRID_FACTORY_HH
2 #define DUNE_ALU3DGRID_FACTORY_HH
3 
4 #include <algorithm>
5 #include <array>
6 #include <map>
7 #include <memory>
8 #include <vector>
9 
11 
12 #include <dune/geometry/referenceelements.hh>
13 
15 #include <dune/grid/common/boundaryprojection.hh>
16 
17 #include <dune/alugrid/common/transformation.hh>
19 
20 #include <dune/alugrid/common/hsfc.hh>
21 
22 namespace Dune
23 {
25  template< class ALUGrid >
27  : public GridFactoryInterface< ALUGrid >
28  {
31 
32  public:
33  typedef ALUGrid Grid;
34 
35  typedef typename Grid::ctype ctype;
36 
37  static const ALU3dGridElementType elementType = Grid::elementType;
38 
39  static const unsigned int dimension = Grid::dimension;
40  static const unsigned int dimensionworld = Grid::dimensionworld;
41 
42  typedef typename Grid::MPICommunicatorType MPICommunicatorType;
43 
44  template< int codim >
45  struct Codim
46  {
47  typedef typename Grid::template Codim< codim >::Entity Entity;
48  };
49 
50  typedef unsigned int VertexId;
51  typedef unsigned int GlobalIdType;
52 
53  typedef ALUGridTransformation< ctype, dimensionworld > Transformation;
54 
59 
60  typedef typename Grid::Communication Communication;
61 
62  // typedef grid pointer type based on what the grid factory interface defines
63  typedef decltype(std::declval< Dune::GridFactoryInterface< Grid >* >()->createGrid()) GridPtrType;
64 
65  private:
66  static_assert ( (elementType == tetra || elementType == hexa),
67  "ALU3dGridFactory supports only grids containing "
68  "tetrahedrons or hexahedrons exclusively." );
69 
71  typedef DuneBoundaryProjection< dimensionworld > DuneBoundaryProjectionType;
72 
73  typedef Dune::BoundarySegmentWrapper< dimension, dimensionworld > BoundarySegmentWrapperType;
75 
76  static const unsigned int numCorners = EntityCount< elementType >::numVertices;
77  static const unsigned int numFaces = EntityCount< elementType >::numFaces;
78  static const unsigned int numFaceCorners = EntityCount< elementType >::numVerticesPerFace;
79 
81  typedef FaceTopologyMapping< elementType > FaceTopologyMappingType;
82 
83  // type of vertex coordinates put into the factory
84  typedef FieldVector< ctype, dimensionworld > VertexInputType;
85  typedef SpaceFillingCurveOrdering< VertexInputType > SpaceFillingCurveOrderingType;
86 
87  // type of vertex coordinates stored inside the factory
88  typedef FieldVector< ctype, 3 > VertexType;
89 
90  typedef std::vector< unsigned int > ElementType;
91  typedef std::array< unsigned int, numFaceCorners > FaceType;
92 
93  struct FaceLess;
94 
95  typedef std::vector< std::pair< VertexType, GlobalIdType > > VertexVector;
96  typedef std::vector< ElementType > ElementVector;
97  typedef std::pair< FaceType, int > BndPair ;
98  typedef std::map < FaceType, int > BoundaryIdMap;
99  typedef std::vector< std::pair< BndPair, BndPair > > PeriodicBoundaryVector;
100  typedef std::pair< unsigned int, int > SubEntity;
101  typedef std::map< FaceType, SubEntity, FaceLess > FaceMap;
102 
103  typedef std::map< FaceType, const DuneBoundaryProjectionType* > BoundaryProjectionMap;
104  typedef std::vector< const DuneBoundaryProjectionType* > BoundaryProjectionVector;
105 
106  typedef std::vector< Transformation > FaceTransformationVector;
107 
108  static void copy ( const std::initializer_list< unsigned int > &vertices, FaceType &faceId )
109  {
110  std::copy_n( vertices.begin(), faceId.size(), faceId.begin() );
111  }
112 
113  static FaceType makeFace ( const std::vector< unsigned int > &vertices )
114  {
115  if( vertices.size() != (dimension == 2 ? 2 : numFaceCorners) )
116  DUNE_THROW( GridError, "Wrong number of face vertices passed: " << vertices.size() << "." );
117 
118  FaceType faceId;
119  if( dimension == 2 )
120  {
121  if( elementType == tetra )
122  copy( { 0, vertices[ 1 ]+1, vertices[ 0 ]+1 }, faceId );
123  else if( elementType == hexa )
124  copy( { 2*vertices[ 0 ], 2*vertices[ 1 ], 2*vertices[ 0 ]+1, 2*vertices[ 1 ]+1 }, faceId );
125  }
126  else if( dimension == 3 )
127  std::copy_n( vertices.begin(), numFaceCorners, faceId.begin() );
128  return faceId;
129  }
130 
131  static BndPair makeBndPair ( const FaceType &face, const int id )
132  {
133  BndPair bndPair;
134  for( unsigned int i = 0; i < numFaceCorners; ++i )
135  {
136  const unsigned int j = FaceTopologyMappingType::dune2aluVertex( i );
137  bndPair.first[ j ] = face[ i ];
138  }
139  bndPair.second = id;
140  return bndPair;
141  }
142 
143  void markLongestEdge( std::vector< bool >& elementOrientation, const bool resortElements = true ) ;
144  void markLongestEdge();
145 
146  private:
147  // return grid object
148  virtual Grid* createGridObj( const std::string& name ) const
149  {
150  ALU3DSPACE ProjectVertexPtrPair pv = std::make_pair( globalProjection_, surfaceProjection_ );
151  return new Grid( communicator_, pv, name, realGrid_ );
152  }
153 
154  protected:
156  explicit ALU3dGridFactory ( const bool verbose, const MPICommunicatorType &communicator );
157 
158  public:
160  explicit ALU3dGridFactory ( const MPICommunicatorType &communicator = Grid::defaultCommunicator(),
161  bool removeGeneratedFile = true );
162 
164  explicit ALU3dGridFactory ( const std::string &filename,
165  const MPICommunicatorType &communicator = Grid::defaultCommunicator() );
166 
168  virtual ~ALU3dGridFactory ();
169 
174  virtual void insertVertex ( const VertexInputType &pos );
175 
181  void insertVertex ( const VertexInputType &pos, const VertexId globalId );
182 
191  virtual void
192  insertElement ( const GeometryType &geometry,
193  const std::vector< VertexId > &vertices );
194 
206  virtual void
207  insertBoundary ( const GeometryType &geometry, const std::vector< VertexId > &faceVertices, int boundaryId = 1 );
208 
209 
217  virtual void insertBoundary ( int element, int face, int boundaryId = 1 );
218 
219  // for testing parallel GridFactory
220  void insertProcessBorder ( int element, int face )
221  {
222  insertBoundary( element, face, ALU3DSPACE ProcessorBoundary_t );
223  }
224 
233  virtual void
235  const std::vector< VertexId > &vertices,
236  const DuneBoundaryProjectionType *projection );
237 
242  virtual void
243  insertBoundarySegment ( const std::vector< VertexId >& vertices ) ;
244 
245  virtual void
246  insertProcessBorder ( const std::vector< VertexId >& vertices );
247 
253  virtual void
254  insertBoundarySegment ( const std::vector< VertexId >& vertices,
255  const std::shared_ptr<BoundarySegment<dimension,dimensionworld> >& boundarySegment ) ;
256 
261  virtual void insertBoundaryProjection ( const DuneBoundaryProjectionType& bndProjection, const bool isSurfaceProjection = (dimension != dimensionworld) );
262 
272  void insertFaceTransformation ( const WorldMatrix &matrix, const WorldVector &shift );
273 
278  GridPtrType createGrid ();
279 
280  GridPtrType createGrid ( const bool addMissingBoundaries, const std::string dgfName = "" );
281 
282  GridPtrType createGrid ( const bool addMissingBoundaries, bool temporary, const std::string dgfName = "" );
283 
284  virtual unsigned int
285  insertionIndex ( const typename Codim< 0 >::Entity &entity ) const
286  {
287  alugrid_assert( entity.impl().getIndex() < int(ordering_.size()) );
288  return ordering_[ entity.impl().getIndex() ];
289  }
290 
291  virtual unsigned int
292  insertionIndex ( const typename Codim< dimension >::Entity &entity ) const
293  {
294  if(dimension == 2 && elementType == hexa )
295  // for quadrilaterals we simply half the number, see gridfactory.cc doInsertVertex
296  return entity.impl().getIndex()/2;
297  else if ( dimension == 2 && elementType == tetra )
298  // for triangles we have to substract 1, see gridfactory.cc doInsertVertex
299  return entity.impl().getIndex() - 1;
300  else // dimension 3
301  return entity.impl().getIndex();
302  }
303 
304  virtual unsigned int insertionIndex ( const typename Grid::LevelIntersection &intersection ) const
305  {
306  return boundaryInsertionIndex( intersection.inside(), intersection.indexInInside() );
307  }
308 
309  virtual unsigned int insertionIndex ( const typename Grid::LeafIntersection &intersection ) const
310  {
311  return boundaryInsertionIndex( intersection.inside(), intersection.indexInInside() );
312  }
313 
314  virtual bool wasInserted ( const typename Grid::LevelIntersection &intersection ) const
315  {
316  return intersection.boundary() && (insertionIndex(intersection) < std::numeric_limits<unsigned int>::max());
317  }
318 
319  virtual bool wasInserted ( const typename Grid::LeafIntersection &intersection ) const
320  {
321  return intersection.boundary() && (insertionIndex(intersection) < std::numeric_limits<unsigned int>::max());
322  }
323 
324  const std::vector<unsigned int>& ordering () const { return ordering_; }
325 
326 
328  void setLongestEdgeFlag (bool flag = true) { markLongestEdge_ = flag ; }
329 
334  Communication comm() const
335  {
336  return Communication(communicator_);
337  }
338 
339  private:
340  unsigned int boundaryInsertionIndex ( const typename Codim< 0 >::Entity &entity, int face ) const
341  {
342  const auto& refElem = Dune::ReferenceElements< double, dimension >::general( entity.type() );
343  const int vxSize = refElem.size( face, 1, dimension );
344  std::vector< unsigned int > vertices( vxSize );
345  for( int i = 0; i < vxSize; ++i )
346  vertices[ i ] = insertionIndex( entity.template subEntity< dimension >( refElem.subEntity( face, 1, i, dimension ) ) );
347 
348  FaceType faceId = makeFace( vertices );
349  std::sort( faceId.begin(), faceId.end() );
350 
351  const auto pos = insertionOrder_.find( faceId );
352  return (pos != insertionOrder_.end() ? pos->second : std::numeric_limits< unsigned int >::max());
353  }
354 
355  void doInsertVertex ( const VertexInputType &pos, const GlobalIdType globalId );
356  void doInsertBoundary ( int element, int face, int boundaryId );
357 
358  GlobalIdType globalId ( const VertexId &id ) const
359  {
360  alugrid_assert ( id < vertices_.size() );
361  return vertices_[ id ].second;
362  }
363 
364  const VertexType &position ( const VertexId &id ) const
365  {
366  alugrid_assert ( id < vertices_.size() );
367  return vertices_[ id ].first;
368  }
369 
370  const VertexInputType inputPosition ( const VertexId &id ) const
371  {
372  alugrid_assert ( id < vertices_.size() );
373  VertexType vertex = vertices_[ id ].first;
374  VertexInputType iVtx(0.);
375  for(unsigned i = 0 ; i < dimensionworld ; ++i)
376  iVtx[i] = vertex[i];
377  return iVtx;
378  }
379 
380  void assertGeometryType( const GeometryType &geometry );
381  static void generateFace ( const ElementType &element, const int f, FaceType &face );
382  void generateFace ( const SubEntity &subEntity, FaceType &face ) const;
383  void correctElementOrientation ();
384  bool identifyFaces ( const Transformation &transformation, const FaceType &key1, const FaceType &key2, const int defaultId );
385  void searchPeriodicNeighbor ( FaceMap &faceMap, typename FaceMap::iterator &pos, const int defaultId );
386  void reinsertBoundary ( const FaceMap &faceMap, const typename FaceMap::const_iterator &pos, const int id );
387  void recreateBoundaryIds ( const int defaultId = 1 );
388 
389  // sort elements according to hilbert space filling curve (if Zoltan is available)
390  void sortElements( const VertexVector& vertices, const ElementVector& elements, std::vector< unsigned int >& ordering );
391 
392  int rank_;
393 
394  VertexVector vertices_;
395  ElementVector elements_;
396  BoundaryIdMap boundaryIds_,insertionOrder_;
397  PeriodicBoundaryVector periodicBoundaries_;
398  ALU3DSPACE ProjectVertexPtr globalProjection_ ;
399  ALU3DSPACE ProjectVertexPtr surfaceProjection_ ;
400  BoundaryProjectionMap boundaryProjections_;
401  FaceTransformationVector faceTransformations_;
402  unsigned int numFacesInserted_;
403  bool realGrid_;
404  const bool allowGridGeneration_;
405  bool foundGlobalIndex_ ;
406 
407  MPICommunicatorType communicator_;
408 
409  typename SpaceFillingCurveOrderingType :: CurveType curveType_;
410  std::vector< unsigned int > ordering_;
411 
412  bool markLongestEdge_;
413  };
414 
415 
416 
417  template< class ALUGrid >
418  struct ALU3dGridFactory< ALUGrid >::FaceLess
419  {
420  bool operator() ( const FaceType &a, const FaceType &b ) const
421  {
422  for( unsigned int i = 0; i < numFaceCorners; ++i )
423  {
424  if( a[ i ] != b[ i ] )
425  return (a[ i ] < b[ i ]);
426  }
427  return false;
428  }
429  };
430 
431 
432  template< class ALUGrid >
433  inline void ALU3dGridFactory< ALUGrid >
434  ::assertGeometryType( const GeometryType &geometry )
435  {
436  if( elementType == tetra )
437  {
438  if( !geometry.isSimplex() )
439  DUNE_THROW( GridError, "Only simplex geometries can be inserted into "
440  "ALUGrid< 3, 3, simplex, refrule >." << geometry );
441  }
442  else
443  {
444  if( !geometry.isCube() )
445  DUNE_THROW( GridError, "Only cube geometries can be inserted into "
446  "ALUGrid< 3, 3, cube, refrule >." );
447  }
448  }
449 
453  template<int dim, int dimw, ALUGridElementType eltype, ALUGridRefinementType refinementtype , class Comm >
454  class GridFactory< ALUGrid< dim, dimw, eltype, refinementtype, Comm > >
455  : public ALU3dGridFactory< ALUGrid< dim, dimw, eltype, refinementtype, Comm > >
456  {
459 
460  public:
461  typedef typename BaseType::Grid Grid;
462 
463  typedef typename BaseType::MPICommunicatorType MPICommunicatorType;
464 
466  explicit GridFactory ( const MPICommunicatorType &communicator = Grid::defaultCommunicator() )
467  : BaseType( communicator )
468  {}
469 
471  template <class MPIComm>
472  explicit GridFactory ( const MPIComm & )
473  : BaseType( Grid::defaultCommunicator() )
474  {}
475 
477  explicit GridFactory ( const std::string &filename,
478  const MPICommunicatorType &communicator = Grid::defaultCommunicator() )
479  : BaseType( filename, communicator )
480  {}
481 
483  template <class MPIComm>
484  explicit GridFactory ( const std::string &filename,
485  const MPIComm & )
486  : BaseType( filename, Grid::defaultCommunicator() )
487  {}
488  };
489 
490  template< class Grid >
491  class ReferenceGridFactory;
492 
493  // Specialization of the ReferenceGridFactory for ALUGrid
494  template<int dim, int dimw, ALUGridElementType eltype, ALUGridRefinementType refinementtype , class Comm >
495  class ReferenceGridFactory< ALUGrid< dim, dimw, eltype, refinementtype, Comm > >
496  : public ALU3dGridFactory< ALUGrid< dim, dimw, eltype, refinementtype, Comm > >
497  {
498  typedef ReferenceGridFactory< ALUGrid< dim, dimw, eltype, refinementtype, Comm > > ThisType;
499  typedef ALU3dGridFactory< ALUGrid< dim, dimw, eltype, refinementtype, Comm > > BaseType;
500 
501  public:
502  typedef typename BaseType::Grid Grid;
503 
504  typedef typename BaseType::MPICommunicatorType MPICommunicatorType;
505 
507  ReferenceGridFactory()
508  : BaseType(false, Grid::defaultCommunicator() )
509  {}
510  };
511 
512 
513 
514  // Implementation of ALU3dGridFactory
515  // ----------------------------------
516 
517  template< class ALUGrid >
518  inline
520  :: ALU3dGridFactory ( const MPICommunicatorType &communicator,
521  bool removeGeneratedFile )
522  : rank_( ALU3dGridCommunications< ALUGrid::dimension, ALUGrid::dimensionworld, elementType, MPICommunicatorType >::getRank( communicator ) ),
523  globalProjection_ ( 0 ),
524  surfaceProjection_ ( 0 ),
525  numFacesInserted_ ( 0 ),
526  realGrid_( true ),
527  allowGridGeneration_( rank_ == 0 ),
528  foundGlobalIndex_( false ),
529  communicator_( communicator ),
530  curveType_( SpaceFillingCurveOrderingType :: DefaultCurve ),
531  markLongestEdge_( ALUGrid::dimension == 2 )
532  {
533  BoundarySegmentWrapperType::registerFactory();
534  ALUProjectionType::registerFactory();
535  }
536 
537  template< class ALUGrid >
538  inline
540  :: ALU3dGridFactory ( const std::string &filename,
541  const MPICommunicatorType &communicator )
542  : rank_( ALU3dGridCommunications< ALUGrid::dimension, ALUGrid::dimensionworld, elementType, MPICommunicatorType >::getRank( communicator ) ),
543  globalProjection_ ( 0 ),
544  surfaceProjection_ ( 0 ),
545  numFacesInserted_ ( 0 ),
546  realGrid_( true ),
547  allowGridGeneration_( rank_ == 0 ),
548  foundGlobalIndex_( false ),
549  communicator_( communicator ),
550  curveType_( SpaceFillingCurveOrderingType :: DefaultCurve ),
551  markLongestEdge_( ALUGrid::dimension == 2 )
552  {
553  BoundarySegmentWrapperType::registerFactory();
554  ALUProjectionType::registerFactory();
555  }
556 
557  template< class ALUGrid >
558  inline
560  :: ALU3dGridFactory ( const bool realGrid,
561  const MPICommunicatorType &communicator )
562  : rank_( ALU3dGridCommunications< ALUGrid::dimension, ALUGrid::dimensionworld, elementType, MPICommunicatorType >::getRank( communicator ) ),
563  globalProjection_ ( 0 ),
564  surfaceProjection_ ( 0 ),
565  numFacesInserted_ ( 0 ),
566  realGrid_( realGrid ),
567  allowGridGeneration_( true ),
568  foundGlobalIndex_( false ),
569  communicator_( communicator ),
570  curveType_( SpaceFillingCurveOrderingType :: DefaultCurve ),
571  markLongestEdge_( ALUGrid::dimension == 2 )
572  {
573  BoundarySegmentWrapperType::registerFactory();
574  ALUProjectionType::registerFactory();
575  }
576 
577  template< class ALUGrid >
579  insertBoundarySegment ( const std::vector< unsigned int >& vertices )
580  {
581  FaceType faceId = makeFace( vertices );
582 
583  boundaryIds_.insert( makeBndPair( faceId, 1 ) );
584 
585  std::sort( faceId.begin(), faceId.end() );
586  if( boundaryProjections_.find( faceId ) != boundaryProjections_.end() )
587  DUNE_THROW( GridError, "Only one boundary projection can be attached to a face." );
588 
589  boundaryProjections_[ faceId ] = nullptr;
590 
591  insertionOrder_.insert( std::make_pair( faceId, insertionOrder_.size() ) );
592  }
593 
594  template< class ALUGrid >
596  insertProcessBorder ( const std::vector< unsigned int >& vertices )
597  {
598  FaceType faceId = makeFace( vertices );
599 
600  boundaryIds_.insert( makeBndPair( faceId, ALU3DSPACE ProcessorBoundary_t ) );
601 
602  std::sort( faceId.begin(), faceId.end() );
603  boundaryProjections_[ faceId ] = nullptr;
604  }
605 
606  template< class ALUGrid >
608  insertBoundarySegment ( const std::vector< unsigned int >& vertices,
609  const std::shared_ptr<BoundarySegment<dimension,dimensionworld> >& boundarySegment )
610  {
611  const std::size_t numVx = vertices.size();
612 
613  GeometryType type = (elementType == tetra) ?
614  GeometryTypes::simplex(dimension-1) :
615  GeometryTypes::cube(dimension-1);
616 
617  // we need double here because of the structure of BoundarySegment
618  // and BoundarySegmentWrapper which have double as coordinate type
619  typedef FieldVector< double, dimensionworld > CoordType;
620  std::vector< CoordType > coords( numVx );
621  for( std::size_t i = 0; i < numVx; ++i )
622  {
623  // adapt vertex index for 2d grids
624  const std::size_t vtx = (dimension == 2 ? (elementType == tetra ? vertices[ i ] + 1 : 2 * vertices[ i ]) : vertices[ i ]);
625 
626  // if this assertions is thrown vertices were not inserted at first
627  alugrid_assert ( vertices_.size() > vtx );
628 
629  // get global coordinate and copy it
630  std::copy_n( position( vtx ).begin(), dimensionworld, coords[ i ].begin() );
631  }
632 
633  std::unique_ptr< BoundarySegmentWrapperType > prj( new BoundarySegmentWrapperType( type, coords, boundarySegment ) );
634 
635  // consistency check
636  for( std::size_t i = 0; i < numVx; ++i )
637  {
638  CoordType global = (*prj)( coords [ i ] );
639  if( (global - coords[ i ]).two_norm() > 1e-6 )
640  DUNE_THROW( GridError, "BoundarySegment does not map face vertices to face vertices." );
641  }
642 
643  FaceType faceId = makeFace( vertices );
644 
645  boundaryIds_.insert( makeBndPair( faceId, 1 ) );
646 
647  std::sort( faceId.begin(), faceId.end() );
648  if( boundaryProjections_.find( faceId ) != boundaryProjections_.end() )
649  DUNE_THROW( GridError, "Only one boundary projection can be attached to a face." );
650 
651  boundaryProjections_[ faceId ] = prj.release();
652 
653  insertionOrder_.insert( std::make_pair( faceId, insertionOrder_.size() ) );
654  }
655 
656 
657  template< class ALUGrid >
658  inline void ALU3dGridFactory< ALUGrid >
659  ::generateFace ( const SubEntity &subEntity, FaceType &face ) const
660  {
661  generateFace( elements_[ subEntity.first ], subEntity.second, face );
662  }
663 
664 } // end namespace Dune
665 
666 #if COMPILE_ALUGRID_INLINE
667  #include "gridfactory.cc"
668 #endif
669 #endif
Provides base classes for ALUGrid.
Factory class for ALUGrids.
Definition: gridfactory.hh:28
Communication comm() const
Return the Communication used by the grid factory.
Definition: gridfactory.hh:334
GridPtrType createGrid()
finalize the grid creation and hand over the grid
Definition: gridfactory.cc:476
virtual void insertVertex(const VertexInputType &pos)
insert a vertex into the coarse grid
Definition: gridfactory.cc:34
void insertFaceTransformation(const WorldMatrix &matrix, const WorldVector &shift)
add a face transformation (for periodic identification)
Definition: gridfactory.cc:242
ALU3dGridFactory(const MPICommunicatorType &communicator=Grid::defaultCommunicator(), bool removeGeneratedFile=true)
default constructor
Definition: gridfactory.hh:520
Transformation::WorldMatrix WorldMatrix
type of matrix from world coordinates to world coordinates
Definition: gridfactory.hh:58
virtual void insertBoundarySegment(const std::vector< VertexId > &vertices)
insert a boundary segment into the macro grid
Definition: gridfactory.hh:579
virtual void insertBoundary(const GeometryType &geometry, const std::vector< VertexId > &faceVertices, int boundaryId=1)
insert a boundary element into the coarse grid
Definition: gridfactory.cc:148
Transformation::WorldVector WorldVector
type of vector for world coordinates
Definition: gridfactory.hh:56
ALU3dGridFactory(const std::string &filename, const MPICommunicatorType &communicator=Grid::defaultCommunicator())
constructor taking filename for temporary outfile
Definition: gridfactory.hh:540
virtual void insertElement(const GeometryType &geometry, const std::vector< VertexId > &vertices)
insert an element into the coarse grid
Definition: gridfactory.cc:98
virtual void insertBoundaryProjection(const GeometryType &type, const std::vector< VertexId > &vertices, const DuneBoundaryProjectionType *projection)
insert a boundary projection into the macro grid
Definition: gridfactory.cc:221
virtual ~ALU3dGridFactory()
Destructor.
Definition: gridfactory.cc:28
void setLongestEdgeFlag(bool flag=true)
set longest edge marking for biscetion grids (default is off)
Definition: gridfactory.hh:328
ALU3dGridFactory(const bool verbose, const MPICommunicatorType &communicator)
constructor taking verbose flag
Definition: gridfactory.hh:560
virtual void insertBoundarySegment(const std::vector< VertexId > &vertices, const std::shared_ptr< BoundarySegment< dimension, dimensionworld > > &boundarySegment)
insert a shaped boundary segment into the macro grid
Definition: gridfactory.hh:608
ALUGrid boundary projection implementation DuneBndProjection has to fulfil the DuneBoundaryProjection...
Definition: bndprojection.hh:14
unstructured parallel implementation of the DUNE grid interface
Definition: alugrid.hh:32
Definition: boundaryprojection.hh:133
Definition: topology.hh:40
Wrapper class for entities.
Definition: entity.hh:66
Definition: topology.hh:151
static int dune2aluVertex(int index)
Maps vertex index from Dune onto ALU3dGrid reference face.
Definition: topology.cc:497
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:125
Base class for exceptions in Dune grid modules.
Definition: exceptions.hh:20
Provide a generic factory class for unstructured grids.
Definition: gridfactory.hh:73
Specialization of the generic GridFactory for ALUGrid.
Definition: gridfactory.hh:456
GridFactory(const MPICommunicatorType &communicator=Grid::defaultCommunicator())
Default constructor.
Definition: gridfactory.hh:466
GridFactory(const std::string &filename, const MPIComm &)
constructor taking filename and ignoring MPIComm
Definition: gridfactory.hh:484
GridFactory(const MPIComm &)
Default constructor ignoring MPIComm.
Definition: gridfactory.hh:472
GridFactory(const std::string &filename, const MPICommunicatorType &communicator=Grid::defaultCommunicator())
constructor taking filename
Definition: gridfactory.hh:477
Provide a generic factory class for unstructured grids.
Definition: gridfactory.hh:314
GridFamily::Traits::LeafIntersection LeafIntersection
A type that is a model of Dune::Intersection, an intersections of two codimension 1 of two codimensio...
Definition: grid.hh:456
detected_or_fallback_t< DeprecatedCollectiveCommunication_t, Communication_t, typename GridFamily::Traits > Communication
A type that is a model of Dune::Communication. It provides a portable way for communication on the se...
Definition: grid.hh:525
GridFamily::Traits::LevelIntersection LevelIntersection
A type that is a model of Dune::Intersection, an intersections of two codimension 1 of two codimensio...
Definition: grid.hh:461
Provide a generic factory class for unstructured grids.
#define DUNE_THROW(E, m)
Definition: exceptions.hh:218
constexpr GeometryType cube(unsigned int dim)
Returns a GeometryType representing a hypercube of dimension dim.
Definition: type.hh:472
constexpr GeometryType simplex(unsigned int dim)
Returns a GeometryType representing a simplex of dimension dim.
Definition: type.hh:463
constexpr GeometryType vertex
GeometryType representing a vertex.
Definition: type.hh:506
auto max(ADLTag< 0 >, const V &v1, const V &v2)
implements binary Simd::max()
Definition: defaults.hh:81
Helpers for dealing with MPI.
Dune namespace.
Definition: alignedallocator.hh:13
Base class for classes implementing geometries of boundary segments.
Definition: boundarysegment.hh:94
Static tag representing a codimension.
Definition: dimension.hh:24
Interface class for vertex projection at the boundary.
Definition: boundaryprojection.hh:33
static const ReferenceElement & general(const GeometryType &type)
get general reference elements
Definition: referenceelements.hh:198
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (May 4, 22:30, 2024)