OGS
ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim > Class Template Reference

Detailed Description

template<typename ShapeFunction, int DisplacementDim>
class ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >

Definition at line 28 of file SmallDeformationLocalAssemblerMatrix.h.

#include <SmallDeformationLocalAssemblerMatrix.h>

Inheritance diagram for ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >:
[legend]
Collaboration diagram for ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >:
[legend]

Public Types

using ShapeMatricesType
using NodalMatrixType = typename ShapeMatricesType::NodalMatrixType
using NodalVectorType = typename ShapeMatricesType::NodalVectorType
using ShapeMatrices = typename ShapeMatricesType::ShapeMatrices
using BMatricesType = BMatrixPolicyType<ShapeFunction, DisplacementDim>
using BBarMatrixType = typename BMatricesType::BBarMatrixType
using StiffnessMatrixType = typename BMatricesType::StiffnessMatrixType
using NodalForceVectorType = typename BMatricesType::NodalForceVectorType
using NodalDisplacementVectorType

Public Member Functions

 SmallDeformationLocalAssemblerMatrix (SmallDeformationLocalAssemblerMatrix const &)=delete
 SmallDeformationLocalAssemblerMatrix (SmallDeformationLocalAssemblerMatrix &&)=delete
 SmallDeformationLocalAssemblerMatrix (MeshLib::Element const &e, std::size_t const local_matrix_size, NumLib::GenericIntegrationMethod const &integration_method, bool const is_axially_symmetric, SmallDeformationProcessData< DisplacementDim > &process_data)
void assemble (double const, double const, std::vector< double > const &, std::vector< double > const &, std::vector< double > &, std::vector< double > &, std::vector< double > &) override
void assembleWithJacobian (double const t, double const dt, std::vector< double > const &local_x, std::vector< double > const &, std::vector< double > &local_b_data, std::vector< double > &local_Jac_data) override
void preTimestepConcrete (std::vector< double > const &, double const, double const) override
void computeSecondaryVariableConcreteWithVector (double const t, Eigen::VectorXd const &local_x) override
Eigen::Map< const Eigen::RowVectorXd > getShapeMatrix (const unsigned integration_point) const override
 Provides the shape matrix at the given integration point.
