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

Data export. More...

#include <data_export.h>

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

Classes

class  FreeFunctionFunctor
 
class  Functor
 
class  FunctorBase
 
class  MemberFunctionFunctor
 

Public Member Functions

void add_needed_data (SmartPtr< ICplUserData< dim > > data)
 add data dependency
 
void clear ()
 clear dependent data
 
void clear_fct ()
 clears all export functions
 
virtual bool continuous () const
 returns if provided data is continuous over geometric object boundaries
 
 DataExport (const char *functions)
 default constructor
 
template<int refDim>
void eval_and_deriv (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, bool bDeriv, int s, std::vector< std::vector< TData > > vvvDeriv[], const MathMatrix< refDim, dim > *vJT=NULL) const
 
virtual SmartPtr< ICplUserData< dim > > needed_data (size_t i)
 return needed data
 
virtual size_t num_needed_data () const
 number of other Data this data depends on
 
void remove_needed_data (SmartPtr< ICplUserData< dim > > data)
 remove needed data
 
virtual bool requires_grid_fct () const
 returns if grid function is needed for evaluation
 
template<typename TClass , int refDim>
void set_fct (ReferenceObjectID id, TClass *obj, void(TClass::*func)(TData vValue[], const MathVector< dim > vGlobIP[], number time, int si, const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[], const MathVector< refDim > vLocIP[], const size_t nip, bool bDeriv, std::vector< std::vector< TData > > vvvDeriv[]))
 register evaluation of export function
 
template<int refDim>
void set_fct (ReferenceObjectID id, void(*func)(TData vValue[], const MathVector< dim > vGlobIP[], number time, int si, const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[], const MathVector< refDim > vLocIP[], const size_t nip, bool bDeriv, std::vector< std::vector< TData > > vvvDeriv[]))
 register evaluation of export function
 
- Public Member Functions inherited from ug::StdDependentUserData< DataExport< TData, dim >, TData, dim >
virtual void compute (LocalVector *u, GridObject *elem, const MathVector< dim > vCornerCoords[], bool bDeriv=false)
 compute values (and derivatives iff compDeriv == true)
 
virtual void compute (LocalVectorTimeSeries *u, GridObject *elem, const MathVector< dim > vCornerCoords[], bool bDeriv=false)
 compute values (and derivatives iff compDeriv == true, but only for the 'current' time point)
 
void eval_deriv (LocalVector *u, GridObject *elem, const MathVector< dim > vCornerCoords[], bool bDeriv=false)
 
void eval_deriv (LocalVectorTimeSeries *u, GridObject *elem, const MathVector< dim > vCornerCoords[], bool bDeriv=false)
 
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
 
virtual void operator() (TData &value, const MathVector< dim > &globIP, number time, int si) const
 returns value for a global position
 
virtual void operator() (TData vValue[], const MathVector< dim > vGlobIP[], number time, int si, const size_t nip) const
 returns value for global positions
 
 StdDependentUserData ()
 
 StdDependentUserData (const char *symbFct)
 
 StdDependentUserData (const std::string &symbFct)
 
 StdDependentUserData (const std::vector< std::string > &symbFct)
 
- Public Member Functions inherited from ug::StdUserData< TImpl, TData, dim, TRet, TBase >
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
 
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
 
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
 
- 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 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
 
size_t num_ip (size_t s) const
 returns the number of integration points
 
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 void update_dof_sizes (const LocalIndices &ind)
 resize arrays
 
virtual bool zero_derivative () const
 returns if data depends on solution
 
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)
 
virtual void set_function_pattern (ConstSmartPtr< FunctionPattern > fctPatt)
 sets the function pattern for a possibly needed grid function
 
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 >
int get_dim () const
 returns dimension
 
virtual void operator() (TData &value, const MathVector< dim > &globIP, number time, int si, Vertex *vrt) const
 returns a value at a vertex
 
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
 

Protected Member Functions

template<int refDim>
Functor< refDim > & eval_fct (ReferenceObjectID id)
 
template<int refDim>
const Functor< refDim > & eval_fct (ReferenceObjectID id) const
 
