Loading [MathJax]/extensions/tex2jax.js
ug4
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ug::DependentUserData< TData, dim > Class Template Reference

Dependent UserData. More...

#include <user_data.h>

+ Inheritance diagram for ug::DependentUserData< TData, dim >:

Public Types

typedef CplUserData< TData, dim > base_type
 Base class type.
 
- Public Types inherited from ug::CplUserData< TData, dim, TRet >
typedef ICplUserData< dim > base_type
 type of base class
 
- Public Types inherited from ug::UserData< TData, dim, TRet >
typedef TData data_type
 
typedef TRet return_type
 

Public Member Functions

 DependentUserData ()
 default constructor
 
TData * deriv (size_t s, size_t ip, size_t fct)
 returns the derivatives of the local function, at ip
 
const TData * deriv (size_t s, size_t ip, size_t fct) const
 returns the derivatives of the local function, at ip
 
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
 
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
 
size_t num_ip (size_t s) const
 returns the number of integration points
 
size_t num_series () const
 explicitly forward some functions
 
size_t num_sh (size_t fct) const
 number of shapes for local function
 
virtual bool requires_grid_fct () const
 returns if grid function is needed for evaluation
 
virtual void set_function_pattern (ConstSmartPtr< FunctionPattern > fctPatt)
 sets the associated function pattern
 
virtual void update_dof_sizes (const LocalIndices &ind)
 resize lin defect arrays
 
virtual bool zero_derivative () const
 returns that data depends on solution
 
 DependentUserData (const char *symbFct)
 
 DependentUserData (const std::string &symbFct)
 
 DependentUserData (const std::vector< std::string > &symbFct)
 
void set_functions (const char *symbFct)
 
void set_functions (const std::string &symbFct)
 
void set_functions (const std::vector< std::string > &symbFct)
 
- Public Member Functions inherited from ug::CplUserData< TData, dim, TRet >
bool defined (size_t s, size_t ip) const
 returns flag, if data is evaluated (for conditional data)
 
size_t num_ip (size_t s) const
 returns the number of integration points
 
size_t num_series () const
 explicitly forward some functions
 
void register_storage_callback (DataImport< TData, dim > *obj, void(DataImport< TData, dim >::*func)())
 register external callback, invoked when data storage changed
 
void unregister_storage_callback (DataImport< TData, dim > *obj)
 register all callbacks registered by class
 
TData & value (size_t s, size_t ip)
 returns the value at ip
 
const TData & value (size_t s, size_t ip) const
 returns the value at ip
 
TData * values (size_t s)
 returns all values for a series
 
const TData * values (size_t s) const
 returns all values for a series
 
 ~CplUserData ()
 destructor
 
- Public Member Functions inherited from ug::ICplUserData< dim >
bool at_current_time (size_t s) const
 returns true iff the time point specification is equal to the current one, or not specified
 
virtual void check_setup () const
 returns if the dependent data is ready for evaluation
 
void clear ()
 clear all data
 
virtual void compute (LocalVector *u, GridObject *elem, const MathVector< dim > vCornerCoords[], bool bDeriv=false)=0
 compute values (and derivatives iff compDeriv == true)
 
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)
 
virtual bool constant () const
 returns if data is constant
 
int dim_local_ips () const
 returns current local ip dimension
 
 ICplUserData ()
 default constructor
 
const MathVector< dim > & ip (size_t s, size_t ip) const
 returns global ip
 
const MathVector< dim > * ips (size_t s) const
 returns global ips
 
template<int ldim>
const MathVector< ldim > & local_ip (size_t s, size_t ip) const
 returns local ip
 
template<int ldim>
const MathVector< ldim > * local_ips (size_t s) const
 returns local ips
 
virtual SmartPtr< ICplUserDataneeded_data (size_t i)
 return needed data
 
size_t num_ip (size_t s) const
 returns the number of integration points
 
virtual size_t num_needed_data () const
 number of other Data this data depends on
 
