adamantine
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
adamantine::MechanicalOperator< dim, n_materials, p_order, MaterialStates, MemorySpaceType > Class Template Reference

#include <MechanicalOperator.hh>

Public Types

using TrilinosMatrixType = dealii::TrilinosWrappers::SparseMatrix
 
using TrilinosPreconditionerType = dealii::TrilinosWrappers::PreconditionAMG
 

Public Member Functions

 MechanicalOperator (MPI_Comm const &communicator, MaterialProperty< dim, n_materials, p_order, MaterialStates, MemorySpaceType > &material_properties, std::vector< double > const &reference_temperatures)
 
void reinit (dealii::DoFHandler< dim > const &dof_handler, dealii::AffineConstraints< double > const &affine_constraints, dealii::hp::QCollection< dim > const &quad, std::vector< std::shared_ptr< BodyForce< dim >>> const &body_forces=std::vector< std::shared_ptr< BodyForce< dim >>>())
 
void update_temperature (dealii::DoFHandler< dim > const &thermal_dof_handler, dealii::LA::distributed::Vector< double, dealii::MemorySpace::Host > const &temperature, std::vector< bool > const &has_melted)
 
void assemble_rhs (std::vector< std::shared_ptr< BodyForce< dim >>> const &body_forces)
 
dealii::LA::distributed::Vector< double, dealii::MemorySpace::Host > const & rhs () const
 
TrilinosMatrixType const & system_matrix () const
 
TrilinosPreconditionerType const & preconditioner () const
 

Private Member Functions

void assemble_matrix ()
 

Private Attributes

MPI_Comm const & _communicator
 
std::vector< double > _reference_temperatures
 
MaterialProperty< dim, n_materials, p_order, MaterialStates, MemorySpaceType > & _material_properties
 
dealii::DoFHandler< dim > const * _dof_handler = nullptr
 
dealii::DoFHandler< dim > const * _thermal_dof_handler = nullptr
 
dealii::AffineConstraints< double > const * _affine_constraints = nullptr
 
dealii::hp::QCollection< dim > const * _q_collection = nullptr
 
dealii::LA::distributed::Vector< double, dealii::MemorySpace::Host > _system_rhs
 
TrilinosMatrixType _system_matrix
 
TrilinosPreconditionerType _preconditioner
 
dealii::LA::distributed::Vector< double, dealii::MemorySpace::Host > _temperature
 
std::vector< bool > _has_melted
 

Detailed Description

template<int dim, int n_materials, int p_order, typename MaterialStates, typename MemorySpaceType>
class adamantine::MechanicalOperator< dim, n_materials, p_order, MaterialStates, MemorySpaceType >

This class is the operator associated with the solid mechanics equations. The class is templated on the MemorySpace because it use MaterialProperty which itself is templated on the MemorySpace but the operator is CPU only.

Definition at line 36 of file MechanicalOperator.hh.

Member Typedef Documentation

◆ TrilinosMatrixType

template<int dim, int n_materials, int p_order, typename MaterialStates , typename MemorySpaceType >
using adamantine::MechanicalOperator< dim, n_materials, p_order, MaterialStates, MemorySpaceType >::TrilinosMatrixType = dealii::TrilinosWrappers::SparseMatrix

Definition at line 47 of file MechanicalOperator.hh.

◆ TrilinosPreconditionerType

template<int dim, int n_materials, int p_order, typename MaterialStates , typename MemorySpaceType >
using adamantine::MechanicalOperator< dim, n_materials, p_order, MaterialStates, MemorySpaceType >::TrilinosPreconditionerType = dealii::TrilinosWrappers::PreconditionAMG

Definition at line 48 of file MechanicalOperator.hh.

Constructor & Destructor Documentation

◆ MechanicalOperator()

template<int dim, int n_materials, int p_order, typename MaterialStates , typename MemorySpaceType >
adamantine::MechanicalOperator< dim, n_materials, p_order, MaterialStates, MemorySpaceType >::MechanicalOperator ( MPI_Comm const &  communicator,
MaterialProperty< dim, n_materials, p_order, MaterialStates, MemorySpaceType > &  material_properties,
std::vector< double > const &  reference_temperatures 
)

Constructor. If the initial temperature is negative, the simulation is mechanical only. Otherwise, we solve a thermo-mechanical problem.

