ug4
ug::DataImport< TData, dim > Class Template Reference

Data import. More...

#include <data_import.h>

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

Public Types

typedef boost::function< void(const LocalVector &u, std::vector< std::vector< TData > > vvvLinDefect[], const size_t nip)> LinDefectFunc
 type of evaluation function More...
 

Public Member Functions

void add_jacobian (LocalMatrix &J, const number scale)
 compute jacobian for derivative w.r.t. non-system owned unknowns More...
 
virtual void check_setup ()
 checks if ready for evaluation More...
 
void clear_fct ()
 clear all evaluation functions More...
 
virtual void clear_ips ()
 removes the positions More...
 
virtual void compute_lin_defect (LocalVector &u)
 compute lin defect More...
 
virtual bool constant () const
 returns if data is constant More...
 
SmartPtr< ICplUserData< dim > > data ()
 returns the connected ICplUserData More...
 
virtual bool data_given () const
 returns true if data given More...
 
 DataImport (bool bLinDefect=true)
 Constructor. More...
 
const TData * deriv (size_t ip, size_t fct) const
 return the derivative w.r.t to local function at ip More...
 
const TData & deriv (size_t ip, size_t fct, size_t dof) const
 return the derivative w.r.t to local function and dof at ip More...
 
TData * lin_defect (size_t ip, size_t fct)
 returns the pointer to all linearized defects at one ip More...
 
const TData * lin_defect (size_t ip, size_t fct) const
 returns the pointer to all linearized defects at one ip More...
 
TData & lin_defect (size_t ip, size_t fct, size_t sh)
 returns the linearized defect More...
 
const TData & lin_defect (size_t ip, size_t fct, size_t sh) const
 const access to lin defect More...
 
size_t num_ip () const
 number of integration points More...
 
size_t num_sh (size_t fct) const
 number of shapes for local function More...
 
const TData & operator[] (size_t ip) const
 returns the data value at ip More...
 
const MathVector< dim > & position (size_t i) const
 position of ip More...
 
void set_data (SmartPtr< CplUserData< TData, dim > > spData)
 set the user data More...
 
template<typename TClass >
void set_fct (ReferenceObjectID id, TClass *obj, void(TClass::*func)(const LocalVector &u, std::vector< std::vector< TData > > vvvLinDefect[], const size_t nip))
 register evaluation of linear defect for a element More...
 
void set_fct (ReferenceObjectID id, void(*func)(const LocalVector &u, std::vector< std::vector< TData > > vvvLinDefect[], const size_t nip))
 register evaluation of linear defect for a element More...
 
void set_global_ips (const MathVector< dim > *vPos, size_t numIP)
 sets the global positions More...
 
void set_local_ips (const MathVector< dim > *vPos, size_t numIP, bool bMayChange=true)
 set the local integration points More...
 
void set_local_ips (const MathVector< dim > *vPos, size_t numIP, int timePointSpec, bool bMayChange=true)
 set the local integration points More...
 
template<int ldim>
void set_local_ips (const MathVector< ldim > *vPos, size_t numIP, bool bMayChange=true)
 set the local integration points More...
 
template<int ldim>
void set_local_ips (const MathVector< ldim > *vPos, size_t numIP, int timePointSpec, bool bMayChange=true)
 set the local integration points More...
 
virtual void set_roid (ReferenceObjectID id)
 sets the geometric object type More...
 
void set_time_point (int timePointSpec)
 set the time point specification More...
 
virtual void update_dof_sizes (const LocalIndices &ind)
 resize lin defect arrays More...
 
SmartPtr< CplUserData< TData, dim > > user_data ()
 returns the connected ICplUserData More...
 
const TData * values () const
 returns the data value at ip More...
 
 ~DataImport ()
 Destructor. More...
 
- Public Member Functions inherited from ug::IDataImport< dim >
const FunctionIndexMappingconn_map () const
 get function mapping of dependent data More...
 
 IDataImport (bool compLinDefect=true)
 Constructor. More...
 
const FunctionIndexMappingmap () const
 get function mapping More...
 
size_t num_fct () const
 number of functions More...
 
DiscPart part () const
 returns if import is located in mass part (for time dependent problems) More...
 
void set_comp_lin_defect (bool b)
 sets if lin defect is to be computed More...
 
