33 #ifndef __H__UG__LIB_DISC__SPATIAL_DISC__USER_DATA__USER_DATA__
34 #define __H__UG__LIB_DISC__SPATIAL_DISC__USER_DATA__USER_DATA__
57 virtual std::string
type()
const = 0;
91 UG_LOG (
"Warning: Replacing existing UserData object name '" <<
m_objName.
get() <<
"' with '" <<
name <<
"'.\n");
92 const size_t name_len = strnlen (
name, 128);
94 memcpy (new_name.
get(),
name, name_len); (new_name.
get()) [name_len] =
'\0';
120 template <
typename TData>
124 template <std::
size_t dim>
126 template <std::
size_t dim>
128 template <std::
size_t dim>
141 template <
typename TData,
int dim,
typename TRet =
void>
164 number time,
int si)
const = 0;
169 number time,
int si,
const size_t nip)
const = 0;
190 operator()(&value, &globIP, time, si, elem, vCornerCoords, &locIP, 1, u);
200 operator()(&value, &globIP, time, si, elem, vCornerCoords, &locIP, 1, u);
210 operator()(&value, &globIP, time, si, elem, vCornerCoords, &locIP, 1, u);
301 bool bDeriv =
false) = 0;
307 bool bDeriv =
false) = 0;
341 const int timePointSpec,
342 bool bMayChange =
true);
348 bool bMayChange =
true)
350 return this->
template register_local_ip_series<ldim> (vPos, numIP, -1, bMayChange);
369 void set_time_point(
const size_t seriesId,
const int timePointSpec);
434 inline void check_s(
size_t s)
const;
487 template <
typename TData,
int dim>
class DataImport;
499 template <
typename TData,
int dim,
typename TRet =
void>
595 template <
typename TData,
int dim>
627 const TData&
deriv(
size_t s,
size_t ip,
size_t fct,
size_t dof)
const
631 TData&
deriv(
size_t s,
size_t ip,
size_t fct,
size_t dof)
639 const TData*
deriv(
size_t s,
size_t ip,
size_t fct)
const
643 static void set_zero(std::vector<std::vector<TData> > vvvDeriv[],
const size_t nip);
704 std::vector<std::vector<std::vector<std::vector<TData> > > >
m_vvvvDeriv;
location name
Definition: checkpoint_util.lua:128
Definition: smart_pointer.h:296
T * get()
returns encapsulated pointer
Definition: smart_pointer.h:197
bool valid() const
returns true if the pointer is valid, false if not.
Definition: smart_pointer.h:206
Type based UserData.
Definition: user_data.h:501
void check_series(size_t s) const
checks in debug mode the correct index
Definition: user_data_impl.h:308
void register_storage_callback(DataImport< TData, dim > *obj, void(DataImport< TData, dim >::*func)())
register external callback, invoked when data storage changed
Definition: user_data_impl.h:273
const TData * values(size_t s) const
returns all values for a series
Definition: user_data.h:516
std::vector< std::vector< bool > > m_vvBoolFlag
bool flag at ip (size: (0,...num_series-1) x (0,...,num_ip-1))
Definition: user_data.h:577
TData & value(size_t s, size_t ip)
returns the value at ip
Definition: user_data.h:525
ICplUserData< dim > base_type
type of base class
Definition: user_data.h:504
std::vector< std::pair< DataImport< TData, dim > *, CallbackFct > > m_vCallback
Definition: user_data.h:582
void call_storage_callback() const
calls are registered external storage callbacks
Definition: user_data_impl.h:296
void check_series_ip(size_t s, size_t ip) const
checks in debug mode the correct index
Definition: user_data_impl.h:315
virtual void local_ip_series_added(const size_t seriesID)
resizes the data field, when local ip changed signaled
Definition: user_data_impl.h:323
std::vector< std::vector< TData > > m_vvValue
data at ip (size: (0,...num_series-1) x (0,...,num_ip-1))
Definition: user_data.h:574
virtual void local_ip_series_to_be_cleared()
free the data field memory and set series to zero
Definition: user_data_impl.h:349
bool defined(size_t s, size_t ip) const
returns flag, if data is evaluated (for conditional data)
Definition: user_data.h:538
void unregister_storage_callback(DataImport< TData, dim > *obj)
register all callbacks registered by class
Definition: user_data_impl.h:282
boost::function< void()> CallbackFct
registered callbacks
Definition: user_data.h:581
TData * values(size_t s)
returns all values for a series
Definition: user_data.h:529
size_t num_ip(size_t s) const
returns the number of integration points
Definition: user_data.h:327
virtual void value_storage_changed(const size_t seriesID)
callback, invoked when storage of data has changed for a series
Definition: user_data.h:567
~CplUserData()
destructor
Definition: user_data.h:542
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
virtual void local_ips_changed(const size_t seriesID, const size_t newNumIP)
implement callback, called when local IPs changed
Definition: user_data_impl.h:361
Data import.
Definition: data_import.h:180
Dependent UserData.
Definition: user_data.h:597
TData * deriv(size_t s, size_t ip, size_t fct)
returns the derivatives of the local function, at ip
Definition: user_data.h:635
std::vector< std::vector< std::vector< std::vector< TData > > > > m_vvvvDeriv
Derivatives.
Definition: user_data.h:704
void resize_deriv_array()
resizes the derivative arrays for current number of ips.
Definition: user_data_impl.h:466
const TData * deriv(size_t s, size_t ip, size_t fct) const
returns the derivatives of the local function, at ip
Definition: user_data.h:639
std::vector< std::string > m_SymbFct
string of symbolic functions required
Definition: user_data.h:671
std::vector< size_t > m_vvNumDoFPerFct
number of functions and their dofs
Definition: user_data.h:700
virtual bool zero_derivative() const
returns that data depends on solution
Definition: user_data.h:647
DependentUserData(const std::string &symbFct)
Definition: user_data.h:614
virtual void local_ip_series_to_be_cleared()
implement callback, invoked when local ips are cleared
Definition: user_data_impl.h:535
TData & deriv(size_t s, size_t ip, size_t fct, size_t dof)
returns the derivative of the local function, at ip and for a dof
Definition: user_data.h:631
void extract_fct_grp()
extracts the function group
Definition: user_data_impl.h:410
virtual void local_ip_series_added(const size_t seriesID)
resizes the derivative field when local ip change is signaled
Definition: user_data_impl.h:525
const TData & deriv(size_t s, size_t ip, size_t fct, size_t dof) const
returns the derivative of the local function, at ip and for a dof
Definition: user_data.h:627
void check_s_ip_fct(size_t s, size_t ip, size_t fct) const
checks in debug mode the correct usage of indices
Definition: user_data_impl.h:511
static void set_zero(std::vector< std::vector< TData > > vvvDeriv[], const size_t nip)
sets all derivative values to zero
Definition: user_data_impl.h:491
DependentUserData(const std::vector< std::string > &symbFct)
Definition: user_data.h:615
size_t num_sh(size_t fct) const
number of shapes for local function
Definition: user_data.h:620
DependentUserData()
default constructor
Definition: user_data.h:609
DependentUserData(const char *symbFct)
Definition: user_data.h:613
CplUserData< TData, dim > base_type
Base class type.
Definition: user_data.h:600
virtual void set_function_pattern(ConstSmartPtr< FunctionPattern > fctPatt)
sets the associated function pattern
Definition: user_data_impl.h:384
virtual void update_dof_sizes(const LocalIndices &ind)
resize lin defect arrays
Definition: user_data_impl.h:451
void check_s_ip_fct_dof(size_t s, size_t ip, size_t fct, size_t dof) const
checks in debug mode the correct usage of indices
Definition: user_data_impl.h:518
void check_s_ip(size_t s, size_t ip) const
checks in debug mode the correct usage of indices
Definition: user_data_impl.h:502
virtual void local_ips_changed(const size_t seriesID, const size_t newNumIP)
implement callback, called when local IPs changed
Definition: user_data_impl.h:545
void set_functions(const char *symbFct)
Definition: user_data_impl.h:391
virtual bool requires_grid_fct() const
returns if grid function is needed for evaluation
Definition: user_data.h:650
Definition: function_group.h:52
void set_function_pattern(ConstSmartPtr< FunctionPattern > spFuncPattern)
set underlying function pattern
Definition: function_group.cpp:72
describes a mapping between two local index sets
Definition: function_group.h:186
size_t num_fct() const
returns the number of indices that are mapped
Definition: function_group.h:195
The base class for all geometric objects, such as vertices, edges, faces, volumes,...
Definition: grid_base_objects.h:157
Base class for UserData.
Definition: user_data.h:260
const MathVector< dim > & ip(size_t s, size_t ip) const
returns global ip
Definition: user_data.h:401
int dim_local_ips() const
returns current local ip dimension
Definition: user_data.h:372
std::vector< const MathVector< 2 > * > m_pvLocIP2d
Definition: user_data.h:460
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
ICplUserData()
default constructor
Definition: user_data_impl.h:46
void check_s(size_t s) const
checks in debug mode the correct usage of indices
Definition: user_data_impl.h:253
std::vector< const MathVector< dim > * > m_vvGlobPos
global ips
Definition: user_data.h:467
void set_subset(int si)
set the subset of evaluation
Definition: user_data.h:270
const MathVector< ldim > * local_ips(size_t s) const
returns local ips
Definition: user_data_impl.h:176
void clear()
clear all data
Definition: user_data_impl.h:57
virtual bool constant() const
returns if data is constant
Definition: user_data.h:289
size_t register_local_ip_series(const MathVector< ldim > *vPos, const size_t numIP, bool bMayChange=true)
set local positions without the specification of the time point, returns series id
Definition: user_data.h:346
virtual void compute(LocalVectorTimeSeries *u, GridObject *elem, const MathVector< dim > vCornerCoords[], bool bDeriv=false)=0
compute values (and derivatives iff compDeriv == true, but only for the 'current' time point)
int subset() const
returns the subset of evaluation
Definition: user_data.h:273
std::vector< int > m_vTimePoint
time points for the series
Definition: user_data.h:464
virtual void local_ip_series_to_be_cleared()
callback invoked, when local ips are cleared
Definition: user_data.h:423
void set_local_ips(const size_t seriesId, const MathVector< ldim > *vPos, const size_t numIP)
sets new local ip positions for a local ip series
Definition: user_data_impl.h:119
void set_time_point(size_t timePoint)
sets the current time point
Definition: user_data.h:279
int m_si
subset for evaluation
Definition: user_data.h:479
size_t time_point()
returns the current time point
Definition: user_data.h:282
number time(size_t s) const
get the specified evaluation time
Definition: user_data.h:389
std::vector< const MathVector< 1 > * > m_pvLocIP1d
local ips of dimension 1d-3d
Definition: user_data.h:459
std::vector< const MathVector< 3 > * > m_pvLocIP3d
Definition: user_data.h:461
number time() const
get the current evaluation time
Definition: user_data.h:285
virtual size_t num_needed_data() const
number of other Data this data depends on
Definition: user_data.h:292
virtual void local_ips_changed(const size_t seriesID, const size_t newNumIP)=0
callback invoked, if a local ip series has been changed
size_t m_timePoint
current time point (used if no explicit specification for series)
Definition: user_data.h:473
void check_s_ip(size_t s, size_t ip) const
checks in debug mode the correct usage of indices
Definition: user_data_impl.h:260
virtual void update_dof_sizes(const LocalIndices &ind)
resize arrays
Definition: user_data.h:320
virtual ~ICplUserData()
virtual desctructor
Definition: user_data.h:313
const std::vector< const MathVector< 2 > * > & get_local_ips(Int2Type< 2 >) const
Definition: user_data.h:445
virtual void compute(LocalVector *u, GridObject *elem, const MathVector< dim > vCornerCoords[], bool bDeriv=false)=0
compute values (and derivatives iff compDeriv == true)
std::vector< size_t > m_vNumIP
number of evaluation points (-1 indicates no ips set)
Definition: user_data.h:453
std::vector< number > m_vTime
time for evaluation
Definition: user_data.h:470
std::vector< const MathVector< 3 > * > & get_local_ips(Int2Type< 3 >)
Definition: user_data.h:443
std::vector< const MathVector< 1 > * > & get_local_ips(Int2Type< 1 >)
help function to get local ips
Definition: user_data.h:441
virtual SmartPtr< ICplUserData > needed_data(size_t i)
return needed data
Definition: user_data.h:295
size_t num_ip(size_t s) const
returns the number of integration points
Definition: user_data.h:327
const MathVector< dim > * ips(size_t s) const
returns global ips
Definition: user_data.h:398
virtual void global_ips_changed(const size_t seriesID, const MathVector< dim > *vPos, const size_t numIP)
callback invoked after global ips have been changed
Definition: user_data.h:431
const std::vector< const MathVector< 1 > * > & get_local_ips(Int2Type< 1 >) const
Definition: user_data.h:444
int m_defaultTimePoint
default time point (or -1 if not specified)
Definition: user_data.h:476
virtual void local_ip_series_added(const size_t seriesID)
callback invoked after local ips have been added to the series
Definition: user_data.h:417
size_t register_local_ip_series(const MathVector< ldim > *vPos, const size_t numIP, const int timePointSpec, bool bMayChange=true)
set local positions, returns series id
Definition: user_data_impl.h:71
size_t num_series() const
returns the number of ip series
Definition: user_data.h:324
int m_locPosDim
dimension of local position (-1 indicates no dim set)
Definition: user_data.h:456
void set_global_ips(size_t s, const MathVector< dim > *vPos, size_t numIP)
set global positions
Definition: user_data_impl.h:232
int time_point_specification(size_t s) const
returns the time point specification (note: it may be -1, i.e. not specified)
Definition: user_data_impl.h:201
virtual bool zero_derivative() const
returns if data depends on solution
Definition: user_data.h:317
const MathVector< ldim > & local_ip(size_t s, size_t ip) const
returns local ip
Definition: user_data_impl.h:189
void set_times(const std::vector< number > &vTime)
set evaluation time
Definition: user_data.h:276
std::vector< const MathVector< 2 > * > & get_local_ips(Int2Type< 2 >)
Definition: user_data.h:442
std::vector< bool > m_vMayChange
flags if local ips may change
Definition: user_data.h:450
virtual void check_setup() const
returns if the dependent data is ready for evaluation
Definition: user_data.h:310
const std::vector< const MathVector< 3 > * > & get_local_ips(Int2Type< 3 >) const
Definition: user_data.h:446
Definition: local_algebra.h:50
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
a mathematical Tensor of rank TRank and N entries.
Definition: math_tensor.h:56
a mathematical Vector with N entries.
Definition: math_vector.h:97
Type based UserData.
Definition: user_data.h:143
TRet return_type
Definition: user_data.h:146
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 =0
std::string type() const
returns type of data as string (e.g. "Number", "Vector", "Matrix")
Definition: user_data.h:152
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 =0
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 =0
virtual bool requires_grid_fct() const =0
returns if grid function is needed for evaluation
virtual bool continuous() const =0
returns if provided data is continuous over geometric object boundaries
TData data_type
Definition: user_data.h:145
virtual void operator()(TData vValue[], const MathVector< dim > vGlobIP[], number time, int si, const size_t nip) const =0
returns values for global positions
int get_dim() const
returns dimension
Definition: user_data.h:149
virtual TRet operator()(TData &value, const MathVector< dim > &globIP, number time, int si) const =0
returns value for a global position
base class providing runtime-info on dimension and type
Definition: user_data.h:51
virtual std::string type() const =0
returns type of data as string (e.g. "Number", "Vector", "Matrix")
virtual int get_dim() const =0
returns dimension
const FunctionGroup & function_group() const
Function Group of functions.
Definition: user_data.h:75
const char * obj_name()
gets the name of the object (s. the field m_objName)
Definition: user_data.h:102
virtual bool requires_grid_fct() const =0
returns if grid function is needed for evaluation
FunctionIndexMapping m_map
Mapping for import fct.
Definition: user_data.h:109
const FunctionIndexMapping & map() const
get function mapping
Definition: user_data.h:78
FunctionGroup m_fctGrp
functions the data depends on
Definition: user_data.h:106
virtual bool continuous() const =0
returns if provided data is continuous over geometric object boundaries
virtual ~UserDataInfo()
virtual destructor
Definition: user_data.h:63
void set_obj_name(const char *name)
sets the name of the object (s. the field m_objName)
Definition: user_data.h:87
size_t num_fct() const
number of functions this export depends on
Definition: user_data.h:81
virtual void set_function_pattern(ConstSmartPtr< FunctionPattern > fctPatt)
sets the function pattern for a possibly needed grid function
Definition: user_data.h:70
SmartPtr< char > m_objName
This field is used mainly for debugging: One can assign a name to the object to identify it when runn...
Definition: user_data.h:112
Base-class for all vertex-types.
Definition: grid_base_objects.h:231
const NullSmartPtr SPNULL
The equivalent to NULL for smart pointers.
Definition: smart_pointer.h:90
#define UG_ASSERT(expr, msg)
Definition: assert.h:70
#define UG_LOG(msg)
Definition: log.h:367
double number
Definition: types.h:124
function func(x, y, z, t, si)
Definition: metaprogramming_util.h:42
static std::string name()
Definition: user_data.h:127
static std::string name()
Definition: user_data.h:129
static std::string name()
Definition: user_data.h:125
static std::string name()
Definition: user_data.h:123
Definition: user_data.h:121
static std::string name()
Definition: user_data.h:121