.TH "serif::equations::CentralDensityConstraint< EOST >" 3 "Version v0.0.1a" "SERiF" \" -*- nroff -*- .ad l .nh .SH NAME serif::equations::CentralDensityConstraint< EOST > \- Prescribe central density through the continuous enthalpy: $h(0) - h_{EOS}(\rho_c) = 0$\&. Generally this is not needed; however, in the particular case of an n=3 polytrope with no rotation the central density becomes ill-defined and must be prescribed to avoid a singularity in the solution\&. Note that this equation is not responsible for sorting out what point is the center of the star; rather, this is provided to the evaluate method\&. .SH SYNOPSIS .br .PP .PP \fR#include \fP .PP Inherits \fBserif::equations::Contribution< discretization::forms::Operand< discretization::blocks::enthalpy::specific > >\fP\&. .SS "Public Types" .in +1c .ti -1c .RI "using \fBOperands\fP = \fButils::types::TypeList\fP<\fBTestOperand\fP>" .br .RI "The operand types of the equation, that is the types of the fields which are used to evaluate the equation\&. " .ti -1c .RI "using \fBBorder\fP = \fBdiscretization::blocks::central_density::border\fP" .br .RI "The border type of the equation, that is what row of the global system this equation contributes to\&. " .ti -1c .RI "using \fBResidualQuantity\fP = \fBdimensions::SpecificEnthalpy\fP" .br .RI "The physical quantity which is being constrained by this equation, that is the quantity which is being set to a target value\&. " .in -1c Public Types inherited from \fBserif::equations::Contribution< discretization::forms::Operand< discretization::blocks::enthalpy::specific > >\fP .in +1c .ti -1c .RI "using \fBTest\fP" .br .RI "The test type of the contribution\&. " .ti -1c .RI "using \fBTestOperand\fP" .br .RI "The operand type of the contribution (associating a test function and a term) " .ti -1c .RI "using \fBSupport\fP" .br .RI "The domain support of the contribution (which then boils down to the dofs which are supported by the term on that test function) " .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBCentralDensityConstraint\fP (EOST equation_of_state, \fBdimensions::DensityValue\fP \fBtarget_density\fP)" .br .RI "Construct a central density constraint\&. " .ti -1c .RI "\fBPointLinearization\fP< \fBOperands\fP > \fBevaluate\fP (const \fBEquationPoint\fP< \fBOperands\fP > &point) const" .br .RI "Evaluate the central density constraint at a given point\&. " .ti -1c .RI "\fBdimensions::DensityValue\fP \fBtarget_density\fP () const noexcept" .br .RI "Return the prescribed central density\&. " .ti -1c .RI "\fBdimensions::SpecificEnthalpyValue\fP \fBtarget_enthalpy\fP () const noexcept" .br .RI "Return the target enthalpy corresponding to the prescribed central density\&. " .ti -1c .RI "\fBdimensions::DensityValue\fP \fBdensity_from_enthalpy\fP (\fBdimensions::SpecificEnthalpyValue\fP enthalpy) const" .br .RI "Convert some enthalpy to a density for physical diagnostics, when the inverse relation exists\&. " .in -1c .SS "Static Public Attributes" .in +1c .ti -1c .RI "static constexpr std::string_view \fBname\fP = 'central density constraint'" .br .RI "Compile time name for the equation, used for debugging and logging\&. " .ti -1c .RI "static constexpr bool \fBposition_independent\fP = true" .br .RI "Whether the equation is independent of the position of the point being evaluated, that is whether the equation is invariant under translations and rotations of the point\&. This is only used for compile-time checks\&. " .ti -1c .RI "static constexpr bool \fBaffine\fP = true" .br .RI "Whether the equation is affine, that is whether the equation is linear in the fields being evaluated\&. This is only used for compile-time checks\&. " .ti -1c .RI "static constexpr std::array< double, 3 > \fBreference_position\fP {}" .br .RI "The reference position of the equation, this is only used for compile-time checks and is not used in the evaluation of the equation\&. " .in -1c .SS "Private Attributes" .in +1c .ti -1c .RI "EOST \fBm_eos\fP" .br .RI "The EOS model to use for evaluating the enthalpy from the prescribed density\&. " .ti -1c .RI "\fBdimensions::DensityValue\fP \fBm_target_density\fP" .br .RI "The prescribed central density, which must be finite and strictly positive\&. " .ti -1c .RI "double \fBm_target_enthalpy\fP" .br .RI "The target enthalpy corresponding to the prescribed central density, which is computed from the EOS and must be finite\&. " .in -1c .SH "Detailed Description" .PP .SS "template .br requires eos::models::EOSSupportingRelation .br class serif::equations::CentralDensityConstraint< EOST >"Prescribe central density through the continuous enthalpy: $h(0) - h_{EOS}(\rho_c) = 0$\&. Generally this is not needed; however, in the particular case of an n=3 polytrope with no rotation the central density becomes ill-defined and must be prescribed to avoid a singularity in the solution\&. Note that this equation is not responsible for sorting out what point is the center of the star; rather, this is provided to the evaluate method\&. .PP \fBTemplate Parameters\fP .RS 4 \fIEOST\fP The EOS model type to use for evaluating the enthalpy from the prescribed density\&. .RE .PP Requirements .PD 0 .IP "\(bu" 2 The EOS model must support the relation SpecificEnthalpyFromDensity .PP .PP \fBEquation\fP \fBContributions\fP .PD 0 .IP "\(bu" 2 Residuals to the specific enthalpy row of the system .PP .PP \fBExceptions\fP .RS 4 \fIstd::invalid_argument\fP If the prescribed density is not finite and strictly positive\&. .br \fIstd::domain_error\fP If the EOS returns a non-finite enthalpy for the prescribed density\&. .RE .PP .SH "Member Typedef Documentation" .PP .SS "template using \fBserif::equations::CentralDensityConstraint\fP< EOST >::Border = \fBdiscretization::blocks::central_density::border\fP" .PP The border type of the equation, that is what row of the global system this equation contributes to\&. .SS "template using \fBserif::equations::CentralDensityConstraint\fP< EOST >::Operands = \fButils::types::TypeList\fP<\fBTestOperand\fP>" .PP The operand types of the equation, that is the types of the fields which are used to evaluate the equation\&. .SS "template using \fBserif::equations::CentralDensityConstraint\fP< EOST >::ResidualQuantity = \fBdimensions::SpecificEnthalpy\fP" .PP The physical quantity which is being constrained by this equation, that is the quantity which is being set to a target value\&. .SH "Constructor & Destructor Documentation" .PP .SS "template \fBserif::equations::CentralDensityConstraint\fP< EOST >::CentralDensityConstraint (EOST equation_of_state, \fBdimensions::DensityValue\fP target_density)\fR [inline]\fP" .PP Construct a central density constraint\&. .PP \fBParameters\fP .RS 4 \fIequation_of_state\fP The EOS model to use for evaluating the enthalpy from the prescribed density\&. .br \fItarget_density\fP The prescribed central density, which must be finite and strictly positive\&. .RE .PP \fBExceptions\fP .RS 4 \fIstd::invalid_argument\fP If the prescribed density is not finite and strictly positive\&. .br \fIstd::domain_error\fP If the EOS returns a non-finite enthalpy for the prescribed density\&. .RE .PP \fBTodo\fP .RS 4 We should consider whether we actually need to own the EOS, this choice made lifetime management easier but introduces copy overhead\&. Moreover, it means that the EOS must be copyable and, more importantly in my view, that the caller must know that the EOS is being copied\&. .RE .PP .SH "Member Function Documentation" .PP .SS "template \fBdimensions::DensityValue\fP \fBserif::equations::CentralDensityConstraint\fP< EOST >::density_from_enthalpy (\fBdimensions::SpecificEnthalpyValue\fP enthalpy) const\fR [inline]\fP, \fR [nodiscard]\fP" .PP Convert some enthalpy to a density for physical diagnostics, when the inverse relation exists\&. .PP \fBParameters\fP .RS 4 \fIenthalpy\fP The specific enthalpy to convert\&. .RE .PP \fBReturns\fP .RS 4 The corresponding density\&. .RE .PP Requirements .PD 0 .IP "\(bu" 2 The EOS model must support the relation DensityFromSpecificEnthalpy, otherwise this method is not available\&. .PP .PP \fBNote\fP .RS 4 Generally this method is only for debugging, if you want to use the density you should really call the EOS directly\&. .RE .PP .SS "template \fBPointLinearization\fP< \fBOperands\fP > \fBserif::equations::CentralDensityConstraint\fP< EOST >::evaluate (const \fBEquationPoint\fP< \fBOperands\fP > & point) const\fR [inline]\fP, \fR [nodiscard]\fP" .PP Evaluate the central density constraint at a given point\&. .PP \fBParameters\fP .RS 4 \fIpoint\fP The point at which to evaluate the equation, which must be the center of the star\&. .RE .PP \fBNote\fP .RS 4 It is the responsibility of the caller (and generally of the border equation backend) to ensure that this residual is applied to the correct row of the global system, the row defined by the \fBBorder\fP type alias\&. .RE .PP \fBReturns\fP .RS 4 The linearization of the equation at the given point, which contains the residual and the derivatives of the residual with respect to the fields being evaluated\&. .RE .PP .SS "template \fBdimensions::DensityValue\fP \fBserif::equations::CentralDensityConstraint\fP< EOST >::target_density () const\fR [inline]\fP, \fR [nodiscard]\fP, \fR [noexcept]\fP" .PP Return the prescribed central density\&. .PP \fBReturns\fP .RS 4 The prescribed central density\&. .RE .PP .SS "template \fBdimensions::SpecificEnthalpyValue\fP \fBserif::equations::CentralDensityConstraint\fP< EOST >::target_enthalpy () const\fR [inline]\fP, \fR [nodiscard]\fP, \fR [noexcept]\fP" .PP Return the target enthalpy corresponding to the prescribed central density\&. .PP \fBReturns\fP .RS 4 The target enthalpy corresponding to the prescribed central density\&. .RE .PP .SH "Member Data Documentation" .PP .SS "template bool \fBserif::equations::CentralDensityConstraint\fP< EOST >::affine = true\fR [static]\fP, \fR [constexpr]\fP" .PP Whether the equation is affine, that is whether the equation is linear in the fields being evaluated\&. This is only used for compile-time checks\&. .SS "template EOST \fBserif::equations::CentralDensityConstraint\fP< EOST >::m_eos\fR [private]\fP" .PP The EOS model to use for evaluating the enthalpy from the prescribed density\&. .SS "template \fBdimensions::DensityValue\fP \fBserif::equations::CentralDensityConstraint\fP< EOST >::m_target_density\fR [private]\fP" .PP The prescribed central density, which must be finite and strictly positive\&. .SS "template double \fBserif::equations::CentralDensityConstraint\fP< EOST >::m_target_enthalpy\fR [private]\fP" .PP The target enthalpy corresponding to the prescribed central density, which is computed from the EOS and must be finite\&. .SS "template std::string_view \fBserif::equations::CentralDensityConstraint\fP< EOST >::name = 'central density constraint'\fR [static]\fP, \fR [constexpr]\fP" .PP Compile time name for the equation, used for debugging and logging\&. .SS "template bool \fBserif::equations::CentralDensityConstraint\fP< EOST >::position_independent = true\fR [static]\fP, \fR [constexpr]\fP" .PP Whether the equation is independent of the position of the point being evaluated, that is whether the equation is invariant under translations and rotations of the point\&. This is only used for compile-time checks\&. .SS "template std::array \fBserif::equations::CentralDensityConstraint\fP< EOST >::reference_position {}\fR [static]\fP, \fR [constexpr]\fP" .PP The reference position of the equation, this is only used for compile-time checks and is not used in the evaluation of the equation\&. .SH "Author" .PP Generated automatically by Doxygen for SERiF from the source code\&.