OGS
ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim > Class Template Reference

Detailed Description

template<typename ShapeFunction, int DisplacementDim>
class ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >

Definition at line 79 of file LargeDeformationFEM.h.

#include <LargeDeformationFEM.h>

Inheritance diagram for ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >:
[legend]
Collaboration diagram for ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< 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 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

 LargeDeformationLocalAssembler (LargeDeformationLocalAssembler const &)=delete
 
 LargeDeformationLocalAssembler (LargeDeformationLocalAssembler &&)=delete
 
 LargeDeformationLocalAssembler (MeshLib::Element const &e, std::size_t const, NumLib::GenericIntegrationMethod const &integration_method, bool const is_axially_symmetric, LargeDeformationProcessData< DisplacementDim > &process_data)
 
void initializeConcrete () override
 
ConstitutiveRelations::ConstitutiveData< DisplacementDim > updateConstitutiveRelations (BMatrixType const &B, GradientMatrixType const &G, GradientVectorType const &grad_u, 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
 
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
 
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::LargeDeformation::LargeDeformationLocalAssemblerInterface< DisplacementDim >
 LargeDeformationLocalAssemblerInterface (MeshLib::Element const &e, NumLib::GenericIntegrationMethod const &integration_method, bool const is_axially_symmetric, LargeDeformationProcessData< DisplacementDim > &process_data)
 
std::size_t setIPDataInitialConditions (std::string_view name, double const *values, int const integration_order)
 Returns number of read integration points.
 
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 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
 

Static Private Attributes

static const int displacement_size
 

Additional Inherited Members

- Static Public Member Functions inherited from ProcessLib::LargeDeformation::LargeDeformationLocalAssemblerInterface< DisplacementDim >
static auto getReflectionDataForOutput ()
 
- Protected Attributes inherited from ProcessLib::LargeDeformation::LargeDeformationLocalAssemblerInterface< DisplacementDim >
LargeDeformationProcessData< 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_
 
ConstitutiveRelations::SolidConstitutiveRelation< DisplacementDim > const & solid_material_
 

Member Typedef Documentation

◆ BMatricesType

template<typename ShapeFunction , int DisplacementDim>
using ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::BMatricesType = BMatrixPolicyType<ShapeFunction, DisplacementDim>

Definition at line 88 of file LargeDeformationFEM.h.

◆ BMatrixType

template<typename ShapeFunction , int DisplacementDim>
using ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::BMatrixType = typename BMatricesType::BMatrixType

Definition at line 90 of file LargeDeformationFEM.h.

◆ GMatricesType

template<typename ShapeFunction , int DisplacementDim>
using ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::GMatricesType = GMatrixPolicyType<ShapeFunction, DisplacementDim>

Definition at line 96 of file LargeDeformationFEM.h.

◆ GradientMatrixType

template<typename ShapeFunction , int DisplacementDim>
using ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::GradientMatrixType = typename GMatricesType::GradientMatrixType

Definition at line 98 of file LargeDeformationFEM.h.

◆ GradientVectorType

template<typename ShapeFunction , int DisplacementDim>
using ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::GradientVectorType = typename GMatricesType::GradientVectorType

Definition at line 97 of file LargeDeformationFEM.h.

◆ IpData

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

Definition at line 99 of file LargeDeformationFEM.h.

◆ NodalDisplacementVectorType

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

Definition at line 93 of file LargeDeformationFEM.h.

◆ NodalForceVectorType

template<typename ShapeFunction , int DisplacementDim>
using ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::NodalForceVectorType = typename BMatricesType::NodalForceVectorType

Definition at line 92 of file LargeDeformationFEM.h.

◆ NodalMatrixType

template<typename ShapeFunction , int DisplacementDim>
using ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::NodalMatrixType = typename ShapeMatricesType::NodalMatrixType

Definition at line 85 of file LargeDeformationFEM.h.

◆ NodalVectorType

template<typename ShapeFunction , int DisplacementDim>
using ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::NodalVectorType = typename ShapeMatricesType::NodalVectorType

Definition at line 86 of file LargeDeformationFEM.h.

◆ ShapeMatrices

template<typename ShapeFunction , int DisplacementDim>
using ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::ShapeMatrices = typename ShapeMatricesType::ShapeMatrices

Definition at line 87 of file LargeDeformationFEM.h.

◆ ShapeMatricesType

template<typename ShapeFunction , int DisplacementDim>
using ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::ShapeMatricesType

◆ StiffnessMatrixType

template<typename ShapeFunction , int DisplacementDim>
using ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::StiffnessMatrixType = typename BMatricesType::StiffnessMatrixType

Definition at line 91 of file LargeDeformationFEM.h.

Constructor & Destructor Documentation

◆ LargeDeformationLocalAssembler() [1/3]

template<typename ShapeFunction , int DisplacementDim>
ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::LargeDeformationLocalAssembler ( LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim > const & )
delete

◆ LargeDeformationLocalAssembler() [2/3]

template<typename ShapeFunction , int DisplacementDim>
ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::LargeDeformationLocalAssembler ( LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim > && )
delete

◆ LargeDeformationLocalAssembler() [3/3]

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

Definition at line 109 of file LargeDeformationFEM.h.

116 e, integration_method, is_axially_symmetric, process_data)
117 {
118 unsigned const n_integration_points =
120
121 _ip_data.resize(n_integration_points);
122 _secondary_data.N.resize(n_integration_points);
123
124 auto const shape_matrices =
126 DisplacementDim>(
127 e, is_axially_symmetric, this->integration_method_);
128
129 for (unsigned ip = 0; ip < n_integration_points; ip++)
130 {
131 auto& ip_data = _ip_data[ip];
132 auto const& sm = shape_matrices[ip];
133 _ip_data[ip].integration_weight =
135 sm.integralMeasure * sm.detJ;
136
137 ip_data.N = sm.N;
138 ip_data.dNdx = sm.dNdx;
139
140 _secondary_data.N[ip] = shape_matrices[ip].N;
141 }
142 }
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)
LargeDeformationLocalAssemblerInterface(MeshLib::Element const &e, NumLib::GenericIntegrationMethod const &integration_method, bool const is_axially_symmetric, LargeDeformationProcessData< DisplacementDim > &process_data)
std::vector< ShapeMatrixType, Eigen::aligned_allocator< ShapeMatrixType > > N

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

