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

Detailed Description

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

Definition at line 60 of file SmallDeformationFEM.h.

#include <SmallDeformationFEM.h>

Inheritance diagram for ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >:
[legend]
Collaboration diagram for ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< 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 BMatrixType = typename BMatricesType::BMatrixType
 
using BBarMatrixType = typename BMatricesType::BBarMatrixType
 
using StiffnessMatrixType = typename BMatricesType::StiffnessMatrixType
 
using NodalForceVectorType = typename BMatricesType::NodalForceVectorType
 
using NodalDisplacementVectorType
 
using GMatricesType = GMatrixPolicyType<ShapeFunction, DisplacementDim>
 
using GradientVectorType = typename GMatricesType::GradientVectorType
 
using GradientMatrixType = typename GMatricesType::GradientMatrixType
 
using IpData
 

Public Member Functions

 SmallDeformationLocalAssembler (SmallDeformationLocalAssembler const &)=delete
 
 SmallDeformationLocalAssembler (SmallDeformationLocalAssembler &&)=delete
 
 SmallDeformationLocalAssembler (MeshLib::Element const &e, std::size_t const, NumLib::GenericIntegrationMethod const &integration_method, bool const is_axially_symmetric, SmallDeformationProcessData< DisplacementDim > &process_data)
 
void initializeConcrete () override
 
ConstitutiveRelations::ConstitutiveData< DisplacementDim > updateConstitutiveRelations (BMatrixType const &B, Eigen::Ref< Eigen::VectorXd const > const &u, Eigen::Ref< Eigen::VectorXd const > const &u_prev, ParameterLib::SpatialPosition const &x_position, double const t, double const dt, typename ConstitutiveRelations::ConstitutiveSetting< DisplacementDim > &CS, MaterialPropertyLib::Medium const &medium, typename ConstitutiveRelations::StatefulData< DisplacementDim > &current_state, typename ConstitutiveRelations::StatefulDataPrev< DisplacementDim > const &prev_state, MaterialStateData< DisplacementDim > &material_state, typename ConstitutiveRelations::OutputData< DisplacementDim > &output_data) const
 
void assemble (double const, double const, std::vector< double > const &, std::vector< double > const &, std::vector< double > &, std::vector< double > &, std::vector< double > &) override
 
std::optional< BBarMatrixTypegetDilatationalBBarMatrix () const
 
void assembleWithJacobian (double const t, double const dt, std::vector< double > const &local_x, std::vector< double > const &local_x_prev, std::vector< double > &local_b_data, std::vector< double > &local_Jac_data) override
 
void postTimestepConcrete (Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_x_prev, double const t, double const dt, int const) override
 
std::vector< double > const & getMaterialForces (std::vector< double > const &local_x, std::vector< double > &nodal_values) override
 
Eigen::Map< const Eigen::RowVectorXd > getShapeMatrix (const unsigned integration_point) const override
 Provides the shape matrix at the given integration point.
 
- Public Member Functions inherited from ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >
 SmallDeformationLocalAssemblerInterface (MeshLib::Element const &e, NumLib::GenericIntegrationMethod const &integration_method, bool const is_axially_symmetric, SmallDeformationProcessData< DisplacementDim > &process_data)
 
std::size_t setIPDataInitialConditions (std::string_view name, double const *values, int const integration_order)
 Returns number of read integration points.
 
void computeSecondaryVariableConcrete (double const, double const, Eigen::VectorXd const &, Eigen::VectorXd const &) override
 
unsigned getNumberOfIntegrationPoints () const
 
int getMaterialID () const
 
std::vector< double > getMaterialStateVariableInternalState (std::function< std::span< double >(typename MaterialLib::Solids::MechanicsBase< DisplacementDim >::MaterialStateVariables &)> const &get_values_span, int const &n_components) const
 
MaterialLib::Solids::MechanicsBase< DisplacementDim >::MaterialStateVariables const & getMaterialStateVariablesAt (unsigned integration_point) const
 
- 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.
 
- Public Member Functions inherited from ProcessLib::SmallDeformation::MaterialForcesInterface
virtual ~MaterialForcesInterface ()=default
 
- Public Member Functions inherited from NumLib::ExtrapolatableElement
virtual ~ExtrapolatableElement ()=default
 

Static Public Attributes

static constexpr auto & N_u_op
 

