SERiF v0.0.1a
Stellar Evolution and Rotation in Four Dimensions
Loading...
Searching...
No Matches
serif::equations::RigidRotation Class Referencefinal

A class that implements rigid rotation, providing methods to compute the centrifugal potential, its gradient, and its Hessian. More...

#include <rigid_rotation.hpp>

Collaboration diagram for serif::equations::RigidRotation:
[legend]

Public Types

using Vector = discretization::forms::VectorValue
 Alias for some vector (rank 1 tensor) type.
 
using Matrix = discretization::forms::MatrixValue
 Alias for some matrix (rank 2 tensor) type.
 

Public Member Functions

 RigidRotation (const Vector &angular_velocity_vector, const Vector &axis_origin={})
 Construct a RigidRotation object with the given angular velocity vector and axis origin.
 
double centrifugal_potential (const Vector &position) const
 Ψ = ½|ω × λ|²; using the cross product avoids subtracting nearly equal squared lengths near the axis.
 
Vector centrifugal_potential_gradient (const Vector &position) const
 Compute the gradient of the centrifugal potential at a given position. This is computed as \( \nabla \Psi = H \lambda\) where \(H = |\omega|^2 I - \omega \otimes \omega\) is the Hessian of the centrifugal potential.
 
const Matrix & centrifugal_potential_hessian () const
 Get the Hessian of the centrifugal potential, which is independent of position for rigid rotation. This is computed as \( H = |\omega|^2 I - \omega \otimes \omega\).
 
const Vector & angular_velocity_vector () const
 Get the angular velocity vector of the rigid rotation.
 
const Vector & axis_origin () const
 Get the origin of the rotation axis.
 

Static Public Member Functions

static RigidRotation unit_rotation (Vector rotation_axis={0.0, 0.0, 1.0}, const Vector &axis_origin={})
 Construct a RigidRotation object with a unit rotation axis and an axis origin.
 

Private Attributes

Vector m_angular_velocity_vector
 The angular velocity vector of the rigid rotation, which must be finite.
 
Vector m_axis_origin
 The origin of the rotation axis, which must be finite.
 
Matrix m_potential_hessian {}
 The Hessian of the centrifugal potential, which is independent of position for rigid rotation and is computed as \( H = |\omega|^2 I - \omega \otimes \omega\).
 

Detailed Description

A class that implements rigid rotation, providing methods to compute the centrifugal potential, its gradient, and its Hessian.

Note
This is not an equation in the same way that other parts of this module are; rather, this is a utility class used in other equations.
Todo
This should probably be refactored into its own submodule to clean up equations a bit

Broadly this class handles a number of the details of rigid rotation. Note that this is really setup to be static physics; that is to say, there are a series of things you setup with the constructor (the angular velocity vector and the axis origin), then those are used to evaluate a series of relations. There is not however any way to update and re-evaluate the same object.

The relations implemented are

  • Centrifugal potential: \(\Psi = \frac{1}{2}|\omega \times \lambda|^2\) where \(\lambda = r - r_a\) is the position relative to the axis origin. This can be further simplified to \(\Psi = \frac{1}{2}\Omega^{2}s^{2}\) where \(s\) is the cylindrical radius from the axis of rotation.
  • Centrifugal potential gradient: \(\nabla \Psi = H\ lambda\) where \(H = |\omega|^2 I - \omega \otimes \omega\) is the Hessian of the centrifugal potential.

Member Typedef Documentation

◆ Matrix

Alias for some matrix (rank 2 tensor) type.

◆ Vector

Alias for some vector (rank 1 tensor) type.

Constructor & Destructor Documentation

◆ RigidRotation()

serif::equations::RigidRotation::RigidRotation ( const Vector & angular_velocity_vector,
const Vector & axis_origin = {} )
inlineexplicit

Construct a RigidRotation object with the given angular velocity vector and axis origin.

Parameters
angular_velocity_vectorThe angular velocity vector, which must be finite.
axis_originThe origin of the rotation axis, which must be finite. (default to the origin, (0, 0, 0))
Exceptions
std::invalid_argumentIf the angular velocity vector or axis origin is not finite.

