Dune Core Modules (2.3.1)

constructor for creating ALUSimplexGrid from given macro grid file More...

#include <dune/grid/alugrid/3d/alugrid.hh>

Public Types

typedef BaseType::DuneBoundaryProjectionType DuneBoundaryProjectionType
 type of boundary projection
 
typedef BaseType::DuneBoundaryProjectionVector DuneBoundaryProjectionVector
 type of boundary projection
 
typedef ALU3dGridHierarchicIndexSet< elType, Comm > HierarchicIndexSet
 Type of the hierarchic index set.
 
typedef ReferenceElement< alu3d_ctype, dimension > ReferenceElementType
 reference element type
 
typedef ALU3DSPACE ProjectVertex ALUGridVertexProjectionType
 type of ALUGrid Vertex Projection Interface
 
typedef Traits::CollectiveCommunication CollectiveCommunication
 type of collective communication object
 
Exported constants
enum  
 A constant that exports the template parameter dim.
 
enum  
 A constant that exports the template parameter dimworld.
 
Exported types
typedef GridFamily::Traits::LeafIntersection LeafIntersection
 A type that is a model of Dune::Intersection, an intersections of two codimension 1 of two codimension 0 entities in the leaf view.
 
typedef GridFamily::Traits::LevelIntersection LevelIntersection
 A type that is a model of Dune::Intersection, an intersections of two codimension 1 of two codimension 0 entities in a level view.
 
typedef GridFamily::Traits::LeafIntersectionIterator LeafIntersectionIterator
 A type that is a model of Dune::IntersectionIterator which is an iterator that allows to examine, but not to modify, the intersections of codimension 1 of an leaf element (entity of codimension 0) with other leaf elements.
 
typedef GridFamily::Traits::LevelIntersectionIterator LevelIntersectionIterator
 A type that is a model of Dune::IntersectionIterator which is an iterator that allows to examine, but not to modify, the intersections of codimension 1 of an element (entity of codimension 0) with other elements on the same level.
 
typedef GridFamily::Traits::HierarchicIterator HierarchicIterator
 A type that is a model of Dune::HierarchicIterator A type of iterator that allows to examine, but not to modify, entities of codimension 0 that result from refinement of an entity of codimension 0.
 
typedef GridFamily::Traits::LevelIndexSet LevelIndexSet
 A type that is a model of Dune::IndexSet which provides a consecutive, but non persistent, numbering for entities on a grid level.
 
typedef GridFamily::Traits::LeafIndexSet LeafIndexSet
 A type that is a model of Dune::IndexSet which provides a consecutive, but non persistent, numbering for entities in the leaf grid.
 

Public Member Functions

DUNE_DEPRECATED ALUSimplexGrid (const std::string macroName, const MPICommunicatorType mpiComm=BaseType::defaultCommunicator(), const DuneBoundaryProjectionType *bndProject=0, const DuneBoundaryProjectionVector *bndVector=0, const bool verb=true)
 constructor for creating ALUSimplexGrid from given macro grid file More...
 
DUNE_DEPRECATED ALUSimplexGrid (const MPICommunicatorType mpiComm, const DuneBoundaryProjectionType *bndProject, const DuneBoundaryProjectionVector *bndVector, const std::string macroName, const bool verb=true)
 constructor called from ALUGridFactory for creating ALUSimplexGrid from given macro grid file More...
 
DUNE_DEPRECATED ALUSimplexGrid (const MPICommunicatorType mpiComm=BaseType::defaultCommunicator())
 
int maxLevel () const
 Return maximum level defined in this grid. Levels are numbered maxLevel with 0 the coarsest level.
 
Traits::template Codim< cd >::template Partition< pitype >::LevelIterator lbegin (int level) const
 Iterator to first entity of given codim on level.
 
Traits::template Codim< cd >::template Partition< All_Partition >::LevelIterator lbegin (int level) const
 Iterator to first entity of given codim on level.
 
Traits::template Codim< cd >::template Partition< pitype >::LevelIterator lend (int level) const
 one past the end on this level
 
Traits::template Codim< cd >::template Partition< All_Partition >::LevelIterator lend (int level) const
 one past the end on this level
 
Traits::template Codim< codim >::template Partition< pitype >::LeafIterator leafbegin () const
 General definiton for a leaf iterator.
 
Traits::template Codim< codim >::LeafIterator leafbegin () const
 General definiton for a leaf iterator.
 
Traits::template Codim< codim >::template Partition< pitype >::LeafIterator leafend () const
 General definition for an end iterator on leaf level.
 
Traits::template Codim< codim >::LeafIterator leafend () const
 General definition for an end iterator on leaf level.
 
int size (int level, int cd) const
 number of grid entities per level and codim
 
int size (int codim) const
 number of leaf entities per codim in this process
 
int size (int level, GeometryType type) const
 number of entities per level and geometry type in this process
 
int size (GeometryType type) const
 number of leaf entities per geometry type in this process
 
size_t numBoundarySegments () const
 number of boundary segments
 
int global_size (int cd) const
 number of grid entities on all levels for given codim
 
const GlobalIdSetglobalIdSet () const
 get global id set of grid
 
const LocalIdSetlocalIdSet () const
 get global id set of grid
 
const Traits::LeafIndexSetleafIndexSet () const
 get leaf index set of the grid
 
const Traits::LevelIndexSetlevelIndexSet (int level) const
 get level index set of the grid
 
bool loadBalance ()
 Calculates load of each process and repartition the grid if neccessary. For parameters of the load balancing process see the README file of the ALUGrid package.
 
bool loadBalance (DataHandle &data)
 Calculates load of each process and repartition the grid if neccessary. For parameters of the load balancing process see the README file of the ALUGrid package. More...
 
int ghostSize (int level, int codim) const
 ghostSize is one for codim 0 and zero otherwise for this grid

 
int ghostSize (int codim) const
 ghostSize is one for codim 0 and zero otherwise for this grid

 
int overlapSize (int level, int codim) const
 overlapSize is zero for this grid

 
int overlapSize (int codim) const
 overlapSize is zero for this grid

 
void communicate (CommDataHandleIF< DataHandleImp, DataTypeImp > &data, InterfaceType iftype, CommunicationDirection dir, int level) const
 Communicate information on distributed entities on a given level Template parameter is a model of Dune::CommDataHandleIF. More...
 
void communicate (CommDataHandleIF< DataHandleImp, DataTypeImp > &data, InterfaceType iftype, CommunicationDirection dir) const
 Communicate information on distributed entities on the leaf grid. Template parameter is a model of Dune::CommDataHandleIF.
 
const CollectiveCommunicationcomm () const
 return const reference to a collective communication object. The return type is a model of Dune::CollectiveCommunication. More...
 
bool preAdapt ()
 returns if a least one entity was marked for coarsening
 
void postAdapt ()
 clear all entity new markers
 
bool adapt ()
 Refine all positive marked leaf entities, coarsen all negative marked entities if possible. More...
 
bool adapt (AdaptDataHandleInterface< GridImp, DataHandle > &handle)
 Refine all positive marked leaf entities, coarsen all negative marked entities if possible. More...
 
void globalRefine (int refCount)
 uses the interface, mark on entity and refineLocal
 
bool writeGrid (const std::string filename, alu3d_ctype time) const
 write Grid to file in specified FileFormatType
 
bool writeGrid_Ascii (const std::string filename, alu3d_ctype time, bool scientific=false) const
 write leaf grid in macro grid format to ascii file
 
bool writeMacroGrid (const std::string path, const std::string filename) const
 write macro grid in ALUGrid macro format to path/filename.rank
 
bool readGrid (const std::string filename, alu3d_ctype &time)
 read Grid from file filename and store time of mesh in time
 
void backup (std::ostream &) const
 backup to ostream
 
void restore (std::istream &)
 restore from istream
 
bool mark (int refCount, const typename Traits::template Codim< 0 >::Entity &e)
 Marks an entity to be refined/coarsened in a subsequent adapt. More...
 
bool mark (int refCount, const typename Traits ::template Codim< 0 >::Entity &e)
 Marks an entity to be refined/coarsened in a subsequent adapt. More...
 
int getMark (const typename Traits::template Codim< 0 >::Entity &e) const
 returns adaptation mark for given entity More...
 
const std::vector< GeometryType > & geomTypes (int codim) const
 deliver all geometry types used in this grid
 
const ReferenceElementTypereferenceElement () const
 return reference to Dune reference element according to elType
 
Traits::template Partition< pitype >::LevelGridView DUNE_DEPRECATED_MSG ("The method levelView has been renamed to levelGridView.") levelView(int level) const
 View for a grid level.
 
Traits::template Partition< pitype >::LeafGridView DUNE_DEPRECATED_MSG ("The method levelView has been renamed to leafGridView.") leafView() const
 View for the leaf grid.
 
Adaptivity and grid refinement
bool mark (int refCount, const typename Codim< 0 >::Entity &e)
 Marks an entity to be refined/coarsened in a subsequent adapt. More...
 
int getMark (const typename Codim< 0 >::Entity &e) const
 returns adaptation mark for given entity More...
 

Static Public Member Functions

static std::string name ()
 for grid identification
 

Protected Types

enum  
 max number of levels
 
enum  
 element chunk for refinement
 
enum  
 upper estimate on number of elements that could be created when a new element is created
 

Protected Member Functions

void calcExtras ()
 reset size and global size, update Level- and LeafIndexSet, if they exist
 
void calcMaxLevel ()
 calculate maxlevel
 
