Files
MeanField_SERiF/docs/man/man3/serif_eos_runtime_EOSView.3
Emily Boudreaux 6b57738330 docs(docs): built docs
Note for now much of the docs is LLM written. This was done to save time and focus on code development. The docs have been LOOSLEY reviewed. However, the code itself has been either fully written by hand or fully reviewed. Therefore, the docs should at the moment be seen as a loose resource rather than authoratiative (and this is on top of the general ability for docs to drift)
2026-11-09 14:09:44 -05:00

375 lines
16 KiB
Groff

.TH "serif::eos::runtime::EOSView" 3 "Version v0.0.1a" "SERiF" \" -*- nroff -*-
.ad l
.nh
.SH NAME
serif::eos::runtime::EOSView \- A class to provide a runtime view of an EOS model and its relations\&. This class is used to provide a uniform interface for evaluating relations and partial derivatives at runtime\&.
.SH SYNOPSIS
.br
.PP
.PP
\fR#include <views\&.hpp>\fP
.SS "Public Member Functions"
.in +1c
.ti -1c
.RI "template<typename EOS>
.br
requires RuntimeEOSModel<std::remove_cvref_t<EOS>>\fBEOSView\fP (const EOS &eos) noexcept"
.br
.RI "Constructs an \fBEOSView\fP from a runtime EOS model\&. This constructor is used to create a view of the EOS model and its relations at runtime\&. "
.ti -1c
.RI "template<typename EOS>
.br
requires RuntimeEOSModel<std::remove_cvref_t<EOS>>\fBEOSView\fP (const EOS &&)=delete"
.br
.RI "Deleted constructor to prevent constructing an \fBEOSView\fP from an rvalue EOS model\&. This is to prevent dangling references and ensure that the EOS model instance outlives the \fBEOSView\fP\&. "
.ti -1c
.RI "std::span< const \fBdimensions::runtime::RuntimeRelationDescriptor\fP > \fBrelations\fP () const noexcept"
.br
.RI "Returns a span of the runtime relation descriptors for the EOS model\&. "
.ti -1c
.RI "bool \fBsupports\fP (const \fBdimensions::runtime::ThermodynamicQuantityID\fP outputQuantity, const std::span< const \fBdimensions::runtime::ThermodynamicQuantityID\fP > inputQuantities) const noexcept"
.br
.RI "Determines if the EOS model supports a relation with the given output quantity and input quantities at runtime\&. This is used to check if a relation can be evaluated at runtime\&. "
.ti -1c
.RI "std::expected< \fBdimensions::runtime::RuntimeQuantityValue\fP, \fButils::errors::SERiFErrorCode\fP > \fBtry_evaluate\fP (const \fBdimensions::runtime::ThermodynamicQuantityID\fP outputQuantity, const std::span< const \fBdimensions::runtime::RuntimeQuantityValue\fP > inputQuantities) const"
.br
.RI "Evaluates a relation with the given output quantity and input quantities at runtime\&. This is used to evaluate relations at runtime\&. "
.ti -1c
.RI "template<dimensions::runtime::RuntimeIdentifiedThermodynamicQuantity OutputQuantity, dimensions::ThermodynamicQuantityValueType\&.\&.\&. InputValues> std::expected< \fBdimensions::QuantityValue\fP< OutputQuantity >, \fButils::errors::SERiFErrorCode\fP > \fBtry_evaluate\fP (const InputValues\&.\&.\&. inputValues) const"
.br
.RI "Evaluates a relation with the given output quantity and input quantities at runtime\&. This is used to evaluate relations at runtime\&. "
.ti -1c
.RI "std::expected< double, \fButils::errors::SERiFErrorCode\fP > \fBtry_partial_derivative\fP (const \fBdimensions::runtime::ThermodynamicQuantityID\fP outputQuantity, const \fBdimensions::runtime::ThermodynamicQuantityID\fP withRespectTo, const std::span< const \fBdimensions::runtime::RuntimeQuantityValue\fP > inputValues) const"
.br
.RI "Evaluates a partial derivative of a relation with the given output quantity and input quantities at runtime\&. This is used to evaluate partial derivatives at runtime\&. "
.ti -1c
.RI "template<dimensions::runtime::RuntimeIdentifiedThermodynamicQuantity OutputQuantity, dimensions::runtime::RuntimeIdentifiedThermodynamicQuantity InputQuantity, dimensions::QuantityValueType\&.\&.\&. InputValues> std::expected< \fBdimensions::PartialDerivative\fP< OutputQuantity, InputQuantity >, \fButils::errors::SERiFErrorCode\fP > \fBtry_partial_derivative\fP (const InputValues\&.\&.\&. inputValues) const"
.br
.RI "Evaluates a partial derivative of a relation with the given output quantity and input quantities at runtime\&. This is used to evaluate partial derivatives at runtime\&. "
.in -1c
.SS "Private Types"
.in +1c
.ti -1c
.RI "using \fBRuntimeEvaluateFunction\fP"
.br
.RI "A type alias for a function pointer to a runtime evaluation function\&. This is used to store the evaluation function for the EOS model\&. "
.ti -1c
.RI "using \fBRuntimePartialDerivativeFunction\fP"
.br
.RI "A type alias for a function pointer to a runtime partial derivative evaluation function\&. This is used to store the partial derivative evaluation function for the EOS model\&. "
.in -1c
.SS "Private Member Functions"
.in +1c
.ti -1c
.RI "const \fBdimensions::runtime::RuntimeRelationDescriptor\fP * \fBfind_relation\fP (const \fBdimensions::runtime::ThermodynamicQuantityID\fP outputQuantity, const std::span< const \fBdimensions::runtime::ThermodynamicQuantityID\fP > inputQuantities) const noexcept"
.br
.RI "Finds a relation with the given output quantity and input quantities at runtime\&. This is used to find relations at runtime\&. "
.ti -1c
.RI "std::expected< const \fBdimensions::runtime::RuntimeRelationDescriptor\fP *, \fButils::errors::SERiFErrorCode\fP > \fBvalidate_relation_request\fP (const \fBdimensions::runtime::ThermodynamicQuantityID\fP outputQuantity, const std::span< const \fBdimensions::runtime::RuntimeQuantityValue\fP > inputValues) const"
.br
.RI "Validates a relation request with the given output quantity and input quantities at runtime\&. This is used to validate relations at runtime\&. "
.in -1c
.SS "Static Private Member Functions"
.in +1c
.ti -1c
.RI "template<typename Value> static std::expected< Value, \fButils::errors::SERiFErrorCode\fP > \fBruntime_failure\fP (const \fButils::errors::SERiFErrorCode\fP code)"
.br
.RI "A helper function to handle runtime failures\&. This is used to simplify the usage of std::expected in the runtime system\&. "
.in -1c
.SS "Private Attributes"
.in +1c
.ti -1c
.RI "const void * \fBm_object\fP"
.br
.RI "Type erased pointer to the EOS model instance\&. "
.ti -1c
.RI "std::span< const \fBdimensions::runtime::RuntimeRelationDescriptor\fP > \fBm_relations\fP"
.br
.RI "A span of the runtime relation descriptors for the EOS model\&. "
.ti -1c
.RI "\fBRuntimeEvaluateFunction\fP \fBm_evaluate\fP"
.br
.RI "A function pointer to the runtime evaluation function for the EOS model\&. "
.ti -1c
.RI "\fBRuntimePartialDerivativeFunction\fP \fBm_partialDerivative\fP"
.br
.RI "A function pointer to the runtime partial derivative evaluation function for the EOS model\&. "
.in -1c
.SH "Detailed Description"
.PP
A class to provide a runtime view of an EOS model and its relations\&. This class is used to provide a uniform interface for evaluating relations and partial derivatives at runtime\&.
.SH "Member Typedef Documentation"
.PP
.SS "using \fBserif::eos::runtime::EOSView::RuntimeEvaluateFunction\fP\fR [private]\fP"
\fBInitial value:\fP
.nf
std::expected<double, utils::errors::SERiFErrorCode> (*)(
const void*,
const dimensions::runtime::ThermodynamicQuantityID&,
std::span<const dimensions::runtime::RuntimeQuantityValue>
)
.PP
.fi
.PP
A type alias for a function pointer to a runtime evaluation function\&. This is used to store the evaluation function for the EOS model\&.
.SS "using \fBserif::eos::runtime::EOSView::RuntimePartialDerivativeFunction\fP\fR [private]\fP"
\fBInitial value:\fP
.nf
std::expected<double, utils::errors::SERiFErrorCode> (*)(
const void*,
const dimensions::runtime::ThermodynamicQuantityID&,
const dimensions::runtime::ThermodynamicQuantityID&,
std::span<const dimensions::runtime::RuntimeQuantityValue>
)
.PP
.fi
.PP
A type alias for a function pointer to a runtime partial derivative evaluation function\&. This is used to store the partial derivative evaluation function for the EOS model\&.
.SH "Constructor & Destructor Documentation"
.PP
.SS "template<typename EOS>
.br
requires RuntimeEOSModel<std::remove_cvref_t<EOS>>serif::eos::runtime::EOSView::EOSView (const EOS & eos)\fR [inline]\fP, \fR [explicit]\fP, \fR [noexcept]\fP"
.PP
Constructs an \fBEOSView\fP from a runtime EOS model\&. This constructor is used to create a view of the EOS model and its relations at runtime\&.
.PP
\fBTemplate Parameters\fP
.RS 4
\fIEOS\fP The type of the EOS model to view\&.
.RE
.PP
\fBParameters\fP
.RS 4
\fIeos\fP The EOS model instance to view\&.
.RE
.PP
.SS "template<typename EOS>
.br
requires RuntimeEOSModel<std::remove_cvref_t<EOS>>serif::eos::runtime::EOSView::EOSView (const EOS && )\fR [explicit]\fP, \fR [delete]\fP"
.PP
Deleted constructor to prevent constructing an \fBEOSView\fP from an rvalue EOS model\&. This is to prevent dangling references and ensure that the EOS model instance outlives the \fBEOSView\fP\&.
.PP
\fBTemplate Parameters\fP
.RS 4
\fIEOS\fP The type of the EOS model to view\&.
.RE
.PP
\fBParameters\fP
.RS 4
\fIeos\fP The EOS model instance to view\&.
.RE
.PP
.SH "Member Function Documentation"
.PP
.SS "const \fBdimensions::runtime::RuntimeRelationDescriptor\fP * serif::eos::runtime::EOSView::find_relation (const \fBdimensions::runtime::ThermodynamicQuantityID\fP outputQuantity, const std::span< const \fBdimensions::runtime::ThermodynamicQuantityID\fP > inputQuantities) const\fR [inline]\fP, \fR [nodiscard]\fP, \fR [private]\fP, \fR [noexcept]\fP"
.PP
Finds a relation with the given output quantity and input quantities at runtime\&. This is used to find relations at runtime\&.
.PP
\fBParameters\fP
.RS 4
\fIoutputQuantity\fP The output quantity to find the relation for\&.
.br
\fIinputQuantities\fP The input quantities to find the relation for\&.
.RE
.PP
\fBReturns\fP
.RS 4
A pointer to the runtime relation descriptor if found, nullptr otherwise\&.
.RE
.PP
\fBTodo\fP
.RS 4
move to implementation file to clean things up a bit\&.
.RE
.PP
.SS "std::span< const \fBdimensions::runtime::RuntimeRelationDescriptor\fP > serif::eos::runtime::EOSView::relations () const\fR [inline]\fP, \fR [nodiscard]\fP, \fR [noexcept]\fP"
.PP
Returns a span of the runtime relation descriptors for the EOS model\&.
.PP
\fBReturns\fP
.RS 4
A span of the runtime relation descriptors\&.
.RE
.PP
\fBTodo\fP
.RS 4
Move this to the implementation file to clean things up a bit\&.
.RE
.PP
.SS "template<typename Value> static std::expected< Value, \fButils::errors::SERiFErrorCode\fP > serif::eos::runtime::EOSView::runtime_failure (const \fButils::errors::SERiFErrorCode\fP code)\fR [inline]\fP, \fR [static]\fP, \fR [nodiscard]\fP, \fR [private]\fP"
.PP
A helper function to handle runtime failures\&. This is used to simplify the usage of std::expected in the runtime system\&.
.PP
\fBTemplate Parameters\fP
.RS 4
\fIValue\fP The type of the value to return\&.
.RE
.PP
\fBParameters\fP
.RS 4
\fIcode\fP The \fBSERiFErrorCode\fP to return\&.
.RE
.PP
\fBReturns\fP
.RS 4
A std::unexpected containing the \fBSERiFErrorCode\fP\&.
.RE
.PP
.SS "bool serif::eos::runtime::EOSView::supports (const \fBdimensions::runtime::ThermodynamicQuantityID\fP outputQuantity, const std::span< const \fBdimensions::runtime::ThermodynamicQuantityID\fP > inputQuantities) const\fR [inline]\fP, \fR [nodiscard]\fP, \fR [noexcept]\fP"
.PP
Determines if the EOS model supports a relation with the given output quantity and input quantities at runtime\&. This is used to check if a relation can be evaluated at runtime\&.
.PP
\fBParameters\fP
.RS 4
\fIoutputQuantity\fP The output quantity to check\&.
.br
\fIinputQuantities\fP The input quantities to check\&.
.RE
.PP
\fBReturns\fP
.RS 4
True if the relation is supported, false otherwise\&.
.RE
.PP
.SS "std::expected< \fBdimensions::runtime::RuntimeQuantityValue\fP, \fButils::errors::SERiFErrorCode\fP > serif::eos::runtime::EOSView::try_evaluate (const \fBdimensions::runtime::ThermodynamicQuantityID\fP outputQuantity, const std::span< const \fBdimensions::runtime::RuntimeQuantityValue\fP > inputQuantities) const\fR [inline]\fP, \fR [nodiscard]\fP"
.PP
Evaluates a relation with the given output quantity and input quantities at runtime\&. This is used to evaluate relations at runtime\&.
.PP
\fBParameters\fP
.RS 4
\fIoutputQuantity\fP The output quantity to evaluate\&.
.br
\fIinputQuantities\fP The input quantities to evaluate\&.
.RE
.PP
\fBReturns\fP
.RS 4
A std::expected containing the result of the evaluation or a \fBSERiFErrorCode\fP if the evaluation failed\&.
.RE
.PP
.SS "template<dimensions::runtime::RuntimeIdentifiedThermodynamicQuantity OutputQuantity, dimensions::ThermodynamicQuantityValueType\&.\&.\&. InputValues> std::expected< \fBdimensions::QuantityValue\fP< OutputQuantity >, \fButils::errors::SERiFErrorCode\fP > serif::eos::runtime::EOSView::try_evaluate (const InputValues\&.\&.\&. inputValues) const\fR [inline]\fP, \fR [nodiscard]\fP"
.PP
Evaluates a relation with the given output quantity and input quantities at runtime\&. This is used to evaluate relations at runtime\&.
.PP
\fBTemplate Parameters\fP
.RS 4
\fIOutputQuantity\fP The output quantity to evaluate\&.
.br
\fIInputValues\fP The input values to evaluate\&.
.RE
.PP
\fBReturns\fP
.RS 4
A std::expected containing the result of the evaluation or a \fBSERiFErrorCode\fP if the evaluation failed\&.
.RE
.PP
.SS "std::expected< double, \fButils::errors::SERiFErrorCode\fP > serif::eos::runtime::EOSView::try_partial_derivative (const \fBdimensions::runtime::ThermodynamicQuantityID\fP outputQuantity, const \fBdimensions::runtime::ThermodynamicQuantityID\fP withRespectTo, const std::span< const \fBdimensions::runtime::RuntimeQuantityValue\fP > inputValues) const\fR [inline]\fP, \fR [nodiscard]\fP"
.PP
Evaluates a partial derivative of a relation with the given output quantity and input quantities at runtime\&. This is used to evaluate partial derivatives at runtime\&.
.PP
\fBParameters\fP
.RS 4
\fIoutputQuantity\fP The output quantity to evaluate\&.
.br
\fIwithRespectTo\fP The input quantity with respect to which the partial derivative is taken\&.
.br
\fIinputValues\fP The input values to evaluate\&.
.RE
.PP
\fBReturns\fP
.RS 4
A std::expected containing the result of the evaluation or a \fBSERiFErrorCode\fP if the evaluation failed\&.
.RE
.PP
.SS "template<dimensions::runtime::RuntimeIdentifiedThermodynamicQuantity OutputQuantity, dimensions::runtime::RuntimeIdentifiedThermodynamicQuantity InputQuantity, dimensions::QuantityValueType\&.\&.\&. InputValues> std::expected< \fBdimensions::PartialDerivative\fP< OutputQuantity, InputQuantity >, \fButils::errors::SERiFErrorCode\fP > serif::eos::runtime::EOSView::try_partial_derivative (const InputValues\&.\&.\&. inputValues) const\fR [inline]\fP, \fR [nodiscard]\fP"
.PP
Evaluates a partial derivative of a relation with the given output quantity and input quantities at runtime\&. This is used to evaluate partial derivatives at runtime\&.
.PP
\fBTemplate Parameters\fP
.RS 4
\fIOutputQuantity\fP The output quantity to evaluate\&.
.br
\fIInputQuantity\fP The input quantity with respect to which the partial derivative is taken\&.
.br
\fIInputValues\fP The types of the input values\&.
.RE
.PP
\fBParameters\fP
.RS 4
\fIinputValues\fP The input values to evaluate\&.
.RE
.PP
\fBReturns\fP
.RS 4
A std::expected containing the result of the evaluation or a \fBSERiFErrorCode\fP if the evaluation failed\&.
.RE
.PP
.SS "std::expected< const \fBdimensions::runtime::RuntimeRelationDescriptor\fP *, \fButils::errors::SERiFErrorCode\fP > serif::eos::runtime::EOSView::validate_relation_request (const \fBdimensions::runtime::ThermodynamicQuantityID\fP outputQuantity, const std::span< const \fBdimensions::runtime::RuntimeQuantityValue\fP > inputValues) const\fR [inline]\fP, \fR [nodiscard]\fP, \fR [private]\fP"
.PP
Validates a relation request with the given output quantity and input quantities at runtime\&. This is used to validate relations at runtime\&.
.PP
\fBParameters\fP
.RS 4
\fIoutputQuantity\fP The output quantity to validate\&.
.br
\fIinputValues\fP The input values to validate\&.
.RE
.PP
\fBReturns\fP
.RS 4
A std::expected containing a pointer to the runtime relation descriptor if valid, or a \fBSERiFErrorCode\fP if invalid\&.
.RE
.PP
.SH "Member Data Documentation"
.PP
.SS "\fBRuntimeEvaluateFunction\fP serif::eos::runtime::EOSView::m_evaluate\fR [private]\fP"
.PP
A function pointer to the runtime evaluation function for the EOS model\&.
.SS "const void* serif::eos::runtime::EOSView::m_object\fR [private]\fP"
.PP
Type erased pointer to the EOS model instance\&.
.SS "\fBRuntimePartialDerivativeFunction\fP serif::eos::runtime::EOSView::m_partialDerivative\fR [private]\fP"
.PP
A function pointer to the runtime partial derivative evaluation function for the EOS model\&.
.SS "std::span<const \fBdimensions::runtime::RuntimeRelationDescriptor\fP> serif::eos::runtime::EOSView::m_relations\fR [private]\fP"
.PP
A span of the runtime relation descriptors for the EOS model\&.
.SH "Author"
.PP
Generated automatically by Doxygen for SERiF from the source code\&.