Static Private Member Functions

static constexpr auto localDOF (std::vector< double > const &x)
 

Private Attributes

std::vector< IpData, Eigen::aligned_allocator< IpData > > _ip_data
 
SecondaryData< typename ShapeMatrices::ShapeType > _secondary_data
 

Additional Inherited Members

- Static Public Member Functions inherited from ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >
static auto getReflectionDataForOutput ()
 
- Protected Attributes inherited from ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >
SmallDeformationProcessData< DisplacementDim > & process_data_
 
std::vector< MaterialStateData< DisplacementDim > > material_states_
 
std::vector< typename ConstitutiveRelations::StatefulData< DisplacementDim > > current_states_
 
std::vector< typename ConstitutiveRelations::StatefulDataPrev< DisplacementDim > > prev_states_
 
std::vector< typename ConstitutiveRelations::OutputData< DisplacementDim > > output_data_
 
NumLib::GenericIntegrationMethod const & integration_method_
 
MeshLib::Element const & element_
 
bool const is_axially_symmetric_
 
MaterialLib::Solids::MechanicsBase< DisplacementDim > const & solid_material_
 
ConstitutiveRelations::ConstitutiveSetting< DisplacementDim > constitutive_setting
 

Member Typedef Documentation

◆ BBarMatrixType

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

Definition at line 72 of file SmallDeformationFEM.h.

◆ BMatricesType

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

Definition at line 69 of file SmallDeformationFEM.h.

◆ BMatrixType

template<typename ShapeFunction , int DisplacementDim>
using ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::BMatrixType = typename BMatricesType::BMatrixType

Definition at line 71 of file SmallDeformationFEM.h.

◆ GMatricesType

template<typename ShapeFunction , int DisplacementDim>
using ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::GMatricesType = GMatrixPolicyType<ShapeFunction, DisplacementDim>

Definition at line 78 of file SmallDeformationFEM.h.

◆ GradientMatrixType

template<typename ShapeFunction , int DisplacementDim>
using ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::GradientMatrixType = typename GMatricesType::GradientMatrixType

Definition at line 80 of file SmallDeformationFEM.h.

◆ GradientVectorType

template<typename ShapeFunction , int DisplacementDim>
using ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::GradientVectorType = typename GMatricesType::GradientVectorType

Definition at line 79 of file SmallDeformationFEM.h.

◆ IpData

template<typename ShapeFunction , int DisplacementDim>
using ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::IpData
Initial value:
IntegrationPointData<BMatricesType, ShapeMatricesType, DisplacementDim>

Definition at line 81 of file SmallDeformationFEM.h.

◆ NodalDisplacementVectorType

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

Definition at line 75 of file SmallDeformationFEM.h.

◆ NodalForceVectorType

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

Definition at line 74 of file SmallDeformationFEM.h.

◆ NodalMatrixType

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

Definition at line 66 of file SmallDeformationFEM.h.

◆ NodalVectorType

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

Definition at line 67 of file SmallDeformationFEM.h.

◆ ShapeMatrices

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

Definition at line 68 of file SmallDeformationFEM.h.

◆ ShapeMatricesType

template<typename ShapeFunction , int DisplacementDim>
using ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::ShapeMatricesType

◆ StiffnessMatrixType

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

Definition at line 73 of file SmallDeformationFEM.h.

Constructor & Destructor Documentation

◆ SmallDeformationLocalAssembler() [1/3]

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

◆ SmallDeformationLocalAssembler() [2/3]

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

◆ SmallDeformationLocalAssembler() [3/3]

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

Definition at line 91 of file SmallDeformationFEM.h.

