Files
MeanField_SERiF/docs/man/man3/serif_equations_MassNormalization.3

223 lines
8.4 KiB
Groff
Raw Normal View History

.TH "serif::equations::MassNormalization" 3 "Version v0.0.1a" "SERiF" \" -*- nroff -*-
.ad l
.nh
.SH NAME
serif::equations::MassNormalization \- Mass normalization equation, which enforces a global constraint on the total mass of a system\&.
.SH SYNOPSIS
.br
.PP
.PP
\fR#include <mass_normalization\&.hpp>\fP
.PP
Inherits \fBserif::equations::Contribution< discretization::forms::Operand< discretization::blocks::barotropic_constant::mass_normalization > >\fP\&.
.SS "Public Types"
.in +1c
.ti -1c
.RI "using \fBDensity\fP = \fBdiscretization::blocks::density::mass\fP"
.br
.RI "Alias for mass density\&. "
.ti -1c
.RI "using \fBResidualQuantity\fP = \fBdimensions::Mass\fP"
.br
.RI "Alias for the dimension of the residual\&. "
.ti -1c
.RI "using \fBDensityValue\fP = \fBdiscretization::forms::Operand\fP<\fBDensity\fP>"
.br
.RI "Alias for the operand type of the mass density\&. "
.ti -1c
.RI "using \fBOperands\fP = \fButils::types::TypeList\fP<\fBDensityValue\fP>"
.br
.RI "The list of operands for the mass normalization equation\&. "
.in -1c
Public Types inherited from \fBserif::equations::Contribution< discretization::forms::Operand< discretization::blocks::barotropic_constant::mass_normalization > >\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 "\fBMassNormalization\fP (const double target_mass)"
.br
.RI "Construct a mass normalization equation\&. "
.ti -1c
.RI "double \fBresidual_offset\fP () const"
.br
.RI "Return the residual offset for the mass normalization equation\&. "
.in -1c
.SS "Static Public Member Functions"
.in +1c
.ti -1c
.RI "static \fBPointLinearization\fP< \fBOperands\fP > \fBevaluate\fP (const \fBEquationPoint\fP< \fBOperands\fP > &point)"
.br
.RI "Evaluate the mass normalization equation point-wise integrand and its partial derivatives\&. "
.ti -1c
.RI "static int \fBadditional_order\fP (\fBDensityValue\fP, int)"
.br
.RI "Return the additional quadrature order required for the operands of this equation\&. "
.in -1c
.SS "Static Public Attributes"
.in +1c
.ti -1c
.RI "static constexpr std::string_view \fBname\fP = 'mass normalization'"
.br
.RI "Compile time name for the mass normalization equation, used for debugging and logging\&. "
.in -1c
.SS "Private Attributes"
.in +1c
.ti -1c
.RI "double \fBm_target_mass\fP"
.br
.RI "The target mass for the system, which must be finite and positive\&. "
.in -1c
.SH "Detailed Description"
.PP
Mass normalization equation, which enforces a global constraint on the total mass of a system\&.
.PP
\fBNote\fP
.RS 4
In the barotropic case the bernoulli constant as the control variable here\&. This is a "clever" choice in this case; however, more broadly most of this equation is general (its only that in we choose to inject the residual into the mass_normalization member of the barotropic_constant block)\&. That could very easily become a more general control variable without changing the rest of this
.RE
.PP
Mass normalization, being an integral constraint must make use of the \fBresidual_offset()\fP method to properly find the residual\&. See \fBAngularMomentumConstraint\fP for a more detailed discussion of this\&. Suffice it to say that these are point-wise integrands so if we were to subtract the target mass from every point we would wildly over count the target mass\&. Rather, we simply return the density everywhere as the volume integrated density will be the mass\&. Then the \fBresidual_offset()\fP method returns the negative of the target mass (the backend automatically adds anything from this function, if it exists, to the integrated residual to get the final residual)\&.
.PP
@contribution Residuals to the mass_normalization term in the barotropic_constant block\&. This is effectively a global constraint on the total mass of the system\&.
.SH "Member Typedef Documentation"
.PP
.SS "using \fBserif::equations::MassNormalization::Density\fP = \fBdiscretization::blocks::density::mass\fP"
.PP
Alias for mass density\&.
.SS "using \fBserif::equations::MassNormalization::DensityValue\fP = \fBdiscretization::forms::Operand\fP<\fBDensity\fP>"
.PP
Alias for the operand type of the mass density\&.
.SS "using \fBserif::equations::MassNormalization::Operands\fP = \fButils::types::TypeList\fP<\fBDensityValue\fP>"
.PP
The list of operands for the mass normalization equation\&.
.SS "using \fBserif::equations::MassNormalization::ResidualQuantity\fP = \fBdimensions::Mass\fP"
.PP
Alias for the dimension of the residual\&.
.SH "Constructor & Destructor Documentation"
.PP
.SS "serif::equations::MassNormalization::MassNormalization (const double target_mass)\fR [inline]\fP, \fR [explicit]\fP"
.PP
Construct a mass normalization equation\&.
.PP
\fBParameters\fP
.RS 4
\fItarget_mass\fP The target mass for the system, which must be finite and positive\&.
.RE
.PP
\fBExceptions\fP
.RS 4
\fIstd::invalid_argument\fP If the target mass is not finite or not positive\&.
.RE
.PP
.SH "Member Function Documentation"
.PP
.SS "static int serif::equations::MassNormalization::additional_order (\fBDensityValue\fP , int )\fR [inline]\fP, \fR [static]\fP, \fR [nodiscard]\fP"
.PP
Return the additional quadrature order required for the operands of this equation\&.
.PP
\fBParameters\fP
.RS 4
\fIoperand\fP The operand type for which to determine the additional quadrature order\&. Note that this is only used to select the correct overload of this function\&. This particular version only has one overload; therefore this is really just their to maintain symmetry with other equation implementations\&.
.br
\fIposition_order\fP The order of the position basis functions\&.
.RE
.PP
\fBReturns\fP
.RS 4
The additional quadrature order required for the given operand type (\fBalways 0 in this case\fP)\&.
.RE
.PP
.SS "static \fBPointLinearization\fP< \fBOperands\fP > serif::equations::MassNormalization::evaluate (const \fBEquationPoint\fP< \fBOperands\fP > & point)\fR [inline]\fP, \fR [static]\fP, \fR [nodiscard]\fP"
.PP
Evaluate the mass normalization equation point-wise integrand and its partial derivatives\&. The point-wise integrand is calculated as $ \rho $, where $ \rho $ is the model density\&. The partial derivative is calculated as:
.IP "\(bu" 2
$ \frac{\partial r}{\partial \rho} = 1 $
.PP
.PP
\fBNote\fP
.RS 4
As the class description notes, the residual is not calculated as $ \rho - M_{\text{target}} $ because this would over count the target mass\&. Instead we simply return the density and then use the \fBresidual_offset()\fP method to subtract the target mass from the integrated residual\&.
.RE
.PP
\fBParameters\fP
.RS 4
\fIpoint\fP The point at which to evaluate the equation\&.
.RE
.PP
\fBReturns\fP
.RS 4
The point-wise linearization of the mass normalization equation, which contains the residual and the partial derivative with respect to the model density\&.
.RE
.PP
.SS "double serif::equations::MassNormalization::residual_offset () const\fR [inline]\fP, \fR [nodiscard]\fP"
.PP
Return the residual offset for the mass normalization equation\&. The backend integrates the point-wise residual integrand over the domain\&. The global constraint is satisfied when the total mass equals the target value\&. Therefore we subtract the target from the integrated residual to get the actual residual\&.
.PP
\fBNote\fP
.RS 4
The backend automatically looks for this method and calls it if it exists\&.
.br
.br
.PP
The backend actually adds whatever is returned from this function to the integrated residual to get the final residual\&. Therefore we return the negative of the target mass here\&.
.RE
.PP
\fBReturns\fP
.RS 4
The negative of the target mass, $-M_{\text{target}}$\&.
.RE
.PP
.SH "Member Data Documentation"
.PP
.SS "double serif::equations::MassNormalization::m_target_mass\fR [private]\fP"
.PP
The target mass for the system, which must be finite and positive\&.
.SS "std::string_view serif::equations::MassNormalization::name = 'mass normalization'\fR [static]\fP, \fR [constexpr]\fP"
.PP
Compile time name for the mass normalization equation, used for debugging and logging\&.
.SH "Author"
.PP
Generated automatically by Doxygen for SERiF from the source code\&.