size_t num_series () const
 returns the number of ip series
 
template<int ldim>
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
 
template<int ldim>
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
 
void set_global_ips (size_t s, const MathVector< dim > *vPos, size_t numIP)
 set global positions
 
template<int ldim>
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
 
void set_subset (int si)
 set the subset of evaluation
 
void set_time_point (const size_t seriesId, const int timePointSpec)
 sets a new time point for a local ip series
 
void set_time_point (size_t timePoint)
 sets the current time point
 
void set_times (const std::vector< number > &vTime)
 set evaluation time
 
int subset () const
 returns the subset of evaluation
 
number time () const
 get the current evaluation time
 
number time (size_t s) const
 get the specified evaluation time
 
size_t time_point ()
 returns the current time point
 
size_t time_point (size_t s) const
 returns the time point specification (in particular, the current one, if the own one not specified)
 
int time_point_specification (size_t s) const
 returns the time point specification (note: it may be -1, i.e. not specified)
 
virtual ~ICplUserData ()
 virtual desctructor
 
- Public Member Functions inherited from ug::UserDataInfo
const FunctionGroupfunction_group () const
 Function Group of functions.
 
const FunctionIndexMappingmap () const
 get function mapping
 
size_t num_fct () const
 number of functions this export depends on
 
const char * obj_name ()
 gets the name of the object (s. the field m_objName)
 
void set_obj_name (const char *name)
 sets the name of the object (s. the field m_objName)
 
virtual ~UserDataInfo ()
 virtual destructor
 
- Public Member Functions inherited from ug::UserData< TData, dim, TRet >
virtual bool continuous () const =0
 returns if provided data is continuous over geometric object boundaries
 
int get_dim () const
 returns dimension
 
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 &value, const MathVector< dim > &globIP, number time, int si, Vertex *vrt) const
 returns a value at a vertex
 
virtual void operator() (TData vValue[], const MathVector< dim > vGlobIP[], number time, int si, const size_t nip) const =0
 returns values for global positions
 
std::string type () const
 returns type of data as string (e.g. "Number", "Vector", "Matrix")
 
TRet operator() (TData &value, const MathVector< dim > &globIP, number time, int si, GridObject *elem, const MathVector< dim > vCornerCoords[], const MathVector< 1 > &locIP, LocalVector *u) const
 
TRet operator() (TData &value, const MathVector< dim > &globIP, number time, int si, GridObject *elem, const MathVector< dim > vCornerCoords[], const MathVector< 2 > &locIP, LocalVector *u) const
 
TRet operator() (TData &value, const MathVector< dim > &globIP, number time, int si, GridObject *elem, const MathVector< dim > vCornerCoords[], const MathVector< 3 > &locIP, LocalVector *u) const
 
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 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
 

Static Public Member Functions

static void set_zero (std::vector< std::vector< TData > > vvvDeriv[], const size_t nip)
 sets all derivative values to zero
 

Protected Member Functions

void check_s_ip (size_t s, size_t ip) const
 checks in debug mode the correct usage of indices
 
void check_s_ip_fct (size_t s, size_t ip, size_t fct) const
 checks in debug mode the correct usage of indices
 
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
 
void extract_fct_grp ()
 extracts the function group
 
virtual void local_ip_series_added (const size_t seriesID)
 resizes the derivative field when local ip change is signaled
 
virtual void local_ip_series_to_be_cleared ()
 implement callback, invoked when local ips are cleared
 
virtual void local_ips_changed (const size_t seriesID, const size_t newNumIP)
 implement callback, called when local IPs changed
 
void resize_deriv_array ()
 resizes the derivative arrays for current number of ips.
 
void resize_deriv_array (const size_t seriesID)
 resizes the derivative arrays for current number of ips of a single series
 
- Protected Member Functions inherited from ug::CplUserData< TData, dim, TRet >
void call_storage_callback () const
 calls are registered external storage callbacks
 
