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

Public Member Functions

 MaterialModelInputs (const unsigned int n_points, const unsigned int n_comp)
 
 MaterialModelInputs (const DataPostprocessorInputs::Vector< dim > &input_data, const Introspection< dim > &introspection, const bool use_strain_rate=true)
 
 MaterialModelInputs (const FEValuesBase< dim, dim > &fe_values, const typename DoFHandler< dim >::active_cell_iterator &cell, const Introspection< dim > &introspection, const LinearAlgebra::BlockVector &solution_vector, const bool use_strain_rates=true)
 
 MaterialModelInputs (const MaterialModelInputs &source)
 
 MaterialModelInputs (MaterialModelInputs &&)=default
 
MaterialModelInputsoperator= (const MaterialModelInputs &source)=delete
 
MaterialModelInputsoperator= (MaterialModelInputs &&)=default
 
void reinit (const FEValuesBase< dim, dim > &fe_values, const typename DoFHandler< dim >::active_cell_iterator &cell, const Introspection< dim > &introspection, const LinearAlgebra::BlockVector &solution_vector, const bool use_strain_rates=true)
 
template<class AdditionalInputType >
AdditionalInputType * get_additional_input ()
 
template<class AdditionalInputType >
const AdditionalInputType * get_additional_input () const
 

Public Attributes

std::vector< Point< dim > > position
 
std::vector< double > temperature
 
std::vector< double > pressure
 
std::vector< Tensor< 1, dim > > pressure_gradient
 
std::vector< Tensor< 1, dim > > velocity
 
std::vector< std::vector< double > > composition
 
std::vector< SymmetricTensor< 2, dim > > strain_rate
 
const DoFHandler< dim >::active_cell_iterator *cell DEAL_II_DEPRECATED
 
DoFHandler< dim >::active_cell_iterator current_cell
 
std::vector< std::unique_ptr< AdditionalMaterialInputs< dim > > > additional_inputs
 

Detailed Description

template<int dim>
struct aspect::MaterialModel::MaterialModelInputs< dim >

A data structure with all inputs for the MaterialModel::Interface::evaluate() method. The vectors all have the same length and refer to different evaluation points (given in position).

Definition at line 181 of file interface.h.

Constructor & Destructor Documentation

§ MaterialModelInputs() [1/5]

