PLaSK library

Loading...
Searching...
No Matches
Static Public Member Functions | Static Public Attributes | List of all members
plask::Temperature Struct Reference

Physical property tag class for temperature: More...

`#include <plask/properties/thermal.hpp>`

Inheritance diagram for plask::Temperature:
[legend]
Collaboration diagram for plask::Temperature:
[legend]

## Static Public Member Functions
static double | getDefaultValue ()
Static Public Member Functions inherited from plask::Property< _propertyType, _ValueType2D, _ValueType3D, _ExtraParams >
static ValueType2D | getDefaultValue2D ()
| Return default value of the property (usually zero) in 2D space.
static ValueType3D | getDefaultValue3D ()
| Return default value of the property (usually zero) in 3D space.

## Static Public Attributes
static constexpr const char * | NAME = "temperature"
static constexpr const char * | UNIT = "K"
Static Public Attributes inherited from plask::Property< _propertyType, _ValueType2D, _ValueType3D, _ExtraParams >
static const PropertyType | propertyType = _propertyType
| Type of property.
static constexpr const char * | NAME = PropertyTypeToProviderName<_propertyType>::value
| Name of the property.
static constexpr bool | hasUniqueValueType = false
| `true` only if property use same value type in 2D and 3D space

## Additional Inherited Members
Public Types inherited from plask::Property< _propertyType, _ValueType2D, _ValueType3D, _ExtraParams >
typedef _ValueType2D | ValueType2D
| Type of provided value in 2D space.
typedef _ValueType3D | ValueType3D
| Type of provided value in 3D space.
typedef VariadicTemplateTypesHolder< _ExtraParams... > | ExtraParams
| Extra parameters passed as arguments to provider to get value.

## Detailed Description

Physical property tag class for temperature:

- plask::ProviderFor<Temperature> is an abstract base class for temperature providers, which has following implementations:
  - plask::ProviderFor<Temperature>::Delegate is a class for temperature provider which delegate calls to functor given in its constructor;
  - plask::ProviderFor<Temperature>::WithValue is a template (parametrized by mesh type) of class for temperature provider which holds vector of value (value member) and mesh (mesh member).
- plask::ReceiverFor<Temperature> is a class for temperature receivers.

Example:

// solver calculating temperature in Cartesian 2d space:
struct PSolver1: plask::SolverOver<plask::Geometry2DCartesian> {
plask::ProviderFor<Temperature, plask::Cartesian2D>::WithValue<SomeMeshType> outTemperature;
// outTemperature.value stores temperature values in points pointed by outTemperature.mesh
// outTemperature.value has type plask::shared_ptr< std::vector<double> >
// outTemperature.mesh has type SomeMeshType (which should inherit from plask::MeshD<plask::Cartesian2D>)
// ...
};
// another solver which calculates temperature in Cartesian 2d space:
struct PSolver2: plask::SolverWithMesh<plask::Geometry2DCartesian, plask::RectilinearMesh2D> {
plask::ProviderFor<Temperature, plask::Cartesian2D>::Delegate outTemperature;
plask::DataVector<double> my_temperature;
plask::DataVector<double> getTemperature(const plask::MeshD<plask::Cartesian2D>& dst_mesh, plask::InterpolationMethod method) {
return interpolate(*mesh, my_temperature, dst_mesh, method);
}
// ...
PSolver1(): outTemperature(this, &PSolver2::getTemperature) {}
};
// needs temperature in Cartesian 2d space:
struct RSolver {
plask::ReceiverFor<Temperature, plask::Cartesian2D> inTemperature;
// ...
};
//... in program:
PSolver1 m1;
PSolver2 m2;
RSolver r;
r.inTemperature << m1.outTemperature; // connect
r.inTemperature << m2.outTemperature; // change data source of r from m1 to m2

See also
  How to write a new calculation solver?; Providers and receivers; plask::ProviderFor Temperature (K).

Definition at line 74 of file thermal.hpp.

## Member Function Documentation

## ◆ getDefaultValue()

static double plask::Temperature::getDefaultValue | ( |  | ) |
| inline static

Definition at line 77 of file thermal.hpp.

## Member Data Documentation

## ◆ NAME

constexpr const char * plask::Temperature::NAME = "temperature"
| static constexpr

Definition at line 75 of file thermal.hpp.

## ◆ UNIT

constexpr const char * plask::Temperature::UNIT = "K"
| static constexpr

Definition at line 76 of file thermal.hpp.

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

- plask/properties/thermal.hpp
- plask/properties/names.cpp