ASPECT
Public Member Functions | Public Attributes | List of all members
aspect::MaterialModel::MaterialModelInputs< dim > Class 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 compute_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 compute_strain_rate=true)
 
 MaterialModelInputs (const MaterialModelInputs &source)
 
 MaterialModelInputs (MaterialModelInputs &&) noexcept=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 compute_strain_rate=true)
 
unsigned int n_evaluation_points () const
 
bool requests_property (const MaterialProperties::Property &property) const
 
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
 
DoFHandler< dim >::active_cell_iterator current_cell
 
MaterialProperties::Property requested_properties
 
std::vector< std::unique_ptr< AdditionalMaterialInputs< dim > > > additional_inputs
 

Detailed Description

template<int dim>
class 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 245 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  compute_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.
compute_strain_rateIf set to true, then the object that is currently created will also store the strain rates at all evaluation points. This is an expensive operation. If set to false, then the strain_rate array is going to be empty, and strain rates are not evaluated. As a consequence, strain rates are then also not available to functions that take this MaterialModelInputs object as input, for example to compute strain rate-dependent viscosities.

§ 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  compute_strain_rate = 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.
compute_strain_rateIf set to true, then the object that is currently created will also store the strain rates at all evaluation points. This is an expensive operation. If set to false, then the strain_rate array is going to be empty, and strain rates are not evaluated. As a consequence, strain rates are then also not available to functions that take this MaterialModelInputs object as input, for example to compute strain rate-dependent viscosities.

§ 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 > &&  )
defaultnoexcept

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  compute_strain_rate = true 
)

Function to re-initialize and populate the pre-existing arrays created by the constructor MaterialModelInputs. The arguments here have the same meaning as in the constructor of this class.

§ n_evaluation_points()

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

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

§ requests_property()

template<int dim>
bool aspect::MaterialModel::MaterialModelInputs< dim >::requests_property ( const MaterialProperties::Property property) const

Function that returns if the caller requests an evaluation of the handed over property. This is optional, because calculating some properties can be more expensive than the other material model properties and not all are needed for all applications.

§ 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. Ownership of the pointed-to object remains with the current object.

If the input does not exist, i.e., if there is no additional input object of the specified type, then a null pointer is returned.

Definition at line 1459 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

A version of the previous function that is used when the object being queried is const.

Definition at line 1473 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 366 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 371 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 376 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 382 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 391 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 398 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 412 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 429 of file interface.h.

§ requested_properties

template<int dim>
MaterialProperties::Property aspect::MaterialModel::MaterialModelInputs< dim >::requested_properties

A member variable that stores which properties the material model should compute. You can check specific properties using the requests_property function and usually do not need to access this variable directly. For documentation on the internal storage of this variable see the documentation for MaterialProperties::Property.

Definition at line 438 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 464 of file interface.h.


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