ug4
|
Base class for all Grid Functions. More...
#include <grid_function.h>
Public Member Functions | |
virtual void | copy_values (const std::vector< std::pair< size_t, size_t > > &vIndexMap, bool bDisjunct=false)=0 |
copy values More... | |
virtual void | permute_values (const std::vector< size_t > &vIndNew)=0 |
permutes all values More... | |
virtual void | resize_values (size_t s, number defaultValue=0.0)=0 |
resize More... | |
virtual | ~IGridFunction () |
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.
|
inlinevirtual |
|
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.
[in] | vIndexMap | vector of index mappings (indexOld, indexNew) |
[in] | bDisjunct | flag, if permutation disjunct |
Implemented in ug::GridFunction< TDomain, TAlgebra >.
|
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].
[in] | vIndNew | mapping for each index |
Implemented in ug::GridFunction< TDomain, TAlgebra >.
|
pure virtual |
resize
This method resizes the length of the vector.
[in] | s | new size |
[in] | defaultValue | default value for new entries |
Implemented in ug::GridFunction< TDomain, TAlgebra >.