SpECTRE  v2025.03.17
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
ScalarWave::BoundaryCorrections::UpwindPenalty< Dim > Class Template Referencefinal

Computes the scalar wave upwind multipenalty boundary correction. More...

#include <UpwindPenalty.hpp>

Public Types

using options = implementation defined
 
using dg_package_field_tags = implementation defined
 
using dg_package_data_temporary_tags = implementation defined
 
using dg_package_data_volume_tags = implementation defined
 
using dg_boundary_terms_volume_tags = implementation defined
 
- Public Types inherited from ScalarWave::BoundaryCorrections::BoundaryCorrection< Dim >
using creatable_classes = implementation defined
 

Public Member Functions

 UpwindPenalty (const UpwindPenalty &)=default
 
UpwindPenaltyoperator= (const UpwindPenalty &)=default
 
 UpwindPenalty (UpwindPenalty &&)=default
 
UpwindPenaltyoperator= (UpwindPenalty &&)=default
 
void pup (PUP::er &p) override
 
std::unique_ptr< BoundaryCorrection< Dim > > get_clone () const override
 
double dg_package_data (gsl::not_null< Scalar< DataVector > * > packaged_char_speed_v_psi, gsl::not_null< tnsr::i< DataVector, Dim, Frame::Inertial > * > packaged_char_speed_v_zero, gsl::not_null< Scalar< DataVector > * > packaged_char_speed_v_plus, gsl::not_null< Scalar< DataVector > * > packaged_char_speed_v_minus, gsl::not_null< tnsr::i< DataVector, Dim, Frame::Inertial > * > packaged_char_speed_n_times_v_plus, gsl::not_null< tnsr::i< DataVector, Dim, Frame::Inertial > * > packaged_char_speed_n_times_v_minus, gsl::not_null< Scalar< DataVector > * > packaged_char_speed_gamma2_v_psi, gsl::not_null< tnsr::i< DataVector, 3, Frame::Inertial > * > packaged_char_speeds, const Scalar< DataVector > &psi, const Scalar< DataVector > &pi, const tnsr::i< DataVector, Dim, Frame::Inertial > &phi, const Scalar< DataVector > &constraint_gamma2, const tnsr::i< DataVector, Dim, Frame::Inertial > &normal_covector, const std::optional< tnsr::I< DataVector, Dim, Frame::Inertial > > &, const std::optional< Scalar< DataVector > > &normal_dot_mesh_velocity) const
 
void dg_boundary_terms (gsl::not_null< Scalar< DataVector > * > psi_boundary_correction, gsl::not_null< Scalar< DataVector > * > pi_boundary_correction, gsl::not_null< tnsr::i< DataVector, Dim, Frame::Inertial > * > phi_boundary_correction, const Scalar< DataVector > &char_speed_v_psi_int, const tnsr::i< DataVector, Dim, Frame::Inertial > &char_speed_v_zero_int, const Scalar< DataVector > &char_speed_v_plus_int, const Scalar< DataVector > &char_speed_v_minus_int, const tnsr::i< DataVector, Dim, Frame::Inertial > &char_speed_normal_times_v_plus_int, const tnsr::i< DataVector, Dim, Frame::Inertial > &char_speed_normal_times_v_minus_int, const Scalar< DataVector > &char_speed_constraint_gamma2_v_psi_int, const tnsr::i< DataVector, 3, Frame::Inertial > &char_speeds_int, const Scalar< DataVector > &char_speed_v_psi_ext, const tnsr::i< DataVector, Dim, Frame::Inertial > &char_speed_v_zero_ext, const Scalar< DataVector > &char_speed_v_plus_ext, const Scalar< DataVector > &char_speed_v_minus_ext, const tnsr::i< DataVector, Dim, Frame::Inertial > &char_speed_minus_normal_times_v_plus_ext, const tnsr::i< DataVector, Dim, Frame::Inertial > &char_speed_minus_normal_times_v_minus_ext, const Scalar< DataVector > &char_speed_constraint_gamma2_v_psi_ext, const tnsr::i< DataVector, 3, Frame::Inertial > &char_speeds_ext, dg::Formulation) const
 
