PLaSK library
Loading...
Searching...
No Matches
plask::ProviderImpl< PropertyT, FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue< MeshType > Struct Template Reference

Template for implementation of field provider class which holds vector of values and mesh inside. More...

#include <plask/provider/providerfor.hpp>

Inheritance diagram for plask::ProviderImpl< PropertyT, FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue< MeshType >:
[legend]
Collaboration diagram for plask::ProviderImpl< PropertyT, FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue< MeshType >:
[legend]

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 ValueTypeHeldType
 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 ()
 
ProvidedTypeoperator() ()
 Get provided value in points described by this->mesh.
 
const ProvidedTypeoperator() () 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.
 

Detailed Description

template<typename PropertyT, typename SpaceT, typename... _ExtraParams>
template<typename MeshType>
struct plask::ProviderImpl< PropertyT, FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue< MeshType >

Template for implementation of field provider class which holds vector of values and mesh inside.

operator() call plask::interpolate.

Template Parameters
MeshPtrTypetype 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.

Member Typedef Documentation

◆ HeldType

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>
template<typename MeshType >
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.

◆ MeshPointerType

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>
template<typename MeshType >
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.

◆ ProvidedType

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>
template<typename MeshType >
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.

Constructor & Destructor Documentation

◆ WithValue() [1/2]

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>
template<typename MeshType >
plask::ProviderImpl< PropertyT, FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue< MeshType >::WithValue ( HeldType  values,
MeshPointerType  mesh_ptr = nullptr,
InterpolationMethod  default_interpolation = INTERPOLATION_LINEAR 
)
inlineexplicit
Parameters
valuesprovided value, values in points describe by this->mesh.
mesh_ptrpointer to mesh which describes in which points there are this->values
default_interpolationdefault interpolation method for this provider

Definition at line 1133 of file providerfor.hpp.

◆ WithValue() [2/2]

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>
template<typename MeshType >
plask::ProviderImpl< PropertyT, FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue< MeshType >::WithValue ( MeshPointerType  mesh_ptr = nullptr,
const InterpolationMethod default_interpolation = INTERPOLATION_LINEAR 
)
inlineexplicit
Parameters
mesh_ptrpointer to mesh which describes in which points there are this->values
default_interpolationtype of interpolation to use as default

Definition at line 1142 of file providerfor.hpp.

◆ ~WithValue()

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>
template<typename MeshType >
plask::ProviderImpl< PropertyT, FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue< MeshType >::~WithValue ( )
inline

Definition at line 1147 of file providerfor.hpp.

Member Function Documentation

◆ allocate()

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>
template<typename MeshType >
void plask::ProviderImpl< PropertyT, FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue< MeshType >::allocate ( )
inline

Reserve memory in values using mesh size.

Definition at line 1092 of file providerfor.hpp.

◆ ensureHasCorrectValue()

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>
template<typename MeshType >
void plask::ProviderImpl< PropertyT, FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue< MeshType >::ensureHasCorrectValue ( ) const
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.

◆ ensureHasValue()

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>
template<typename MeshType >
void plask::ProviderImpl< PropertyT, FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue< MeshType >::ensureHasValue ( ) const
inline

Throw NoValue exception if value is not initialized.

Definition at line 1101 of file providerfor.hpp.

◆ getMesh() [1/2]

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>
template<typename MeshType >
auto plask::ProviderImpl< PropertyT, FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue< MeshType >::getMesh ( ) -> decltype(*mesh_ptr)
inline

Get mesh.

Returns
*mesh_ptr

Definition at line 1070 of file providerfor.hpp.

◆ getMesh() [2/2]

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>
template<typename MeshType >
auto plask::ProviderImpl< PropertyT, FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue< MeshType >::getMesh ( ) const -> decltype(*mesh_ptr)
inline

Get mesh (const).

Returns
*mesh_ptr

Definition at line 1076 of file providerfor.hpp.

◆ hasCorrectValue()

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>
template<typename MeshType >
bool plask::ProviderImpl< PropertyT, FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue< MeshType >::hasCorrectValue ( ) const
inline

Check if this has value of the right size.

Returns
true only if this is initialized (has value)

Definition at line 1109 of file providerfor.hpp.

◆ hasValue()

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>
template<typename MeshType >
bool plask::ProviderImpl< PropertyT, FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue< MeshType >::hasValue ( ) const
inline

Check if this has value / is initialized.

Returns
true only if this is initialized (has value)

Definition at line 1098 of file providerfor.hpp.

◆ invalidate()

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>
template<typename MeshType >
void plask::ProviderImpl< PropertyT, FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue< MeshType >::invalidate ( )
inline

Reset values to uninitialized state (nullptr data).

Definition at line 1089 of file providerfor.hpp.

◆ onMeshChange()

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>
template<typename MeshType >
void plask::ProviderImpl< PropertyT, FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue< MeshType >::onMeshChange ( const Mesh::Event PLASK_UNUSEDevt)
inline

This method is called when mesh was changed.

It just calls invalidate().

Parameters
evtinformation about mesh changes

Definition at line 1123 of file providerfor.hpp.

◆ operator()() [1/3]

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>
template<typename MeshType >
ProvidedType & plask::ProviderImpl< PropertyT, FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue< MeshType >::operator() ( )
inline

Get provided value in points described by this->mesh.

Returns
provided value in points described by this->mesh

Definition at line 1155 of file providerfor.hpp.

◆ operator()() [2/3]

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>
template<typename MeshType >
const ProvidedType & plask::ProviderImpl< PropertyT, FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue< MeshType >::operator() ( ) const
inline

Get provided value in points described by this->mesh.

Returns
provided value in points described by this->mesh

Definition at line 1164 of file providerfor.hpp.

◆ operator()() [3/3]

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>
template<typename MeshType >
ProvidedType plask::ProviderImpl< PropertyT, FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue< MeshType >::operator() ( shared_ptr< const MeshD< SpaceT::DIM > >  dst_mesh,
_ExtraParams...  ,
InterpolationMethod  method = INTERPOLATION_DEFAULT 
) const
inlineoverride

Calculate interpolated values using plask::interpolate.

Parameters
dst_meshset of requested points
methodmethod which should be use to do interpolation
Returns
values in points described by mesh dst_mesh

Definition at line 1175 of file providerfor.hpp.

◆ setMesh()

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>
template<typename MeshType >
void plask::ProviderImpl< PropertyT, FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue< MeshType >::setMesh ( MeshPointerType  mesh_p)
inline

Set a new Mesh.

Parameters
mesh_ppointer to the new mesh

Definition at line 1082 of file providerfor.hpp.

Member Data Documentation

◆ default_interpolation

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>
template<typename MeshType >
InterpolationMethod plask::ProviderImpl< PropertyT, FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue< MeshType >::default_interpolation
protected

Default interpolation method.

Definition at line 1062 of file providerfor.hpp.

◆ mesh_ptr

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>
template<typename MeshType >
MeshPointerType plask::ProviderImpl< PropertyT, FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue< MeshType >::mesh_ptr
protected

Mesh which describes in which points there are this->values.

Definition at line 1059 of file providerfor.hpp.

◆ values

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>
template<typename MeshType >
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.


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