void check_series (size_t s) const
 checks in debug mode the correct index
 
void check_series_ip (size_t s, size_t ip) const
 checks in debug mode the correct index
 
virtual void value_storage_changed (const size_t seriesID)
 callback, invoked when storage of data has changed for a series
 
- Protected Member Functions inherited from ug::ICplUserData< dim >
void check_s (size_t s) const
 checks in debug mode the correct usage of indices
 
void check_s_ip (size_t s, size_t ip) const
 checks in debug mode the correct usage of indices
 
std::vector< const MathVector< 1 > * > & get_local_ips (Int2Type< 1 >)
 help function to get local ips
 
const std::vector< const MathVector< 1 > * > & get_local_ips (Int2Type< 1 >) const
 
std::vector< const MathVector< 2 > * > & get_local_ips (Int2Type< 2 >)
 
const std::vector< const MathVector< 2 > * > & get_local_ips (Int2Type< 2 >) const
 
std::vector< const MathVector< 3 > * > & get_local_ips (Int2Type< 3 >)
 
const std::vector< const MathVector< 3 > * > & get_local_ips (Int2Type< 3 >) const
 
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
 

Protected Attributes

std::vector< std::string > m_SymbFct
 string of symbolic functions required
 
std::vector< size_t > m_vvNumDoFPerFct
 number of functions and their dofs
 
std::vector< std::vector< std::vector< std::vector< TData > > > > m_vvvvDeriv
 Derivatives.
 
- Protected Attributes inherited from ug::ICplUserData< dim >
int m_defaultTimePoint
 default time point (or -1 if not specified)
 
int m_locPosDim
 dimension of local position (-1 indicates no dim set)
 
std::vector< const MathVector< 1 > * > m_pvLocIP1d
 local ips of dimension 1d-3d
 
std::vector< const MathVector< 2 > * > m_pvLocIP2d
 
std::vector< const MathVector< 3 > * > m_pvLocIP3d
 
int m_si
 subset for evaluation
 
size_t m_timePoint
 current time point (used if no explicit specification for series)
 
std::vector< bool > m_vMayChange
 flags if local ips may change
 
std::vector< size_t > m_vNumIP
 number of evaluation points (-1 indicates no ips set)
 
std::vector< numberm_vTime
 time for evaluation
 
std::vector< int > m_vTimePoint
 time points for the series
 
std::vector< const MathVector< dim > * > m_vvGlobPos
 global ips
 
- Protected Attributes inherited from ug::UserDataInfo
FunctionGroup m_fctGrp
 functions the data depends on
 
FunctionIndexMapping m_map
 Mapping for import fct.
 
SmartPtr< char > m_objName
 This field is used mainly for debugging: One can assign a name to the object to identify it when running.
 

Detailed Description

template<typename TData, int dim>
class ug::DependentUserData< TData, dim >

Dependent UserData.

This class extends the UserData by the derivatives of the data w.r.t. to unknown solutions.

Member Typedef Documentation

◆ base_type

template<typename TData , int dim>
typedef CplUserData<TData, dim> ug::DependentUserData< TData, dim >::base_type

Base class type.

Constructor & Destructor Documentation

◆ DependentUserData() [1/4]

template<typename TData , int dim>
ug::DependentUserData< TData, dim >::DependentUserData ( )
inline

default constructor

◆ DependentUserData() [2/4]

template<typename TData , int dim>
ug::DependentUserData< TData, dim >::DependentUserData ( const char *  symbFct)
inline

sets the associated symbolic functions

References ug::DependentUserData< TData, dim >::set_functions().

◆ DependentUserData() [3/4]

template<typename TData , int dim>
ug::DependentUserData< TData, dim >::DependentUserData ( const std::string &  symbFct)
inline

sets the associated symbolic functions

References ug::DependentUserData< TData, dim >::set_functions().

◆ DependentUserData() [4/4]