std::vector< double > const & getIntPtSigma (const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override
std::vector< double > const & getIntPtEpsilon (const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override
std::vector< double > const & getIntPtFractureStress (const double, std::vector< GlobalVector * > const &, std::vector< NumLib::LocalToGlobalIndexMap const * > const &, std::vector< double > &cache) const override
std::vector< double > const & getIntPtFractureAperture (const double, std::vector< GlobalVector * > const &, std::vector< NumLib::LocalToGlobalIndexMap const * > const &, std::vector< double > &cache) const override
Public Member Functions inherited from ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerInterface
 SmallDeformationLocalAssemblerInterface ()
 SmallDeformationLocalAssemblerInterface (std::size_t n_local_size, std::vector< unsigned > dofIndex_to_localIndex)
virtual void assembleWithJacobian (double const, double const, Eigen::VectorXd const &, Eigen::VectorXd &, Eigen::MatrixXd &)
void computeSecondaryVariableConcrete (double const t, double const, Eigen::VectorXd const &local_x, Eigen::VectorXd const &) override
Public Member Functions inherited from ProcessLib::LocalAssemblerInterface
virtual ~LocalAssemblerInterface ()=default
virtual void setInitialConditions (std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x, double const t, int const process_id)
virtual void initialize (std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table)
virtual void preAssemble (double const, double const, std::vector< double > const &)
virtual void assembleForStaggeredScheme (double const t, double const dt, Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_x_prev, int const process_id, std::vector< double > &local_M_data, std::vector< double > &local_K_data, std::vector< double > &local_b_data)
virtual void assembleWithJacobianForStaggeredScheme (double const t, double const dt, Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_x_prev, int const process_id, std::vector< double > &local_b_data, std::vector< double > &local_Jac_data)
virtual void computeSecondaryVariable (std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, double const t, double const dt, std::vector< GlobalVector * > const &x, GlobalVector const &x_prev, int const process_id)
virtual void preTimestep (std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table, GlobalVector const &x, double const t, double const delta_t)
virtual void postTimestep (std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, double const t, double const dt, int const process_id)
void postNonLinearSolver (std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, double const t, double const dt, int const process_id)
virtual Eigen::Vector3d getFlux (MathLib::Point3d const &, double const, std::vector< double > const &) const
virtual Eigen::Vector3d getFlux (MathLib::Point3d const &, double const, std::vector< std::vector< double > > const &) const
 Fits to staggered scheme.
virtual int getNumberOfVectorElementsForDeformation () const
Public Member Functions inherited from NumLib::ExtrapolatableElement
virtual ~ExtrapolatableElement ()=default

Private Types

using IntegrationPointDataType

Private Member Functions

std::optional< BBarMatrixTypegetDilatationalBBarMatrix () const

Private Attributes

SmallDeformationProcessData< DisplacementDim > & _process_data
std::vector< IntegrationPointDataType, Eigen::aligned_allocator< IntegrationPointDataType > > _ip_data
NumLib::GenericIntegrationMethod const & _integration_method
MeshLib::Element const & _element
bool const _is_axially_symmetric
SecondaryData< typename ShapeMatrices::ShapeType > _secondary_data

Member Typedef Documentation

◆ BBarMatrixType

template<typename ShapeFunction, int DisplacementDim>
using ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >::BBarMatrixType = typename BMatricesType::BBarMatrixType

Definition at line 38 of file SmallDeformationLocalAssemblerMatrix.h.

◆ BMatricesType

template<typename ShapeFunction, int DisplacementDim>
using ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >::BMatricesType = BMatrixPolicyType<ShapeFunction, DisplacementDim>

Definition at line 37 of file SmallDeformationLocalAssemblerMatrix.h.

◆ IntegrationPointDataType

◆ NodalDisplacementVectorType

template<typename ShapeFunction, int DisplacementDim>
using ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >::NodalDisplacementVectorType
Initial value:
VectorType< _number_of_dof > NodalForceVectorType
Rhs residual.

Definition at line 42 of file SmallDeformationLocalAssemblerMatrix.h.

◆ NodalForceVectorType

template<typename ShapeFunction, int DisplacementDim>
using ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >::NodalForceVectorType = typename BMatricesType::NodalForceVectorType

Definition at line 41 of file SmallDeformationLocalAssemblerMatrix.h.

◆ NodalMatrixType

template<typename ShapeFunction, int DisplacementDim>
using ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >::NodalMatrixType = typename ShapeMatricesType::NodalMatrixType

Definition at line 34 of file SmallDeformationLocalAssemblerMatrix.h.

◆ NodalVectorType

template<typename ShapeFunction, int DisplacementDim>
using ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >::NodalVectorType = typename ShapeMatricesType::NodalVectorType

Definition at line 35 of file SmallDeformationLocalAssemblerMatrix.h.

◆ ShapeMatrices

template<typename ShapeFunction, int DisplacementDim>
using ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >::ShapeMatrices = typename ShapeMatricesType::ShapeMatrices

Definition at line 36 of file SmallDeformationLocalAssemblerMatrix.h.

◆ ShapeMatricesType

template<typename ShapeFunction, int DisplacementDim>
using ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >::ShapeMatricesType
Initial value:
EigenFixedShapeMatrixPolicy< ShapeFunction, GlobalDim > ShapeMatrixPolicyType

Definition at line 32 of file SmallDeformationLocalAssemblerMatrix.h.

◆ StiffnessMatrixType

template<typename ShapeFunction, int DisplacementDim>
using ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >::StiffnessMatrixType = typename BMatricesType::StiffnessMatrixType

Definition at line 40 of file SmallDeformationLocalAssemblerMatrix.h.

Constructor & Destructor Documentation

◆ SmallDeformationLocalAssemblerMatrix() [1/3]

template<typename ShapeFunction, int DisplacementDim>
ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >::SmallDeformationLocalAssemblerMatrix ( SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim > const & )
delete

◆ SmallDeformationLocalAssemblerMatrix() [2/3]

template<typename ShapeFunction, int DisplacementDim>
ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >::SmallDeformationLocalAssemblerMatrix ( SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim > && )
delete

◆ SmallDeformationLocalAssemblerMatrix() [3/3]

template<typename ShapeFunction, int DisplacementDim>
ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >::SmallDeformationLocalAssemblerMatrix ( MeshLib::Element const & e,
std::size_t const local_matrix_size,
NumLib::GenericIntegrationMethod const & integration_method,
bool const is_axially_symmetric,
SmallDeformationProcessData< DisplacementDim > & process_data )

Definition at line 31 of file SmallDeformationLocalAssemblerMatrix-impl.h.

40 _element(e),
42{
43 unsigned const n_integration_points =
44 _integration_method.getNumberOfPoints();
45
48
49 auto const shape_matrices =
53
55 _process_data.solid_materials, _process_data.material_ids, e.getID());
56
57 for (unsigned ip = 0; ip < n_integration_points; ip++)
58 {
59 _ip_data.emplace_back(solid_material);
60 auto& ip_data = _ip_data[ip];
61 auto const& sm = shape_matrices[ip];
62 ip_data.N_u = sm.N;
63 ip_data.dNdx_u = sm.dNdx;
64 ip_data.integration_weight =
65 _integration_method.getWeightedPoint(ip).getWeight() *
66 sm.integralMeasure * sm.detJ;
67
68 // Initialize current time step values
69 static const int kelvin_vector_size =
71 ip_data._sigma.setZero(kelvin_vector_size);
72 ip_data._eps.setZero(kelvin_vector_size);
73
74 // Previous time step values are not initialized and are set later.
75 ip_data._sigma_prev.resize(kelvin_vector_size);
76 ip_data._eps_prev.resize(kelvin_vector_size);
77
79
80 _secondary_data.N[ip] = sm.N;
81 }
82}
std::vector< IntegrationPointDataType, Eigen::aligned_allocator< IntegrationPointDataType > > _ip_data
auto & selectSolidConstitutiveRelation(SolidMaterialsMap const &constitutive_relations, MeshLib::PropertyVector< int > const *const material_ids, std::size_t const element_id)
constexpr int kelvin_vector_dimensions(int const displacement_dim)
Kelvin vector dimensions for given displacement dimension.

References _element, _integration_method, _ip_data, _is_axially_symmetric, _process_data, _secondary_data, MeshLib::Element::getID(), NumLib::initShapeMatrices(), MathLib::KelvinVector::kelvin_vector_dimensions(), and MaterialLib::Solids::selectSolidConstitutiveRelation().

Member Function Documentation

◆ assemble()

template<typename ShapeFunction, int DisplacementDim>
void ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >::assemble ( double const ,
double const ,
std::vector< double > const & ,
std::vector< double > const & ,
std::vector< double > & ,
std::vector< double > & ,
std::vector< double > &  )
inlineoverridevirtual

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 57 of file SmallDeformationLocalAssemblerMatrix.h.

63 {
65 "SmallDeformationLocalAssembler: assembly without jacobian is not "
66 "implemented.");
67 }
#define OGS_FATAL(...)
Definition Error.h:19

References OGS_FATAL.

◆ assembleWithJacobian()

template<typename ShapeFunction, int DisplacementDim>
void ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >::assembleWithJacobian ( double const t,
double const dt,
std::vector< double > const & local_x,
std::vector< double > const & ,
std::vector< double > & local_b_data,
std::vector< double > & local_Jac_data )
overridevirtual

Reimplemented from ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerInterface.

Definition at line 85 of file SmallDeformationLocalAssemblerMatrix-impl.h.

91{
92 assert(_element.getDimension() == DisplacementDim);
93
94 auto const local_matrix_size = local_x.size();
95
98
101
102 unsigned const n_integration_points =
103 _integration_method.getNumberOfPoints();
104
107
109
110 for (unsigned ip = 0; ip < n_integration_points; ip++)
111 {
112 auto const& w = _ip_data[ip].integration_weight;
113
114 auto const& N = _ip_data[ip].N_u;
115 auto const& dNdx = _ip_data[ip].dNdx_u;
116
118 std::nullopt, this->_element.getID(),
121 this->_element, N))};
122
123 auto const x_coord =
124 x_position.getCoordinates().value()[0]; // r for axisymmetry
129
130 auto const& eps_prev = _ip_data[ip]._eps_prev;
131 auto const& sigma_prev = _ip_data[ip]._sigma_prev;
132
133 auto& eps = _ip_data[ip]._eps;
134 auto& sigma = _ip_data[ip]._sigma;
135 auto& state = _ip_data[ip]._material_state_variables;
136
137 eps.noalias() =
140
141 variables.mechanical_strain
143 eps);
144 variables_prev.stress
146 sigma_prev);
147 variables_prev.mechanical_strain
149 eps_prev);
150 variables_prev.temperature = _process_data.reference_temperature;
151
152 auto&& solution = _ip_data[ip]._solid_material.integrateStress(
154
155 if (!solution)
156 {
157 OGS_FATAL("Computation of local constitutive relation failed.");
158 }
159
162
163 local_b.noalias() -= B.transpose() * sigma * w;
164 local_Jac.noalias() += B.transpose() * C * B * w;
165 }
166}
MatrixType< _kelvin_vector_size, _number_of_dof > BMatrixType
Eigen::Map< Vector > createZeroedVector(std::vector< double > &data, Eigen::VectorXd::Index size)
Eigen::Map< Matrix > createZeroedMatrix(std::vector< double > &data, Eigen::MatrixXd::Index rows, Eigen::MatrixXd::Index cols)

References _element, _integration_method, _ip_data, _is_axially_symmetric, _process_data, ProcessLib::LinearBMatrix::computeBMatrixPossiblyWithBbar(), MathLib::createZeroedMatrix(), MathLib::createZeroedVector(), ParameterLib::SpatialPosition::getCoordinates(), getDilatationalBBarMatrix(), NumLib::interpolateCoordinates(), MaterialPropertyLib::VariableArray::mechanical_strain, OGS_FATAL, MaterialPropertyLib::VariableArray::stress, and MaterialPropertyLib::VariableArray::temperature.

◆ computeSecondaryVariableConcreteWithVector()

template<typename ShapeFunction, int DisplacementDim>
void ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >::computeSecondaryVariableConcreteWithVector ( double const t,
Eigen::VectorXd const & local_x )
overridevirtual

Implements ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerInterface.

Definition at line 169 of file SmallDeformationLocalAssemblerMatrix-impl.h.

172{
173 // Compute average value per element
176 auto const e_id = _element.getID();
177
178 unsigned const n_integration_points =
179 _integration_method.getNumberOfPoints();
180 for (unsigned ip = 0; ip < n_integration_points; ip++)
181 {
182 sigma_avg += _ip_data[ip]._sigma;
183 }
185
187 &(*_process_data.element_stresses)[e_id * KV::RowsAtCompileTime]) =
189}
Eigen::Matrix< double, 4, 1 > kelvinVectorToSymmetricTensor(Eigen::Matrix< double, 4, 1, Eigen::ColMajor, 4, 1 > const &v)

References _element, _integration_method, _ip_data, _process_data, and MathLib::KelvinVector::kelvinVectorToSymmetricTensor().

◆ getDilatationalBBarMatrix()

template<typename ShapeFunction, int DisplacementDim>
std::optional< BBarMatrixType > ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >::getDilatationalBBarMatrix ( ) const
inlineprivate

◆ getIntPtEpsilon()

template<typename ShapeFunction, int DisplacementDim>
std::vector< double > const & ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >::getIntPtEpsilon ( const double t,
std::vector< GlobalVector * > const & x,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & dof_table,
std::vector< double > & cache ) const
overridevirtual

◆ getIntPtFractureAperture()

template<typename ShapeFunction, int DisplacementDim>
std::vector< double > const & ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >::getIntPtFractureAperture ( const double ,
std::vector< GlobalVector * > const & ,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & ,
std::vector< double > & cache ) const
inlineoverridevirtual

Implements ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerInterface.

Definition at line 122 of file SmallDeformationLocalAssemblerMatrix.h.

127 {
128 cache.resize(0);
129 return cache;
130 }

◆ getIntPtFractureStress()

template<typename ShapeFunction, int DisplacementDim>
std::vector< double > const & ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >::getIntPtFractureStress ( const double ,
std::vector< GlobalVector * > const & ,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & ,
std::vector< double > & cache ) const
inlineoverridevirtual

Implements ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerInterface.

Definition at line 112 of file SmallDeformationLocalAssemblerMatrix.h.

117 {
118 cache.resize(0);
119 return cache;
120 }

◆ getIntPtSigma()

◆ getShapeMatrix()

template<typename ShapeFunction, int DisplacementDim>
Eigen::Map< const Eigen::RowVectorXd > ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >::getShapeMatrix ( const unsigned integration_point) const
inlineoverridevirtual

Provides the shape matrix at the given integration point.

Implements NumLib::ExtrapolatableElement.

Definition at line 91 of file SmallDeformationLocalAssemblerMatrix.h.

93 {
94 auto const& N = _secondary_data.N[integration_point];
95
96 // assumes N is stored contiguously in memory
97 return Eigen::Map<const Eigen::RowVectorXd>(N.data(), N.size());
98 }

References _secondary_data.

◆ preTimestepConcrete()

template<typename ShapeFunction, int DisplacementDim>
void ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >::preTimestepConcrete ( std::vector< double > const & ,
double const ,
double const  )
inlineoverridevirtual

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 75 of file SmallDeformationLocalAssemblerMatrix.h.

78 {
79 unsigned const n_integration_points =
80 _integration_method.getNumberOfPoints();
81
82 for (unsigned ip = 0; ip < n_integration_points; ip++)
83 {
84 _ip_data[ip].pushBackState();
85 }
86 }

References _integration_method, and _ip_data.

Member Data Documentation

◆ _element

◆ _integration_method

◆ _ip_data

◆ _is_axially_symmetric

template<typename ShapeFunction, int DisplacementDim>
bool const ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >::_is_axially_symmetric
private

◆ _process_data

◆ _secondary_data

template<typename ShapeFunction, int DisplacementDim>
SecondaryData<typename ShapeMatrices::ShapeType> ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >::_secondary_data
private

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