5#ifndef DUNE_GRID_COMMON_BOUNDARY_SEGMENT_HH
6#define DUNE_GRID_COMMON_BOUNDARY_SEGMENT_HH
11#include <dune/common/singleton.hh>
12#include <dune/common/parameterizedobject.hh>
13#include <dune/common/fvector.hh>
36 template<
int dim,
int dimworld = dim,
class ctype =
double >
37 struct BoundarySegment;
39 template <
class BndSeg>
63 in.read( (
char *) &key,
sizeof(
int ) );
66 return factory().create( key, in );
69 template <
class DerivedType>
72 const int key = createKey();
74 factory().template define< DerivedType >( key );
80 static int createKey()
88 return Dune::Singleton< FactoryType > :: instance();
92 template<
int dim,
int dimworld,
class ctype >
108 virtual FieldVector< ctype, dimworld >
109 operator() (
const FieldVector< ctype, dim-1> &local )
const = 0;
116 DUNE_THROW(NotImplemented,
"BoundarySegment::backup needs to be overloaded!");
Include standard header files.
Definition: agrid.hh:60
BaseType::ObjectStreamType ObjectStreamType
Definition: boundarysegment.hh:98
BoundarySegment< dim, dimworld, ctype > ThisType
Definition: boundarysegment.hh:95
virtual void backup(ObjectStreamType &buffer) const
write BoundarySegment's data to stream buffer
Definition: boundarysegment.hh:114
BoundarySegmentBackupRestore< BoundarySegment< dim, dimworld, ctype > > BaseType
Definition: boundarysegment.hh:96
virtual FieldVector< ctype, dimworld > operator()(const FieldVector< ctype, dim-1 > &local) const =0
A function mapping local coordinates on a boundary segment to world coordinates.
virtual ~BoundarySegment()
Dummy virtual destructor.
Definition: boundarysegment.hh:104
Definition: boundarysegment.hh:41
static std::unique_ptr< BoundarySegment > restore(ObjectStreamType &in)
create an object of BoundarySegment type from a previously registered factory linked to key.
Definition: boundarysegment.hh:59
Dune::ParameterizedObjectFactory< std::unique_ptr< BoundarySegment >(ObjectStreamType &), int > FactoryType
type of factory creating a unique_ptr from an ObjectStreamType
Definition: boundarysegment.hh:51
BndSeg BoundarySegment
type of BoundarySegment interface class
Definition: boundarysegment.hh:48
std::stringstream ObjectStreamType
Definition: boundarysegment.hh:44
static int registerFactory()
Definition: boundarysegment.hh:70