Definition at line 91 of file MechanicalOperator.cc.

Member Function Documentation

◆ assemble_matrix()

template<int dim, int n_materials, int p_order, typename MaterialStates , typename MemorySpaceType >
void adamantine::MechanicalOperator< dim, n_materials, p_order, MaterialStates, MemorySpaceType >::assemble_matrix
private

Assemble the sparse matrix of the system.

Note
The 2D case does not represent any physical model but it is convenient for testing.

Definition at line 137 of file MechanicalOperator.cc.

◆ assemble_rhs()

template<int dim, int n_materials, int p_order, typename MaterialStates , typename MemorySpaceType >
void adamantine::MechanicalOperator< dim, n_materials, p_order, MaterialStates, MemorySpaceType >::assemble_rhs ( std::vector< std::shared_ptr< BodyForce< dim >>> const &  body_forces)

Assemble the right-hand-side.

Definition at line 230 of file MechanicalOperator.cc.

◆ preconditioner()

template<int dim, int n_materials, int p_order, typename MaterialStates , typename MemorySpaceType >
MechanicalOperator< dim, n_materials, p_order, MaterialStates, MemorySpaceType >::TrilinosPreconditionerType const & adamantine::MechanicalOperator< dim, n_materials, p_order, MaterialStates, MemorySpaceType >::preconditioner
inline

Return the preconditioner for the system matrix.

Definition at line 187 of file MechanicalOperator.hh.

◆ reinit()

template<int dim, int n_materials, int p_order, typename MaterialStates , typename MemorySpaceType >
void adamantine::MechanicalOperator< dim, n_materials, p_order, MaterialStates, MemorySpaceType >::reinit ( dealii::DoFHandler< dim > const &  dof_handler,
dealii::AffineConstraints< double > const &  affine_constraints,
dealii::hp::QCollection< dim > const &  quad,
std::vector< std::shared_ptr< BodyForce< dim >>> const &  body_forces = std::vector<std::shared_ptr<BodyForce<dim>>>() 
)

Definition at line 106 of file MechanicalOperator.cc.

◆ rhs()

template<int dim, int n_materials, int p_order, typename MaterialStates , typename MemorySpaceType >
dealii::LA::distributed::Vector< double, dealii::MemorySpace::Host > const & adamantine::MechanicalOperator< dim, n_materials, p_order, MaterialStates, MemorySpaceType >::rhs
inline

Return the right-hand-side.

Definition at line 166 of file MechanicalOperator.hh.

◆ system_matrix()

template<int dim, int n_materials, int p_order, typename MaterialStates , typename MemorySpaceType >
MechanicalOperator< dim, n_materials, p_order, MaterialStates, MemorySpaceType >::TrilinosMatrixType const & adamantine::MechanicalOperator< dim, n_materials, p_order, MaterialStates, MemorySpaceType >::system_matrix
inline

Return the matrix of the system.

Definition at line 176 of file MechanicalOperator.hh.

◆ update_temperature()

template<int dim, int n_materials, int p_order, typename MaterialStates , typename MemorySpaceType >
void adamantine::MechanicalOperator< dim, n_materials, p_order, MaterialStates, MemorySpaceType >::update_temperature ( dealii::DoFHandler< dim > const &  thermal_dof_handler,
dealii::LA::distributed::Vector< double, dealii::MemorySpace::Host > const &  temperature,
std::vector< bool > const &  has_melted 
)

Update the DoFHandler used by ThermalPhysics and update the temperature.

Definition at line 122 of file MechanicalOperator.cc.

Member Data Documentation

◆ _affine_constraints

template<int dim, int n_materials, int p_order, typename MaterialStates , typename MemorySpaceType >
dealii::AffineConstraints<double> const* adamantine::MechanicalOperator< dim, n_materials, p_order, MaterialStates, MemorySpaceType >::_affine_constraints = nullptr
private

Non-owning pointer to the AffineConstraints from MechanicalPhysics

Definition at line 130 of file MechanicalOperator.hh.

◆ _communicator

template<int dim, int n_materials, int p_order, typename MaterialStates , typename MemorySpaceType >
MPI_Comm const& adamantine::MechanicalOperator< dim, n_materials, p_order, MaterialStates, MemorySpaceType >::_communicator
private

