33 #ifndef __H__UG__LIB_DISC__SPATIAL_DISC__STD_USER_DATA__
34 #define __H__UG__LIB_DISC__SPATIAL_DISC__STD_USER_DATA__
61 template <
typename TImpl,
typename TData,
int dim,
typename TRet =
void,
typename TBase = CplUserData<TData, dim, TRet> >
73 number time,
int si,
const size_t nip)
const = 0;
87 getImpl().template evaluate<1>(vValue,vGlobIP,
time,si,elem,
88 vCornerCoords,vLocIP,nip,u,vJT);
101 getImpl().template evaluate<2>(vValue,vGlobIP,
time,si,elem,
102 vCornerCoords,vLocIP,nip,u,vJT);
115 getImpl().template evaluate<3>(vValue,vGlobIP,
time,si,elem,
116 vCornerCoords,vLocIP,nip,u,vJT);
122 TImpl&
getImpl() {
return static_cast<TImpl&
>(*this);}
125 const TImpl&
getImpl()
const {
return static_cast<const TImpl&
>(*this);}
128 template <
typename TImpl,
typename TData,
int dim>
130 :
public StdUserData< StdDependentUserData<TImpl, TData, dim>,
132 DependentUserData<TData, dim> >
146 UG_THROW(
"StdDependentUserData: Solution, element and local ips required "
147 "for evaluation, but not passed. Cannot evaluate.");
154 UG_THROW(
"StdDependentUserData: Solution, element and local ips required "
155 "for evaluation, but not passed. Cannot evaluate.");
158 template <
int refDim>
169 const_cast<TImpl*
>(
static_cast<const TImpl*
>(
this))->
170 template eval_and_deriv<refDim>(vValue,vGlobIP,
time,si,elem,
171 vCornerCoords,vLocIP,nip,u,
175 template <
int refDim>
179 const int si = this->
subset();
181 std::vector<std::vector<TData> >* vvvDeriv = NULL;
192 this->
template local_ips<refDim>(
s), this->
num_ip(
s),
193 u, bDeriv,
s, vvvDeriv);
197 template <
int refDim>
201 const int si = this->
subset();
203 std::vector<std::vector<TData> >* vvvDeriv = NULL;
216 this->
template local_ips<refDim>(
s), this->
num_ip(
s),
217 &(u->
solution(this->time_point(
s))), bDoDeriv,
s, vvvDeriv);
225 "local ip dimension (" << this->dim_local_ips()
226 <<
") and reference element dimension ("
230 case 1: eval_deriv<1>(u,elem,vCornerCoords,bDeriv);
break;
231 case 2: eval_deriv<2>(u,elem,vCornerCoords,bDeriv);
break;
232 case 3: eval_deriv<3>(u,elem,vCornerCoords,bDeriv);
break;
233 default:
UG_THROW(
"StdDependentUserData: Dimension not supported.");
241 "local ip dimension and reference element dimension mismatch.");
244 case 1: eval_deriv<1>(u,elem,vCornerCoords,bDeriv);
break;
245 case 2: eval_deriv<2>(u,elem,vCornerCoords,bDeriv);
break;
246 case 3: eval_deriv<3>(u,elem,vCornerCoords,bDeriv);
break;
247 default:
UG_THROW(
"StdDependentUserData: Dimension not supported.");
253 TImpl&
getImpl() {
return static_cast<TImpl&
>(*this);}
256 const TImpl&
getImpl()
const {
return static_cast<const TImpl&
>(*this);}
const TData * values(size_t s) const
returns all values for a series
Definition: user_data.h:516
const TData & value(size_t s, size_t ip) const
returns the value at ip
Definition: user_data.h:512
std::vector< std::vector< std::vector< std::vector< TData > > > > m_vvvvDeriv
Derivatives.
Definition: user_data.h:704
size_t num_ip(size_t s) const
returns the number of integration points
Definition: user_data.h:327
size_t num_series() const
returns the number of ip series
Definition: user_data.h:324
void set_functions(const char *symbFct)
Definition: user_data_impl.h:391
The base class for all geometric objects, such as vertices, edges, faces, volumes,...
Definition: grid_base_objects.h:157
virtual int base_object_id() const =0
int dim_local_ips() const
returns current local ip dimension
Definition: user_data.h:372
bool at_current_time(size_t s) const
returns true iff the time point specification is equal to the current one, or not specified
Definition: user_data_impl.h:221
int subset() const
returns the subset of evaluation
Definition: user_data.h:273
number time() const
get the current evaluation time
Definition: user_data.h:285
const MathVector< dim > * ips(size_t s) const
returns global ips
Definition: user_data.h:398
Definition: local_algebra.h:198
time series of local vectors
Definition: solution_time_series.h:167
const LocalVector & solution(size_t i) const
returns the local vector for the i'th time point
Definition: solution_time_series.h:182
A class for fixed size, dense matrices.
Definition: math_matrix.h:52
Definition: std_user_data.h:133
void eval_deriv(LocalVector *u, GridObject *elem, const MathVector< dim > vCornerCoords[], bool bDeriv=false)
Definition: std_user_data.h:176
void eval_deriv(LocalVectorTimeSeries *u, GridObject *elem, const MathVector< dim > vCornerCoords[], bool bDeriv=false)
Definition: std_user_data.h:198
virtual void operator()(TData &value, const MathVector< dim > &globIP, number time, int si) const
returns value for a global position
Definition: std_user_data.h:142
virtual void compute(LocalVectorTimeSeries *u, GridObject *elem, const MathVector< dim > vCornerCoords[], bool bDeriv=false)
compute values (and derivatives iff compDeriv == true, but only for the 'current' time point)
Definition: std_user_data.h:237
virtual void operator()(TData vValue[], const MathVector< dim > vGlobIP[], number time, int si, const size_t nip) const
returns value for global positions
Definition: std_user_data.h:150
StdDependentUserData(const char *symbFct)
Definition: std_user_data.h:137
void evaluate(TData vValue[], const MathVector< dim > vGlobIP[], number time, int si, GridObject *elem, const MathVector< dim > vCornerCoords[], const MathVector< refDim > vLocIP[], const size_t nip, LocalVector *u, const MathMatrix< refDim, dim > *vJT=NULL) const
Definition: std_user_data.h:159
StdDependentUserData(const std::vector< std::string > &symbFct)
Definition: std_user_data.h:139
StdDependentUserData(const std::string &symbFct)
Definition: std_user_data.h:138
StdDependentUserData()
Definition: std_user_data.h:135
TImpl & getImpl()
access to implementation
Definition: std_user_data.h:253
virtual void compute(LocalVector *u, GridObject *elem, const MathVector< dim > vCornerCoords[], bool bDeriv=false)
compute values (and derivatives iff compDeriv == true)
Definition: std_user_data.h:221
const TImpl & getImpl() const
const access to implementation
Definition: std_user_data.h:256
Definition: std_user_data.h:63
virtual void operator()(TData vValue[], const MathVector< dim > vGlobIP[], number time, int si, GridObject *elem, const MathVector< dim > vCornerCoords[], const MathVector< 1 > vLocIP[], const size_t nip, LocalVector *u, const MathMatrix< 1, dim > *vJT=NULL) const
Definition: std_user_data.h:77
virtual TRet operator()(TData &value, const MathVector< dim > &globIP, number time, int si) const =0
returns value for a global position
virtual void operator()(TData vValue[], const MathVector< dim > vGlobIP[], number time, int si, GridObject *elem, const MathVector< dim > vCornerCoords[], const MathVector< 2 > vLocIP[], const size_t nip, LocalVector *u, const MathMatrix< 2, dim > *vJT=NULL) const
Definition: std_user_data.h:91
const TImpl & getImpl() const
const access to implementation
Definition: std_user_data.h:125
virtual void operator()(TData vValue[], const MathVector< dim > vGlobIP[], number time, int si, const size_t nip) const =0
returns value for global positions
virtual void operator()(TData vValue[], const MathVector< dim > vGlobIP[], number time, int si, GridObject *elem, const MathVector< dim > vCornerCoords[], const MathVector< 3 > vLocIP[], const size_t nip, LocalVector *u, const MathMatrix< 3, dim > *vJT=NULL) const
Definition: std_user_data.h:105
TImpl & getImpl()
access to implementation
Definition: std_user_data.h:122
#define UG_ASSERT(expr, msg)
Definition: assert.h:70
#define UG_THROW(msg)
Definition: error.h:57
double number
Definition: types.h:124