template<typename TData , int dim>
ug::DependentUserData< TData, dim >::DependentUserData ( const std::vector< std::string > &  symbFct)
inline

sets the associated symbolic functions

References ug::DependentUserData< TData, dim >::set_functions().

Member Function Documentation

◆ check_s_ip()

template<typename TData , int dim>
void ug::DependentUserData< TData, dim >::check_s_ip ( size_t  s,
size_t  ip 
) const
inlineprotected

checks in debug mode the correct usage of indices

References s, and UG_ASSERT.

◆ check_s_ip_fct()

template<typename TData , int dim>
void ug::DependentUserData< TData, dim >::check_s_ip_fct ( size_t  s,
size_t  ip,
size_t  fct 
) const
inlineprotected

checks in debug mode the correct usage of indices

References s, and UG_ASSERT.

Referenced by ug::DependentUserData< TData, dim >::deriv(), and ug::DependentUserData< TData, dim >::deriv().

◆ check_s_ip_fct_dof()

template<typename TData , int dim>
void ug::DependentUserData< TData, dim >::check_s_ip_fct_dof ( size_t  s,
size_t  ip,
size_t  fct,
size_t  dof 
) const
inlineprotected

checks in debug mode the correct usage of indices

References s, and UG_ASSERT.

Referenced by ug::DependentUserData< TData, dim >::deriv(), and ug::DependentUserData< TData, dim >::deriv().

◆ deriv() [1/4]

template<typename TData , int dim>
TData * ug::DependentUserData< TData, dim >::deriv ( size_t  s,
size_t  ip,
size_t  fct 
)
inline

◆ deriv() [2/4]

template<typename TData , int dim>
const TData * ug::DependentUserData< TData, dim >::deriv ( size_t  s,
size_t  ip,
size_t  fct 
) const
inline

◆ deriv() [3/4]

template<typename TData , int dim>
TData & ug::DependentUserData< TData, dim >::deriv ( size_t  s,
size_t  ip,
size_t  fct,
size_t  dof 
)
inline

returns the derivative of the local function, at ip and for a dof

References ug::DependentUserData< TData, dim >::check_s_ip_fct_dof(), ug::ICplUserData< dim >::ip(), ug::DependentUserData< TData, dim >::m_vvvvDeriv, and s.

◆ deriv() [4/4]

template<typename TData , int dim>
const TData & ug::DependentUserData< TData, dim >::deriv ( size_t  s,
size_t  ip,
size_t  fct,
size_t  dof 
) const
inline

returns the derivative of the local function, at ip and for a dof

References ug::DependentUserData< TData, dim >::check_s_ip_fct_dof(), ug::ICplUserData< dim >::ip(), ug::DependentUserData< TData, dim >::m_vvvvDeriv, and s.

◆ extract_fct_grp()

template<typename TData , int dim>
void ug::DependentUserData< TData, dim >::extract_fct_grp ( )
protected

◆ local_ip_series_added()

template<typename TData , int dim>
void ug::DependentUserData< TData, dim >::local_ip_series_added ( const size_t  seriesID)
protectedvirtual

resizes the derivative field when local ip change is signaled

Reimplemented from ug::CplUserData< TData, dim, TRet >.

Reimplemented in ug::StdDataLinker< TImpl, TData, dim >.

Referenced by ug::StdDataLinker< TImpl, TData, dim >::local_ip_series_added().

◆ local_ip_series_to_be_cleared()

template<typename TData , int dim>
void ug::DependentUserData< TData, dim >::local_ip_series_to_be_cleared ( )
protectedvirtual

implement callback, invoked when local ips are cleared

Reimplemented from ug::CplUserData< TData, dim, TRet >.

Reimplemented in ug::StdDataLinker< TImpl, TData, dim >.

Referenced by ug::StdDataLinker< TImpl, TData, dim >::local_ip_series_to_be_cleared().

◆ local_ips_changed()

