33 #ifndef __H__UG__LIB_DISC__LOCAL_FINITE_ELEMENT__LOCAL_FINITE_ELEMENT_PROVIDER_IMPL__
34 #define __H__UG__LIB_DISC__LOCAL_FINITE_ELEMENT__LOCAL_FINITE_ELEMENT_PROVIDER_IMPL__
45 template <
int dim,
typename TShape,
typename TGrad>
46 std::map<LFEID, LocalFiniteElementProvider::LocalShapeFunctionSets<dim, TShape, TGrad> >&
49 typedef std::map<LFEID, LocalShapeFunctionSets<dim, TShape, TGrad> > Map;
55 std::map<LFEID, LocalFiniteElementProvider::DimLocalDoFSets<dim> >&
58 typedef std::map<LFEID, DimLocalDoFSets<dim> > Map;
63 template <
int dim,
typename TShape,
typename TGrad>
69 typedef std::map<LFEID, LocalShapeFunctionSets<dim, TShape, TGrad> > Map;
74 if(vLSFS[roid].valid()){
75 UG_THROW(
"LocalFiniteElementProvider::register_set(): "
76 "Reference type already registered for trial space: "<<
id<<
" and "
77 " Reference element type "<<roid<<
".");
86 UG_THROW(
"LocalFiniteElementProvider::register_set(): "
87 "Reference type says continuous:"<<set->continuous()<<
", but "
88 " other Reference element says "<<
m_mContSpace[
id]<<
".");
101 typedef std::map<LFEID, DimLocalDoFSets<dim> > Map;
107 if(vLDS[roid].valid()){
108 UG_THROW(
"LocalFiniteElementProvider::register_set(): "
109 "Reference type already registered for trial space: "<<
id<<
" and "
110 " Reference element type "<<roid<<
".");
116 register_set(
id, set.template cast_dynamic<LocalDoFSet>());
120 template <
int dim,
typename TShape,
typename TGrad>
126 typedef std::map<LFEID, LocalShapeFunctionSets<dim, TShape, TGrad> > Map;
130 typename Map::const_iterator iter = map.find(
id);
131 if(iter == map.end() || (iter->second)[roid].invalid())
136 return getptr<dim, TShape, TGrad>(roid,
id,
false);
142 return (iter->second)[roid];
145 template <
int dim,
typename TShape,
typename TGrad>
151 getptr<dim,TShape,TGrad>(roid,
id, bCreate);
153 if(ptr.
valid())
return *ptr;
155 UG_THROW(
"LocalFiniteElementProvider: Local Shape Function Set not "
156 "found for "<<roid<<
" (world dim: "<<
dim<<
") and type = "<<
id<<
157 ". (This is usually due to: a) The function set is not implemented at "
158 " all, or b) The finite element space is discontinuous but the "
159 "evaluation is requested on a subelement, i.e. a grid object "
160 "with dimension less than the dimension where the finite element"
161 " space is defined.)");
170 typedef std::map<LFEID, DimLocalDoFSets<dim> > Map;
174 typename Map::const_iterator iter = map.find(
id);
175 if(iter == map.end() || (iter->second)[roid].invalid())
180 return get_dof_ptr<dim>(roid,
id,
false);
186 return (iter->second)[roid];
195 get_dof_ptr<dim>(roid,
id, bCreate);
197 if(ptr.
valid())
return *ptr;
199 UG_THROW(
"LocalFiniteElementProvider: Local DoF Set not "
200 "found for "<<roid<<
" (world dim: "<<
dim<<
") and type = "<<
id);
Definition: smart_pointer.h:296
bool valid() const
returns true if the pointer is valid, false if not.
Definition: smart_pointer.h:414
Definition: local_dof_set.h:158
Identifier for Local Finite Elements.
Definition: local_finite_element_id.h:98
static std::map< LFEID, LocalShapeFunctionSets< dim, TShape, TGrad > > & lsfs_map()
Definition: local_finite_element_provider_impl.h:47
static void create_dof_set(ReferenceObjectID roid, const LFEID &id)
Definition: local_finite_element_provider.cpp:663
static std::map< LFEID, DimLocalDoFSets< dim > > & lds_map()
Definition: local_finite_element_provider_impl.h:56
static const LocalShapeFunctionSet< dim, TShape, TGrad > & get(ReferenceObjectID roid, const LFEID &id, bool bCreate=true)
returns the Local Shape Function Set
Definition: local_finite_element_provider_impl.h:148
static void create_set(ReferenceObjectID roid, const LFEID &id)
creates new set at runtime if available
Definition: local_finite_element_provider.cpp:552
static const CommonLocalDoFSet & get_dofs(const LFEID &id, bool bCreate=true)
returns the common dof set for all reference objects of a dimension
Definition: local_finite_element_provider.cpp:730
static void register_set(const LFEID &id, ConstSmartPtr< LocalShapeFunctionSet< dim, TShape, TGrad > > set)
register a local shape function set for a given reference element type
Definition: local_finite_element_provider_impl.h:65
static LocalFiniteElementProvider & inst()
Definition: local_finite_element_provider.h:73
static ConstSmartPtr< DimLocalDoFSet< dim > > get_dof_ptr(ReferenceObjectID roid, const LFEID &id, bool bCreate=true)
Definition: local_finite_element_provider_impl.h:167
static ConstSmartPtr< LocalShapeFunctionSet< dim, TShape, TGrad > > getptr(ReferenceObjectID roid, const LFEID &id, bool bCreate=true)
returns the Local Shape Function Set
Definition: local_finite_element_provider_impl.h:123
static std::map< LFEID, bool > m_mContSpace
Definition: local_finite_element_provider.h:140
virtual base class for local shape function sets
Definition: local_shape_function_set.h:70
const NullSmartPtr SPNULL
The equivalent to NULL for smart pointers.
Definition: smart_pointer.h:90
#define UG_THROW(msg)
Definition: error.h:57
ReferenceObjectID
these ids are used to identify the shape of a geometric object.
Definition: grid_base_objects.h:74
T value_type
Definition: sparsematrix_interface.h:2
Definition: local_finite_element_provider.h:150
Definition: local_finite_element_provider.h:128