Member Function Documentation

◆ assemble()

template<typename ShapeFunction , int DisplacementDim>
void ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< 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 230 of file LargeDeformationFEM.h.

236 {
237 OGS_FATAL(
238 "LargeDeformationLocalAssembler: assembly without jacobian is not "
239 "implemented.");
240 }
#define OGS_FATAL(...)
Definition Error.h:26

References OGS_FATAL.

◆ assembleWithJacobian()

template<typename ShapeFunction , int DisplacementDim>
void ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< 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 242 of file LargeDeformationFEM.h.

247 {
248 auto const local_matrix_size = local_x.size();
249
251 local_Jac_data, local_matrix_size, local_matrix_size);
252
254 local_b_data, local_matrix_size);
255
256 auto [u] = localDOF(local_x);
257 auto [u_prev] = localDOF(local_x_prev);
258
259 unsigned const n_integration_points =
261
263 x_position.setElementID(this->element_.getID());
264
265 typename ConstitutiveRelations::ConstitutiveSetting<DisplacementDim>
266 constitutive_setting;
267 auto const& medium =
268 *this->process_data_.media_map.getMedium(this->element_.getID());
269
270 for (unsigned ip = 0; ip < n_integration_points; ip++)
271 {
272 x_position.setIntegrationPoint(ip);
273 auto const& w = _ip_data[ip].integration_weight;
274 auto const& N = _ip_data[ip].N;
275 auto const& dNdx = _ip_data[ip].dNdx;
276
277 auto const x_coord =
278 NumLib::interpolateXCoordinate<ShapeFunction,
280 this->element_, N);
281
282 // For the 2D case the 33-component is needed (and the four entries
283 // of the non-symmetric matrix); In 3d there are nine entries.
284 GradientMatrixType G(DisplacementDim * DisplacementDim +
285 (DisplacementDim == 2 ? 1 : 0),
286 ShapeFunction::NPOINTS * DisplacementDim);
287 Deformation::computeGMatrix<DisplacementDim,
288 ShapeFunction::NPOINTS>(
289 dNdx, G, this->is_axially_symmetric_, N, x_coord);
290
291 GradientVectorType const grad_u = G * u;
292
293 auto const B_0 = LinearBMatrix::computeBMatrix<
294 DisplacementDim, ShapeFunction::NPOINTS,
296 dNdx, N, x_coord, this->is_axially_symmetric_);
297
298 auto const B_N = NonLinearBMatrix::computeBMatrix<
299 DisplacementDim, ShapeFunction::NPOINTS,
301 dNdx, N, grad_u, x_coord, this->is_axially_symmetric_);
302
303 auto const CD = updateConstitutiveRelations(
304 B_0 + 0.5 * B_N, G, grad_u, u, u_prev, x_position, t, dt,
305 constitutive_setting, medium, this->current_states_[ip],
306 this->prev_states_[ip], this->material_states_[ip],
307 this->output_data_[ip]);
308
309 auto const B = B_0 + B_N;
310
311 auto const& sigma = this->current_states_[ip].stress_data.sigma;
312 auto const& b = *CD.volumetric_body_force;
313 auto const& C = CD.s_mech_data.stiffness_tensor;
314
315 local_b.noalias() -=
316 (B.transpose() * sigma - N_u_op(N).transpose() * b) * w;
317
318 auto const sigma_geom =
321
322 local_Jac.noalias() += G.transpose() * sigma_geom * G * w;
323
324 local_Jac.noalias() += B.transpose() * C * B * w;
325 }
326 }
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
typename GMatricesType::GradientVectorType GradientVectorType
static constexpr auto localDOF(std::vector< double > const &x)
ConstitutiveRelations::ConstitutiveData< DisplacementDim > updateConstitutiveRelations(BMatrixType const &B, GradientMatrixType const &G, GradientVectorType const &grad_u, 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
typename GMatricesType::GradientMatrixType GradientMatrixType
Eigen::Matrix< double, 3, 3 > kelvinVectorToTensor(Eigen::Matrix< double, 4, 1, Eigen::ColMajor, 4, 1 > const &v)
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)
void computeGMatrix(DNDX_Type const &dNdx, GMatrixType &g_matrix, const bool is_axially_symmetric, N_Type const &N, const double radius)
Fills a G-matrix based on given shape function dN/dx values.
Definition GMatrix.h:25
Eigen::Matrix< double, MPL::tensorSize(DisplacementDim), MPL::tensorSize(DisplacementDim)> computeSigmaGeom(Eigen::Matrix3d const &sigma_tensor)
BMatrixType computeBMatrix(DNDX_Type const &dNdx, N_Type const &N, const double radius, const bool is_axially_symmetric)
Fills a B-matrix based on given shape function dN/dx values.
BMatrixType computeBMatrix(DNDX_Type const &dNdx, N_Type const &N, GradientVectorType const &grad_u, const double radius, const bool is_axially_symmetric)
std::vector< MaterialStateData< DisplacementDim > > material_states_
std::vector< typename ConstitutiveRelations::StatefulDataPrev< DisplacementDim > > prev_states_
std::vector< typename ConstitutiveRelations::StatefulData< DisplacementDim > > current_states_
std::vector< typename ConstitutiveRelations::OutputData< DisplacementDim > > output_data_

References ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::_ip_data, ProcessLib::LinearBMatrix::computeBMatrix(), ProcessLib::NonLinearBMatrix::computeBMatrix(), ProcessLib::Deformation::computeGMatrix(), ProcessLib::LargeDeformation::computeSigmaGeom(), MathLib::createZeroedMatrix(), MathLib::createZeroedVector(), ProcessLib::LargeDeformation::LargeDeformationLocalAssemblerInterface< DisplacementDim >::current_states_, ProcessLib::LargeDeformation::LargeDeformationLocalAssemblerInterface< DisplacementDim >::element_, MeshLib::Element::getID(), NumLib::GenericIntegrationMethod::getNumberOfPoints(), ProcessLib::LargeDeformation::LargeDeformationLocalAssemblerInterface< DisplacementDim >::integration_method_, NumLib::interpolateXCoordinate(), ProcessLib::LargeDeformation::LargeDeformationLocalAssemblerInterface< DisplacementDim >::is_axially_symmetric_, MathLib::KelvinVector::kelvinVectorToTensor(), ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::localDOF(), ProcessLib::LargeDeformation::LargeDeformationLocalAssemblerInterface< DisplacementDim >::material_states_, ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::N_u_op, ProcessLib::LargeDeformation::LargeDeformationLocalAssemblerInterface< DisplacementDim >::output_data_, ProcessLib::LargeDeformation::LargeDeformationLocalAssemblerInterface< DisplacementDim >::prev_states_, ProcessLib::LargeDeformation::LargeDeformationLocalAssemblerInterface< DisplacementDim >::process_data_, ParameterLib::SpatialPosition::setElementID(), ParameterLib::SpatialPosition::setIntegrationPoint(), and ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::updateConstitutiveRelations().

