Loading [MathJax]/extensions/tex2jax.js
ug4
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ug::IGridFunction Class Referenceabstract

Base class for all Grid Functions. More...

#include <grid_function.h>

+ Inheritance diagram for ug::IGridFunction:

Public Member Functions

virtual void copy_values (const std::vector< std::pair< size_t, size_t > > &vIndexMap, bool bDisjunct=false)=0
 copy values
 
virtual void permute_values (const std::vector< size_t > &vIndNew)=0
 permutes all values
 
virtual void resize_values (size_t s, number defaultValue=0.0)=0
 resize
 
virtual ~IGridFunction ()
 

Detailed Description

Base class for all Grid Functions.

This class is the base class for all grid functions. It basically only stores the Dof distribution and registers itself at the DoFDistribution on creation, such that the Grid function is adapted when the Distribution is changed.

Constructor & Destructor Documentation

◆ ~IGridFunction()

virtual ug::IGridFunction::~IGridFunction ( )
inlinevirtual

Member Function Documentation

◆ copy_values()

virtual void ug::IGridFunction::copy_values ( const std::vector< std::pair< size_t, size_t > > &  vIndexMap,
bool  bDisjunct = false 
)
pure virtual

copy values

This method copies values between indices according to the passed mapping. The copy of the values is are performed as:

for all i: newIndex = vIndexMap[i].second oldIndex = vIndexMap[i].first value[newIndex] <- value[oldIndex]

If the copy operation is known to be a disjunct composition (i.e. each index appears only in one operation), this can be specified by a flag. In this case the order in which the copying is performed is arbitrary and this will save a copy operation of the whole vector.

Parameters
[in]vIndexMapvector of index mappings (indexOld, indexNew)
[in]bDisjunctflag, if permutation disjunct
Returns
success flag

Implemented in ug::GridFunction< TDomain, TAlgebra >, and ug::GridFunction< TDomain, ug::CPUAlgebra >.

◆ permute_values()

virtual void ug::IGridFunction::permute_values ( const std::vector< size_t > &  vIndNew)
pure virtual

permutes all values

This method permutes the values according to the passed mapping vector, i.e. it performs a permutation of the whole index set. The vector vIndNew must have the size of the number of indices and for each index it must return the new index, i.e. newIndex = vIndNew[oldIndex].

Parameters
[in]vIndNewmapping for each index
Returns
success flag

Implemented in ug::GridFunction< TDomain, TAlgebra >, and ug::GridFunction< TDomain, ug::CPUAlgebra >.

◆ resize_values()

virtual void ug::IGridFunction::resize_values ( size_t  s,
number  defaultValue = 0.0 
)
pure virtual

resize

This method resizes the length of the vector.

Parameters
[in]snew size
[in]defaultValuedefault value for new entries

Implemented in ug::GridFunction< TDomain, TAlgebra >, and ug::GridFunction< TDomain, ug::CPUAlgebra >.


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