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, 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 () |
Reserve memory in values using mesh size. | |
bool | hasValue () const |
Check if this has value / is initialized. | |
void | ensureHasValue () const |
Throw NoValue exception if value is not initialized. | |
bool | hasCorrectValue () const |
Check if this has value of the right size. | |
void | ensureHasCorrectValue () 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 (MeshPointerType mesh_ptr=nullptr, const InterpolationMethod &default_interpolation=INTERPOLATION_LINEAR) | |
~WithValue () | |
ProvidedType & | operator() () |
Get provided value in points described by this->mesh. | |
const ProvidedType & | operator() () const |
Get provided value in points described by this->mesh. | |
ProvidedType | operator() (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 | |
HeldType | values |
Provided value. 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) to mesh which is used for calculation and which describe places of data points |
Definition at line 1042 of file providerfor.hpp.
typedef DataVector<const ValueType> plask::ProviderImpl< PropertyT, FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue< MeshType >::HeldType |
Type that is used to store value.
Definition at line 1051 of file providerfor.hpp.
typedef shared_ptr<MeshType> plask::ProviderImpl< PropertyT, FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue< MeshType >::MeshPointerType |
Type of mesh pointer.
Definition at line 1045 of file providerfor.hpp.
typedef ProviderImpl<PropertyT,FIELD_PROPERTY,SpaceT,VariadicTemplateTypesHolder<_ExtraParams...>>::ProvidedType plask::ProviderImpl< PropertyT, FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue< MeshType >::ProvidedType |
Type of provided value.
Definition at line 1048 of file providerfor.hpp.
|
inlineexplicit |
values | provided value, values in points describe by this->mesh. |
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 1133 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 1142 of file providerfor.hpp.
|
inline |
Definition at line 1147 of file providerfor.hpp.
|
inline |
Reserve memory in values using mesh size.
Definition at line 1092 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 1112 of file providerfor.hpp.
|
inline |
Throw NoValue exception if value is not initialized.
Definition at line 1101 of file providerfor.hpp.
|
inline |
|
inline |
|
inline |
Check if this has value of the right size.
true
only if this is initialized (has value) Definition at line 1109 of file providerfor.hpp.
|
inline |
Check if this has value / is initialized.
true
only if this is initialized (has value) Definition at line 1098 of file providerfor.hpp.
|
inline |
Reset values to uninitialized state (nullptr data).
Definition at line 1089 of file providerfor.hpp.
|
inline |
This method is called when mesh was changed.
It just calls invalidate().
evt | information about mesh changes |
Definition at line 1123 of file providerfor.hpp.
|
inline |
Get provided value in points described by this->mesh.
Definition at line 1155 of file providerfor.hpp.
|
inline |
Get provided value in points described by this->mesh.
Definition at line 1164 of file providerfor.hpp.
|
inlineoverride |
Calculate interpolated values using plask::interpolate.
dst_mesh | set of requested points |
method | method which should be use to do interpolation |
Definition at line 1175 of file providerfor.hpp.
|
inline |
Set a new Mesh.
mesh_p | pointer to the new mesh |
Definition at line 1082 of file providerfor.hpp.
|
protected |
Default interpolation method.
Definition at line 1062 of file providerfor.hpp.
|
protected |
Mesh which describes in which points there are this->values.
Definition at line 1059 of file providerfor.hpp.
HeldType plask::ProviderImpl< PropertyT, FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue< MeshType >::values |
Provided value. Values in points described by this->mesh.
Definition at line 1054 of file providerfor.hpp.