MPI communicator.

Definition at line 108 of file MechanicalOperator.hh.

◆ _dof_handler

template<int dim, int n_materials, int p_order, typename MaterialStates , typename MemorySpaceType >
dealii::DoFHandler<dim> const* adamantine::MechanicalOperator< dim, n_materials, p_order, MaterialStates, MemorySpaceType >::_dof_handler = nullptr
private

Non-owning pointer to the DoFHandler from MechanicalPhysics

Definition at line 122 of file MechanicalOperator.hh.

◆ _has_melted

template<int dim, int n_materials, int p_order, typename MaterialStates , typename MemorySpaceType >
std::vector<bool> adamantine::MechanicalOperator< dim, n_materials, p_order, MaterialStates, MemorySpaceType >::_has_melted
private

Indicator variable for whether a point has ever been above the solidus. The value is false for material that has not yet melted and true for material that has melted.

Definition at line 158 of file MechanicalOperator.hh.

◆ _material_properties

template<int dim, int n_materials, int p_order, typename MaterialStates , typename MemorySpaceType >
MaterialProperty<dim, n_materials, p_order, MaterialStates, MemorySpaceType>& adamantine::MechanicalOperator< dim, n_materials, p_order, MaterialStates, MemorySpaceType >::_material_properties
private

Reference to the MaterialProperty from MechanicalPhysics.

Definition at line 118 of file MechanicalOperator.hh.

◆ _preconditioner

template<int dim, int n_materials, int p_order, typename MaterialStates , typename MemorySpaceType >
TrilinosPreconditionerType adamantine::MechanicalOperator< dim, n_materials, p_order, MaterialStates, MemorySpaceType >::_preconditioner
private

Preconditioner associated with the system matrix

Definition at line 147 of file MechanicalOperator.hh.

◆ _q_collection

template<int dim, int n_materials, int p_order, typename MaterialStates , typename MemorySpaceType >
dealii::hp::QCollection<dim> const* adamantine::MechanicalOperator< dim, n_materials, p_order, MaterialStates, MemorySpaceType >::_q_collection = nullptr
private

Non-owning pointer to the QCollection from MechanicalPhysics

Definition at line 134 of file MechanicalOperator.hh.

◆ _reference_temperatures

template<int dim, int n_materials, int p_order, typename MaterialStates , typename MemorySpaceType >
std::vector<double> adamantine::MechanicalOperator< dim, n_materials, p_order, MaterialStates, MemorySpaceType >::_reference_temperatures
private

List of initial temperatures of the material. If the length of the vector is nonzero, we solve a thermo-mechanical problem.

Definition at line 113 of file MechanicalOperator.hh.

◆ _system_matrix

template<int dim, int n_materials, int p_order, typename MaterialStates , typename MemorySpaceType >
TrilinosMatrixType adamantine::MechanicalOperator< dim, n_materials, p_order, MaterialStates, MemorySpaceType >::_system_matrix
private

Matrix of the mechanical problem.

Definition at line 143 of file MechanicalOperator.hh.

◆ _system_rhs

template<int dim, int n_materials, int p_order, typename MaterialStates , typename MemorySpaceType >
dealii::LA::distributed::Vector<double, dealii::MemorySpace::Host> adamantine::MechanicalOperator< dim, n_materials, p_order, MaterialStates, MemorySpaceType >::_system_rhs
private

Right-hand-side of the mechanical problem.

Definition at line 139 of file MechanicalOperator.hh.

◆ _temperature

template<int dim, int n_materials, int p_order, typename MaterialStates , typename MemorySpaceType >
dealii::LA::distributed::Vector<double, dealii::MemorySpace::Host> adamantine::MechanicalOperator< dim, n_materials, p_order, MaterialStates, MemorySpaceType >::_temperature
private

Temperature of the material.

Definition at line 152 of file MechanicalOperator.hh.

◆ _thermal_dof_handler

template<int dim, int n_materials, int p_order, typename MaterialStates , typename MemorySpaceType >
dealii::DoFHandler<dim> const* adamantine::MechanicalOperator< dim, n_materials, p_order, MaterialStates, MemorySpaceType >::_thermal_dof_handler = nullptr
private

Non-owning pointer to the DoFHandler from ThermalPhysics

Definition at line 126 of file MechanicalOperator.hh.