98 e, integration_method, is_axially_symmetric, process_data)
99 {
100 unsigned const n_integration_points =
102
103 _ip_data.resize(n_integration_points);
104 _secondary_data.N.resize(n_integration_points);
105
106 auto const shape_matrices =
108 DisplacementDim>(
109 e, is_axially_symmetric, this->integration_method_);
110
111 for (unsigned ip = 0; ip < n_integration_points; ip++)
112 {
113 auto& ip_data = _ip_data[ip];
114 auto const& sm = shape_matrices[ip];
115 _ip_data[ip].integration_weight =
117 sm.integralMeasure * sm.detJ;
118
119 ip_data.N_u = sm.N;
120 ip_data.dNdx_u = sm.dNdx;
121
122 _secondary_data.N[ip] = shape_matrices[ip].N;
123 }
124 }
double getWeight() const
MathLib::WeightedPoint const & getWeightedPoint(unsigned const igp) const
SecondaryData< typename ShapeMatrices::ShapeType > _secondary_data
std::vector< IpData, Eigen::aligned_allocator< IpData > > _ip_data
ShapeMatrixPolicyType< ShapeFunction, DisplacementDim > ShapeMatricesType
std::vector< typename ShapeMatricesType::ShapeMatrices, Eigen::aligned_allocator< typename ShapeMatricesType::ShapeMatrices > > initShapeMatrices(MeshLib::Element const &e, bool const is_axially_symmetric, IntegrationMethod const &integration_method)
std::vector< ShapeMatrixType, Eigen::aligned_allocator< ShapeMatrixType > > N
SmallDeformationLocalAssemblerInterface(MeshLib::Element const &e, NumLib::GenericIntegrationMethod const &integration_method, bool const is_axially_symmetric, SmallDeformationProcessData< DisplacementDim > &process_data)

References ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::_ip_data, ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::_secondary_data, NumLib::GenericIntegrationMethod::getNumberOfPoints(), MathLib::WeightedPoint::getWeight(), NumLib::GenericIntegrationMethod::getWeightedPoint(), NumLib::initShapeMatrices(), ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::integration_method_, and ProcessLib::SmallDeformation::SecondaryData< ShapeMatrixType >::N.

Member Function Documentation

◆ assemble()

template<typename ShapeFunction , int DisplacementDim>
void ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< 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 203 of file SmallDeformationFEM.h.

209 {
210 OGS_FATAL(
211 "SmallDeformationLocalAssembler: assembly without jacobian is not "
212 "implemented.");
213 }
#define OGS_FATAL(...)
Definition Error.h:26

References OGS_FATAL.

◆ assembleWithJacobian()

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

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 229 of file SmallDeformationFEM.h.

234 {
235 auto const local_matrix_size = local_x.size();
236
238 local_Jac_data, local_matrix_size, local_matrix_size);
239
241 local_b_data, local_matrix_size);
242
243 auto [u] = localDOF(local_x);
244 auto [u_prev] = localDOF(local_x_prev);
245
246 unsigned const n_integration_points =
248
250 x_position.setElementID(this->element_.getID());
251
252 typename ConstitutiveRelations::ConstitutiveSetting<DisplacementDim>
254 auto const& medium =
255 *this->process_data_.media_map.getMedium(this->element_.getID());
256
257 auto const B_dil_bar = getDilatationalBBarMatrix();
258
259 for (unsigned ip = 0; ip < n_integration_points; ip++)
260 {
261 x_position.setIntegrationPoint(ip);
262 auto const& w = _ip_data[ip].integration_weight;
263 auto const& N = _ip_data[ip].N_u;
264 auto const& dNdx = _ip_data[ip].dNdx_u;
265
266 auto const x_coord =
267 NumLib::interpolateXCoordinate<ShapeFunction,
269 this->element_, N);
271 DisplacementDim, ShapeFunction::NPOINTS, BBarMatrixType,
273 dNdx, N, B_dil_bar, x_coord, this->is_axially_symmetric_);
274
275 auto const CD = updateConstitutiveRelations(
276 B, u, u_prev, x_position, t, dt, constitutive_setting, medium,
277 this->current_states_[ip], this->prev_states_[ip],
278 this->material_states_[ip], this->output_data_[ip]);
279
280 auto const& sigma = this->current_states_[ip].stress_data.sigma;
281 auto const& b = *CD.volumetric_body_force;
282 auto const& C = CD.s_mech_data.stiffness_tensor;
283
284 local_b.noalias() -=
285 (B.transpose() * sigma - N_u_op(N).transpose() * b) * w;
286 local_Jac.noalias() += B.transpose() * C * B * w;
287 }
288 }
std::size_t getID() const
Returns the ID of the element.
Definition Element.h:89
void setElementID(std::size_t element_id)
void setIntegrationPoint(unsigned integration_point)
MatrixType< _kelvin_vector_size, _number_of_dof > BMatrixType
ConstitutiveRelations::ConstitutiveData< DisplacementDim > updateConstitutiveRelations(BMatrixType const &B, Eigen::Ref< Eigen::VectorXd const > const &u, Eigen::Ref< Eigen::VectorXd const > const &u_prev, ParameterLib::SpatialPosition const &x_position, double const t, double const dt, typename ConstitutiveRelations::ConstitutiveSetting< DisplacementDim > &CS, MaterialPropertyLib::Medium const &medium, typename ConstitutiveRelations::StatefulData< DisplacementDim > &current_state, typename ConstitutiveRelations::StatefulDataPrev< DisplacementDim > const &prev_state, MaterialStateData< DisplacementDim > &material_state, typename ConstitutiveRelations::OutputData< DisplacementDim > &output_data) const
std::optional< BBarMatrixType > getDilatationalBBarMatrix() const
static constexpr auto localDOF(std::vector< double > const &x)
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)
double interpolateXCoordinate(MeshLib::Element const &e, typename ShapeMatricesType::ShapeMatrices::ShapeType const &N)
BMatrixType computeBMatrixPossiblyWithBbar(DNDX_Type const &dNdx, N_Type const &N, std::optional< BBarMatrixType > const &B_dil_bar, const double radius, const bool is_axially_symmetric)
Fills a B matrix, or a B bar matrix if required.
ConstitutiveRelations::ConstitutiveSetting< DisplacementDim > constitutive_setting
std::vector< typename ConstitutiveRelations::StatefulDataPrev< DisplacementDim > > prev_states_
std::vector< typename ConstitutiveRelations::StatefulData< DisplacementDim > > current_states_
std::vector< typename ConstitutiveRelations::OutputData< DisplacementDim > > output_data_
std::vector< MaterialStateData< DisplacementDim > > material_states_

References ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::_ip_data, ProcessLib::LinearBMatrix::computeBMatrixPossiblyWithBbar(), ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::constitutive_setting, MathLib::createZeroedMatrix(), MathLib::createZeroedVector(), ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::current_states_, ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::element_, ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::getDilatationalBBarMatrix(), MeshLib::Element::getID(), NumLib::GenericIntegrationMethod::getNumberOfPoints(), ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::integration_method_, NumLib::interpolateXCoordinate(), ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::is_axially_symmetric_, ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::localDOF(), ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::material_states_, ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::N_u_op, ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::output_data_, ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::prev_states_, ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::process_data_, ParameterLib::SpatialPosition::setElementID(), ParameterLib::SpatialPosition::setIntegrationPoint(), and ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::updateConstitutiveRelations().

◆ getDilatationalBBarMatrix()

template<typename ShapeFunction , int DisplacementDim>
std::optional< BBarMatrixType > ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::getDilatationalBBarMatrix ( ) const
inline

Definition at line 215 of file SmallDeformationFEM.h.

216 {
217 if (!(this->process_data_.use_b_bar))
218 {
219 return std::nullopt;
220 }
221
223 DisplacementDim, ShapeFunction::NPOINTS, ShapeFunction,
227 }
IntegrationPointData< BMatricesType, ShapeMatricesType, DisplacementDim > IpData
BBarMatrixType computeDilatationalBbar(std::vector< IpData, Eigen::aligned_allocator< IpData > > const &ip_data, MeshLib::Element const &element, NumLib::GenericIntegrationMethod const &integration_method, const bool is_axially_symmetric)

References ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::_ip_data, ProcessLib::LinearBMatrix::computeDilatationalBbar(), ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::element_, ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::integration_method_, ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::is_axially_symmetric_, and ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::process_data_.

Referenced by ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobian(), and ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::postTimestepConcrete().

◆ getMaterialForces()

template<typename ShapeFunction , int DisplacementDim>
std::vector< double > const & ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::getMaterialForces ( std::vector< double > const & local_x,
std::vector< double > & nodal_values )
inlineoverridevirtual

Implements ProcessLib::SmallDeformation::MaterialForcesInterface.

Definition at line 339 of file SmallDeformationFEM.h.

342 {
344 DisplacementDim, ShapeFunction, ShapeMatricesType,
347 GradientMatrixType>(local_x, nodal_values,
349 this->current_states_, this->output_data_,
350 this->element_, this->is_axially_symmetric_);
351 }
typename BMatricesType::NodalForceVectorType NodalDisplacementVectorType
typename GMatricesType::GradientMatrixType GradientMatrixType
typename GMatricesType::GradientVectorType GradientVectorType
std::vector< double > const & getMaterialForces(std::vector< double > const &local_x, std::vector< double > &nodal_values, IntegrationMethod const &_integration_method, IPData const &_ip_data, StressData const &stress_data, OutputData const &output_data, MeshLib::Element const &element, bool const is_axially_symmetric)

References ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::_ip_data, ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::current_states_, ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::element_, ProcessLib::SmallDeformation::getMaterialForces(), ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::integration_method_, ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::is_axially_symmetric_, and ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::output_data_.

◆ getShapeMatrix()

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

Provides the shape matrix at the given integration point.

Implements NumLib::ExtrapolatableElement.

Definition at line 353 of file SmallDeformationFEM.h.

355 {
356 auto const& N = _secondary_data.N[integration_point];
357
358 // assumes N is stored contiguously in memory
359 return Eigen::Map<const Eigen::RowVectorXd>(N.data(), N.size());
360 }

References ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::_secondary_data, and ProcessLib::SmallDeformation::SecondaryData< ShapeMatrixType >::N.

◆ initializeConcrete()

template<typename ShapeFunction , int DisplacementDim>
void ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::initializeConcrete ( )
inlineoverridevirtual

Set initial stress from parameter.

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 126 of file SmallDeformationFEM.h.

127 {
128 unsigned const n_integration_points =
130 for (unsigned ip = 0; ip < n_integration_points; ip++)
131 {
132 auto const& ip_data = _ip_data[ip];
133
134 ParameterLib::SpatialPosition const x_position{
135 std::nullopt, this->element_.getID(), ip,
137 NumLib::interpolateCoordinates<ShapeFunction,
139 this->element_, ip_data.N_u))};
140
142 if (this->process_data_.initial_stress != nullptr)
143 {
144 this->current_states_[ip].stress_data.sigma.noalias() =
146 DisplacementDim>((*this->process_data_.initial_stress)(
147 std::numeric_limits<
148 double>::quiet_NaN() /* time independent */,
149 x_position));
150 }
151
152 double const t = 0; // TODO (naumov) pass t from top
153 auto& material_state = this->material_states_[ip];
154 this->solid_material_.initializeInternalStateVariables(
155 t, x_position, *material_state.material_state_variables);
156
157 material_state.pushBackState();
158 }
159
160 for (unsigned ip = 0; ip < n_integration_points; ip++)
161 {
162 this->prev_states_[ip] = this->current_states_[ip];
163 }
164 }
Eigen::Matrix< double, Eigen::MatrixBase< Derived >::RowsAtCompileTime, 1 > symmetricTensorToKelvinVector(Eigen::MatrixBase< Derived > const &v)
std::array< double, 3 > interpolateCoordinates(MeshLib::Element const &e, typename ShapeMatricesType::ShapeMatrices::ShapeType const &N)
MaterialLib::Solids::MechanicsBase< DisplacementDim > const & solid_material_

References ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::_ip_data, ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::current_states_, ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::element_, MeshLib::Element::getID(), NumLib::GenericIntegrationMethod::getNumberOfPoints(), ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::integration_method_, NumLib::interpolateCoordinates(), ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::material_states_, ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::prev_states_, ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::process_data_, ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::solid_material_, and MathLib::KelvinVector::symmetricTensorToKelvinVector().

◆ localDOF()

template<typename ShapeFunction , int DisplacementDim>
static constexpr auto ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::localDOF ( std::vector< double > const & x)
inlinestaticconstexprprivate

◆ postTimestepConcrete()

template<typename ShapeFunction , int DisplacementDim>
void ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::postTimestepConcrete ( Eigen::VectorXd const & local_x,
Eigen::VectorXd const & local_x_prev,
double const t,
double const dt,
int const  )
inlineoverridevirtual

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 290 of file SmallDeformationFEM.h.