void set_expl_part ()
 set to explicit part More...
 
void set_map (const FunctionIndexMapping &map)
 set function group for linearization of defect More...
 
void set_mass_part ()
 sets if import is located in mass part (for time dependent problems) More...
 
void set_none_part ()
 set to no part More...
 
void set_part (DiscPart part)
 sets part of import More...
 
void set_rhs_part ()
 sets if import is located in rhs part More...
 
void set_stiff_part ()
 sets if import is located in stiff part (default) More...
 
bool zero_derivative () const
 returns if data depends on unknown functions More...
 
virtual ~IDataImport ()
 

Protected Member Functions

void cache_data_access ()
 caches data access More...
 
void check_ip (size_t ip) const
 checks in debug mode the correct index More...
 
void check_ip_fct (size_t ip, size_t fct) const
 checks in debug mode the correct index More...
 
void check_ip_fct_sh (size_t ip, size_t fct, size_t sh) const
 checks in debug mode the correct index More...
 
void check_values () const
 checks in debug mode the correct index More...
 
void resize_defect_array ()
 resizes the lin defect arrays for current number of ips. More...
 

Protected Attributes

ReferenceObjectID m_id
 current Geom Object More...
 
size_t m_numIP
 number of ips More...
 
int m_seriesID
 series number provided by export More...
 
SmartPtr< DependentUserData< TData, dim > > m_spDependentUserData
 connected export (if depended data) More...
 
SmartPtr< CplUserData< TData, dim > > m_spUserData
 connected UserData More...
 
LinDefectFunc m_vLinDefectFunc [NUM_REFERENCE_OBJECTS]
 function pointers for all elem types More...
 
const TData * m_vValue
 cached access to the UserData field More...
 
std::vector< size_t > m_vvNumDoFPerFct
 number of functions and their dofs More...
 
std::vector< std::vector< std::vector< TData > > > m_vvvLinDefect
 linearized defect (num_ip) x (num_fct) x (num_dofs(i)) More...
 
- Protected Attributes inherited from ug::IDataImport< dim >
bool m_bCompLinDefect
 indicates iff lin defect should be computed More...
 
FunctionIndexMapping m_map
 Mapping for import fct. More...
 
DiscPart m_part
 flag to indicate where import is located More...
 
SmartPtr< ICplUserData< dim > > m_spICplUserData
 connected iexport More...
 

Detailed Description

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

Data import.

A DataImport is used to import data into an ElemDisc.

Member Typedef Documentation

◆ LinDefectFunc

template<typename TData , int dim>
typedef boost::function<void (const LocalVector& u, std::vector<std::vector<TData> > vvvLinDefect[], const size_t nip)> ug::DataImport< TData, dim >::LinDefectFunc

type of evaluation function

Constructor & Destructor Documentation

◆ DataImport()

template<typename TData , int dim>
ug::DataImport< TData, dim >::DataImport ( bool  bLinDefect = true)
inline

◆ ~DataImport()

template<typename TData , int dim>
ug::DataImport< TData, dim >::~DataImport

Destructor.

Member Function Documentation

◆ add_jacobian()

template<typename TData , int dim>
void ug::DataImport< TData, dim >::add_jacobian ( LocalMatrix J,
const number  scale 
)
virtual

compute jacobian for derivative w.r.t. non-system owned unknowns

compute the linearization only if the export parameter is 'at current time'

Implements ug::IDataImport< dim >.

References ug::LocalMatrix::access_by_map(), and UG_ASSERT.

◆ cache_data_access()

template<typename TData , int dim>
void ug::DataImport< TData, dim >::cache_data_access
protected

caches data access

◆ check_ip()

template<typename TData , int dim>
void ug::DataImport< TData, dim >::check_ip ( size_t  ip) const
inlineprotected

checks in debug mode the correct index

References UG_ASSERT.

Referenced by ug::DataImport< TData, dim >::operator[]().

◆ check_ip_fct()

template<typename TData , int dim>
void ug::DataImport< TData, dim >::check_ip_fct ( size_t  ip,
size_t  fct 
) const
inlineprotected

checks in debug mode the correct index

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

◆ check_ip_fct_sh()

