33 #ifndef __LIB_DISC__COMPOSITE_USER_DATA_H_
34 #define __LIB_DISC__COMPOSITE_USER_DATA_H_
50 template <
typename TData,
int dim,
typename TRet =
void>
72 UG_ASSERT (si >= 0,
"CompositeUserData: Non-existing subset index!");
74 if ((
size_t) si >=
m_vData.size ())
90 for (
size_t i = 0; i < ssg.
size (); i++)
add (ssg[i], ref);
97 const char * ss_names,
101 std::vector<std::string> v_ss_names;
105 ssg.
add (v_ss_names);
110 bool has(
int si)
const {
return si >= 0 && (size_t) si <
m_vData.size () &&
m_vData[si].valid ();}
131 number time,
int si)
const
132 {
check (si);
return (*
m_vData[si]) (value, globIP, time, si); }
137 number time,
int si,
const size_t nip)
const
138 {
check (si);
return (*
m_vData[si]) (vValue, vGlobIP, time, si, nip); }
151 check (si);
return (*
m_vData[si]) (vValue, vGlobIP, time, si, elem, vCornerCoords, vLocIP, nip, u, vJT);
164 check (si);
return (*
m_vData[si]) (vValue, vGlobIP, time, si, elem, vCornerCoords, vLocIP, nip, u, vJT);
177 check (si);
return (*
m_vData[si]) (vValue, vGlobIP, time, si, elem, vCornerCoords, vLocIP, nip, u, vJT);
187 UG_THROW (
"CompositeUserData: No data for subset " << si);
Definition: smart_pointer.h:296
Definition: smart_pointer.h:108
This is a compositum for user data defined on different subsets.
Definition: composite_user_data.h:52
virtual TRet operator()(TData &value, const MathVector< dim > &globIP, number time, int si) const
returns value for a global position
Definition: composite_user_data.h:129
CompositeUserData()
Definition: composite_user_data.h:59
SmartPtr< TCplUserData > get_coupled(int si)
Definition: composite_user_data.h:116
UserData< TData, dim, TRet > base_type
Definition: composite_user_data.h:56
void add(const SubsetGroup &ssg, SmartPtr< base_type > ref)
Add 'UserData' object for all subsets in a given group.
Definition: composite_user_data.h:85
virtual ~CompositeUserData()
Definition: composite_user_data.h:63
void check(int si) const
Definition: composite_user_data.h:183
void add(ConstSmartPtr< ISubsetHandler > ssh, const char *ss_names, SmartPtr< base_type > ref)
Add 'UserData' object for all subsets by their names.
Definition: composite_user_data.h:95
virtual void operator()(TData vValue[], const MathVector< dim > vGlobIP[], number time, int si, const size_t nip) const
returns values for global positions
Definition: composite_user_data.h:135
virtual bool continuous() const
returns if provided data is continuous over geometric object boundaries
Definition: composite_user_data.h:120
virtual bool requires_grid_fct() const
returns true, if at least one of the underlying UserData requires grid functions.
Definition: composite_user_data.h:123
bool is_coupled(int si)
Definition: composite_user_data.h:114
bool m_bRequiresGridFunction
Definition: composite_user_data.h:195
CompositeUserData(bool continuous)
Definition: composite_user_data.h:61
SmartPtr< base_type > get(int si) const
Definition: composite_user_data.h:112
bool m_bContinuous
Definition: composite_user_data.h:194
std::vector< SmartPtr< base_type > > m_vData
Definition: composite_user_data.h:193
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: composite_user_data.h:167
bool has(int si) const
Checks if anything is assigned to a given subset index.
Definition: composite_user_data.h:110
CplUserData< TData, dim, TRet > TCplUserData
Definition: composite_user_data.h:54
void add(int si, SmartPtr< base_type > ref)
Add 'UserData' object for given subset index.
Definition: composite_user_data.h:67
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: composite_user_data.h:141
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: composite_user_data.h:154
SmartPtr< base_type > ref_type
the attached UserData objects should have the same type as this class (i.e. they are "remapped")
Definition: composite_user_data.h:57
Type based UserData.
Definition: user_data.h:501
The base class for all geometric objects, such as vertices, edges, faces, volumes,...
Definition: grid_base_objects.h:157
Definition: local_algebra.h:198
A class for fixed size, dense matrices.
Definition: math_matrix.h:52
Group of subsets.
Definition: subset_group.h:51
size_t size() const
number of subsets in this group
Definition: subset_group.h:122
void add(int si)
adds a subset by number to this group
Definition: subset_group.cpp:64
Type based UserData.
Definition: user_data.h:143
#define UG_ASSERT(expr, msg)
Definition: assert.h:70
#define UG_THROW(msg)
Definition: error.h:57
double number
Definition: types.h:124
void TokenizeTrimString(const string &str, vector< string > &vToken, const char delimiter)
Definition: string_util.cpp:83