294 {
295 unsigned const n_integration_points =
297
299 x_position.setElementID(this->element_.getID());
300
301 typename ConstitutiveRelations::ConstitutiveSetting<DisplacementDim>
303
304 auto const& medium =
305 *this->process_data_.media_map.getMedium(this->element_.getID());
306
307 auto const B_dil_bar = getDilatationalBBarMatrix();
308
309 for (unsigned ip = 0; ip < n_integration_points; ip++)
310 {
311 x_position.setIntegrationPoint(ip);
312 auto const& N = _ip_data[ip].N_u;
313 auto const& dNdx = _ip_data[ip].dNdx_u;
314
315 auto const x_coord =
316 NumLib::interpolateXCoordinate<ShapeFunction,
318 this->element_, N);
320 DisplacementDim, ShapeFunction::NPOINTS, BBarMatrixType,
322 dNdx, N, B_dil_bar, x_coord, this->is_axially_symmetric_);
323
325 B, local_x, local_x_prev, x_position, t, dt,
326 constitutive_setting, medium, this->current_states_[ip],
327 this->prev_states_[ip], this->material_states_[ip],
328 this->output_data_[ip]);
329
330 this->material_states_[ip].pushBackState();
331 }
332
333 for (unsigned ip = 0; ip < n_integration_points; ip++)
334 {
335 this->prev_states_[ip] = this->current_states_[ip];
336 }
337 }

References ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::_ip_data, ProcessLib::LinearBMatrix::computeBMatrixPossiblyWithBbar(), ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::constitutive_setting, ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::current_states_, ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::element_, ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::getDilatationalBBarMatrix(), MeshLib::Element::getID(), NumLib::GenericIntegrationMethod::getNumberOfPoints(), ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::integration_method_, NumLib::interpolateXCoordinate(), ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::is_axially_symmetric_, ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::material_states_, ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::output_data_, ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::prev_states_, ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::process_data_, ParameterLib::SpatialPosition::setElementID(), ParameterLib::SpatialPosition::setIntegrationPoint(), and ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::updateConstitutiveRelations().

◆ updateConstitutiveRelations()

template<typename ShapeFunction , int DisplacementDim>
ConstitutiveRelations::ConstitutiveData< DisplacementDim > ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::updateConstitutiveRelations ( BMatrixType const & B,
Eigen::Ref< Eigen::VectorXd const > const & u,
Eigen::Ref< Eigen::VectorXd const > const & u_prev,
ParameterLib::SpatialPosition const & x_position,
double const t,
double const dt,
typename ConstitutiveRelations::ConstitutiveSetting< DisplacementDim > & CS,
MaterialPropertyLib::Medium const & medium,
typename ConstitutiveRelations::StatefulData< DisplacementDim > & current_state,
typename ConstitutiveRelations::StatefulDataPrev< DisplacementDim > const & prev_state,
MaterialStateData< DisplacementDim > & material_state,
typename ConstitutiveRelations::OutputData< DisplacementDim > & output_data ) const
inline

Definition at line 167 of file SmallDeformationFEM.h.

182 {
183 double const T_ref =
184 this->process_data_.reference_temperature
185 ? (*this->process_data_.reference_temperature)(t, x_position)[0]
186 : std::numeric_limits<double>::quiet_NaN();
187
188 typename ConstitutiveRelations::ConstitutiveModels<DisplacementDim>
189 models{this->process_data_, this->solid_material_};
190 typename ConstitutiveRelations::ConstitutiveTempData<DisplacementDim>
191 tmp;
192 typename ConstitutiveRelations::ConstitutiveData<DisplacementDim> CD;
193
194 CS.eval(models, t, dt, x_position, //
195 medium, //
196 T_ref, B * u, B * u_prev, //
197 current_state, prev_state, material_state, tmp, output_data,
198 CD);
199
200 return CD;
201 }

References ProcessLib::SmallDeformation::ConstitutiveRelations::ConstitutiveSetting< DisplacementDim >::eval(), ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::process_data_, and ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::solid_material_.

Referenced by ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobian(), and ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::postTimestepConcrete().

Member Data Documentation

◆ _ip_data

◆ _secondary_data

◆ N_u_op

template<typename ShapeFunction , int DisplacementDim>
auto& ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::N_u_op
staticconstexpr
Initial value:
DisplacementDim, typename ShapeMatricesType::NodalRowVectorType>
constexpr Eigen::CwiseNullaryOp< EigenBlockMatrixViewFunctor< D, M >, typename EigenBlockMatrixViewFunctor< D, M >::Matrix > eigenBlockMatrixView(const Eigen::MatrixBase< M > &matrix)
RowVectorType< ShapeFunction::NPOINTS > NodalRowVectorType

Definition at line 84 of file SmallDeformationFEM.h.

Referenced by ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobian().


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