33 #ifndef __H__UG__LIB_DISC__SPATIAL_DISC__DATA_IMPORT__
34 #define __H__UG__LIB_DISC__SPATIAL_DISC__DATA_IMPORT__
56 case NONE: outStream <<
"(none)";
break;
57 case MASS: outStream <<
"mass";
break;
58 case STIFF: outStream <<
"stiff";
break;
59 case RHS: outStream <<
"rhs";
break;
60 case EXPL: outStream <<
"expl";
break;
61 default:
UG_THROW(
"Unknown DiscPart in operator<<");
178 template <
typename TData,
int dim>
224 const TData*
deriv(
size_t ip,
size_t fct)
const
232 const TData&
deriv(
size_t ip,
size_t fct,
size_t dof)
const
249 bool bMayChange =
true);
253 bool bMayChange =
true);
258 bool bMayChange =
true);
262 bool bMayChange =
true);
275 "No Data set, but positions requested.");
305 const TData&
lin_defect(
size_t ip,
size_t fct,
size_t sh)
const
316 typedef boost::function<void (
const LocalVector& u,
317 std::vector<std::vector<TData> > vvvLinDefect[],
327 template <
typename TClass>
329 void (TClass::*
func)(
331 std::vector<std::vector<TData> > vvvLinDefect[],
338 std::vector<std::vector<TData> > vvvLinDefect[],
366 inline void check_ip(
size_t ip)
const;
Definition: smart_pointer.h:108
Type based UserData.
Definition: user_data.h:501
Data import.
Definition: data_import.h:180
const MathVector< dim > & position(size_t i) const
position of ip
Definition: data_import.h:271
virtual bool data_given() const
returns true if data given
Definition: data_import.h:203
void add_jacobian(LocalMatrix &J, const number scale)
compute jacobian for derivative w.r.t. non-system owned unknowns
Definition: data_import_impl.h:238
virtual void clear_ips()
removes the positions
Definition: data_import_impl.h:228
void check_ip(size_t ip) const
checks in debug mode the correct index
Definition: data_import_impl.h:324
virtual void update_dof_sizes(const LocalIndices &ind)
resize lin defect arrays
Definition: data_import_impl.h:271
void clear_fct()
clear all evaluation functions
Definition: data_import_impl.h:109
virtual void set_roid(ReferenceObjectID id)
sets the geometric object type
Definition: data_import_impl.h:51
const TData * values() const
returns the data value at ip
Definition: data_import.h:221
void set_data(SmartPtr< CplUserData< TData, dim > > spData)
set the user data
Definition: data_import_impl.h:117
const TData & operator[](size_t ip) const
returns the data value at ip
Definition: data_import.h:218
const TData * lin_defect(size_t ip, size_t fct) const
returns the pointer to all linearized defects at one ip
Definition: data_import.h:297
~DataImport()
Destructor.
Definition: data_import_impl.h:45
LinDefectFunc m_vLinDefectFunc[NUM_REFERENCE_OBJECTS]
function pointers for all elem types
Definition: data_import.h:381
SmartPtr< DependentUserData< TData, dim > > m_spDependentUserData
connected export (if depended data)
Definition: data_import.h:396
void set_global_ips(const MathVector< dim > *vPos, size_t numIP)
sets the global positions
Definition: data_import_impl.h:217
void cache_data_access()
caches data access
Definition: data_import_impl.h:130
virtual bool constant() const
returns if data is constant
Definition: data_import.h:211
const TData * deriv(size_t ip, size_t fct) const
return the derivative w.r.t to local function at ip
Definition: data_import.h:224
ReferenceObjectID m_id
current Geom Object
Definition: data_import.h:378
virtual void compute_lin_defect(LocalVector &u)
compute lin defect
Definition: data_import.h:345
std::vector< size_t > m_vvNumDoFPerFct
number of functions and their dofs
Definition: data_import.h:399
DataImport(bool bLinDefect=true)
Constructor.
Definition: data_import.h:183
std::vector< std::vector< std::vector< TData > > > m_vvvLinDefect
linearized defect (num_ip) x (num_fct) x (num_dofs(i))
Definition: data_import.h:402
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
Definition: data_import.h:232
SmartPtr< CplUserData< TData, dim > > user_data()
returns the connected ICplUserData
Definition: data_import.h:200
TData & lin_defect(size_t ip, size_t fct, size_t sh)
returns the linearized defect
Definition: data_import.h:301
void resize_defect_array()
resizes the lin defect arrays for current number of ips.
Definition: data_import_impl.h:287
SmartPtr< ICplUserData< dim > > data()
returns the connected ICplUserData
Definition: data_import.h:197
TData * lin_defect(size_t ip, size_t fct)
returns the pointer to all linearized defects at one ip
Definition: data_import.h:293
void check_ip_fct_sh(size_t ip, size_t fct, size_t sh) const
checks in debug mode the correct index
Definition: data_import_impl.h:317
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
Definition: data_import_impl.h:83
const TData & lin_defect(size_t ip, size_t fct, size_t sh) const
const access to lin defect
Definition: data_import.h:305
SmartPtr< CplUserData< TData, dim > > m_spUserData
connected UserData
Definition: data_import.h:387
virtual void check_setup()
checks if ready for evaluation
Definition: data_import_impl.h:60
void set_local_ips(const MathVector< ldim > *vPos, size_t numIP, int timePointSpec, bool bMayChange=true)
set the local integration points
Definition: data_import_impl.h:141
boost::function< void(const LocalVector &u, std::vector< std::vector< TData > > vvvLinDefect[], const size_t nip)> LinDefectFunc
type of evaluation function
Definition: data_import.h:318
void check_values() const
checks in debug mode the correct index
Definition: data_import_impl.h:330
const TData * m_vValue
cached access to the UserData field
Definition: data_import.h:390
size_t num_sh(size_t fct) const
number of shapes for local function
Definition: data_import.h:286
int m_seriesID
series number provided by export
Definition: data_import.h:384
void check_ip_fct(size_t ip, size_t fct) const
checks in debug mode the correct index
Definition: data_import_impl.h:309
size_t m_numIP
number of ips
Definition: data_import.h:393
size_t num_ip() const
number of integration points
Definition: data_import.h:244
void set_time_point(int timePointSpec)
set the time point specification
Definition: data_import_impl.h:211
describes a mapping between two local index sets
Definition: function_group.h:186
size_t num_fct() const
returns the number of indices that are mapped
Definition: function_group.h:195
Base class for data import.
Definition: data_import.h:72
DiscPart m_part
flag to indicate where import is located
Definition: data_import.h:168
void set_mass_part()
sets if import is located in mass part (for time dependent problems)
Definition: data_import.h:92
void set_part(DiscPart part)
sets part of import
Definition: data_import.h:83
void set_map(const FunctionIndexMapping &map)
set function group for linearization of defect
Definition: data_import.h:130
bool m_bCompLinDefect
indicates iff lin defect should be computed
Definition: data_import.h:171
DiscPart part() const
returns if import is located in mass part (for time dependent problems)
Definition: data_import.h:104
virtual ~IDataImport()
Definition: data_import.h:80
void set_stiff_part()
sets if import is located in stiff part (default)
Definition: data_import.h:98
const FunctionIndexMapping & map() const
get function mapping
Definition: data_import.h:133
FunctionIndexMapping m_map
Mapping for import fct.
Definition: data_import.h:164
virtual void add_jacobian(LocalMatrix &J, const number scale)=0
add jacobian entries introduced by this import
void set_rhs_part()
sets if import is located in rhs part
Definition: data_import.h:95
bool zero_derivative() const
returns if data depends on unknown functions
Definition: data_import.h:119
virtual void check_setup()=0
checks if ready for evaluation
virtual void set_roid(ReferenceObjectID id)=0
sets the geometric object type
virtual bool constant() const =0
returns if data is constant
virtual SmartPtr< ICplUserData< dim > > data()=0
returns the connected user data
void set_none_part()
set to no part
Definition: data_import.h:86
virtual void clear_ips()=0
removes the positions
virtual bool data_given() const =0
returns if data is set
void set_comp_lin_defect(bool b)
sets if lin defect is to be computed
Definition: data_import.h:101
virtual void update_dof_sizes(const LocalIndices &ind)=0
resize arrays
size_t num_fct() const
number of functions
Definition: data_import.h:139
IDataImport(bool compLinDefect=true)
Constructor.
Definition: data_import.h:75
virtual void compute_lin_defect(LocalVector &u)=0
compute lin defect
const FunctionIndexMapping & conn_map() const
get function mapping of dependent data
Definition: data_import.h:136
SmartPtr< ICplUserData< dim > > m_spICplUserData
connected iexport
Definition: data_import.h:161
void set_expl_part()
set to explicit part
Definition: data_import.h:89
Definition: local_algebra.h:50
Definition: local_algebra.h:422
Definition: local_algebra.h:198
void access_by_map(const FunctionIndexMapping &funcMap)
access only part of the functions using mapping (restrict functions)
Definition: local_algebra.h:306
a mathematical Vector with N entries.
Definition: math_vector.h:97
std::ostream & operator<<(std::ostream &outStream, const ug::MathMatrix< 2, 2 > &m)
Definition: math_matrix.cpp:38
#define UG_ASSERT(expr, msg)
Definition: assert.h:70
#define UG_THROW(msg)
Definition: error.h:57
double number
Definition: types.h:124
ReferenceObjectID
these ids are used to identify the shape of a geometric object.
Definition: grid_base_objects.h:74
@ NUM_REFERENCE_OBJECTS
Definition: grid_base_objects.h:85
@ ROID_UNKNOWN
Definition: grid_base_objects.h:75
DiscPart
Definition: data_import.h:44
@ NONE
Definition: data_import.h:44
@ STIFF
Definition: data_import.h:46
@ MAX_PART
Definition: data_import.h:49
@ RHS
Definition: data_import.h:47
@ EXPL
Definition: data_import.h:48
@ MASS
Definition: data_import.h:45
function func(x, y, z, t, si)