template<int dim>
aspect::MaterialModel::MaterialModelInputs< dim >::MaterialModelInputs ( 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 input quantities will be provided.
n_compThe number of vector quantities (in the order in which the Introspection class reports them) for which input will be provided.

§ MaterialModelInputs() [2/5]

template<int dim>
aspect::MaterialModel::MaterialModelInputs< dim >::MaterialModelInputs ( const DataPostprocessorInputs::Vector< dim > &  input_data,
const Introspection< dim > &  introspection,
const bool  use_strain_rate = true 
)

Constructor. Initialize the arrays of the structure with the number of points in the input_data structure, and fills them appropriately.

Parameters
input_dataThe data used to populate the material model input quantities.
introspectionA reference to the simulator introspection object.
use_strain_rateWhether to compute the strain rates.

§ MaterialModelInputs() [3/5]

template<int dim>
aspect::MaterialModel::MaterialModelInputs< dim >::MaterialModelInputs ( const FEValuesBase< dim, dim > &  fe_values,
const typename DoFHandler< dim >::active_cell_iterator cell,
const Introspection< dim > &  introspection,
const LinearAlgebra::BlockVector solution_vector,
const bool  use_strain_rates = true 
)

Constructor. Initializes the various arrays of this structure with the FEValues and introspection objects and the solution_vector. This constructor calls the function reinit to populate the newly created arrays.

Parameters
fe_valuesAn FEValuesBase object used to evaluate the finite elements.
cellThe currently active cell for the fe_values object.
introspectionA reference to the simulator introspection object.
solution_vectorThe finite element vector from which to construct the inputs.
use_strain_ratesWhether to compute the strain rates.

§ MaterialModelInputs() [4/5]

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

Copy constructor. This constructor copies all data members of the source object except for the additional input data (of type AdditionalMaterialInputs) pointers, stored in the source.additional_inputs 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 input data objects associated with it.

§ MaterialModelInputs() [5/5]

template<int dim>
aspect::MaterialModel::MaterialModelInputs< dim >::MaterialModelInputs ( MaterialModelInputs< dim > &&  )
default

Move constructor. This constructor simply moves all members.

Member Function Documentation

§ operator=() [1/2]

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

Copy operator. Copying these objects is expensive and consequently prohibited

§ operator=() [2/2]

template<int dim>
MaterialModelInputs& aspect::MaterialModel::MaterialModelInputs< dim >::operator= ( MaterialModelInputs< dim > &&  )
default

Move operator.

§ reinit()

template<int dim>
void aspect::MaterialModel::MaterialModelInputs< dim >::reinit ( const FEValuesBase< dim, dim > &  fe_values,
const typename DoFHandler< dim >::active_cell_iterator cell,
const Introspection< dim > &  introspection,
const LinearAlgebra::BlockVector solution_vector,
const bool  use_strain_rates = true 
)

Function to re-initialize and populate the pre-existing arrays created by the constructor MaterialModelInputs.

§ get_additional_input() [1/2]

template<int dim>
template<class AdditionalInputType >
AdditionalInputType * aspect::MaterialModel::MaterialModelInputs< dim >::get_additional_input ( )

Given an additional material model input class as explicitly specified template argument, returns a pointer to this additional material model input object if it is used in the current simulation. If the output does not exist, a null pointer is returned.

Definition at line 1254 of file interface.h.

§ get_additional_input() [2/2]

template<int dim>
template<class AdditionalInputType >
const AdditionalInputType * aspect::MaterialModel::MaterialModelInputs< dim >::get_additional_input ( ) const

Constant version of get_additional_input() returning a const pointer.

Definition at line 1268 of file interface.h.

Member Data Documentation

§ position

template<int dim>
std::vector<Point<dim> > aspect::MaterialModel::MaterialModelInputs< dim >::position

Vector with global positions where the material has to be evaluated in evaluate().

Definition at line 273 of file interface.h.

§ temperature

template<int dim>
std::vector<double> aspect::MaterialModel::MaterialModelInputs< dim >::temperature

Temperature values at the points given in the position vector.

Definition at line 278 of file interface.h.

§ pressure

template<int dim>
std::vector<double> aspect::MaterialModel::MaterialModelInputs< dim >::pressure

Pressure values at the points given in the position vector.

Definition at line 283 of file interface.h.

§ pressure_gradient

template<int dim>
std::vector<Tensor<1,dim> > aspect::MaterialModel::MaterialModelInputs< dim >::pressure_gradient

Pressure gradients at the points given in the position vector. This is important for the heating models.

Definition at line 289 of file interface.h.

§ velocity

template<int dim>
std::vector<Tensor<1,dim> > aspect::MaterialModel::MaterialModelInputs< dim >::velocity

Velocity values at the points given in the position vector. This value is mostly important in the case of determining whether material crossed a certain region (e.g. a phase boundary). The timestep that is needed for this check can be requested from SimulatorAccess.

Definition at line 298 of file interface.h.

§ composition

template<int dim>
std::vector<std::vector<double> > aspect::MaterialModel::MaterialModelInputs< dim >::composition

Values of the compositional fields at the points given in the position vector: composition[i][c] is the compositional field c at point i.

Definition at line 305 of file interface.h.

§ strain_rate

template<int dim>
std::vector<SymmetricTensor<2,dim> > aspect::MaterialModel::MaterialModelInputs< dim >::strain_rate

Strain rate at the points given in the position vector. Only the viscosity may depend on these values. This std::vector can be set to size 0 if the viscosity is not needed.

Note
The strain rate is computed as $\varepsilon(\mathbf u)=\frac 12 (\nabla \mathbf u + \nabla \mathbf u^T)$, regardless of whether the model is compressible or not. This is relevant since in some other contexts, the strain rate in the compressible case is computed as $\varepsilon(\mathbf u)=\frac 12 (\nabla \mathbf u + \nabla \mathbf u^T) - \frac 13 \nabla \cdot \mathbf u \mathbf 1$.

Definition at line 319 of file interface.h.

§ DEAL_II_DEPRECATED

template<int dim>
const DoFHandler<dim>::active_cell_iterator* cell aspect::MaterialModel::MaterialModelInputs< dim >::DEAL_II_DEPRECATED

Optional reference to the cell that contains these quadrature points. This allows for evaluating properties at the cell vertices and interpolating to the quadrature points, or to query the cell for material ids, neighbors, or other information that is not available solely from the locations. Note that not all calling functions can set this reference. In these cases it will be a nullptr, so make sure that your material model either fails with a proper error message or provide an alternative calculation for these cases.

Deprecated:
Use DoFHandler<dim>::active_cell_iterator current_cell instead.

Definition at line 333 of file interface.h.

§ current_cell

template<int dim>
DoFHandler<dim>::active_cell_iterator aspect::MaterialModel::MaterialModelInputs< dim >::current_cell

Optional cell object that contains these quadrature points. This allows for evaluating properties at the cell vertices and interpolating to the quadrature points, or to query the cell for material ids, neighbors, or other information that is not available solely from the locations. Note that not all calling functions will set this cell iterator. In these cases it will be an invalid iterator constructed using the default constructor, so make sure that your material model either fails with a proper error message, or provides an alternative calculation for these cases. You can detect this with

if (in.current_cell.state() == IteratorState::valid)

Definition at line 350 of file interface.h.

§ additional_inputs

template<int dim>
std::vector<std::unique_ptr<AdditionalMaterialInputs<dim> > > aspect::MaterialModel::MaterialModelInputs< dim >::additional_inputs

Vector of shared pointers to additional material model input objects that can be added to MaterialModelInputs. By default, no inputs are added.

Definition at line 357 of file interface.h.


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