36 #ifndef __H__UG__LIB_DISC__SPATIAL_DISC__USER_DATA__SSIND_USER_DATA__
37 #define __H__UG__LIB_DISC__SPATIAL_DISC__USER_DATA__SSIND_USER_DATA__
56 template <
typename TDomain>
58 :
public StdUserData<SubsetIndicatorUserData<TDomain>, number, TDomain::dim, void, UserData<number, TDomain::dim, void> >
82 :
m_ssGrp (domain->subset_handler ())
85 std::vector<std::string> vssNames;
89 for (
size_t k = 0; k < vssNames.size (); k++)
93 }
UG_CATCH_THROW (
"SubsetIndicatorUserData: Failed to parse subset names.");
103 template <
int refDim>
123 for (
size_t i = 0; i < nip; i++)
124 vValue [i] = indicator;
154 for (
size_t i = 0; i < nip; i++)
155 vValue [i] = indicator;
164 template <
typename TDomain>
166 :
public StdUserData<ValueIndicatorUserData<TDomain>, number, TDomain::dim, void, UserData<number, TDomain::dim, void> >
198 UG_THROW (
"ValueIndicatorUserData: No userdata specified!");
208 template <
int refDim>
224 (* m_spData) (vValue, vGlobIP, time, si, elem, vCornerCoords, vLocIP, nip, u, vJT);
241 (* m_spData) (vValue, globIP, time, si);
258 (* m_spData) (vValue, vGlobIP, time, si, nip);
269 for (
size_t i = 0; i < nip; i++)
270 if (vValue[i] >=
m_threshold) vValue[i] = 1;
else vValue[i] = 0;
272 for (
size_t i = 0; i < nip; i++)
273 if (vValue[i] <=
m_threshold) vValue[i] = 1;
else vValue[i] = 0;
Definition: smart_pointer.h:108
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
Definition: std_user_data.h:63
Group of subsets.
Definition: subset_group.h:51
void clear()
clear all subsets
Definition: subset_group.h:116
ConstSmartPtr< ISubsetHandler > subset_handler() const
get underlying subset handler
Definition: subset_group.h:72
void add(int si)
adds a subset by number to this group
Definition: subset_group.cpp:64
bool contains(int si) const
returns true if subset is contained in this group
Definition: subset_group.cpp:272
User data of a subset indicator (1 in the subset, 0 everywhere else)
Definition: subset_indicator_user_data.h:59
static const int dim
World dimension.
Definition: subset_indicator_user_data.h:65
TDomain domain_type
Type of domain.
Definition: subset_indicator_user_data.h:62
SubsetGroup m_ssGrp
subset group representing the specified subdomain
Definition: subset_indicator_user_data.h:72
virtual bool continuous() const
Indicator functions are discontinuous.
Definition: subset_indicator_user_data.h:97
domain_type::subset_handler_type subset_handler_type
subset handler type
Definition: subset_indicator_user_data.h:68
SubsetIndicatorUserData(ConstSmartPtr< domain_type > domain, const char *ss_names)
Constructor.
Definition: subset_indicator_user_data.h:78
virtual bool requires_grid_fct() const
Returns true to get the grid element in the evaluation routine.
Definition: subset_indicator_user_data.h:100
void evaluate(number 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
Evaluator.
Definition: subset_indicator_user_data.h:105
Type based UserData.
Definition: user_data.h:143
"Heaviside step function" based on the value of values of a further userdata
Definition: subset_indicator_user_data.h:167
SmartPtr< UserData< number, dim, void > > m_spData
the original data
Definition: subset_indicator_user_data.h:178
TDomain domain_type
the domain type
Definition: subset_indicator_user_data.h:172
void reset_values(number vValue[], const size_t nip) const
Definition: subset_indicator_user_data.h:266
TDomain::grid_type grid_type
the grid type
Definition: subset_indicator_user_data.h:175
virtual bool requires_grid_fct() const
Returns true to get the grid element in the evaluation routine.
Definition: subset_indicator_user_data.h:205
bool m_greater
if less or greater
Definition: subset_indicator_user_data.h:184
ValueIndicatorUserData(SmartPtr< UserData< number, dim, void > > spData, number threshold, bool greater)
constructor
Definition: subset_indicator_user_data.h:190
number m_threshold
the threshold value
Definition: subset_indicator_user_data.h:181
static const int dim
the world dimension
Definition: subset_indicator_user_data.h:169
virtual bool continuous() const
Indicator functions are discontinuous.
Definition: subset_indicator_user_data.h:202
void evaluate(number 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
Evaluator.
Definition: subset_indicator_user_data.h:210
void RemoveWhitespaceFromString(std::string &str)
removes all white space from a string, also within the string
Definition: string_util.cpp:50
#define UG_CATCH_THROW(msg)
Definition: error.h:64
#define UG_THROW(msg)
Definition: error.h:57
double number
Definition: types.h:124
void TokenizeString(const string &str, vector< string > &vToken, const char delimiter)
Definition: string_util.cpp:56