Functor< 1 > & eval_fct (ReferenceObjectID id, Int2Type< 1 >)
 
const Functor< 1 > & eval_fct (ReferenceObjectID id, Int2Type< 1 >) const
 
Functor< 2 > & eval_fct (ReferenceObjectID id, Int2Type< 2 >)
 
const Functor< 2 > & eval_fct (ReferenceObjectID id, Int2Type< 2 >) const
 
Functor< 3 > & eval_fct (ReferenceObjectID id, Int2Type< 3 >)
 
const Functor< 3 > & eval_fct (ReferenceObjectID id, Int2Type< 3 >) const
 
bool eval_fct_set (ReferenceObjectID id) const
 
- Protected Member Functions inherited from ug::StdDependentUserData< DataExport< TData, dim >, TData, dim >
DataExport< TData, dim > & getImpl ()
 access to implementation
 
const DataExport< TData, dim > & getImpl () const
 const access to implementation
 
- Protected Member Functions inherited from ug::StdUserData< TImpl, TData, dim, TRet, TBase >
TImpl & getImpl ()
 access to implementation
 
const TImpl & getImpl () const
 const access to implementation
 
- 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 local_ip_series_added (const size_t seriesID)
 resizes the data field, when local ip changed signaled
 
virtual void local_ip_series_to_be_cleared ()
 free the data field memory and set series to zero
 
virtual void local_ips_changed (const size_t seriesID, const size_t newNumIP)
 implement callback, called when local IPs changed
 
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

Functor< 1 > m_vCompFct1d [NUM_REFERENCE_OBJECTS]
 
Functor< 2 > m_vCompFct2d [NUM_REFERENCE_OBJECTS]
 
Functor< 3 > m_vCompFct3d [NUM_REFERENCE_OBJECTS]
 
std::vector< SmartPtr< ICplUserData< dim > > > m_vDependData
 data the export depends on
 
- 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.
 

Additional Inherited Members

- 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
 

Detailed Description

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

Data export.

A DataExport is user data produced by an element discretization.

Constructor & Destructor Documentation

◆ DataExport()

template<typename TData , int dim>
ug::DataExport< TData, dim >::DataExport ( const char *  functions)

default constructor

References ug::DataExport< TData, dim >::clear_fct().

Member Function Documentation

◆ add_needed_data()

template<typename TData , int dim>
void ug::DataExport< TData, dim >::add_needed_data ( SmartPtr< ICplUserData< dim > >  data)

add data dependency

◆ clear()

template<typename TData , int dim>
void ug::DataExport< TData, dim >::clear ( )
inline

clear dependent data

References ug::DataExport< TData, dim >::m_vDependData.

◆ clear_fct()

template<typename TData , int dim>
void ug::DataExport< TData, dim >::clear_fct ( )

clears all export functions

References ug::NUM_REFERENCE_OBJECTS.

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

◆ continuous()

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

returns if provided data is continuous over geometric object boundaries

Implements ug::UserDataInfo.

◆ eval_and_deriv()

template<typename TData , int dim>
template<int refDim>
void ug::DataExport< TData, dim >::eval_and_deriv ( 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,
bool  bDeriv,
int  s,
std::vector< std::vector< TData > >  vvvDeriv[],
const MathMatrix< refDim, dim > *  vJT = NULL 
) const

◆ eval_fct() [1/8]

template<typename TData , int dim>
template<int refDim>
Functor< refDim > & ug::DataExport< TData, dim >::eval_fct ( ReferenceObjectID  id)
inlineprotected

◆ eval_fct() [2/8]

template<typename TData , int dim>
template<int refDim>
const Functor< refDim > & ug::DataExport< TData, dim >::eval_fct ( ReferenceObjectID  id) const
inlineprotected

◆ eval_fct() [3/8]

template<typename TData , int dim>
Functor< 1 > & ug::DataExport< TData, dim >::eval_fct ( ReferenceObjectID  id,
Int2Type< 1 >   
)
inlineprotected

◆ eval_fct() [4/8]