◆ getShapeMatrix()

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

Provides the shape matrix at the given integration point.

Implements NumLib::ExtrapolatableElement.

Definition at line 393 of file LargeDeformationFEM.h.

395 {
396 auto const& N = _secondary_data.N[integration_point];
397
398 // assumes N is stored contiguously in memory
399 return Eigen::Map<const Eigen::RowVectorXd>(N.data(), N.size());
400 }

References ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::_secondary_data, and ProcessLib::LargeDeformation::SecondaryData< ShapeMatrixType >::N.

◆ initializeConcrete()

template<typename ShapeFunction , int DisplacementDim>
void ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::initializeConcrete ( )
inlineoverridevirtual

Set initial stress from parameter.

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 144 of file LargeDeformationFEM.h.

145 {
146 unsigned const n_integration_points =
148 for (unsigned ip = 0; ip < n_integration_points; ip++)
149 {
150 auto const& ip_data = _ip_data[ip];
151
152 ParameterLib::SpatialPosition const x_position{
153 std::nullopt, this->element_.getID(), ip,
155 NumLib::interpolateCoordinates<ShapeFunction,
157 this->element_, ip_data.N))};
158
160 if (this->process_data_.initial_stress != nullptr)
161 {
162 this->current_states_[ip].stress_data.sigma.noalias() =
164 DisplacementDim>((*this->process_data_.initial_stress)(
165 std::numeric_limits<
166 double>::quiet_NaN() /* time independent */,
167 x_position));
168 }
169
170 double const t = 0; // TODO (naumov) pass t from top
171 auto& material_state = this->material_states_[ip];
172 this->solid_material_.initializeInternalStateVariables(
173 t, x_position, *material_state.material_state_variables);
174
175 material_state.pushBackState();
176 this->prev_states_[ip] = this->current_states_[ip];
177 }
178 }
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)
ConstitutiveRelations::SolidConstitutiveRelation< DisplacementDim > const & solid_material_

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

◆ localDOF()

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

◆ postTimestepConcrete()

template<typename ShapeFunction , int DisplacementDim>
void ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< 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 328 of file LargeDeformationFEM.h.

332 {
333 unsigned const n_integration_points =
335
337 x_position.setElementID(this->element_.getID());
338
339 typename ConstitutiveRelations::ConstitutiveSetting<DisplacementDim>
340 constitutive_setting;
341
342 auto& medium =
343 *this->process_data_.media_map.getMedium(this->element_.getID());
344
345 for (unsigned ip = 0; ip < n_integration_points; ip++)
346 {
347 x_position.setIntegrationPoint(ip);
348 auto const& N = _ip_data[ip].N;
349 auto const& dNdx = _ip_data[ip].dNdx;
350 auto const x_coord =
351 NumLib::interpolateXCoordinate<ShapeFunction,
353 this->element_, N);
354
355 // For the 2D case the 33-component is needed (and the four entries
356 // of the non-symmetric matrix); In 3d there are nine entries.
357 GradientMatrixType G(DisplacementDim * DisplacementDim +
358 (DisplacementDim == 2 ? 1 : 0),
359 ShapeFunction::NPOINTS * DisplacementDim);
360 Deformation::computeGMatrix<DisplacementDim,
361 ShapeFunction::NPOINTS>(
362 dNdx, G, this->is_axially_symmetric_, N, x_coord);
363
364 GradientVectorType const grad_u = G * local_x;
365
366 // B for Green-Lagrange strain.
368 DisplacementDim, ShapeFunction::NPOINTS,
370 dNdx, N, x_coord, this->is_axially_symmetric_);
371
372 B.noalias() += 0.5 * NonLinearBMatrix::computeBMatrix<
373 DisplacementDim, ShapeFunction::NPOINTS,
375 dNdx, N, grad_u, x_coord,
377
379 B, G, grad_u, local_x, local_x_prev, x_position, t, dt,
380 constitutive_setting, medium, this->current_states_[ip],
381 this->prev_states_[ip], this->material_states_[ip],
382 this->output_data_[ip]);
383
384 this->material_states_[ip].pushBackState();
385 }
386
387 for (unsigned ip = 0; ip < n_integration_points; ip++)
388 {
389 this->prev_states_[ip] = this->current_states_[ip];
390 }
391 }

References ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::_ip_data, ProcessLib::LinearBMatrix::computeBMatrix(), ProcessLib::NonLinearBMatrix::computeBMatrix(), ProcessLib::Deformation::computeGMatrix(), ProcessLib::LargeDeformation::LargeDeformationLocalAssemblerInterface< DisplacementDim >::current_states_, ProcessLib::LargeDeformation::LargeDeformationLocalAssemblerInterface< DisplacementDim >::element_, MeshLib::Element::getID(), NumLib::GenericIntegrationMethod::getNumberOfPoints(), ProcessLib::LargeDeformation::LargeDeformationLocalAssemblerInterface< DisplacementDim >::integration_method_, NumLib::interpolateXCoordinate(), ProcessLib::LargeDeformation::LargeDeformationLocalAssemblerInterface< DisplacementDim >::is_axially_symmetric_, ProcessLib::LargeDeformation::LargeDeformationLocalAssemblerInterface< DisplacementDim >::material_states_, ProcessLib::LargeDeformation::LargeDeformationLocalAssemblerInterface< DisplacementDim >::output_data_, ProcessLib::LargeDeformation::LargeDeformationLocalAssemblerInterface< DisplacementDim >::prev_states_, ProcessLib::LargeDeformation::LargeDeformationLocalAssemblerInterface< DisplacementDim >::process_data_, ParameterLib::SpatialPosition::setElementID(), ParameterLib::SpatialPosition::setIntegrationPoint(), and ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::updateConstitutiveRelations().

◆ updateConstitutiveRelations()

template<typename ShapeFunction , int DisplacementDim>
ConstitutiveRelations::ConstitutiveData< DisplacementDim > ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::updateConstitutiveRelations ( BMatrixType const & B,
GradientMatrixType const & G,
GradientVectorType const & grad_u,
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 181 of file LargeDeformationFEM.h.

199 {
200 double const T_ref =
201 this->process_data_.reference_temperature
202 ? (*this->process_data_.reference_temperature)(t, x_position)[0]
203 : std::numeric_limits<double>::quiet_NaN();
204
205 typename ConstitutiveRelations::ConstitutiveModels<DisplacementDim>
206 models(this->process_data_, this->solid_material_);
207 typename ConstitutiveRelations::ConstitutiveTempData<DisplacementDim>
208 tmp;
209 typename ConstitutiveRelations::ConstitutiveData<DisplacementDim> CD;
210
211 // Note: Here B=B_{linear}+B_{nonlinear}/2 For Green-Lagrange strain.
212 output_data.eps_data.eps = B * u;
213 output_data.deformation_gradient_data.deformation_gradient =
215 output_data.deformation_gradient_data.volume_ratio =
217 output_data.deformation_gradient_data.deformation_gradient);
218
219 CS.eval(
220 models, t, dt, x_position, //
221 medium, //
222 T_ref, //
223 output_data.deformation_gradient_data, //
225 current_state, prev_state, material_state, tmp, CD);
226
227 return CD;
228 }
double determinant(Eigen::MatrixBase< Derived > const &tensor)
Computes determinant of a vectorized tensor.

References ProcessLib::LargeDeformation::ConstitutiveRelations::OutputData< DisplacementDim >::deformation_gradient_data, MathLib::VectorizedTensor::determinant(), ProcessLib::LargeDeformation::ConstitutiveRelations::OutputData< DisplacementDim >::eps_data, ProcessLib::LargeDeformation::ConstitutiveRelations::ConstitutiveSetting< DisplacementDim >::eval(), MathLib::VectorizedTensor::identity(), ProcessLib::LargeDeformation::LargeDeformationLocalAssemblerInterface< DisplacementDim >::process_data_, and ProcessLib::LargeDeformation::LargeDeformationLocalAssemblerInterface< DisplacementDim >::solid_material_.

Referenced by ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobian(), and ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::postTimestepConcrete().

Member Data Documentation

◆ _ip_data

◆ _secondary_data

◆ displacement_size

template<typename ShapeFunction , int DisplacementDim>
const int ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::displacement_size
staticprivate
Initial value:
=
ShapeFunction::NPOINTS * DisplacementDim

Definition at line 414 of file LargeDeformationFEM.h.

◆ N_u_op

template<typename ShapeFunction , int DisplacementDim>
auto& ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< 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 102 of file LargeDeformationFEM.h.

Referenced by ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobian().


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