Loading...
Searching...
No Matches
terra::fe::wedge::linearforms::shell::InvRhoDrhoDt< ScalarT > Class Template Reference

Linear form for the PDA temporal compressibility term in compressible Stokes. More...

#include <inv_rho_drho_dt.hpp>

Public Types

using DstVectorType = linalg::VectorQ1Scalar< ScalarT >
 
using ScalarType = ScalarT
 

Public Member Functions

 InvRhoDrhoDt (const grid::shell::DistributedDomain &domain, const grid::Grid3DDataVec< ScalarT, 3 > &grid, const grid::Grid2DDataScalar< ScalarT > &radii, const linalg::VectorQ1Scalar< ScalarT > &rho, const linalg::VectorQ1Scalar< ScalarT > &drho_dt, const linalg::OperatorApplyMode operator_apply_mode=linalg::OperatorApplyMode::Replace, const linalg::OperatorCommunicationMode operator_communication_mode=linalg::OperatorCommunicationMode::CommunicateAdditively)
 
void apply_impl (DstVectorType &dst)
 
void operator() (const int local_subdomain_id, const int x_cell, const int y_cell, const int r_cell) const
 Kokkos kernel: per-cell contribution to \( f_i = \int_E \frac{1}{\rho} \dot\rho \, \phi_i \, \mathrm{d}x \).
 

Detailed Description

template<typename ScalarT>
class terra::fe::wedge::linearforms::shell::InvRhoDrhoDt< ScalarT >

Linear form for the PDA temporal compressibility term in compressible Stokes.

Given scalar FE functions \(\rho\) (density) and \(\dot\rho\) (its previously computed time derivative), this linear form evaluates

\[ f_i = \int_\Omega \frac{1}{\rho} \dot\rho \, \phi_i \, \mathrm{d}x \]

into a scalar finite element coefficient vector, where \(\phi_i\) are the scalar Q1 test functions on the spherical shell mesh.

This is the temporal part of the right-hand side of the mass conservation equation in the Projected Density Approximation (PDA) for compressible Stokes flow. The time derivative \(\dot\rho\) is expected to be pre-computed (e.g. via a first- or second-order BDF scheme) and stored as a scalar FE coefficient vector before calling apply. See the Stokes documentation for the full context.

Note
The sign convention at the call site depends on the (2,1) block of the Stokes operator. The Divergence block computes \(-(q, \mathrm{div}\, u)\), so the mass conservation equation \(-(q, \mathrm{div}\, u) = f_p\) requires \(f_p = +\frac{1}{\rho}\dot\rho\) term (positive sign).
\(\rho\) must not vanish in the domain; no singular-value protection is applied.

Concept. This class satisfies terra::linalg::LinearFormLike. Evaluation writes the assembled coefficient vector into dst via linalg::apply:

InvRhoDrhoDt< double > L( domain, grid, radii, rho, drho_dt );
linalg::apply( L, g ); // fills g_i = ∫ (1/ρ) ρ̇ φ_i dx
Linear form for the PDA temporal compressibility term in compressible Stokes.
Definition inv_rho_drho_dt.hpp:55
Q1 scalar finite element vector on a distributed shell grid.
Definition vector_q1.hpp:21
void apply(LinearForm &L, typename LinearForm::DstVectorType &dst)
Apply a linear form and write to a destination vector.
Definition linear_form.hpp:37

The default OperatorApplyMode::Replace zeroes dst before accumulation. Pass OperatorApplyMode::Add to add into an existing vector instead.

Member Typedef Documentation

◆ DstVectorType

template<typename ScalarT >
using terra::fe::wedge::linearforms::shell::InvRhoDrhoDt< ScalarT >::DstVectorType = linalg::VectorQ1Scalar< ScalarT >

◆ ScalarType

template<typename ScalarT >
using terra::fe::wedge::linearforms::shell::InvRhoDrhoDt< ScalarT >::ScalarType = ScalarT

Constructor & Destructor Documentation

◆ InvRhoDrhoDt()

template<typename ScalarT >
terra::fe::wedge::linearforms::shell::InvRhoDrhoDt< ScalarT >::InvRhoDrhoDt ( const grid::shell::DistributedDomain domain,
const grid::Grid3DDataVec< ScalarT, 3 > &  grid,
const grid::Grid2DDataScalar< ScalarT > &  radii,
const linalg::VectorQ1Scalar< ScalarT > &  rho,
const linalg::VectorQ1Scalar< ScalarT > &  drho_dt,
const linalg::OperatorApplyMode  operator_apply_mode = linalg::OperatorApplyMode::Replace,
const linalg::OperatorCommunicationMode  operator_communication_mode = linalg::OperatorCommunicationMode::CommunicateAdditively 
)
inline

Member Function Documentation

◆ apply_impl()

template<typename ScalarT >
void terra::fe::wedge::linearforms::shell::InvRhoDrhoDt< ScalarT >::apply_impl ( DstVectorType dst)
inline

◆ operator()()

template<typename ScalarT >
void terra::fe::wedge::linearforms::shell::InvRhoDrhoDt< ScalarT >::operator() ( const int  local_subdomain_id,
const int  x_cell,
const int  y_cell,
const int  r_cell 
) const
inline

Kokkos kernel: per-cell contribution to \( f_i = \int_E \frac{1}{\rho} \dot\rho \, \phi_i \, \mathrm{d}x \).


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