The constructor also evaluates the Hessian of the centrifugal potential at construction time. This is defined as

\[H = \nabla\nabla \Psi = |\omega|^2 I - \omega \otimes \omega \]

Todo
We make an assumption here about the dimensionality of the space (e.g that the hessian is a 3x3 matrix). This is likely fine; however, if we ever want to be able to model 1D or 2D systems we will need to refactor this to be more general.

Member Function Documentation

◆ angular_velocity_vector()

const Vector & serif::equations::RigidRotation::angular_velocity_vector ( ) const
inlinenodiscard

Get the angular velocity vector of the rigid rotation.

Returns
The angular velocity vector.

◆ axis_origin()

const Vector & serif::equations::RigidRotation::axis_origin ( ) const
inlinenodiscard

Get the origin of the rotation axis.

Returns
The origin of the rotation axis.

◆ centrifugal_potential()

double serif::equations::RigidRotation::centrifugal_potential ( const Vector & position) const
inlinenodiscard

Ψ = ½|ω × λ|²; using the cross product avoids subtracting nearly equal squared lengths near the axis.

Compute the centrifugal potential at a given position. This is computed as \( \Psi = \frac{1}{2}|\omega \times \lambda|^2\) where \(\lambda = r - r_a\) is the position relative to the axis origin.

Parameters
positionThe position at which to compute the centrifugal potential, which must be finite.
Returns
The centrifugal potential at the given position.
Todo
We should add some validation for position into this

◆ centrifugal_potential_gradient()

Vector serif::equations::RigidRotation::centrifugal_potential_gradient ( const Vector & position) const
inlinenodiscard

Compute the gradient of the centrifugal potential at a given position. This is computed as \( \nabla \Psi = H \lambda\) where \(H = |\omega|^2 I - \omega \otimes \omega\) is the Hessian of the centrifugal potential.

Parameters
positionThe position at which to compute the gradient of the centrifugal potential, which must be finite.
Returns
The gradient of the centrifugal potential at the given position.
Todo
We should add some validation for position into this

◆ centrifugal_potential_hessian()

const Matrix & serif::equations::RigidRotation::centrifugal_potential_hessian ( ) const
inlinenodiscard

Get the Hessian of the centrifugal potential, which is independent of position for rigid rotation. This is computed as \( H = |\omega|^2 I - \omega \otimes \omega\).

Returns
The Hessian of the centrifugal potential.

◆ unit_rotation()

static RigidRotation serif::equations::RigidRotation::unit_rotation ( Vector rotation_axis = {0.0, 0.0, 1.0},
const Vector & axis_origin = {} )
inlinestaticnodiscard

Construct a RigidRotation object with a unit rotation axis and an axis origin.

Parameters
rotation_axisThe rotation axis, which must be finite and nonzero. (default to the z-axis, (0, 0, 1))
axis_originThe origin of the rotation axis, which must be finite. (default to the origin, (0, 0, 0))
Exceptions
std::invalid_argumentIf the norm of the rotation axis is not finite and positive.

This method normalizes the rotation axis to create a unit vector. It then constructs a RigidRotation object using this unit vector and the provided axis origin.

Note
This constructs a new RigidRotation object does not modify the original object in place.
Todo
This may make sense to turn into a free-function rather than a class method.

Member Data Documentation

◆ m_angular_velocity_vector

Vector serif::equations::RigidRotation::m_angular_velocity_vector
private

The angular velocity vector of the rigid rotation, which must be finite.

◆ m_axis_origin

Vector serif::equations::RigidRotation::m_axis_origin
private

The origin of the rotation axis, which must be finite.

◆ m_potential_hessian

Matrix serif::equations::RigidRotation::m_potential_hessian {}
private

The Hessian of the centrifugal potential, which is independent of position for rigid rotation and is computed as \( H = |\omega|^2 I - \omega \otimes \omega\).


The documentation for this class was generated from the following file: