dune-grid  2.2.1
Classes | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Dune::GridPtr< GridType > Struct Template Reference

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

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

Classes

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 More...
 
 GridPtr (std::istream &input, MPICommunicatorType comm=MPIHelper::getCommunicator())
 constructor given a std::istream More...
 
 GridPtr ()
 Default constructor, creating empty GridPtr. More...
 
 GridPtr (GridType *grd)
 Constructor storing given pointer to internal auto pointer. More...
 
 GridPtr (const GridPtr &org)
 Copy constructor, copies internal auto pointer. More...
 
GridPtroperator= (const GridPtr &org)
 assignment of grid pointer More...
 
GridPtroperator= (GridType *grd)
 assignment of pointer to internal auto pointer More...
 
GridType & operator* ()
 return reference to GridType instance More...
 
GridType * operator-> ()
 return pointer to GridType instance More...
 
const GridType & operator* () const
 return const reference to GridType instance More...
 
const GridType * operator-> () const
 return const pointer to GridType instance More...
 
GridType * release ()
 release pointer from internal ownership More...
 
int nofParameters (int cdim) const
 get number of parameters defined for a given codimension More...
 
template<class Entity >
int nofParameters (const Entity &) const
 get parameters defined for given entity More...
 
template<class GridImp , template< class > class IntersectionImp>
int nofParameters (const Intersection< GridImp, IntersectionImp > &intersection) const
 get number of parameters defined for a given intersection More...
 
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 More...
 
template<class GridImp , template< class > class IntersectionImp>
const DGFBoundaryParameter::typeparameters (const Intersection< GridImp, IntersectionImp > &intersection) const
 get parameters for intersection More...
 
void loadBalance ()
 

Static Public Attributes

static const int dimension = GridType::dimension
 

Protected Member Functions

void initialize (DGFGridFactory< GridType > &dgfFactory)
 
template<class Entity >
std::vector< double > & params (const Entity &entity)
 
void setNofParams (int cdim, int nofP)
 

Protected Attributes

std::auto_ptr< GridType > gridPtr_
 
std::vector< std::vector
< double > > 
elParam_
 
std::vector< std::vector
< double > > 
vtxParam_
 
std::vector
< DGFBoundaryParameter::type
bndParam_
 
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;

Member Typedef Documentation

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

Constructor & Destructor Documentation

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

constructor given the name of a DGF file

References Dune::GridPtr< GridType >::initialize().

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

constructor given a std::istream

References Dune::GridPtr< GridType >::initialize().

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

Default constructor, creating empty GridPtr.

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

Constructor storing given pointer to internal auto pointer.

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

Copy constructor, copies internal auto pointer.

Member Function Documentation

template<class GridType>
void Dune::GridPtr< GridType >::initialize ( DGFGridFactory< GridType > &  dgfFactory)
inlineprotected
template<class GridType>
void Dune::GridPtr< GridType >::loadBalance ( )
inline
template<class GridType>
int Dune::GridPtr< GridType >::nofParameters ( int  cdim) const
inline
template<class GridType>
template<class Entity >
int Dune::GridPtr< GridType >::nofParameters ( const Entity ) const
inline
template<class GridType>
template<class GridImp , template< class > class IntersectionImp>
int Dune::GridPtr< GridType >::nofParameters ( const Intersection< GridImp, IntersectionImp > &  intersection) const
inline

get number of parameters defined for a given intersection

References Dune::GridPtr< GridType >::parameters().

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

return reference to GridType instance

References Dune::GridPtr< GridType >::gridPtr_.

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

return const reference to GridType instance

References Dune::GridPtr< GridType >::gridPtr_.

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

return pointer to GridType instance

References Dune::GridPtr< GridType >::gridPtr_.

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

return const pointer to GridType instance

References Dune::GridPtr< GridType >::gridPtr_.

template<class GridType>
GridPtr& Dune::GridPtr< GridType >::operator= ( const GridPtr< GridType > &  org)
inline
template<class GridType>
GridPtr& Dune::GridPtr< GridType >::operator= ( GridType *  grd)
inline
template<class GridType>
template<class Entity >
const std::vector< double >& Dune::GridPtr< GridType >::parameters ( const Entity entity) const
inline
template<class GridType>
template<class GridImp , template< class > class IntersectionImp>
const DGFBoundaryParameter::type& Dune::GridPtr< GridType >::parameters ( const Intersection< GridImp, IntersectionImp > &  intersection) const
inline
template<class GridType>
template<class Entity >
std::vector< double >& Dune::GridPtr< GridType >::params ( const Entity entity)
inlineprotected
template<class GridType>
GridType* Dune::GridPtr< GridType >::release ( )
inline

release pointer from internal ownership

References Dune::GridPtr< GridType >::gridPtr_.

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

Member Data Documentation

template<class GridType>
std::vector< int > Dune::GridPtr< GridType >::bndId_
protected
template<class GridType>
std::vector< DGFBoundaryParameter::type > Dune::GridPtr< GridType >::bndParam_
protected
template<class GridType>
const int Dune::GridPtr< GridType >::dimension = GridType::dimension
static
template<class GridType>
std::vector< std::vector< double > > Dune::GridPtr< GridType >::elParam_
protected
template<class GridType>
std::vector< double > Dune::GridPtr< GridType >::emptyParam_
protected
template<class GridType>
std::auto_ptr<GridType> Dune::GridPtr< GridType >::gridPtr_
mutableprotected
template<class GridType>
bool Dune::GridPtr< GridType >::haveBndParam_
protected
template<class GridType>
int Dune::GridPtr< GridType >::nofElParam_
protected
template<class GridType>
int Dune::GridPtr< GridType >::nofVtxParam_
protected
template<class GridType>
std::vector< std::vector< double > > Dune::GridPtr< GridType >::vtxParam_
protected

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