void recalcGlobalSize ()
 make grid walkthrough and calc global size
 
void checkMacroGridFile (const std::string filename)
 check whether macro grid format is of our type
 
void checkMacroGrid ()
 check whether macro grid has the right element type
 
const DuneBoundaryProjectionTypeboundaryProjection (const int segmentIndex) const
 return boudanry projection for given segment Id
 
Parallel data distribution and communication
GridImp & asImp ()
 Barton-Nackman trick.
 
const GridImp & asImp () const
 Barton-Nackman trick.
 

Static Protected Member Functions

static ReturnImplementationType< InterfaceType >::ImplementationType & getRealImplementation (InterfaceType &i)
 return real implementation of interface class
 

Detailed Description

constructor for creating ALUSimplexGrid from given macro grid file

Parameters
macroNamefilename for macro grid in ALUGrid tetra format
mpiCommMPI Communicator (when HAVE_MPI == 1 then mpiComm is of type MPI_Comm and the default value is MPI_COMM_WORLD)
bndProjectglobal boundary projection pointer
bndVectorpointer to vector holding boundary projection for each boundary segment. ALUGrid takes ownership of this pointer and will delete it in the desctructor
verbWhether to write a notice about grid creation to stdout.
Deprecated:
Use ALUGrid< 3, 3, simplex, nonconforming > instead.

[ provides Dune::Grid ]

grid with support for simplicial mesh in 3d.

Deprecated:
Use ALUGrid< 3, 3, simplex, nonconforming > instead.

Constructor & Destructor Documentation

◆ ALUSimplexGrid() [1/3]

DUNE_DEPRECATED Dune::ALUSimplexGrid< 3, 3 >::ALUSimplexGrid ( const std::string  macroName,
const MPICommunicatorType  mpiComm = BaseType::defaultCommunicator(),
const DuneBoundaryProjectionType bndProject = 0,
const DuneBoundaryProjectionVector bndVector = 0,
const bool  verb = true 
)
inline

constructor for creating ALUSimplexGrid from given macro grid file

Parameters
macroNamefilename for macro grid in ALUGrid tetra format
mpiCommMPI Communicator (when HAVE_MPI == 1 then mpiComm is of type MPI_Comm and the default value is MPI_COMM_WORLD)
bndProjectglobal boundary projection pointer
bndVectorpointer to vector holding boundary projection for each boundary segment. ALUGrid takes ownership of this pointer and will delete it in the desctructor
verbWhether to write a notice about grid creation to stdout.
Deprecated:
Use ALUGrid< 3, 3, simplex, nonconforming > instead.

◆ ALUSimplexGrid() [2/3]

DUNE_DEPRECATED Dune::ALUSimplexGrid< 3, 3 >::ALUSimplexGrid ( const MPICommunicatorType  mpiComm,
const DuneBoundaryProjectionType bndProject,
const DuneBoundaryProjectionVector bndVector,
const std::string  macroName,
const bool  verb = true 
)
inline

constructor called from ALUGridFactory for creating ALUSimplexGrid from given macro grid file

Parameters
mpiCommMPI Communicator (when HAVE_MPI == 1 then mpiComm is of type MPI_Comm)
bndProjectglobal boundary projection pointer
bndVectorpointer to vector holding boundary projection for each boundary segment
Note
ALUGrid takes ownership of this pointer and will delete it in the desctructor
Parameters
macroNamefilename from which ALUGrid is being generated
verbWhether to write a notice about grid creation to stdout.
Deprecated:
Use ALUGrid< 3, 3, simplex, nonconforming > instead.

◆ ALUSimplexGrid() [3/3]

DUNE_DEPRECATED Dune::ALUSimplexGrid< 3, 3 >::ALUSimplexGrid ( const MPICommunicatorType  mpiComm = BaseType::defaultCommunicator())
inline

constructor creating empty grid, empty string creates empty grid

Deprecated:
Use ALUGrid< 3, 3, simplex, nonconforming > instead.

Member Function Documentation

◆ adapt() [1/2]

bool Dune::ALU3dGrid< elType, Comm >::adapt ( )
inherited

Refine all positive marked leaf entities, coarsen all negative marked entities if possible.

\return true if a least one entity was refined

The complete adaptation process works as follows:

- mark entities with the mark() method
- call preAdapt()
- if preAdapt() returned true: possibly save current solution
- call adapt()
- if adapt() returned true: possibly interpolate the (saved) solution
- call postAdapt()

◆ adapt() [2/2]

bool Dune::ALU3dGrid< elType, Comm >::adapt ( AdaptDataHandleInterface< GridImp, DataHandle > &  handle)
inlineinherited

Refine all positive marked leaf entities, coarsen all negative marked entities if possible.

\return true if a least one entity was refined

The complete adaptation process works as follows:

- mark entities with the mark() method
- call preAdapt()
- if preAdapt() returned true: possibly save current solution
- call adapt()
- if adapt() returned true: possibly interpolate the (saved) solution
- call postAdapt()
Parameters
handlehandler for restriction and prolongation operations which is a Model of the AdaptDataHandleInterface class.

◆ comm()

const CollectiveCommunication & Dune::ALU3dGrid< elType, Comm >::comm ( ) const
inlineinherited

return const reference to a collective communication object. The return type is a model of Dune::CollectiveCommunication.

◆ communicate()

void Dune::ALU3dGrid< elType, Comm >::communicate ( CommDataHandleIF< DataHandleImp, DataTypeImp > &  data,
InterfaceType  iftype,
CommunicationDirection  dir,
int  level 
) const
inherited

Communicate information on distributed entities on a given level Template parameter is a model of Dune::CommDataHandleIF.

Parameters
dataA data handle telling the method what data is communicated and how this should be done.
interfaceThe communication interface to use.
dirThe direction of the communication along the interface (forward or backward.
levelThe index of the grid level where the communication should happen.

◆ getMark() [1/2]

int Dune::Grid< dim, dimworld, alu3d_ctype , ALU3dGridFamily< elType, Comm > >::getMark ( const typename Codim< 0 >::Entity &  e) const
inlineinherited

returns adaptation mark for given entity

Parameters
[in]eEntity for which adaptation mark should be determined
Returns
int adaptation mark currently set for given Entity e

◆ getMark() [2/2]

int Dune::ALU3dGrid< elType, Comm >::getMark ( const typename Traits::template Codim< 0 >::Entity &  e) const
inlineinherited

returns adaptation mark for given entity

Parameters
[in]eEntity for which adaptation mark should be determined
Returns
int adaptation mark currently set for given Entity e

◆ loadBalance()

bool Dune::ALU3dGrid< elType, Comm >::loadBalance ( DataHandle &  data)
inlineinherited

Calculates load of each process and repartition the grid if neccessary. For parameters of the load balancing process see the README file of the ALUGrid package.

Parameters
datathe data handler class that must implement three methods:
// calls data inline on macro element. From there the data of
// all children can be written to the message buffer.
// MessageBufferImp implements the MessageBufferIF interface.
template<class MessageBufferImp>
void inlineData ( MessageBufferImp& buff, Dune::Entity<0> & e);
// calls data xtract on macro element. From there the data of
// all children can be restored from the message buffer.
// numChildren is the number of all children underneath the
// macro element e.
// MessageBufferImp implements the MessageBufferIF interface.
template<class MessageBufferImp>
void xtractData ( MessageBufferImp& buff, Dune::Entity<0> & e, size_t numChildren );
// This method is called at the end of the load balancing process
// before adaptation markers are removed. Here the user can apply
// a data compression or other features. This method can be
// empty if nothing should be done.
void compress ();
Wrapper class for entities.
Definition: entity.hh:57

◆ mark() [1/3]

bool Dune::Grid< dim, dimworld, alu3d_ctype , ALU3dGridFamily< elType, Comm > >::mark ( int  refCount,
const typename Codim< 0 >::Entity &  e 
)
inlineinherited

Marks an entity to be refined/coarsened in a subsequent adapt.

Parameters
[in]refCountNumber of subdivisions that should be applied. Negative value means coarsening.
[in]eEntity that should be marked
Returns
true if Entity was marked, false otherwise.

◆ mark() [2/3]

bool Dune::GridDefaultImplementation< dim, dimworld, alu3d_ctype , ALU3dGridFamily< elType, Comm > >::mark ( int  refCount,
const typename Traits ::template Codim< 0 >::Entity &  e 
)
inlineinherited

Marks an entity to be refined/coarsened in a subsequent adapt.

Parameters
[in]refCountNumber of subdivisions that should be applied. Negative value means coarsening.
[in]eEntity to Entity that should be refined
Returns
true if Entity was marked, false otherwise.
Note
  • default implementation is: return false; for grids with no adaptation.
  • for the grid programmer: this method is implemented as a template method, because the Entity type is not defined when the class is instantiated You won't need this trick in the implementation. In your implementation you should use it as
    bool mark( int refCount,
    typename Traits::template Codim<0>::Entity & e ).
    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_inline.hh:299
    This template method will vanish due to the inheritance rules.

◆ mark() [3/3]

bool Dune::ALU3dGrid< elType, Comm >::mark ( int  refCount,
const typename Traits::template Codim< 0 >::Entity &  e 
)
inlineinherited

Marks an entity to be refined/coarsened in a subsequent adapt.

Parameters
[in]refCountNumber of subdivisions that should be applied. Negative value means coarsening.
[in]eEntity that should be marked
Returns
true if Entity was marked, false otherwise.

The documentation for this class was generated from the following file:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 12, 23:30, 2024)