ASPECT
Public Member Functions | Public Attributes | List of all members
aspect::MaterialModel::MaterialModelOutputs< dim > Class Template Reference

Public Member Functions

 MaterialModelOutputs (const unsigned int n_points, const unsigned int n_comp)
 
void resize (const unsigned int n_points, const unsigned int n_comp, const bool remove_additional_outputs=true)
 
 MaterialModelOutputs (const MaterialModelOutputs &source)
 
 MaterialModelOutputs (MaterialModelOutputs &&) noexcept=default
 
MaterialModelOutputsoperator= (const MaterialModelOutputs &source)=delete
 
MaterialModelOutputsoperator= (MaterialModelOutputs &&) noexcept=default
 
unsigned int n_evaluation_points () const
 
template<class AdditionalOutputType >
std::shared_ptr< AdditionalOutputType > get_additional_output_object ()
 
template<class AdditionalOutputType >
std::shared_ptr< const AdditionalOutputType > get_additional_output_object () const
 
template<class AdditionalOutputType >
DEAL_II_DEPRECATED AdditionalOutputType * get_additional_output ()
 
template<class AdditionalOutputType >
DEAL_II_DEPRECATED const AdditionalOutputType * get_additional_output () const
 
template<class AdditionalInputType >
bool has_additional_output_object () const
 
void move_additional_outputs_from (MaterialModelOutputs< dim > &other)
 
template<class AdditionalOutputType >
AdditionalOutputType * get_additional_output ()
 
template<class AdditionalOutputType >
const AdditionalOutputType * get_additional_output () const
 

Public Attributes

std::vector< doubleviscosities
 
std::vector< doubledensities
 
std::vector< doublethermal_expansion_coefficients
 
std::vector< doublespecific_heat
 
std::vector< doublethermal_conductivities
 
std::vector< doublecompressibilities
 
std::vector< doubleentropy_derivative_pressure
 
std::vector< doubleentropy_derivative_temperature
 
std::vector< std::vector< double > > reaction_terms
 
std::vector< std::shared_ptr< AdditionalMaterialOutputs< dim > > > additional_outputs
 

Detailed Description

template<int dim>
class aspect::MaterialModel::MaterialModelOutputs< dim >

A data structure with the output field of the MaterialModel::Interface::evaluate() function. The vectors are the values at the different positions given by MaterialModelInputs::position.

Definition at line 530 of file interface.h.

Constructor & Destructor Documentation

§ MaterialModelOutputs() [1/3]

template<int dim>
aspect::MaterialModel::MaterialModelOutputs< dim >::MaterialModelOutputs ( const unsigned int  n_points,
const unsigned int  n_comp 
)

Constructor. Initialize the various arrays of this structure with the given number of quadrature points and (finite element) components.

Parameters
n_pointsThe number of quadrature points for which output quantities will be provided.
n_compThe number of vector quantities (in the order in which the Introspection class reports them) for which output will be provided.

§ MaterialModelOutputs() [2/3]

template<int dim>
aspect::MaterialModel::MaterialModelOutputs< dim >::MaterialModelOutputs ( const MaterialModelOutputs< dim > &  source)

Copy constructor. This constructor copies all data members of the source object except for the additional output data (of type AdditionalMaterialOutputs) pointers, stored in the source.additional_outputs member variable.

This is because these pointers can not be copied (they are unique to the source object). Since they can also not be recreated without the original code that created these objects in the first place, this constructor throws an exception if the source object had any additional output data objects associated with it.

§ MaterialModelOutputs() [3/3]

template<int dim>
aspect::MaterialModel::MaterialModelOutputs< dim >::MaterialModelOutputs ( MaterialModelOutputs< dim > &&  )
defaultnoexcept

Move constructor. This constructor simply moves all members.

Member Function Documentation

§ resize()

template<int dim>
void aspect::MaterialModel::MaterialModelOutputs< dim >::resize ( const unsigned int  n_points,
const unsigned int  n_comp,
const bool  remove_additional_outputs = true 
)

Resize the internal data structures to provide sufficient memory to store (at least) n_points points and n_comp compositions. If possible reallocation of memory will be avoided. All entries will be reset to signaling NaNs. This function is not supported if AdditionalMaterialOutputs are attached.

