diff --git a/fem/common/discretefunctionspace.hh b/fem/common/discretefunctionspace.hh index 4a9f392988c3a0a4afe08330f2040b0c8644f667..8b1fb4ec1b5e58ae5dd6cc0b25f9525f6d74bb1d 100644 --- a/fem/common/discretefunctionspace.hh +++ b/fem/common/discretefunctionspace.hh @@ -18,6 +18,22 @@ namespace Dune { Periodic //!< Periodic boundary }; + /*! + BoundaryIdentifierInterface is a map from a given boundary id to a + certain boundary type in an application, for example -1 means Dirichlet. + This class should be defined by the user and is a parameter + of the function space. + */ + class BoundaryIdentifierDefault + { + public: + //! for given boundary id return corresponding boundary type + BoundaryType boundaryType ( int id ) const + { + return (id < 0) ? Dirichlet : Neumann; + } + }; + /** @defgroup DiscreteFunctionSpace DiscreteFunctionSpace @ingroup DiscreteFunction This provides the interfaces for discrete function spaces. @@ -96,6 +112,12 @@ namespace Dune { //! this depends also on the base function set int size () const { return asImp().size(); }; + //! return boundary type for given boundary id + BoundaryType boundaryType ( int id ) const + { + return asImp().boundaryType(id); + } + //! For given entity map local dof number to global dof number //! at the level of the given entity. template <class EntityType>