template<typename TData , int dim>
const Functor< 1 > & ug::DataExport< TData, dim >::eval_fct ( ReferenceObjectID  id,
Int2Type< 1 >   
) const
inlineprotected

◆ eval_fct() [5/8]

template<typename TData , int dim>
Functor< 2 > & ug::DataExport< TData, dim >::eval_fct ( ReferenceObjectID  id,
Int2Type< 2 >   
)
inlineprotected

◆ eval_fct() [6/8]

template<typename TData , int dim>
const Functor< 2 > & ug::DataExport< TData, dim >::eval_fct ( ReferenceObjectID  id,
Int2Type< 2 >   
) const
inlineprotected

◆ eval_fct() [7/8]

template<typename TData , int dim>
Functor< 3 > & ug::DataExport< TData, dim >::eval_fct ( ReferenceObjectID  id,
Int2Type< 3 >   
)
inlineprotected

◆ eval_fct() [8/8]

template<typename TData , int dim>
const Functor< 3 > & ug::DataExport< TData, dim >::eval_fct ( ReferenceObjectID  id,
Int2Type< 3 >   
) const
inlineprotected

◆ eval_fct_set()

template<typename TData , int dim>
bool ug::DataExport< TData, dim >::eval_fct_set ( ReferenceObjectID  id) const
protected

◆ needed_data()

template<typename TData , int dim>
virtual SmartPtr< ICplUserData< dim > > ug::DataExport< TData, dim >::needed_data ( size_t  i)
inlinevirtual

return needed data

Reimplemented from ug::ICplUserData< dim >.

References ug::DataExport< TData, dim >::m_vDependData.

◆ num_needed_data()

template<typename TData , int dim>
virtual size_t ug::DataExport< TData, dim >::num_needed_data ( ) const
inlinevirtual

number of other Data this data depends on

Reimplemented from ug::ICplUserData< dim >.

References ug::DataExport< TData, dim >::m_vDependData.

◆ remove_needed_data()

template<typename TData , int dim>
void ug::DataExport< TData, dim >::remove_needed_data ( SmartPtr< ICplUserData< dim > >  data)

remove needed data

◆ requires_grid_fct()

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

returns if grid function is needed for evaluation

Implements ug::UserDataInfo.

◆ set_fct() [1/2]

template<typename TData , int dim>
template<typename TClass , int refDim>
void ug::DataExport< TData, dim >::set_fct ( ReferenceObjectID  id,
TClass *  obj,
void(TClass::*)(TData vValue[], const MathVector< dim > vGlobIP[], number time, int si, const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[], const MathVector< refDim > vLocIP[], const size_t nip, bool bDeriv, std::vector< std::vector< TData > > vvvDeriv[])  func 
)

register evaluation of export function

References func(), ug::NUM_REFERENCE_OBJECTS, and UG_THROW.

◆ set_fct() [2/2]

template<typename TData , int dim>
template<int refDim>
void ug::DataExport< TData, dim >::set_fct ( ReferenceObjectID  id,
void(*)(TData vValue[], const MathVector< dim > vGlobIP[], number time, int si, const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[], const MathVector< refDim > vLocIP[], const size_t nip, bool bDeriv, std::vector< std::vector< TData > > vvvDeriv[])  func 
)

register evaluation of export function

References func(), ug::NUM_REFERENCE_OBJECTS, and UG_THROW.

Member Data Documentation

◆ m_vCompFct1d

template<typename TData , int dim>
Functor<1> ug::DataExport< TData, dim >::m_vCompFct1d[NUM_REFERENCE_OBJECTS]
protected

◆ m_vCompFct2d

template<typename TData , int dim>
Functor<2> ug::DataExport< TData, dim >::m_vCompFct2d[NUM_REFERENCE_OBJECTS]
protected

◆ m_vCompFct3d

template<typename TData , int dim>
Functor<3> ug::DataExport< TData, dim >::m_vCompFct3d[NUM_REFERENCE_OBJECTS]
protected

◆ m_vDependData

template<typename TData , int dim>
std::vector<SmartPtr<ICplUserData<dim> > > ug::DataExport< TData, dim >::m_vDependData
protected

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