Parameters
n_pointsThe number of quadrature points for which output quantities will be computed.
n_compThe number of vector quantities (in the order in which the Introspection class reports them) for which output will be computed.
remove_additional_outputsIf set to true, any additional outputs attached to this object will be removed. In that case, the resulting MaterialModelOutputs object will be as if it had been constructed from scratch via the constructor that takes the number of quadrature points and number of compositions as arguments. If set to false, and if additional outputs are attached, these objects will remain untouched.

§ operator=() [1/2]

template<int dim>
MaterialModelOutputs& aspect::MaterialModel::MaterialModelOutputs< dim >::operator= ( const MaterialModelOutputs< dim > &  source)
delete

Copy operator. Copying these objects is expensive, and consequently prohibited.

§ operator=() [2/2]

template<int dim>
MaterialModelOutputs& aspect::MaterialModel::MaterialModelOutputs< dim >::operator= ( MaterialModelOutputs< dim > &&  )
defaultnoexcept

Move operator.

§ n_evaluation_points()

template<int dim>
unsigned int aspect::MaterialModel::MaterialModelOutputs< dim >::n_evaluation_points ( ) const

Function that returns the number of points at which the material model is to be evaluated.

§ get_additional_output_object() [1/2]

template<int dim>
template<class AdditionalOutputType >
std::shared_ptr< AdditionalOutputType > aspect::MaterialModel::MaterialModelOutputs< dim >::get_additional_output_object ( )

Given an additional material model output class as explicitly specified by the template argument, return a pointer to this additional material model output object if it is used in the current simulation. The output can then be filled in the MaterialModels::Interface::evaluate() function.

If the output does not exist, a null pointer is returned.

Definition at line 1621 of file interface.h.

References aspect::MaterialModel::MaterialProperties::additional_outputs.

§ get_additional_output_object() [2/2]

template<int dim>
template<class AdditionalOutputType >
std::shared_ptr< const AdditionalOutputType > aspect::MaterialModel::MaterialModelOutputs< dim >::get_additional_output_object ( ) const

Constant version of get_additional_output_object() returning a const pointer.

Definition at line 1634 of file interface.h.

References aspect::MaterialModel::MaterialProperties::additional_outputs.

§ get_additional_output() [1/4]

template<int dim>
template<class AdditionalOutputType >
DEAL_II_DEPRECATED AdditionalOutputType* aspect::MaterialModel::MaterialModelOutputs< dim >::get_additional_output ( )
Deprecated:
This is a version of the functions above that returns a bare pointer, rather than a managed pointer object. This function is deprecated, use the functions above.

§ get_additional_output() [2/4]

template<int dim>
template<class AdditionalOutputType >
DEAL_II_DEPRECATED const AdditionalOutputType* aspect::MaterialModel::MaterialModelOutputs< dim >::get_additional_output ( ) const
Deprecated:
This is a version of the functions above that returns a bare pointer, rather than a managed pointer object. This function is deprecated, use the functions above.

§ has_additional_output_object()

template<int dim>
template<class AdditionalOutputType >
bool aspect::MaterialModel::MaterialModelOutputs< dim >::has_additional_output_object ( ) const

Given an additional material model output class as explicitly specified by the template argument, return whether the current object stores such an additional material model output object. If so, the get_additional_output_object() function will return a non-null pointer.

If the output does not exist, i.e., if there is no additional output object of the specified type, then this function will return false.

Definition at line 1697 of file interface.h.

References aspect::MaterialModel::MaterialProperties::additional_outputs.

§ move_additional_outputs_from()

template<int dim>
void aspect::MaterialModel::MaterialModelOutputs< dim >::move_additional_outputs_from ( MaterialModelOutputs< dim > &  other)

Steal the additional outputs from other. The destination (this), is expected to currently have no additional outputs.

Definition at line 1709 of file interface.h.

References aspect::MaterialModel::MaterialProperties::additional_outputs, aspect::MaterialModel::MaterialModelOutputs< dim >::additional_outputs, Assert, and StandardExceptions::ExcMessage().

§ get_additional_output() [3/4]

template<int dim>
template<class AdditionalOutputType >
AdditionalOutputType* aspect::MaterialModel::MaterialModelOutputs< dim >::get_additional_output ( )

Definition at line 1666 of file interface.h.

§ get_additional_output() [4/4]

template<int dim>
template<class AdditionalOutputType >
const AdditionalOutputType* aspect::MaterialModel::MaterialModelOutputs< dim >::get_additional_output ( ) const