- Public Member Functions inherited from ScalarWave::BoundaryCorrections::BoundaryCorrection< Dim >
 BoundaryCorrection (const BoundaryCorrection &)=default
 
BoundaryCorrectionoperator= (const BoundaryCorrection &)=default
 
 BoundaryCorrection (BoundaryCorrection &&)=default
 
BoundaryCorrectionoperator= (BoundaryCorrection &&)=default
 
virtual std::unique_ptr< BoundaryCorrection< Dim > > get_clone () const =0
 

Static Public Attributes

static constexpr Options::String help
 

Detailed Description

template<size_t Dim>
class ScalarWave::BoundaryCorrections::UpwindPenalty< Dim >

Computes the scalar wave upwind multipenalty boundary correction.

This implements the upwind multipenalty boundary correction term Dβ. The general form is given by:

Dβ=Tββ^extΛβ^α^ext,vα^extTββ^intΛβ^α^int,vα^int.

We denote the evolved fields by uα, the characteristic fields by vα^, and implicitly sum over reapeated indices. Tββ^ transforms characteristic fields to evolved fields, while Λβ^α^ is a diagonal matrix with only the negative characteristic speeds, and has zeros on the diagonal for all other entries. The int and ext superscripts denote quantities on the internal and external side of the mortar. Note that Eq. (6.3) of [192] is not exactly what's implemented since that boundary term does not consistently treat both sides of the interface on the same footing.

For the scalar wave system the correction is:

(1)DΨ=λvΨext,vext,ΨλvΨint,vint,Ψ,DΠ=12(λv+ext,vext,++λvext,vext,)+λvΨext,γ2vext,Ψ(2)12(λv+int,vint,++λvint,vint,)λvΨint,γ2vint,Ψ,DΦi=12(λv+ext,vext,+λvext,vext,)niext+λv0ext,viext,0(3)12(λv+int,vint,+λvint,vint,)niintλv0int,viint,0,

with characteristic fields

(4)vΨ=Ψ,(5)vi0=(δiknkni)Φk,(6)v±=Π±niΦiγ2Ψ,

and characteristic speeds

(7)λvΨ=vgini,(8)λv0=vgini,(9)λv±=±1vgini,

where vgi is the mesh velocity and ni is the outward directed unit normal covector to the interface. We have also defined

(10)λα^±={λα^if±λα^>00otherwise

In the implementation we store the speeds in a rank-3 tensor with the zeroth component being λvΨ, the first being λv+ and the second being λv.

Note that we have assumed niext points in the same direction as niint, but in the code they point in opposite directions. If niext points in the opposite direction the external speeds have their sign flipped and the ± fields and their speeds reverse roles (i.e. the vext,+ field is now flowing into the element, while vext, flows out). In our implementation this reversal actually cancels out, and we have the following equations:

(11)DΨ=λvΨext,+vext,ΨλvΨint,vint,Ψ,DΠ=12(λv+ext,+vext,+λvext,+vext,)λvΨext,+γ2vext,Ψ(12)12(λv+int,vint,++λvint,vint,)λvΨint,γ2vint,Ψ,DΦi=12(λv+ext,+vext,++λvext,+vext,)niextλv0ext,+viext,0(13)12(λv+int,vint,+λvint,vint,)niintλv0int,viint,0,

Member Function Documentation

◆ get_clone()

template<size_t Dim>
std::unique_ptr< BoundaryCorrection< Dim > > ScalarWave::BoundaryCorrections::UpwindPenalty< Dim >::get_clone ( ) const
overridevirtual

Member Data Documentation

◆ help

template<size_t Dim>
constexpr Options::String ScalarWave::BoundaryCorrections::UpwindPenalty< Dim >::help
staticconstexpr
Initial value:
= {
"Computes the UpwindPenalty boundary correction term for the scalar wave "
"system."}

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