5#ifndef DUNE_ALBERTA_ALBERTAREADER_HH
6#define DUNE_ALBERTA_ALBERTAREADER_HH
20 template<
class Gr
id >
23 typedef AlbertaReader< Grid > This;
34 static_assert(dimensionworld == Alberta::dimWorld,
35 "AlbertaReader: world dimension must match ALBERTA's world dimension.");
37 typedef Alberta::MacroData< dimension > MacroData;
41 AlbertaReader (
const This & );
42 This &operator= (
const This & );
48 void readGrid (
const std::string &fileName, GridFactory &factory )
51 macroData_.read( fileName,
false );
54 const int numVertices = macroData_.vertexCount();
55 for(
int i = 0; i < numVertices; ++i )
57 FieldVector< ctype, dimensionworld > v;
58 const Alberta::GlobalVector &coords = macroData_.vertex( i );
59 for(
int j = 0; j < dimensionworld; ++j )
61 factory.insertVertex( v );
65 std::vector< unsigned int > vertices( dimension+1 );
66 const int numElements = macroData_.elementCount();
67 for(
int i = 0; i < numElements; ++i )
69 const typename MacroData::ElementId &
id = macroData_.element( i );
70 for(
int j = 0; j <= dimension; ++j )
71 vertices[ j ] =
id[ j ];
static constexpr int dimension
The dimension of the grid.
Definition: grid.hh:387
static constexpr int dimensionworld
The dimension of the world the grid lives in.
Definition: grid.hh:390
ct ctype
Define type used for coordinates in grid module.
Definition: grid.hh:518
Different resources needed by all grid implementations.
Provide a generic factory class for unstructured grids.
constexpr GeometryType simplex(unsigned int dim)
Returns a GeometryType representing a simplex of dimension dim.
Definition: type.hh:453
provides a wrapper for ALBERTA's macro_data structure
Dune namespace.
Definition: alignedallocator.hh:13
A unique label for each type of element that can occur in a grid.