MGIS 3.1.0
Loading...
Searching...
No Matches
Quantity.hxx File Reference

File which defines the concepts and the modifiers used to handle the values of a function or an evaluator as TFEL's quantities, i.e. scalar values associated with a physical unit. More...

Classes

struct  mgis::function::internals::CompileTimeSize<::tfel::math::qt< UnitType, real > >
 specialization for a quantity owning its value, which has one component More...
struct  mgis::function::internals::CompileTimeSize<::tfel::math::qt_ref< UnitType, real > >
 specialization for a mutable reference to a quantity, which has one component More...
struct  mgis::function::internals::CompileTimeSize<::tfel::math::const_qt_ref< UnitType, real > >
 specialization for a read-only reference to a quantity, which has one component More...
struct  mgis::function::internals::quantity_modifier< UnitType >
 structure used to modify a function or an evaluator so that it returns its values as quantities, i.e. scalar values associated with a physical unit More...
struct  mgis::function::internals::ScalarModifier< T >
 metafunction giving the modifier used to view the values of a function or an evaluator as scalars of type T More...
struct  mgis::function::internals::ScalarModifier< real >
 specialization for real scalars, which have no physical unit More...

Namespaces

namespace  mgis
 the namespace mgis encloses all the MGIS project.

Concepts

concept  mgis::function::QuantityConcept
 concept defining the types which are quantities of real numbers
concept  mgis::function::ScalarConcept
 concept defining the types which can address a scalar value, either a real scalar or a quantity of real numbers
concept  mgis::function::MutableScalarConcept
 concept defining the non const qualified scalar types, i.e. the scalar types which can be used to modify values

Functions

template<ViewableFunctionArgumentConcept QualifiedFunctionArgumentType, ::tfel::math::unit::UnitConcept UnitType>
requires (internals::checkNumberOfComponentsCompatibility< QualifiedFunctionArgumentType, 1u>())
constexpr auto mgis::function::operator| (QualifiedFunctionArgumentType &&f, const internals::quantity_modifier< UnitType > &m)
 create a view returning the values of a function as quantities

Variables

template<::tfel::math::unit::UnitConcept UnitType>
constexpr auto mgis::function::as_quantity = internals::quantity_modifier<UnitType>{}
 modifier used to return the values of a function or an evaluator as quantities
template<MutableScalarConcept T = real>
constexpr auto mgis::function::as_qt = typename internals::ScalarModifier<T>::type{}
 modifier used to return the values of a function or an evaluator as scalars of type T

Detailed Description

File which defines the concepts and the modifiers used to handle the values of a function or an evaluator as TFEL's quantities, i.e. scalar values associated with a physical unit.

Author
Thomas Helfer
Date
16/08/2026

Function Documentation

◆ operator|()

template<ViewableFunctionArgumentConcept QualifiedFunctionArgumentType, ::tfel::math::unit::UnitConcept UnitType>
requires (internals::checkNumberOfComponentsCompatibility< QualifiedFunctionArgumentType, 1u>())
auto mgis::function::operator| ( QualifiedFunctionArgumentType && f,
const internals::quantity_modifier< UnitType > & m )
constexpr

create a view returning the values of a function as quantities

Template Parameters
QualifiedFunctionArgumentTypetype of the function, which may be a qualified type (reference, const, etc...)
UnitTypeunit of the quantities returned by the view
Parameters
[in]ffunction
[in]mmodifier
Returns
a view returning the values of the function as quantities with the unit UnitType
Note
only available if the number of components of the function is compatible with a quantity, i.e. is equal to one or is only known at run time

Variable Documentation

◆ as_qt

template<MutableScalarConcept T = real>
auto mgis::function::as_qt = typename internals::ScalarModifier<T>::type{}
inlineconstexpr

modifier used to return the values of a function or an evaluator as scalars of type T

If T is a quantity, this modifier is as_quantity with the unit of T. If T is real, which is the default, this modifier is as_scalar

Template Parameters
Tscalar type, which must satisfy the MutableScalarConcept concept

◆ as_quantity

template<::tfel::math::unit::UnitConcept UnitType>
auto mgis::function::as_quantity = internals::quantity_modifier<UnitType>{}
inlineconstexpr

modifier used to return the values of a function or an evaluator as quantities

Template Parameters
UnitTypeunit of the quantities