|
SERiF v0.0.1a
Stellar Evolution and Rotation in Four Dimensions
|
Mass normalization equation, which enforces a global constraint on the total mass of a system. More...
#include <mass_normalization.hpp>
Public Types | |
| using | Density = discretization::blocks::density::mass |
| Alias for mass density. | |
| using | ResidualQuantity = dimensions::Mass |
| Alias for the dimension of the residual. | |
| using | DensityValue = discretization::forms::Operand<Density> |
| Alias for the operand type of the mass density. | |
| using | Operands = utils::types::TypeList<DensityValue> |
| The list of operands for the mass normalization equation. | |
Public Types inherited from serif::equations::Contribution< discretization::forms::Operand< discretization::blocks::barotropic_constant::mass_normalization > > | |
| using | Test |
| The test type of the contribution. | |
| using | TestOperand |
| The operand type of the contribution (associating a test function and a term) | |
| using | Support |
| The domain support of the contribution (which then boils down to the dofs which are supported by the term on that test function) | |
Public Member Functions | |
| MassNormalization (const double target_mass) | |
| Construct a mass normalization equation. | |
| double | residual_offset () const |
| Return the residual offset for the mass normalization equation. | |
Static Public Member Functions | |
| static PointLinearization< Operands > | evaluate (const EquationPoint< Operands > &point) |
| Evaluate the mass normalization equation point-wise integrand and its partial derivatives. | |
| static int | additional_order (DensityValue, int) |
| Return the additional quadrature order required for the operands of this equation. | |
Static Public Attributes | |
| static constexpr std::string_view | name = "mass normalization" |
| Compile time name for the mass normalization equation, used for debugging and logging. | |
Private Attributes | |
| double | m_target_mass |
| The target mass for the system, which must be finite and positive. | |
Mass normalization equation, which enforces a global constraint on the total mass of a system.
Mass normalization, being an integral constraint must make use of the residual_offset() method to properly find the residual. See AngularMomentumConstraint 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 residual_offset() 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).
@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.
Alias for mass density.
Alias for the operand type of the mass density.
The list of operands for the mass normalization equation.
Alias for the dimension of the residual.
|
inlineexplicit |
Construct a mass normalization equation.
| target_mass | The target mass for the system, which must be finite and positive. |
| std::invalid_argument | If the target mass is not finite or not positive. |
|
inlinestaticnodiscard |
Return the additional quadrature order required for the operands of this equation.
| operand | 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. |
| position_order | The order of the position basis functions. |
|
inlinestaticnodiscard |
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:
| point | The point at which to evaluate the equation. |
|
inlinenodiscard |
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.
|
private |
The target mass for the system, which must be finite and positive.
|
staticconstexpr |
Compile time name for the mass normalization equation, used for debugging and logging.