33 #ifndef __H__UG__LIB_DISC__FUNCTION_SPACE__GRID_FUNCTION__
34 #define __H__UG__LIB_DISC__FUNCTION_SPACE__GRID_FUNCTION__
90 virtual void copy_values(
const std::vector<std::pair<size_t, size_t> >& vIndexMap,
91 bool bDisjunct =
false) = 0;
116 template <
typename TDomain,
typename TAlgebra>
118 :
public TAlgebra::vector_type,
143 template <
typename TElem>
210 vector_type::operator=(d);
251 template <
typename TElem>
253 {
return m_spDD->template begin<TElem>();}
255 template <
typename TElem>
258 {
return m_spDD->template begin<TElem>(validStates);}
260 template <
typename TElem>
262 {
return m_spDD->template end<TElem>();}
264 template <
typename TElem>
267 {
return m_spDD->template end<TElem>(validStates);}
269 template <
typename TElem>
271 {
return m_spDD->template begin<TElem>(si);}
273 template <
typename TElem>
276 {
return m_spDD->template begin<TElem>(si, validStates);}
278 template <
typename TElem>
280 {
return m_spDD->template end<TElem>(si);}
282 template <
typename TElem>
285 {
return m_spDD->template end<TElem>(si, validStates);}
289 template <
typename TElem,
typename TBaseElem>
291 TElem* elem,
bool clearContainer =
true)
const{
292 m_spDD->collect_associated(vAssElem, elem, clearContainer);
296 template <
class TGeomObj>
298 return m_spDD->is_contained(obj);
312 size_t num_dofs(
int fct,
int si)
const;
316 template <
typename TElem>
318 {
m_spDD->indices(elem, ind, bHang);}
321 template <
typename TElem>
322 size_t dof_indices(TElem* elem,
size_t fct, std::vector<DoFIndex>& ind,
bool bHang =
false,
bool bClear =
true)
const
323 {
return m_spDD->dof_indices(elem, fct, ind, bHang, bClear);}
326 template <
typename TElem>
327 size_t inner_dof_indices(TElem* elem,
size_t fct, std::vector<DoFIndex>& ind,
bool bClear =
true)
const
328 {
return m_spDD->inner_dof_indices(elem, fct, ind, bClear);}
331 template <
typename TElem>
332 size_t algebra_indices(TElem* elem, std::vector<size_t>& ind,
bool bClear =
true)
const
333 {
return m_spDD->algebra_indices(elem, ind, bClear);}
336 template <
typename TElem>
338 {
return m_spDD->inner_algebra_indices(elem, ind, bClear);}
384 virtual void copy_values(
const std::vector<std::pair<size_t, size_t> >& vIndexMap,
385 bool bDisjunct =
false);
425 template <
typename TDomain,
typename TAlgebra>
432 template <
typename TDomain,
typename TAlgebra>
435 outStream << *dynamic_cast<const GridFunction<TDomain, TAlgebra>*>(&v);
Definition: smart_pointer.h:296
Definition: smart_pointer.h:108
Definition: adaption_surface_grid_function.h:43
base class for approximation spaces without type of algebra or dof distribution
Definition: approximation_space.h:279
static const int ALL_FCT
Definition: dof_count.h:48
static const int ALL_SUBSET
Definition: dof_count.h:49
Definition: dof_distribution_info.h:152
represents numerical solutions on a grid using an algebraic vector
Definition: grid_function.h:121
TDomain domain_type
Domain.
Definition: grid_function.h:130
size_t num_dofs() const
Definition: grid_function.h:310
traits< TElem >::const_iterator begin(SurfaceView::SurfaceConstants validStates) const
Definition: grid_function.h:257
ConstSmartPtr< ApproximationSpace< TDomain > > approx_space() const
returns const domain
Definition: grid_function.h:351
ConstSmartPtr< DoFDistribution > dof_distribution() const
Definition: grid_function.h:242
size_t num_indices() const
return the number of indices distributed (proc local)
Definition: grid_function.h:303
traits< TElem >::const_iterator begin(int si) const
Definition: grid_function.h:270
void check_algebra()
checks the algebra
Definition: grid_function_impl.h:127
size_t num_dofs(int fct) const
Definition: grid_function.h:311
bool m_bRedistribute
specifies whether the gridfunction should be redistributed together with the grid.
Definition: grid_function.h:419
GridFunction< TDomain, TAlgebra > this_type
This type.
Definition: grid_function.h:124
bool redistribution_enabled() const
retruns true if the grid-function is redistributed together with the grid in parallel applications
Definition: grid_function.h:361
algebra_type::vector_type vector_type
Vector type used to store dof values.
Definition: grid_function.h:139
traits< TElem >::const_iterator end(int si, SurfaceView::SurfaceConstants validStates) const
Definition: grid_function.h:284
this_type & operator=(const this_type &v)
assigns another grid function
Definition: grid_function.h:201
SmartPtr< TDomain > domain()
returns domain
Definition: grid_function.h:342
TAlgebra algebra_type
Algebra type.
Definition: grid_function.h:136
size_t inner_dof_indices(TElem *elem, size_t fct, std::vector< DoFIndex > &ind, bool bClear=true) const
get multi indices on an geometric object in canonical order
Definition: grid_function.h:327
void indices(TElem *elem, LocalIndices &ind, bool bHang=false) const
get all indices of the element
Definition: grid_function.h:317
SmartPtr< DoFDistribution > dof_distribution()
Definition: grid_function.h:236
uint m_preDistStorageType
stores the storage-type from before redistribution
Definition: grid_function.h:422
SmartPtr< ApproximationSpace< TDomain > > m_spApproxSpace
Approximation Space.
Definition: grid_function.h:412
traits< TElem >::const_iterator end(int si) const
Definition: grid_function.h:279
ApproximationSpace< TDomain > approximation_space_type
Type of Approximation space.
Definition: grid_function.h:127
virtual void copy_values(const std::vector< std::pair< size_t, size_t > > &vIndexMap, bool bDisjunct=false)
copy values
Definition: grid_function_impl.h:270
virtual void clone_pattern(const this_type &v)
copies the GridFunction v, except that the values are copied.
Definition: grid_function_impl.h:169
SmartPtr< ApproximationSpace< TDomain > > approx_space()
returns approx space
Definition: grid_function.h:348
bool managed() const
return m_bManaged
Definition: grid_function.h:355
traits< TElem >::const_iterator begin(int si, SurfaceView::SurfaceConstants validStates) const
Definition: grid_function.h:275
size_t dof_indices(TElem *elem, size_t fct, std::vector< DoFIndex > &ind, bool bHang=false, bool bClear=true) const
get multi indices on an finite element in canonical order
Definition: grid_function.h:322
dim_traits< dim-1 >::iterator side_iterator
Definition: grid_function.h:164
GridFunction(SmartPtr< ApproximationSpace< TDomain > > spApproxSpace, SmartPtr< DoFDistribution > spDoFDistr, bool bManage=true)
Initializing Constructor.
Definition: grid_function_impl.h:57
void grid_changed_callback(const GridMessage_Adaption &msg)
Definition: grid_function_impl.h:315
SmartPtr< this_type > clone_without_values() const
clone excluding values
Definition: grid_function.h:219
dim_traits< dim >::const_iterator const_element_iterator
Definition: grid_function.h:161
virtual void resize_values(size_t s, number defaultValue=0.0)
resize
Definition: grid_function_impl.h:227
size_t algebra_indices(TElem *elem, std::vector< size_t > &ind, bool bClear=true) const
get algebra indices on an geometric object in canonical order
Definition: grid_function.h:332
void grid_distribution_callback(const GridMessage_Distribution &msg)
called during parallel redistribution
Definition: grid_function_impl.h:390
virtual this_type * virtual_clone() const
virtual clone using covariant return type
Definition: grid_function.h:169
MessageHub::SPCallbackId m_spGridDistributionCallbackID
Definition: grid_function.h:391
virtual void permute_values(const std::vector< size_t > &vIndNew)
permutes all values
Definition: grid_function_impl.h:243
static const int dim
World Dimension.
Definition: grid_function.h:133
traits< TElem >::const_iterator begin() const
Definition: grid_function.h:252
void SetConsistentStorageType()
Definition: grid_function.h:370
void collect_associated(std::vector< TBaseElem * > &vAssElem, TElem *elem, bool clearContainer=true) const
returns the adjacend elements
Definition: grid_function.h:290
void register_at_adaption_msg_hub()
registers at message hub for grid adaption
Definition: grid_function_impl.h:299
SmartPtr< AdaptionSurfaceGridFunction< TDomain > > m_spAdaptGridFct
adaption grid function for temporary storage of values in grid
Definition: grid_function.h:405
SmartPtr< DoFDistribution > m_spDD
DoF Distribution this GridFunction relies on.
Definition: grid_function.h:409
const GridLevel & grid_level() const
returns the grid level
Definition: grid_function.h:247
size_t num_indices(int si) const
return the number of indices distributed on subset si (proc local)
Definition: grid_function.h:306
ConstSmartPtr< TDomain > domain() const
returns const domain
Definition: grid_function.h:345
void enable_redistribution(bool enable)
enables or disables redistribution for this grid function
Definition: grid_function.h:367
void assign(const this_type &v)
assigns another GridFunction
Definition: grid_function_impl.h:195
dim_traits< dim-1 >::const_iterator const_side_iterator
Definition: grid_function.h:165
ConstSmartPtr< DoFDistribution > dd() const
Definition: grid_function.h:243
GridFunction(const this_type &v)
Copy constructor.
Definition: grid_function.h:198
SmartPtr< this_type > clone() const
clone including values
Definition: grid_function.h:215
bool m_bManaged
boolean for DoF Distribution management of grid function
Definition: grid_function.h:415
MessageHub::SPCallbackId m_spGridAdaptionCallbackID
message hub id
Definition: grid_function.h:390
dim_traits< dim >::grid_base_object element_type
Definition: grid_function.h:159
virtual this_type * virtual_clone_without_values() const
virtual clone using covariant return type excluding values
Definition: grid_function_impl.h:206
traits< TElem >::const_iterator end() const
Definition: grid_function.h:261
SmartPtr< DoFDistribution > dd()
Definition: grid_function.h:237
virtual ~GridFunction()
Destructor.
Definition: grid_function.h:231
void init(SmartPtr< ApproximationSpace< TDomain > > spApproxSpace, SmartPtr< DoFDistribution > spDoFDistr, bool bManage)
inits the grid function
Definition: grid_function_impl.h:87
dim_traits< dim >::iterator element_iterator
Definition: grid_function.h:160
size_t inner_algebra_indices(TElem *elem, std::vector< size_t > &ind, bool bClear=true) const
get algebra indices on an geometric object in canonical order
Definition: grid_function.h:337
traits< TElem >::const_iterator end(SurfaceView::SurfaceConstants validStates) const
Definition: grid_function.h:266
bool is_contained(TGeomObj *obj) const
returns if the grid object is part of this grid function
Definition: grid_function.h:297
dim_traits< dim-1 >::grid_base_object side_type
Definition: grid_function.h:163
this_type & operator=(number d)
assigns constant value
Definition: grid_function.h:208
Definition: grid_level.h:42
A message sent along with "GridRefinement" messages.
Definition: lib_grid_messages.h:91
Definition: lib_grid_messages.h:166
Base class for all Grid Functions.
Definition: grid_function.h:56
virtual void resize_values(size_t s, number defaultValue=0.0)=0
resize
virtual void permute_values(const std::vector< size_t > &vIndNew)=0
permutes all values
virtual void copy_values(const std::vector< std::pair< size_t, size_t > > &vIndexMap, bool bDisjunct=false)=0
copy values
virtual ~IGridFunction()
Definition: grid_function.h:58
Definition: local_algebra.h:50
Const iterator to traverse the surface of a multi-grid hierarchy.
Definition: surface_view.h:237
Iterator to traverse the surface of a multi-grid hierarchy.
Definition: surface_view.h:178
SurfaceConstants
Definition: surface_view.h:72
@ PST_CONSISTENT
Definition: parallel_storage_type.h:68
std::ostream & operator<<(std::ostream &outStream, const ug::MathMatrix< 2, 2 > &m)
Definition: math_matrix.cpp:38
PrandtlReuss< TDomain > this_type
unsigned int uint
Definition: types.h:114
double number
Definition: types.h:124
CPUAlgebra::vector_type vector_type
const T & getVector(const T &t)
Definition: template_expressions.h:123
domain_traits< dim >::grid_base_object grid_base_object
Definition: dof_distribution.h:88
TElem grid_object
Definition: dof_distribution.h:80
Definition: grid_function.h:153
DoFDistribution::dim_traits< dim >::const_iterator const_iterator
Definition: grid_function.h:156
DoFDistribution::dim_traits< dim >::grid_base_object grid_base_object
Definition: grid_function.h:154
DoFDistribution::dim_traits< dim >::iterator iterator
Definition: grid_function.h:155
iterator traits
Definition: grid_function.h:145
DoFDistribution::traits< TElem >::iterator iterator
Definition: grid_function.h:147
DoFDistribution::traits< TElem >::const_iterator const_iterator
Definition: grid_function.h:148
DoFDistribution::traits< TElem >::grid_object grid_object
Definition: grid_function.h:146