|
PLaSK library
|
Template for implementation of field provider class which holds vector of values and mesh inside. More...
#include <plask/provider/providerfor.hpp>
Public Types | |
| typedef shared_ptr< MeshType > | MeshPointerType |
| Type of mesh pointer. | |
| typedef ProviderImpl< PropertyT, MULTI_FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::ProvidedType | ProvidedType |
| Type of provided value. | |
| typedef DataVector< const ValueType > | HeldType |
| Type that is used to store value. | |
Public Types inherited from plask::ProviderFor< PropertyT, SpaceT > | |
| typedef PropertyT | PropertyTag |
| typedef SpaceT | SpaceType |
Public Member Functions | |
| auto | getMesh () -> decltype(*mesh_ptr) |
| Get mesh. | |
| auto | getMesh () const -> decltype(*mesh_ptr) |
| Get mesh (const). | |
| void | setMesh (MeshPointerType mesh_p) |
| Set a new Mesh. | |
| void | invalidate () |
| Reset values to uninitialized state (nullptr data). | |
| void | allocate (size_t num) |
| Reserve memory for n values using mesh size. | |
| void | push_back (const HeldType &value) |
| Add new value. | |
| size_t | size () const override |
| Get number of values. | |
| bool | hasCorrectValue (size_t n) const |
| Check if this has values of the right size. | |
| bool | hasCorrectValues () const |
| Check if this has values of the right size. | |
| void | ensureHasCorrectValue (size_t n) const |
| Throw NoValue exception if value is not initialized and BadMesh exception if the mesh and values sizes mismatch. | |
| void | ensureHasCorrectValues () const |
| Throw NoValue exception if value is not initialized and BadMesh exception if the mesh and values sizes mismatch. | |
| void | onMeshChange (const Mesh::Event &PLASK_UNUSED(evt)) |
| This method is called when mesh was changed. | |
| WithValue (HeldType values, MeshPointerType mesh_ptr=nullptr, InterpolationMethod default_interpolation=INTERPOLATION_LINEAR) | |
| WithValue (const std::initializer_list< HeldType > &values, MeshPointerType mesh_ptr=nullptr, InterpolationMethod default_interpolation=INTERPOLATION_LINEAR) | |
| template<typename Iterator > | |
| WithValue (const Iterator &begin, const Iterator &end, MeshPointerType mesh_ptr=nullptr, InterpolationMethod default_interpolation=INTERPOLATION_LINEAR) | |
| WithValue (MeshPointerType mesh_ptr=nullptr, const InterpolationMethod &default_interpolation=INTERPOLATION_LINEAR) | |
| ~WithValue () | |
| HeldType & | operator() (size_t n) |
| Get provided value in points described by this->mesh. | |
| const HeldType & | operator() (size_t n) const |
| Get provided value in points described by this->mesh. | |
| ProvidedType | operator() (EnumType num, shared_ptr< const MeshD< SpaceT::DIM > > dst_mesh, _ExtraParams..., InterpolationMethod method=INTERPOLATION_DEFAULT) const override |
| Calculate interpolated values using plask::interpolate. | |
Public Member Functions inherited from plask::ProviderFor< PropertyT, SpaceT > | |
| ProviderFor (Args &&... params) | |
| Delegate all constructors to parent class. | |
Public Attributes | |
| std::vector< HeldType > | values |
| Provided values. Values in points described by this->mesh. | |
Protected Attributes | |
| MeshPointerType | mesh_ptr |
| Mesh which describes in which points there are this->values. | |
| InterpolationMethod | default_interpolation |
| Default interpolation method. | |
Template for implementation of field provider class which holds vector of values and mesh inside.
operator() call plask::interpolate.
| MeshPtrType | type of pointer (shared_ptr or unique_ptr) to mesh which is used for calculation and which describe places of data points |
Definition at line 1287 of file providerfor.hpp.
| typedef DataVector<const ValueType> plask::ProviderImpl< PropertyT, MULTI_FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue< MeshType >::HeldType |
Type that is used to store value.
Definition at line 1296 of file providerfor.hpp.
| typedef shared_ptr<MeshType> plask::ProviderImpl< PropertyT, MULTI_FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue< MeshType >::MeshPointerType |
Type of mesh pointer.
Definition at line 1290 of file providerfor.hpp.
| typedef ProviderImpl<PropertyT,MULTI_FIELD_PROPERTY,SpaceT,VariadicTemplateTypesHolder<_ExtraParams...>>::ProvidedType plask::ProviderImpl< PropertyT, MULTI_FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue< MeshType >::ProvidedType |
Type of provided value.
Definition at line 1293 of file providerfor.hpp.
|
inlineexplicit |
| values | single (first) provided value |
| mesh_ptr | pointer to mesh which describes in which points there are this->values |
| default_interpolation | default interpolation method for this provider |
Definition at line 1413 of file providerfor.hpp.
|
inlineexplicit |
| values | provided values list |
| mesh_ptr | pointer to mesh which describes in which points there are this->values |
| default_interpolation | default interpolation method for this provider |
Definition at line 1423 of file providerfor.hpp.
|
inlineexplicit |
| begin,end | iterators to range to construct values from |
| mesh_ptr | pointer to mesh which describes in which points there are this->values |
| default_interpolation | default interpolation method for this provider |
Definition at line 1434 of file providerfor.hpp.
|
inlineexplicit |
| mesh_ptr | pointer to mesh which describes in which points there are this->values |
| default_interpolation | type of interpolation to use as default |
Definition at line 1443 of file providerfor.hpp.
|
inline |
Definition at line 1448 of file providerfor.hpp.
|
inline |
Reserve memory for n values using mesh size.
| num | number of values |
Definition at line 1339 of file providerfor.hpp.
|
inline |
Throw NoValue exception if value is not initialized and BadMesh exception if the mesh and values sizes mismatch.
| n | value index |
Definition at line 1384 of file providerfor.hpp.
|
inline |
Throw NoValue exception if value is not initialized and BadMesh exception if the mesh and values sizes mismatch.
Definition at line 1391 of file providerfor.hpp.
|
inline |
|
inline |
|
inline |
Check if this has values of the right size.
| n | value index |
true only if this is initialized (has value) Definition at line 1365 of file providerfor.hpp.
|
inline |
Check if this has values of the right size.
true only if this is initialized (has value) Definition at line 1373 of file providerfor.hpp.
|
inline |
Reset values to uninitialized state (nullptr data).
Definition at line 1334 of file providerfor.hpp.
|
inline |
This method is called when mesh was changed.
It's just call invalidate()
| evt | information about mesh changes |
Definition at line 1403 of file providerfor.hpp.
|
inlineoverride |
Calculate interpolated values using plask::interpolate.
| num | value index |
| dst_mesh | set of requested points |
| method | method which should be use to do interpolation |
Definition at line 1479 of file providerfor.hpp.
|
inline |
Get provided value in points described by this->mesh.
| n | value index |
Definition at line 1457 of file providerfor.hpp.
|
inline |
Get provided value in points described by this->mesh.
| n | value index |
Definition at line 1467 of file providerfor.hpp.
|
inline |
|
inline |
Set a new Mesh.
| mesh_p | pointer to the new mesh |
Definition at line 1327 of file providerfor.hpp.
|
inlineoverride |
|
protected |
Default interpolation method.
Definition at line 1307 of file providerfor.hpp.
|
protected |
Mesh which describes in which points there are this->values.
Definition at line 1304 of file providerfor.hpp.
| std::vector<HeldType> plask::ProviderImpl< PropertyT, MULTI_FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue< MeshType >::values |
Provided values. Values in points described by this->mesh.
Definition at line 1299 of file providerfor.hpp.