33 #ifndef __H__UG__LIB_DISC__SPATIAL_DISC__USER_DATA__CONST_USER_DATA__
34 #define __H__UG__LIB_DISC__SPATIAL_DISC__USER_DATA__CONST_USER_DATA__
56 template <
typename TImpl,
typename TData,
int dim>
58 :
public StdUserData<StdConstData<TImpl,TData,dim>, TData, dim>
72 for(
size_t ip = 0;
ip < nip; ++
ip)
87 for(
size_t ip = 0;
ip < nip; ++
ip)
127 TImpl&
getImpl() {
return static_cast<TImpl&
>(*this);}
130 const TImpl&
getImpl()
const {
return static_cast<const TImpl&
>(*this);}
152 :
public StdConstData<ConstUserNumber<dim>, number, dim>
184 template <
int dim,
int worldDim = dim>
186 :
public StdConstData<ConstUserVector<dim, worldDim>, MathVector<dim>, worldDim>
207 if(val.size() !=
dim)
UG_THROW(
"Size mismatch in ConstUserVector");
208 for(
size_t i = 0; i <
dim; i++)
m_Vector[i] = val[i];
229 template <
int N,
int M = N,
int worldDim = N>
231 :
public StdConstData<ConstUserMatrix<N, M, worldDim>, MathMatrix<N, M>, worldDim>
243 for(
size_t i = 0; i < N; ++i){
244 for(
size_t j = 0; j < M; ++j){
254 for(
size_t i = 0; i < N; ++i){
255 for(
size_t j = 0; j < M; ++j){
275 template <
int TRank,
int dim>
277 :
public StdConstData<ConstUserTensor<TRank,dim>, MathTensor<TRank, dim>, dim>
300 template <
typename TData,
int dim>
309 template <
int dim,
int worldDim=dim>
Definition: smart_pointer.h:108
constant matrix user data
Definition: const_user_data.h:232
ConstUserMatrix()
Constructor.
Definition: const_user_data.h:235
void set_all_entries(number val)
sets all entries of the matrix
Definition: const_user_data.h:252
void set_entry(size_t i, size_t j, number val)
sets a single entry
Definition: const_user_data.h:262
void evaluate(MathMatrix< N, M > &value) const
evaluate
Definition: const_user_data.h:268
ConstUserMatrix(number val)
Constructor setting the diagonal.
Definition: const_user_data.h:238
void set_diag_tensor(number val)
set diagonal of matrix to a vector
Definition: const_user_data.h:241
void print() const
print current setting
Definition: const_user_data.h:265
MathMatrix< N, M > m_Tensor
Definition: const_user_data.h:271
constant scalar user data
Definition: const_user_data.h:153
void evaluate(number &value) const
evaluate
Definition: const_user_data.h:168
ConstUserNumber()
creates empty user number
Definition: const_user_data.h:156
ConstUserNumber(number val)
creates user number with value
Definition: const_user_data.h:159
void set(number val)
set constant value
Definition: const_user_data.h:162
number get() const
get value
Definition: const_user_data.h:171
number m_Number
Definition: const_user_data.h:174
void print() const
print current setting
Definition: const_user_data.h:165
constant tensor user data
Definition: const_user_data.h:278
void print() const
print current setting
Definition: const_user_data.h:290
void evaluate(MathTensor< TRank, dim > &value) const
evaluate
Definition: const_user_data.h:293
ConstUserTensor(number val)
Constructor setting the diagonal.
Definition: const_user_data.h:284
ConstUserTensor()
Constructor.
Definition: const_user_data.h:281
MathTensor< TRank, dim > m_Tensor
Definition: const_user_data.h:296
void set(number val)
set diagonal of matrix to a vector
Definition: const_user_data.h:287
constant vector user data
Definition: const_user_data.h:187
void print() const
print current setting
Definition: const_user_data.h:212
void set_entry(size_t i, number val)
set i'th vector entry
Definition: const_user_data.h:202
void evaluate(MathVector< dim > &value) const
evaluate
Definition: const_user_data.h:215
void set_all_entries(number val)
set all vector entries
Definition: const_user_data.h:199
ConstUserVector()
Constructor: no arguments, zero entries.
Definition: const_user_data.h:190
MathVector< dim > m_Vector
Definition: const_user_data.h:218
void set_vector(const std::vector< number > &val)
set from a given vector:
Definition: const_user_data.h:205
ConstUserVector(const std::vector< number > &val)
Constructor: initialize with a given std::vector.
Definition: const_user_data.h:196
ConstUserVector(number val)
Constructor: set all the entries to the given value.
Definition: const_user_data.h:193
size_t num_ip(size_t s) const
returns the number of integration points
Definition: user_data.h:327
size_t num_series() const
explicitly forward some functions
Definition: user_data.h:324
const TData & value(size_t s, size_t ip) const
returns the value at ip
Definition: user_data.h:512
The base class for all geometric objects, such as vertices, edges, faces, volumes,...
Definition: grid_base_objects.h:157
const MathVector< dim > & ip(size_t s, size_t ip) const
returns global ip
Definition: user_data.h:401
number time() const
get the current evaluation time
Definition: user_data.h:285
Definition: local_algebra.h:198
time series of local vectors
Definition: solution_time_series.h:167
A class for fixed size, dense matrices.
Definition: math_matrix.h:52
void set(T val)
Definition: math_tensor.h:86
Definition: const_user_data.h:59
virtual void compute(LocalVector *u, GridObject *elem, const MathVector< dim > vCornerCoords[], bool bDeriv=false)
implement as a UserData
Definition: const_user_data.h:92
virtual bool requires_grid_fct() const
returns if grid function is needed for evaluation
Definition: const_user_data.h:120
virtual bool continuous() const
returns if provided data is continuous over geometric object boundaries
Definition: const_user_data.h:123
virtual void value_storage_changed(const size_t seriesID)
callback, invoked when data storage changed
Definition: const_user_data.h:110
const TImpl & getImpl() const
const access to implementation
Definition: const_user_data.h:130
virtual void operator()(TData &value, const MathVector< dim > &globIP, number time, int si) const
returns value for a global position
Definition: const_user_data.h:61
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: const_user_data.h:77
virtual void compute(LocalVectorTimeSeries *u, GridObject *elem, const MathVector< dim > vCornerCoords[], bool bDeriv=false)
implement as a UserData
Definition: const_user_data.h:101
virtual bool constant() const
returns if data is constant
Definition: const_user_data.h:117
TImpl & getImpl()
access to implementation
Definition: const_user_data.h:127
virtual void operator()(TData vValue[], const MathVector< dim > vGlobIP[], number time, int si, const size_t nip) const
returns value for global positions
Definition: const_user_data.h:68
Definition: std_user_data.h:63
SmartPtr< CplUserData< TData, dim > > CreateConstUserData(number val, TData dummy)
creates user data of desired type
#define UG_THROW(msg)
Definition: error.h:57
#define UG_LOG(msg)
Definition: log.h:367
double number
Definition: types.h:124
SmartPtr< T, FreePolicy > make_sp(T *inst)
returns a SmartPtr for the passed raw pointer
Definition: smart_pointer.h:836