33#ifndef __H__UG__LIB_DISC__LOCAL_SHAPE_FUNCTION_SET__PIECEWISE_CONSTANT__
34#define __H__UG__LIB_DISC__LOCAL_SHAPE_FUNCTION_SET__PIECEWISE_CONSTANT__
44template <
typename TRefElem>
46 :
public BaseLSFS<PiecewiseConstantLSFS<TRefElem>, TRefElem::dim>
50 static const int dim = TRefElem::dim;
58 bary = rRef.corner(0);
59 for (
size_t j=1; j < rRef.num(0); ++j){
60 bary += rRef.corner(j);
62 bary *= 1./rRef.num(0);
77 if (type == TRefElem::REFERENCE_OBJECT_ID)
return 1;
87 pos =
bary;
return true;
109 TRefElem::check_position(x);
static interface for trial spaces
Definition local_shape_function_set.h:176
Definition local_dof_set.h:58
a mathematical Vector with N entries.
Definition math_vector.h:97
Elementwise constant shape functions.
Definition piecewise_constant.h:47
PiecewiseConstantLSFS()
Constructor.
Definition piecewise_constant.h:54
ReferenceObjectID roid() const
returns the Reference object id of the corresponding grid object
Definition piecewise_constant.h:69
size_t num_dof(ReferenceObjectID type) const
Definition piecewise_constant.h:75
bool continuous() const
returns if space constructs continuous functions
Definition piecewise_constant.h:95
number shape(const size_t i, const MathVector< dim > &x) const
evaluates the shape function
Definition piecewise_constant.h:101
size_t num_dof() const
Definition piecewise_constant.h:72
bool position(size_t i, MathVector< dim > &pos) const
local position of DoF i
Definition piecewise_constant.h:85
bool exact_position_available() const
returns if the local dof position are exact
Definition piecewise_constant.h:91
size_t num_sh() const
Definition piecewise_constant.h:98
void grad(MathVector< dim > &g, const size_t i, const MathVector< dim > &x) const
evaluates the shape function
Definition piecewise_constant.h:107
const LocalDoF & local_dof(size_t dof) const
returns the DoFs storage
Definition piecewise_constant.h:82
static const int dim
Dimension, where shape functions are defined.
Definition piecewise_constant.h:50
MathVector< dim > bary
Barycenter.
Definition piecewise_constant.h:114
LocalDoF m_vLocalDoF
association to elements
Definition piecewise_constant.h:115
static TClass & get()
returns a singleton based on the identifier
Definition provider.h:54
double number
Definition types.h:124
void VecSet(vector_t &vInOut, typename vector_t::value_type s)
Set each vector component to scalar (componentwise)
Definition math_vector_functions_common_impl.hpp:539
ReferenceObjectID
these ids are used to identify the shape of a geometric object.
Definition grid_base_objects.h:74