DofValueMixin< n_start_index, n_species, ValueType, Derived > Struct Template Reference

Developer Documentation: MeltPoolDG::SpeciesTransport::DofValueMixin< n_start_index, n_species, ValueType, Derived > Struct Template Reference
Developer Documentation
MeltPoolDG::SpeciesTransport::DofValueMixin< n_start_index, n_species, ValueType, 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 >
 

Public Member Functions

value_typepartial_density (const unsigned species_component) const
 
ValueType::value_type mass_fraction (const unsigned species_component) const
 

Private Member Functions

ValueType & value () const
 
const Derived & derived () const
 
ValueType::value_type last_species_mass_fraction () const
 
value_typelast_species_partial_density () const
 

Private Attributes

struct { 
 
   std::optional< typename ValueType::value_type >   mass_fraction 
 
   std::optional< typename ValueType::value_type >   partial_density 
 
last_species_cache 
 Cache for the mass fraction and the partial density of the last species component.
 

Detailed Description

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

CRTP mixin providing semantic access to conserved and primitive variables of species transport, i.e. the partial density and the mass fraction. The following mixins assume that the solution vector stores the first n-1 species partial densities in consecutive components starting from the index n_start_index. The mass fraction and partial density of the last species are then derived from the total density and the mass fractions or partial densities of the other species, respectively.

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-like type that can be indexed with operator[] and whose value_type is a floating point type or a dealii::VectorizedArray of a floating point type.
DerivedThe derived type to which the mixin is applied. The derived type must provide a value() member function returning an indexable tensor-like container and a density() function.

Member Typedef Documentation

◆ value_type

template<int n_start_index, int n_species, typename ValueType , typename Derived >
using MeltPoolDG::SpeciesTransport::DofValueMixin< n_start_index, n_species, ValueType, 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 Derived >
const Derived & MeltPoolDG::SpeciesTransport::DofValueMixin< n_start_index, n_species, ValueType, Derived >::derived ( ) const
inlineprivate

◆ last_species_mass_fraction()

template<int n_start_index, int n_species, typename ValueType , typename Derived >
ValueType::value_type MeltPoolDG::SpeciesTransport::DofValueMixin< n_start_index, n_species, ValueType, Derived >::last_species_mass_fraction ( ) const
inlineprivate

Helper function to compute the mass fraction of the last species component. This is not stored in the solution vector and is computed from the mass fractions 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_partial_density()

template<int n_start_index, int n_species, typename ValueType , typename Derived >
value_type & MeltPoolDG::SpeciesTransport::DofValueMixin< n_start_index, n_species, ValueType, Derived >::last_species_partial_density ( ) const
inlineprivate

Helper function to compute the partial density of the last species component. This is not stored in the solution vector and is computed from the partial densities 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.

◆ mass_fraction()

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

Return the mass fraction of a species component.

Parameters
species_componentThe index of the species component of interest.

◆ partial_density()

template<int n_start_index, int n_species, typename ValueType , typename Derived >
value_type & MeltPoolDG::SpeciesTransport::DofValueMixin< n_start_index, n_species, ValueType, Derived >::partial_density ( const unsigned  species_component) const
inline

Return the partial density of a species component.

Parameters
species_componentThe index of the species component of interest.

◆ value()

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

Member Data Documentation

◆ [struct]

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

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

◆ mass_fraction

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

◆ partial_density

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

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