dune-grid 2.10
Loading...
Searching...
No Matches
Dune::GridPtr< GridType > Struct Template Reference

Class for constructing grids from DGF files. More...

#include <dune/grid/io/file/dgfparser/gridptr.hh>

Classes

class  mygrid_ptr
struct  DataHandle

Public Types

typedef MPIHelper::MPICommunicator MPICommunicatorType

Public Member Functions

 GridPtr (const std::string &filename, MPICommunicatorType comm=MPIHelper::getCommunicator())
 constructor given the name of a DGF file
 GridPtr (std::istream &input, MPICommunicatorType comm=MPIHelper::getCommunicator())
 constructor given a std::istream
 GridPtr ()
 Default constructor, creating empty GridPtr.
 GridPtr (GridType *grd)
 Constructor storing given pointer to internal auto pointer.
 GridPtr (const GridPtr &org)=default
 Copy constructor, copies internal auto pointer.
GridPtroperator= (const GridPtr &org)
 assignment of grid pointer
GridPtroperator= (GridType *grd)
 assignment of pointer to internal auto pointer
GridType & operator* ()
 return reference to GridType instance
GridType * operator-> ()
 return pointer to GridType instance
const GridType & operator* () const
 return const reference to GridType instance
const GridType * operator-> () const
 return const pointer to GridType instance
GridType * release ()
 release pointer from internal ownership
int nofParameters (int cdim) const
 get number of parameters defined for a given codimension
template<class Entity>
int nofParameters (const Entity &) const
 get parameters defined for given entity
template<class GridImp, class IntersectionImp>
int nofParameters (const Intersection< GridImp, IntersectionImp > &intersection) const
 get number of parameters defined for a given intersection
template<class Entity>
const std::vector< double > & parameters (const Entity &entity) const
 get parameters defined for each codim 0 und dim entity on the grid through the grid file
template<class GridImp, class IntersectionImp>
const DGFBoundaryParameter::typeparameters (const Intersection< GridImp, IntersectionImp > &intersection) const
 get parameters for intersection
void communicate ()
void loadBalance ()

Static Public Attributes

static const int dimension = GridType::dimension

Protected Member Functions

std::string getFileExtension (const std::string &filename) const
void readGmsh (const std::string &filename, std::integral_constant< bool, true >)
void readGmsh (const std::string &filename, std::integral_constant< bool, false >)
void initialize (DGFGridFactory< GridType > &dgfFactory)
void initialize (GridFactory< GridType > &factory, std::vector< int > &boundaryIds, std::vector< int > &elementIds)
template<class Entity>
std::vector< double > & params (const Entity &entity)
void setNofParams (int cdim, int nofP)

Static Protected Member Functions

template<class Range>
static bool isEmpty (Range &&range)

Protected Attributes

mygrid_ptr gridPtr_
std::vector< std::vector< double > > elParam_
std::vector< std::vector< double > > vtxParam_
std::vector< DGFBoundaryParameter::typebndParam_
std::vector< int > bndId_
std::vector< double > emptyParam_
int nofElParam_
int nofVtxParam_
bool haveBndParam_

Detailed Description

template<class GridType>
struct Dune::GridPtr< GridType >

Class for constructing grids from DGF files.

The constructor of the class is given the filename of the DGF file. From that file a pointer to an instance of type GridType is created by reading the given file which is translated to the specific format of the given GridType. The GridPtr class behaves like an auto pointer of GridType. An auto pointer to a grid of type GridType is constructed as follows:

GridPtr<GridType> gridptr(filename, MPI_COMM_WORLD );
GridType & grid = *gridptr;
GridPtr(const std::string &filename, MPICommunicatorType comm=MPIHelper::getCommunicator())
constructor given the name of a DGF file
Definition gridptr.hh:158

Member Typedef Documentation

◆ MPICommunicatorType

template<class GridType>
typedef MPIHelper::MPICommunicator Dune::GridPtr< GridType >::MPICommunicatorType

Constructor & Destructor Documentation

◆ GridPtr() [1/5]

template<class GridType>
Dune::GridPtr< GridType >::GridPtr ( const std::string & filename,
MPICommunicatorType comm = MPIHelper::getCommunicator() )
inlineexplicit

constructor given the name of a DGF file

◆ GridPtr() [2/5]

template<class GridType>
Dune::GridPtr< GridType >::GridPtr ( std::istream & input,
MPICommunicatorType comm = MPIHelper::getCommunicator() )
inlineexplicit

constructor given a std::istream

◆ GridPtr() [3/5]

template<class GridType>
Dune::GridPtr< GridType >::GridPtr ( )
inline

Default constructor, creating empty GridPtr.

◆ GridPtr() [4/5]

template<class GridType>
Dune::GridPtr< GridType >::GridPtr ( GridType * grd)
inlineexplicit

Constructor storing given pointer to internal auto pointer.

◆ GridPtr() [5/5]

template<class GridType>
Dune::GridPtr< GridType >::GridPtr ( const GridPtr< GridType > & org)
default

Copy constructor, copies internal auto pointer.

Member Function Documentation

◆ communicate()

template<class GridType>
void Dune::GridPtr< GridType >::communicate ( )
inline

◆ getFileExtension()

template<class GridType>
std::string Dune::GridPtr< GridType >::getFileExtension ( const std::string & filename) const
inlineprotected

◆ initialize() [1/2]

template<class GridType>
void Dune::GridPtr< GridType >::initialize ( DGFGridFactory< GridType > & dgfFactory)
inlineprotected

◆ initialize() [2/2]

template<class GridType>
void Dune::GridPtr< GridType >::initialize ( GridFactory< GridType > & factory,
std::vector< int > & boundaryIds,
std::vector< int > & elementIds )
inlineprotected

◆ isEmpty()

template<class GridType>
template<class Range>
bool Dune::GridPtr< GridType >::isEmpty ( Range && range)
inlinestaticprotected

◆ loadBalance()

template<class GridType>
void Dune::GridPtr< GridType >::loadBalance ( )
inline

◆ nofParameters() [1/3]

template<class GridType>
template<class Entity>
int Dune::GridPtr< GridType >::nofParameters ( const Entity & ) const
inline

get parameters defined for given entity

◆ nofParameters() [2/3]

template<class GridType>
template<class GridImp, class IntersectionImp>
int Dune::GridPtr< GridType >::nofParameters ( const Intersection< GridImp, IntersectionImp > & intersection) const
inline

get number of parameters defined for a given intersection

◆ nofParameters() [3/3]

template<class GridType>
int Dune::GridPtr< GridType >::nofParameters ( int cdim) const
inline

get number of parameters defined for a given codimension

◆ operator*() [1/2]

template<class GridType>
GridType & Dune::GridPtr< GridType >::operator* ( )
inline

return reference to GridType instance

◆ operator*() [2/2]

template<class GridType>
const GridType & Dune::GridPtr< GridType >::operator* ( ) const
inline

return const reference to GridType instance

◆ operator->() [1/2]

template<class GridType>
GridType * Dune::GridPtr< GridType >::operator-> ( )
inline

return pointer to GridType instance

◆ operator->() [2/2]

template<class GridType>
const GridType * Dune::GridPtr< GridType >::operator-> ( ) const
inline

return const pointer to GridType instance

◆ operator=() [1/2]

template<class GridType>
GridPtr & Dune::GridPtr< GridType >::operator= ( const GridPtr< GridType > & org)
inline

assignment of grid pointer

◆ operator=() [2/2]

template<class GridType>
GridPtr & Dune::GridPtr< GridType >::operator= ( GridType * grd)
inline

assignment of pointer to internal auto pointer

◆ parameters() [1/2]

template<class GridType>
template<class Entity>
const std::vector< double > & Dune::GridPtr< GridType >::parameters ( const Entity & entity) const
inline

get parameters defined for each codim 0 und dim entity on the grid through the grid file

◆ parameters() [2/2]

template<class GridType>
template<class GridImp, class IntersectionImp>
const DGFBoundaryParameter::type & Dune::GridPtr< GridType >::parameters ( const Intersection< GridImp, IntersectionImp > & intersection) const
inline

get parameters for intersection

◆ params()

template<class GridType>
template<class Entity>
std::vector< double > & Dune::GridPtr< GridType >::params ( const Entity & entity)
inlineprotected

◆ readGmsh() [1/2]

template<class GridType>
void Dune::GridPtr< GridType >::readGmsh ( const std::string & filename,
std::integral_constant< bool, false >  )
inlineprotected

◆ readGmsh() [2/2]

template<class GridType>
void Dune::GridPtr< GridType >::readGmsh ( const std::string & filename,
std::integral_constant< bool, true >  )
inlineprotected

◆ release()

template<class GridType>
GridType * Dune::GridPtr< GridType >::release ( )
inline

release pointer from internal ownership

◆ setNofParams()

template<class GridType>
void Dune::GridPtr< GridType >::setNofParams ( int cdim,
int nofP )
inlineprotected

Member Data Documentation

◆ bndId_

template<class GridType>
std::vector< int > Dune::GridPtr< GridType >::bndId_
protected

◆ bndParam_

template<class GridType>
std::vector< DGFBoundaryParameter::type > Dune::GridPtr< GridType >::bndParam_
protected

◆ dimension

template<class GridType>
const int Dune::GridPtr< GridType >::dimension = GridType::dimension
static

◆ elParam_

template<class GridType>
std::vector< std::vector< double > > Dune::GridPtr< GridType >::elParam_
protected

◆ emptyParam_

template<class GridType>
std::vector< double > Dune::GridPtr< GridType >::emptyParam_
protected

◆ gridPtr_

template<class GridType>
mygrid_ptr Dune::GridPtr< GridType >::gridPtr_
mutableprotected

◆ haveBndParam_

template<class GridType>
bool Dune::GridPtr< GridType >::haveBndParam_
protected

◆ nofElParam_

template<class GridType>
int Dune::GridPtr< GridType >::nofElParam_
protected

◆ nofVtxParam_

template<class GridType>
int Dune::GridPtr< GridType >::nofVtxParam_
protected

◆ vtxParam_

template<class GridType>
std::vector< std::vector< double > > Dune::GridPtr< GridType >::vtxParam_
protected

The documentation for this struct was generated from the following file: