3#ifndef DUNE_ALBERTA_ALBERTAREADER_HH
4#define DUNE_ALBERTA_ALBERTAREADER_HH
18 template<
class Gr
id >
21 typedef AlbertaReader< Grid > This;
32 static_assert(dimensionworld == Alberta::dimWorld,
33 "AlbertaReader: world dimension must match ALBERTA's world dimension.");
35 typedef Alberta::MacroData< dimension > MacroData;
39 AlbertaReader (
const This & );
40 This &operator= (
const This & );
46 void readGrid (
const std::string &fileName, GridFactory &factory )
49 macroData_.read( fileName,
false );
52 const int numVertices = macroData_.vertexCount();
53 for(
int i = 0; i < numVertices; ++i )
55 FieldVector< ctype, dimensionworld > v;
56 const Alberta::GlobalVector &coords = macroData_.vertex( i );
57 for(
int j = 0; j < dimensionworld; ++j )
59 factory.insertVertex( v );
63 std::vector< unsigned int > vertices( dimension+1 );
64 const int numElements = macroData_.elementCount();
65 for(
int i = 0; i < numElements; ++i )
67 const typename MacroData::ElementId &
id = macroData_.element( i );
68 for(
int j = 0; j <= dimension; ++j )
69 vertices[ j ] =
id[ j ];
70 typedef typename Impl::SimplexTopology< dimension >::type Topology;
71 factory.insertElement(
GeometryType( Topology() ), vertices );
@ dimensionworld
The dimension of the world the grid lives in.
Definition: grid.hh:393
@ dimension
The dimension of the grid.
Definition: grid.hh:387
ct ctype
Define type used for coordinates in grid module.
Definition: grid.hh:522
Different resources needed by all grid implementations.
Provide a generic factory class for unstructured grids.
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178
provides a wrapper for ALBERTA's macro_data structure
Dune namespace.
Definition: alignment.hh:11
A unique label for each type of element that can occur in a grid.