GradientValueMixin< n_start_index, n_species, ValueType, GradientType, Derived > Struct Template Reference

Developer Documentation: MeltPoolDG::SpeciesTransport::GradientValueMixin< n_start_index, n_species, ValueType, GradientType, Derived > Struct Template Reference
Developer Documentation
MeltPoolDG::SpeciesTransport::GradientValueMixin< n_start_index, n_species, ValueType, GradientType, Derived > Struct Template Reference

#include <state_views_mixins.hpp>

Public Types

using value_type = std::conditional_t< std::is_const_v< std::remove_reference_t< ValueType > >, std::add_const_t< typename ValueType::value_type >, typename ValueType::value_type >
 
using gradient_type = std::conditional_t< std::is_const_v< std::remove_reference_t< GradientType > >, std::add_const_t< typename GradientType::value_type >, typename GradientType::value_type >
 

Public Member Functions

gradient_typegrad_partial_density (const unsigned species_component) const
 
GradientType::value_type grad_mass_fraction (const unsigned species_component) const
 

Private Member Functions

ValueType & value () const
 
GradientType & gradient_value () const
 
const Derived & derived () const
 
gradient_typelast_species_grad_mass_fraction () const
 
GradientType::value_type & last_species_grad_partial_density () const
 

Private Attributes

struct { 
 
   std::optional< typename GradientType::value_type >   mass_fraction 
 
   std::optional< typename GradientType::value_type >   partial_density 
 
last_species_cache 
 

Detailed Description

template<int n_start_index, int n_species, typename ValueType, typename GradientType, typename Derived>
struct MeltPoolDG::SpeciesTransport::GradientValueMixin< n_start_index, n_species, ValueType, GradientType, Derived >

CRTP mixin providing semantic access to the gradient of conserved and primitive variables of species transport, i.e. the gradient of the partial density and the gradient of mass fraction.

Template Parameters
n_start_indexThe starting index at which the first partial density components of the species solution is located in the solution vector.
n_speciesThe total number of species in the simulation.
ValueTypeA dealii::Tensor type representing the non-gradient value.
GradientTypeA dealii::Tensor type representing the gradient.
DerivedThe derived type to which the mixin is applied. The derived type must provide a value() member function returning an indexable tensor-like container, a density(), a grad_density() and a mass_fraction() function.

Member Typedef Documentation

◆ gradient_type

template<int n_start_index, int n_species, typename ValueType , typename GradientType , typename Derived >
using MeltPoolDG::SpeciesTransport::GradientValueMixin< n_start_index, n_species, ValueType, GradientType, Derived >::gradient_type = std::conditional_t<std::is_const_v<std::remove_reference_t<GradientType> >, std::add_const_t<typename GradientType::value_type>, typename GradientType::value_type>

◆ value_type

template<int n_start_index, int n_species, typename ValueType , typename GradientType , typename Derived >
using MeltPoolDG::SpeciesTransport::GradientValueMixin< n_start_index, n_species, ValueType, GradientType, Derived >::value_type = std::conditional_t<std::is_const_v<std::remove_reference_t<ValueType> >, std::add_const_t<typename ValueType::value_type>, typename ValueType::value_type>

Member Function Documentation

◆ derived()

template<int n_start_index, int n_species, typename ValueType , typename GradientType , typename Derived >
const Derived & MeltPoolDG::SpeciesTransport::GradientValueMixin< n_start_index, n_species, ValueType, GradientType, Derived >::derived ( ) const
inlineprivate

◆ grad_mass_fraction()

template<int n_start_index, int n_species, typename ValueType , typename GradientType , typename Derived >
GradientType::value_type MeltPoolDG::SpeciesTransport::GradientValueMixin< n_start_index, n_species, ValueType, GradientType, Derived >::grad_mass_fraction ( const unsigned  species_component) const
inline

Get the gradient of the mass fraction of a species component.

Parameters
species_componentThe index of the species component for which the gradient of the mass fraction is computed.

◆ grad_partial_density()

template<int n_start_index, int n_species, typename ValueType , typename GradientType , typename Derived >
gradient_type & MeltPoolDG::SpeciesTransport::GradientValueMixin< n_start_index, n_species, ValueType, GradientType, Derived >::grad_partial_density ( const unsigned  species_component) const
inline

Get the gradient of the partial density of a species component.

Parameters
species_componentThe index of the species component for which the gradient of the partial density is computed.

◆ gradient_value()

template<int n_start_index, int n_species, typename ValueType , typename GradientType , typename Derived >
GradientType & MeltPoolDG::SpeciesTransport::GradientValueMixin< n_start_index, n_species, ValueType, GradientType, Derived >::gradient_value ( ) const
inlineprivate

◆ last_species_grad_mass_fraction()

template<int n_start_index, int n_species, typename ValueType , typename GradientType , typename Derived >
gradient_type & MeltPoolDG::SpeciesTransport::GradientValueMixin< n_start_index, n_species, ValueType, GradientType, Derived >::last_species_grad_mass_fraction ( ) const
inlineprivate

Helper function to compute the gradient of the mass fraction of the last species component. This is not stored in the solution vector and is computed from the gradients of the other species components. The result is cached to avoid redundant computations in case the function is called multiple times for the same species component.

◆ last_species_grad_partial_density()

template<int n_start_index, int n_species, typename ValueType , typename GradientType , typename Derived >
GradientType::value_type & MeltPoolDG::SpeciesTransport::GradientValueMixin< n_start_index, n_species, ValueType, GradientType, Derived >::last_species_grad_partial_density ( ) const
inlineprivate

Helper function to compute the gradient of the partial density of the last species component. This is not stored in the solution vector and is computed from the gradients of the other species components. The result is cached to avoid redundant computations in case the function is called multiple times for the same species component.

◆ value()

template<int n_start_index, int n_species, typename ValueType , typename GradientType , typename Derived >
ValueType & MeltPoolDG::SpeciesTransport::GradientValueMixin< n_start_index, n_species, ValueType, GradientType, Derived >::value ( ) const
inlineprivate

Member Data Documentation

◆ [struct]

struct { ... } MeltPoolDG::SpeciesTransport::GradientValueMixin< n_start_index, n_species, ValueType, GradientType, Derived >::last_species_cache

Cache for the gradient of the mass fraction and the gradient of the partial density of the last species component.

◆ mass_fraction

template<int n_start_index, int n_species, typename ValueType , typename GradientType , typename Derived >
std::optional<typename GradientType::value_type> MeltPoolDG::SpeciesTransport::GradientValueMixin< n_start_index, n_species, ValueType, GradientType, Derived >::mass_fraction
mutable

◆ partial_density

template<int n_start_index, int n_species, typename ValueType , typename GradientType , typename Derived >
std::optional<typename GradientType::value_type> MeltPoolDG::SpeciesTransport::GradientValueMixin< n_start_index, n_species, ValueType, GradientType, Derived >::partial_density
mutable

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