Definition at line 1675 of file interface.h.

Member Data Documentation

§ viscosities

template<int dim>
std::vector<double> aspect::MaterialModel::MaterialModelOutputs< dim >::viscosities

Viscosity \(\eta\) values at the given positions.

Definition at line 612 of file interface.h.

§ densities

template<int dim>
std::vector<double> aspect::MaterialModel::MaterialModelOutputs< dim >::densities

Density values at the given positions.

Definition at line 617 of file interface.h.

§ thermal_expansion_coefficients

template<int dim>
std::vector<double> aspect::MaterialModel::MaterialModelOutputs< dim >::thermal_expansion_coefficients

Thermal expansion coefficients at the given positions. It is defined as \(\alpha = - \frac{1}{\rho} \frac{\partial\rho}{\partial T}\)

Definition at line 623 of file interface.h.

§ specific_heat

template<int dim>
std::vector<double> aspect::MaterialModel::MaterialModelOutputs< dim >::specific_heat

Specific heat at the given positions.

Definition at line 628 of file interface.h.

§ thermal_conductivities

template<int dim>
std::vector<double> aspect::MaterialModel::MaterialModelOutputs< dim >::thermal_conductivities

Thermal conductivity at the given positions.

Definition at line 633 of file interface.h.

§ compressibilities

template<int dim>
std::vector<double> aspect::MaterialModel::MaterialModelOutputs< dim >::compressibilities

Compressibility at the given positions. The compressibility is defined as \(\kappa = \frac{1}{\rho} \frac{\partial\rho}{\partial p}\).

Definition at line 639 of file interface.h.

§ entropy_derivative_pressure

template<int dim>
std::vector<double> aspect::MaterialModel::MaterialModelOutputs< dim >::entropy_derivative_pressure

The product of the change of entropy \(\Delta S\) at a phase transition and the derivative of the phase function \(X=X(p,T,\mathfrak c,\mathbf x)\) with regard to pressure at the given positions.

Definition at line 646 of file interface.h.

§ entropy_derivative_temperature

template<int dim>
std::vector<double> aspect::MaterialModel::MaterialModelOutputs< dim >::entropy_derivative_temperature

The product of (minus) the change of entropy \(-\Delta S\) at a phase transition and the derivative of the phase function \(X=X(p,T,\mathfrak c,\mathbf x)\) with regard to temperature at the given positions.

Definition at line 654 of file interface.h.

§ reaction_terms

template<int dim>
std::vector<std::vector<double> > aspect::MaterialModel::MaterialModelOutputs< dim >::reaction_terms

Change in composition due to chemical reactions at the given positions. The term reaction_terms[i][c] is the change in compositional field c at point i.

The mental model behind prescribing actual changes in composition rather than reaction rates is that we assume that there is always an equilibrium between the compositional fields (because the time scale of reactions is normally much shorter than that of convection), so the quantity returned by this function is an actual change in the amount of material, which is added to or subtracted from the current value of the compositional field, and NOT a reaction rate. The idea is, that in dependence of temperature, pressure, position and the compositional fields themselves an equilibrium can be calculated, and the difference between the current value and the equilibrium can be added to the respective compositional field.

For mass conservation it should ALWAYS be checked that what is subtracted from one field is added to another field (and the other way round) and that one never subtracts more than the actual value of a field (so it does not get negative).

This function has a default implementation that sets the reaction term to zero (assuming no reactions).

Note
In cases where one has slow chemical reactions (or cases where compositional fields are used to track quantities different than actual compositions, for example accumulated strains in damage models), models are formulated as differential equations with right hand sides, not as instantaneous equations. In such cases, the reaction terms (i.e., the incremental additions to the previous state) are usually of the form reaction rate times time step size. To implement something like this, derive your material model from SimulatorAccess so you can query the time step used by the simulator in order to compute the reaction increment.

Definition at line 692 of file interface.h.

§ additional_outputs

template<int dim>
std::vector<std::shared_ptr<AdditionalMaterialOutputs<dim> > > aspect::MaterialModel::MaterialModelOutputs< dim >::additional_outputs

Vector of shared pointers to additional material model output objects that can then be added to MaterialModelOutputs. By default, no outputs are added.

Definition at line 699 of file interface.h.

Referenced by aspect::MaterialModel::MaterialModelOutputs< dim >::move_additional_outputs_from().


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