5#ifndef DUNE_DGFGEOGRID_HH
6#define DUNE_DGFGEOGRID_HH
8#include <dune/common/typetraits.hh>
34 template<
class Gr
idImp,
class IntersectionImp >
42 template<
int dimD,
int dimR >
56 : expression_( expression )
61 std::vector< double > vx( dimD );
62 std::vector< double > vy;
63 for(
int i = 0; i < dimD; ++i )
66 assert( vy.size() ==
size_t( dimR ) );
67 for(
int i = 0; i < dimR; ++i )
80 template<
class HostGrid,
class CoordFunction,
85 template<
class HostGr
id,
class CoordFunction >
88 static CoordFunction *
create ( std::istream &,
const HostGrid & )
90 return new CoordFunction;
95 template<
class HostGr
id,
class CoordFunction >
98 static CoordFunction *
create ( std::istream &,
const HostGrid &hostGrid )
100 return new CoordFunction( hostGrid );
105 template<
class HostGr
id,
int dimD,
int dimR >
114 if( expression == 0 )
115 DUNE_THROW(
DGFException,
"no coordfunction specified in DGF file." );
125 template<
class HostGr
id,
class CoordFunction,
class Allocator >
132 typedef typename Grid::template Codim<0>::Entity
Element;
133 typedef typename Grid::template Codim<dimension>::Entity
Vertex;
139 : dgfHostFactory_( input, comm ),
142 auto hostGrid = std::shared_ptr<HostGrid>(dgfHostFactory_.grid());
143 assert( hostGrid != 0 );
144 auto coordFunction = std::shared_ptr<CoordFunction>(CoordFunctionFactory::create( input, *hostGrid ));
145 grid_ =
new Grid( hostGrid, coordFunction );
150 : dgfHostFactory_( filename, comm ),
153 auto hostGrid = std::shared_ptr<HostGrid>(dgfHostFactory_.grid());
154 assert( hostGrid != 0 );
155 std::ifstream input( filename.c_str() );
156 auto coordFunction = std::shared_ptr<CoordFunction>(CoordFunctionFactory::create( input, *hostGrid ));
157 grid_ =
new Grid( hostGrid, coordFunction );
165 template<
class Intersection >
171 template<
class Intersection >
177 template<
int codim >
180 return dgfHostFactory_.template numParameters< codim >();
186 return dgfHostFactory_.haveBoundaryParameters();
189 template<
class GG,
class II >
196 template<
class Entity >
212 template<
class HostGr
id,
class CoordFunction,
class Allocator >
Include standard header files.
Definition: agrid.hh:60
Definition: dgfgridfactory.hh:38
G Grid
Definition: dgfgridfactory.hh:39
static const int dimension
Definition: dgfgridfactory.hh:40
Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
Definition: common/intersection.hh:164
Wrapper class for entities.
Definition: common/entity.hh:66
Grid abstract base class.
Definition: common/grid.hh:375
static constexpr int dimension
The dimension of the grid.
Definition: common/grid.hh:387
Derive an implementation of an analytical coordinate function from this class.
Definition: coordfunction.hh:134
Base::DomainVector DomainVector
Definition: coordfunction.hh:139
Base::RangeVector RangeVector
Definition: coordfunction.hh:140
static const bool value
Definition: coordfunction.hh:308
grid wrapper replacing the geometries
Definition: geometrygrid/grid.hh:86
provides access to host grid objects from GeometryGrid
Definition: identitygrid.hh:37
Definition: io/file/dgfparser/blocks/projection.hh:24
ExpressionPointer function(const std::string &name) const
Definition: io/file/dgfparser/blocks/projection.hh:100
Definition: io/file/dgfparser/blocks/projection.hh:160
virtual void evaluate(const Vector &argument, Vector &result) const =0
exception class for IO errors in the DGF parser
Definition: dgfexception.hh:16
Definition: dgfgeogrid.hh:45
Base::DomainVector DomainVector
Definition: dgfgeogrid.hh:50
void evaluate(const DomainVector &x, RangeVector &y) const
Definition: dgfgeogrid.hh:59
dgf::ProjectionBlock::Expression Expression
Definition: dgfgeogrid.hh:53
DGFCoordFunction(const Expression *expression)
Definition: dgfgeogrid.hh:55
Base::RangeVector RangeVector
Definition: dgfgeogrid.hh:51
Definition: dgfgeogrid.hh:82
static CoordFunction * create(std::istream &, const HostGrid &)
Definition: dgfgeogrid.hh:88
static CoordFunction * create(std::istream &, const HostGrid &hostGrid)
Definition: dgfgeogrid.hh:98
static CoordFunction * create(std::istream &input, const HostGrid &hostGrid)
Definition: dgfgeogrid.hh:110
DGFCoordFunction< dimD, dimR > CoordFunction
Definition: dgfgeogrid.hh:108
Grid::template Codim< dimension >::Entity Vertex
Definition: dgfgeogrid.hh:133
int boundaryId(const Intersection &intersection) const
Definition: dgfgeogrid.hh:172
MPIHelper::MPICommunicator MPICommunicator
Definition: dgfgeogrid.hh:131
const DGFBoundaryParameter::type & boundaryParameter(const Dune::Intersection< GG, II > &intersection) const
Definition: dgfgeogrid.hh:191
DGFGridFactory(std::istream &input, MPICommunicator comm=MPIHelper::getCommunicator())
Definition: dgfgeogrid.hh:137
Grid::template Codim< 0 >::Entity Element
Definition: dgfgeogrid.hh:132
Grid * grid() const
Definition: dgfgeogrid.hh:160
DGFCoordFunctionFactory< HostGrid, CoordFunction > CoordFunctionFactory
Definition: dgfgeogrid.hh:135
GeometryGrid< HostGrid, CoordFunction, Allocator > Grid
Definition: dgfgeogrid.hh:128
int numParameters() const
Definition: dgfgeogrid.hh:178
std::vector< double > & parameter(const Entity &entity)
Definition: dgfgeogrid.hh:197
DGFGridFactory(const std::string &filename, MPICommunicator comm=MPIHelper::getCommunicator())
Definition: dgfgeogrid.hh:148
bool wasInserted(const Intersection &intersection) const
Definition: dgfgeogrid.hh:166
bool haveBoundaryParameters() const
Definition: dgfgeogrid.hh:184
static double refineWeight()
Definition: dgfgeogrid.hh:220
static int refineStepsForHalf()
Definition: dgfgeogrid.hh:215
Some simple static information for a given GridType.
Definition: io/file/dgfparser/dgfparser.hh:56
static int refineStepsForHalf()
number of globalRefine steps needed to refuce h by 0.5
std::string type
type of additional boundary parameters
Definition: parser.hh:25