template<typename TData , int dim>
void ug::DependentUserData< TData, dim >::local_ips_changed ( const size_t  seriesID,
const size_t  newNumIP 
)
protectedvirtual

implement callback, called when local IPs changed

Reimplemented from ug::CplUserData< TData, dim, TRet >.

Reimplemented in ug::StdDataLinker< TImpl, TData, dim >.

References UG_ASSERT.

Referenced by ug::StdDataLinker< TImpl, TData, dim >::local_ips_changed().

◆ num_ip()

template<typename TData , int dim>
size_t ug::ICplUserData< dim >::num_ip ( size_t  s) const
inline

◆ num_series()

template<typename TData , int dim>
size_t ug::ICplUserData< dim >::num_series ( ) const
inline

◆ num_sh()

template<typename TData , int dim>
size_t ug::DependentUserData< TData, dim >::num_sh ( size_t  fct) const
inline

number of shapes for local function

References ug::DependentUserData< TData, dim >::m_vvNumDoFPerFct, and UG_ASSERT.

◆ requires_grid_fct()

template<typename TData , int dim>
virtual bool ug::DependentUserData< TData, dim >::requires_grid_fct ( ) const
inlinevirtual

◆ resize_deriv_array() [1/2]

template<typename TData , int dim>
void ug::DependentUserData< TData, dim >::resize_deriv_array ( )
protected

resizes the derivative arrays for current number of ips.

References s.

◆ resize_deriv_array() [2/2]

template<typename TData , int dim>
void ug::DependentUserData< TData, dim >::resize_deriv_array ( const size_t  seriesID)
protected

resizes the derivative arrays for current number of ips of a single series

References resize(), and s.

◆ set_function_pattern()

template<typename TData , int dim>
void ug::DependentUserData< TData, dim >::set_function_pattern ( ConstSmartPtr< FunctionPattern fctPatt)
virtual

sets the associated function pattern

Reimplemented from ug::UserDataInfo.

Reimplemented in ug::StdDataLinker< TImpl, TData, dim >.

◆ set_functions() [1/3]

◆ set_functions() [2/3]

template<typename TData , int dim>
void ug::DependentUserData< TData, dim >::set_functions ( const std::string &  symbFct)

sets the associated symbolic functions

References ug::TokenizeTrimString().

◆ set_functions() [3/3]

template<typename TData , int dim>
void ug::DependentUserData< TData, dim >::set_functions ( const std::vector< std::string > &  symbFct)

sets the associated symbolic functions

◆ set_zero()

template<typename TData , int dim>
void ug::DependentUserData< TData, dim >::set_zero ( std::vector< std::vector< TData > >  vvvDeriv[],
const size_t  nip 
)
static

sets all derivative values to zero

◆ update_dof_sizes()

template<typename TData , int dim>
void ug::DependentUserData< TData, dim >::update_dof_sizes ( const LocalIndices ind)
virtual

resize lin defect arrays

Reimplemented from ug::ICplUserData< dim >.

References ug::LocalIndices::num_dof(), ug::FunctionIndexMapping::num_fct(), and UG_ASSERT.

◆ zero_derivative()

template<typename TData , int dim>
virtual bool ug::DependentUserData< TData, dim >::zero_derivative ( ) const
inlinevirtual

returns that data depends on solution

Reimplemented from ug::ICplUserData< dim >.

Reimplemented in ug::StdDataLinker< TImpl, TData, dim >.

Member Data Documentation

◆ m_SymbFct

template<typename TData , int dim>
std::vector<std::string> ug::DependentUserData< TData, dim >::m_SymbFct
protected

string of symbolic functions required

◆ m_vvNumDoFPerFct

template<typename TData , int dim>
std::vector<size_t> ug::DependentUserData< TData, dim >::m_vvNumDoFPerFct
protected

number of functions and their dofs

Referenced by ug::DependentUserData< TData, dim >::num_sh().

◆ m_vvvvDeriv


The documentation for this class was generated from the following files: