Go to the documentation of this file.
3 #ifndef DUNE_GRID_COMMON_BOUNDARY_SEGMENT_HH
4 #define DUNE_GRID_COMMON_BOUNDARY_SEGMENT_HH
9 #include <dune/common/singleton.hh>
10 #include <dune/common/parameterizedobject.hh>
11 #include <dune/common/fvector.hh>
34 template<
int dim,
int dimworld = dim,
class ctype =
double >
37 template <
class BndSeg>
61 in.read( (
char *) &key,
sizeof(
int ) );
64 return factory().create( key, in );
67 template <
class DerivedType>
70 const int key = createKey();
72 factory().template define< DerivedType >( key );
78 static int createKey()
86 return Dune::Singleton< FactoryType > :: instance();
90 template<
int dim,
int dimworld,
class ctype >
91 struct BoundarySegment :
public BoundarySegmentBackupRestore< BoundarySegment< dim, dimworld, ctype > >
106 virtual FieldVector< ctype, dimworld >
107 operator() (
const FieldVector< ctype, dim-1> &local )
const = 0;
114 DUNE_THROW(NotImplemented,
"BoundarySegment::backup needs to be overloaded!");
BaseType ::ObjectStreamType ObjectStreamType
Definition: boundarysegment.hh:96
Dune::ParameterizedObjectFactory< std::unique_ptr< BoundarySegment > ObjectStreamType &), int > FactoryType
type of factory creating a unique_ptr from an ObjectStreamType
Definition: boundarysegment.hh:49
Base class for classes implementing geometries of boundary segments.
Definition: boundarysegment.hh:35
virtual void backup(ObjectStreamType &buffer) const
write BoundarySegment's data to stream buffer
Definition: boundarysegment.hh:112
virtual ~BoundarySegment()
Dummy virtual destructor.
Definition: boundarysegment.hh:102
BndSeg BoundarySegment
type of BoundarySegment interface class
Definition: boundarysegment.hh:46
static int registerFactory()
Definition: boundarysegment.hh:68
std::stringstream ObjectStreamType
Definition: boundarysegment.hh:42
BoundarySegmentBackupRestore< BoundarySegment< dim, dimworld, ctype > > BaseType
Definition: boundarysegment.hh:94
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:57
Definition: boundarysegment.hh:38
BoundarySegment< dim, dimworld, ctype > ThisType
Definition: boundarysegment.hh:93
Include standard header files.
Definition: agrid.hh:58
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.