Files
MeanField_SERiF/docs/man/man3/serif_mapping_compactification_KelvinCompactification.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

312 lines
13 KiB
Groff

.TH "serif::mapping::compactification::KelvinCompactification" 3 "Version v0.0.1a" "SERiF" \" -*- nroff -*-
.ad l
.nh
.SH NAME
serif::mapping::compactification::KelvinCompactification \- Concrete implementation of the \fBExteriorDomainMap\fP interface for the Kelvin compactification\&.
.SH SYNOPSIS
.br
.PP
.PP
\fR#include <kelvin\&.hpp>\fP
.PP
Inherits \fBserif::mapping::compactification::ExteriorDomainMap\fP\&.
.SS "Classes"
.in +1c
.ti -1c
.RI "struct \fBRadialFactors\fP"
.br
.RI "A struct to hold the radial factors for the Kelvin compactification mapping\&. "
.in -1c
.SS "Public Member Functions"
.in +1c
.ti -1c
.RI "\fBKelvinCompactification\fP (const \fButils::user_options::KelvinCompactificationOptions\fP &options)"
.br
.RI "Construct a \fBKelvinCompactification\fP with the given options\&. "
.ti -1c
.RI "bool \fBis_affine_in_displacement\fP () const noexcept override"
.br
.RI "Check if the mapping is affine in the displacement\&. For the Kelvin compactification, this is always true\&. "
.ti -1c
.RI "\fBMappingStatus\fP \fBevaluate\fP (const \fBExteriorMapInput\fP &input, \fBExteriorMapResult\fP &result) const override"
.br
.RI "Evaluate the mapping at a given point in the reference domain\&. "
.ti -1c
.RI "\fBMappingStatus\fP \fBevaluate_variation\fP (const \fBExteriorMapInput\fP &input, const \fBExteriorMapResult\fP &result, const \fBExteriorMapDirection\fP &direction, \fBExteriorMapVariation\fP &variation) const override"
.br
.RI "Evaluate the variation of the mapping at a given point in the reference domain\&. "
.ti -1c
.RI "std::string_view \fBget_name\fP () const noexcept override"
.br
.RI "Get the name of the mapping, which is "KelvinCompactification" for this class\&. "
.ti -1c
.RI "double \fBget_reference_stellar_radius\fP () const noexcept"
.br
.RI "Get the reference stellar radius for the mapping, which is the radius of the inner surface of the reference domain\&. "
.ti -1c
.RI "double \fBget_reference_infinity_radius\fP () const noexcept"
.br
.RI "Get the reference infinity radius for the mapping, which is the radius of the outer surface of the reference domain\&. "
.ti -1c
.RI "double \fBget_coordinate_tolerance\fP () const noexcept"
.br
.RI "Get the coordinate tolerance for the mapping, which is the tolerance for the compactification coordinate\&. "
.ti -1c
.RI "\fBMappingStatus\fP \fBevaluate_jacobian_variation_factors\fP (double compactification_coordinate, const mfem::Vector &coordinateGradient, double &scale, mfem::Vector &scaleGradient) const"
.br
.RI "Evaluate the mapping jacobian variation factors at some given compactification coordinate\&. "
.in -1c
Public Member Functions inherited from \fBserif::mapping::compactification::ExteriorDomainMap\fP
.in +1c
.ti -1c
.RI "virtual \fB~ExteriorDomainMap\fP ()=default"
.br
.in -1c
.SS "Private Member Functions"
.in +1c
.ti -1c
.RI "\fBMappingStatus\fP \fBcompute_radial_factors\fP (double compactification_coordinate, \fBRadialFactors\fP &radial_factors) const"
.br
.RI "Compute the radial factors for the Kelvin compactification mapping at a given compactification coordinate\&. "
.in -1c
.SS "Private Attributes"
.in +1c
.ti -1c
.RI "\fButils::user_options::KelvinCompactificationOptions\fP \fBm_options\fP"
.br
.RI "The options for the Kelvin compactification, which must be valid\&. "
.ti -1c
.RI "const std::string_view \fBm_name\fP = 'KelvinCompactification'"
.br
.RI "The name of the mapping, which is "KelvinCompactification" for this class\&. "
.in -1c
.SH "Detailed Description"
.PP
Concrete implementation of the \fBExteriorDomainMap\fP interface for the Kelvin compactification\&.
Broadly, for some reference position $\mathbf{x_{r}}$ on some reference domain $\Omega_{r}$ the Kelvin compactification maps to a physical position $\mathbf{x_{p}}$ on some physical domain $\Omega_{p}$ through the mapping \[\mathbf{x_{p}} = \frac{\mathbf{x_{r}}}{1 - \frac{|\mathbf{x_{r}}|}{R_{\infty}}}
\]
.PP
This results in the inner surface of the domain being mapped to the exterior surface of the physical domain while the outer surface of the exterior domain is mapped to infinity\&. There are some implications of this, namely that we loose accuracy in all things as we approach the outer surface of the domain\&. However, it is nice in so far as we can apply true boundary conditions at infinity\&.
.SH "Constructor & Destructor Documentation"
.PP
.SS "serif::mapping::compactification::KelvinCompactification::KelvinCompactification (const \fButils::user_options::KelvinCompactificationOptions\fP & options)\fR [explicit]\fP"
.PP
Construct a \fBKelvinCompactification\fP with the given options\&.
.PP
\fBParameters\fP
.RS 4
\fIoptions\fP The options for the Kelvin compactification, which must be valid\&.
.RE
.PP
\fBExceptions\fP
.RS 4
\fIstd::invalid_argument\fP If the reference stellar radius is not finite or positive
.br
\fIstd::invalid_argument\fP If the reference infinity radius is not finite or positive
.br
\fIstd::invalid_argument\fP If the reference infinity radius is not greater than the reference stellar radius
.br
\fIstd::invalid_argument\fP If the coordinate tolerance is not finite or positive or is greater than or equal to one
.RE
.PP
.SH "Member Function Documentation"
.PP
.SS "\fBMappingStatus\fP serif::mapping::compactification::KelvinCompactification::compute_radial_factors (double compactification_coordinate, \fBRadialFactors\fP & radial_factors) const\fR [nodiscard]\fP, \fR [private]\fP"
.PP
Compute the radial factors for the Kelvin compactification mapping at a given compactification coordinate\&.
.PP
\fBParameters\fP
.RS 4
\fIcompactification_coordinate\fP The compactification coordinate at which to compute the radial factors\&. (Note this runs from 0 to 1, where 0 is the inner surface and 1 is the outer surface of the reference domain)
.br
\fIradial_factors\fP The radial factors, which will be filled in by the method\&.
.RE
.PP
\fBReturns\fP
.RS 4
The status of the mapping evaluation\&.
.RE
.PP
\fBNote\fP
.RS 4
See the implementation file for more details on the actual algorithm used here\&.
.RE
.PP
.SS "\fBMappingStatus\fP serif::mapping::compactification::KelvinCompactification::evaluate (const \fBExteriorMapInput\fP & input, \fBExteriorMapResult\fP & result) const\fR [nodiscard]\fP, \fR [override]\fP, \fR [virtual]\fP"
.PP
Evaluate the mapping at a given point in the reference domain\&.
.PP
\fBParameters\fP
.RS 4
\fIinput\fP The input point in the reference domain to evaluate the mapping at\&.
.br
\fIresult\fP The result of the mapping evaluation, which will be filled in by the method\&.
.RE
.PP
\fBReturns\fP
.RS 4
A status indicating the success or failure of the mapping evaluation\&. Mapping may fail if
.IP "\(bu" 2
the size of the input reference position is less than or equal to zero
.IP "\(bu" 2
the input displaced position size does not match the input reference position size
.IP "\(bu" 2
the input compactification coordinate gradient size does not match the input reference position size
.IP "\(bu" 2
the displacement_jacobian height does not match the input reference position size
.IP "\(bu" 2
the displacement_jacobian width does not match the input reference position size
.IP "\(bu" 2
the input reference, displaced, compactification coordinate gradient or jacobian contains non-finite values
.IP "\(bu" 2
There is some issue computing the radial factors (this error will be passed through)
.PP
.RE
.PP
The mapping jacobian comes from trivial application of the product rule recall: $r_i = scale * x_i$ where $r$ is the physical position and $x$ is the displaced position\&. then we can differentiate wrt\&. $X_j$ holding nothing fixed\&. Note the capital $X$ here, this is the mesh coordinate not the displaced position\&. Lets call this jacobian $F$ \[ F = \frac{\partial r_i}{\partial X_{j}}
\]
.PP
$F$ then tells us how the physical position changes as we move along mesh coordinates
.PP
Lets then apply this to the function we have for the kelvin compactification \[F = scale * \frac{\partial x_i}{\partial X_j} + x_i * \frac{\partial scale}{\partial X_j}
\]
.PP
In the implementation you can see the displacement jacobian ( $\frac{\partial x_i}{\partial X_j}$) and the scale derivative ( $\frac{\partial scale}{\partial X_j}$) being applied to compute the mapping jacobian\&.
.PP
Implements \fBserif::mapping::compactification::ExteriorDomainMap\fP\&.
.SS "\fBMappingStatus\fP serif::mapping::compactification::KelvinCompactification::evaluate_jacobian_variation_factors (double compactification_coordinate, const mfem::Vector & coordinateGradient, double & scale, mfem::Vector & scaleGradient) const\fR [nodiscard]\fP"
.PP
Evaluate the mapping jacobian variation factors at some given compactification coordinate\&.
.PP
\fBParameters\fP
.RS 4
\fIcompactification_coordinate\fP The compactification coordinate at which to evaluate the mapping jacobian variation factors\&. (Note this runs from 0 to 1, where 0 is the inner surface and 1 is the outer surface of the reference domain)
.br
\fIcoordinateGradient\fP The gradient of the compactification coordinate with respect to the mesh coordinates, which must be finite and have size 3\&.
.br
\fIscale\fP The scale factor for the mapping jacobian, which will be filled in by the method\&.
.br
\fIscaleGradient\fP The gradient of the scale factor with respect to the mesh coordinates, which will be filled in by the method\&.
.RE
.PP
\fBReturns\fP
.RS 4
The status of the mapping evaluation\&.
.RE
.PP
.SS "\fBMappingStatus\fP serif::mapping::compactification::KelvinCompactification::evaluate_variation (const \fBExteriorMapInput\fP & input, const \fBExteriorMapResult\fP & result, const \fBExteriorMapDirection\fP & direction, \fBExteriorMapVariation\fP & variation) const\fR [nodiscard]\fP, \fR [override]\fP, \fR [virtual]\fP"
.PP
Evaluate the variation of the mapping at a given point in the reference domain\&.
.PP
\fBParameters\fP
.RS 4
\fIinput\fP The input point in the reference domain to evaluate the mapping at\&.
.br
\fIresult\fP The result of the mapping evaluation, which will be used in the variation computation\&.
.br
\fIdirection\fP The direction in which to evaluate the variation\&.
.br
\fIvariation\fP The result of the variation evaluation, which will be filled in by the method\&.
.RE
.PP
\fBReturns\fP
.RS 4
A status indicating the success or failure of the variation evaluation\&. The reasons for a failure are effectively the same as the reasons for a failure in the evaluate method just extended to cover the additional inputs\&.
.RE
.PP
.PP
Implements \fBserif::mapping::compactification::ExteriorDomainMap\fP\&.
.SS "double serif::mapping::compactification::KelvinCompactification::get_coordinate_tolerance () const\fR [nodiscard]\fP, \fR [noexcept]\fP"
.PP
Get the coordinate tolerance for the mapping, which is the tolerance for the compactification coordinate\&.
.PP
\fBReturns\fP
.RS 4
The coordinate tolerance for the mapping\&.
.RE
.PP
.SS "std::string_view serif::mapping::compactification::KelvinCompactification::get_name () const\fR [nodiscard]\fP, \fR [override]\fP, \fR [virtual]\fP, \fR [noexcept]\fP"
.PP
Get the name of the mapping, which is "KelvinCompactification" for this class\&.
.PP
\fBReturns\fP
.RS 4
The name of the mapping\&.
.RE
.PP
.PP
Implements \fBserif::mapping::compactification::ExteriorDomainMap\fP\&.
.SS "double serif::mapping::compactification::KelvinCompactification::get_reference_infinity_radius () const\fR [nodiscard]\fP, \fR [noexcept]\fP"
.PP
Get the reference infinity radius for the mapping, which is the radius of the outer surface of the reference domain\&.
.PP
\fBReturns\fP
.RS 4
The reference infinity radius for the mapping\&.
.RE
.PP
.SS "double serif::mapping::compactification::KelvinCompactification::get_reference_stellar_radius () const\fR [nodiscard]\fP, \fR [noexcept]\fP"
.PP
Get the reference stellar radius for the mapping, which is the radius of the inner surface of the reference domain\&.
.PP
\fBReturns\fP
.RS 4
The reference stellar radius for the mapping\&.
.RE
.PP
.SS "bool serif::mapping::compactification::KelvinCompactification::is_affine_in_displacement () const\fR [nodiscard]\fP, \fR [override]\fP, \fR [virtual]\fP, \fR [noexcept]\fP"
.PP
Check if the mapping is affine in the displacement\&. For the Kelvin compactification, this is always true\&.
.PP
\fBReturns\fP
.RS 4
false
.RE
.PP
.PP
Implements \fBserif::mapping::compactification::ExteriorDomainMap\fP\&.
.SH "Member Data Documentation"
.PP
.SS "const std::string_view serif::mapping::compactification::KelvinCompactification::m_name = 'KelvinCompactification'\fR [private]\fP"
.PP
The name of the mapping, which is "KelvinCompactification" for this class\&.
.SS "\fButils::user_options::KelvinCompactificationOptions\fP serif::mapping::compactification::KelvinCompactification::m_options\fR [private]\fP"
.PP
The options for the Kelvin compactification, which must be valid\&.
.SH "Author"
.PP
Generated automatically by Doxygen for SERiF from the source code\&.