template<typename TData , int dim>
void ug::DataImport< TData, dim >::check_ip_fct_sh ( size_t  ip,
size_t  fct,
size_t  sh 
) const
inlineprotected

checks in debug mode the correct index

References UG_ASSERT.

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

◆ check_setup()

template<typename TData , int dim>
void ug::DataImport< TData, dim >::check_setup
virtual

checks if ready for evaluation

Implements ug::IDataImport< dim >.

References dim, ug::ROID_UNKNOWN, and UG_THROW.

◆ check_values()

template<typename TData , int dim>
void ug::DataImport< TData, dim >::check_values
inlineprotected

checks in debug mode the correct index

References UG_ASSERT.

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

◆ clear_fct()

template<typename TData , int dim>
void ug::DataImport< TData, dim >::clear_fct

clear all evaluation functions

References ug::NUM_REFERENCE_OBJECTS.

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

◆ clear_ips()

template<typename TData , int dim>
void ug::DataImport< TData, dim >::clear_ips
virtual

removes the positions

Implements ug::IDataImport< dim >.

◆ compute_lin_defect()

template<typename TData , int dim>
virtual void ug::DataImport< TData, dim >::compute_lin_defect ( LocalVector u)
inlinevirtual

◆ constant()

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

returns if data is constant

This method, returns if the connected data is constant.

Implements ug::IDataImport< dim >.

References ug::DataImport< TData, dim >::data_given(), and ug::DataImport< TData, dim >::m_spUserData.

◆ data()

template<typename TData , int dim>
SmartPtr<ICplUserData<dim> > ug::DataImport< TData, dim >::data ( )
inlinevirtual

◆ data_given()

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

◆ deriv() [1/2]

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

return the derivative w.r.t to local function at ip

References ug::DataImport< TData, dim >::m_seriesID, ug::DataImport< TData, dim >::m_spDependentUserData, and UG_ASSERT.

◆ deriv() [2/2]

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

return the derivative w.r.t to local function and dof at ip

References ug::DataImport< TData, dim >::m_seriesID, ug::DataImport< TData, dim >::m_spDependentUserData, and UG_ASSERT.

◆ lin_defect() [1/4]

template<typename TData , int dim>
TData* ug::DataImport< TData, dim >::lin_defect ( size_t  ip,
size_t  fct 
)
inline

returns the pointer to all linearized defects at one ip

References ug::DataImport< TData, dim >::check_ip_fct(), and ug::DataImport< TData, dim >::m_vvvLinDefect.

◆ lin_defect() [2/4]

template<typename TData , int dim>
const TData* ug::DataImport< TData, dim >::lin_defect ( size_t  ip,
size_t  fct 
) const
inline

returns the pointer to all linearized defects at one ip

References ug::DataImport< TData, dim >::check_ip_fct(), and ug::DataImport< TData, dim >::m_vvvLinDefect.

◆ lin_defect() [3/4]

template<typename TData , int dim>
TData& ug::DataImport< TData, dim >::lin_defect ( size_t  ip,
size_t  fct,
size_t  sh 
)
inline

◆ lin_defect() [4/4]

template<typename TData , int dim>
const TData& ug::DataImport< TData, dim >::lin_defect ( size_t  ip,
size_t  fct,
size_t  sh 
) const
inline

◆ num_ip()

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

number of integration points

References ug::DataImport< TData, dim >::m_numIP.

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

◆ num_sh()

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

number of shapes for local function

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

◆ operator[]()

template<typename TData , int dim>
const TData& ug::DataImport< TData, dim >::operator[] ( size_t  ip) const
inline

◆ position()

template<typename TData , int dim>
const MathVector<dim>& ug::DataImport< TData, dim >::position ( size_t  i) const
inline

◆ resize_defect_array()

template<typename TData , int dim>
void ug::DataImport< TData, dim >::resize_defect_array
protected

resizes the lin defect arrays for current number of ips.

References resize().

◆ set_data()

template<typename TData , int dim>
void ug::DataImport< TData, dim >::set_data ( SmartPtr< CplUserData< TData, dim > >  spData)

set the user data

◆ set_fct() [1/2]

template<typename TData , int dim>
template<typename TClass >
void ug::DataImport< TData, dim >::set_fct ( ReferenceObjectID  id,
TClass *  obj,
void(TClass::*)(const LocalVector &u, std::vector< std::vector< TData > > vvvLinDefect[], const size_t nip)  func 
)

register evaluation of linear defect for a element

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

◆ set_fct() [2/2]

template<typename TData , int dim>
void ug::DataImport< TData, dim >::set_fct ( ReferenceObjectID  id,
void(*)(const LocalVector &u, std::vector< std::vector< TData > > vvvLinDefect[], const size_t nip)  func 
)

register evaluation of linear defect for a element

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

◆ set_global_ips()

template<typename TData , int dim>
void ug::DataImport< TData, dim >::set_global_ips ( const MathVector< dim > *  vPos,
size_t  numIP 
)

sets the global positions

References UG_ASSERT.

◆ set_local_ips() [1/4]

template<typename TData , int dim>
void ug::DataImport< TData, dim >::set_local_ips ( const MathVector< dim > *  vPos,
size_t  numIP,
bool  bMayChange = true 
)

set the local integration points

◆ set_local_ips() [2/4]

template<typename TData , int dim>
void ug::DataImport< TData, dim >::set_local_ips ( const MathVector< dim > *  vPos,
size_t  numIP,
int  timePointSpec,
bool  bMayChange = true 
)

set the local integration points

◆ set_local_ips() [3/4]

template<typename TData , int dim>
template<int ldim>
void ug::DataImport< TData, dim >::set_local_ips ( const MathVector< ldim > *  vPos,
size_t  numIP,
bool  bMayChange = true 
)

set the local integration points

◆ set_local_ips() [4/4]

template<typename TData , int dim>
template<int ldim>
void ug::DataImport< TData, dim >::set_local_ips ( const MathVector< ldim > *  vPos,
size_t  numIP,
int  timePointSpec,
bool  bMayChange = true 
)

set the local integration points

References UG_ASSERT, and UG_THROW.

◆ set_roid()

template<typename TData , int dim>
void ug::DataImport< TData, dim >::set_roid ( ReferenceObjectID  id)
virtual

sets the geometric object type

Implements ug::IDataImport< dim >.

References ug::ROID_UNKNOWN, and UG_THROW.

◆ set_time_point()

template<typename TData , int dim>
void ug::DataImport< TData, dim >::set_time_point ( int  timePointSpec)

set the time point specification

◆ update_dof_sizes()

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

resize lin defect arrays

Implements ug::IDataImport< dim >.

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

◆ user_data()

template<typename TData , int dim>
SmartPtr<CplUserData<TData, dim> > ug::DataImport< TData, dim >::user_data ( )
inline

returns the connected ICplUserData

References ug::DataImport< TData, dim >::m_spUserData.

◆ values()

template<typename TData , int dim>
const TData* ug::DataImport< TData, dim >::values ( ) const
inline

Member Data Documentation

◆ m_id

template<typename TData , int dim>
ReferenceObjectID ug::DataImport< TData, dim >::m_id
protected

current Geom Object

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

◆ m_numIP

template<typename TData , int dim>
size_t ug::DataImport< TData, dim >::m_numIP
protected

◆ m_seriesID

template<typename TData , int dim>
int ug::DataImport< TData, dim >::m_seriesID
protected

◆ m_spDependentUserData

template<typename TData , int dim>
SmartPtr<DependentUserData<TData, dim> > ug::DataImport< TData, dim >::m_spDependentUserData
protected

connected export (if depended data)

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

◆ m_spUserData

◆ m_vLinDefectFunc

template<typename TData , int dim>
LinDefectFunc ug::DataImport< TData, dim >::m_vLinDefectFunc[NUM_REFERENCE_OBJECTS]
protected

function pointers for all elem types

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

◆ m_vValue

template<typename TData , int dim>
const TData* ug::DataImport< TData, dim >::m_vValue
protected

◆ m_vvNumDoFPerFct

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

number of functions and their dofs

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

◆ m_vvvLinDefect

template<typename TData , int dim>
std::vector<std::vector<std::vector<TData> > > ug::DataImport< TData, dim >::m_vvvLinDefect
protected

linearized defect (num_ip) x (num_fct) x (num_dofs(i))

Referenced by ug::DataImport< TData, dim >::compute_lin_defect(), and ug::DataImport< TData, dim >::lin_defect().


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