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

Detailed Description

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

Definition at line 86 of file SmallDeformationFEM.h.

#include <SmallDeformationFEM.h>

Inheritance diagram for ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >:
[legend]
Collaboration diagram for ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >:
[legend]

Public Types

using ShapeMatricesType = ShapeMatrixPolicyType< ShapeFunction, DisplacementDim >
 
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 = typename BMatricesType::NodalForceVectorType
 
using GMatricesType = GMatrixPolicyType< ShapeFunction, DisplacementDim >
 
using GradientVectorType = typename GMatricesType::GradientVectorType
 
using GradientMatrixType = typename GMatricesType::GradientMatrixType
 
using IpData = IntegrationPointData< BMatricesType, ShapeMatricesType, DisplacementDim >
 

Public Member Functions

 SmallDeformationLocalAssembler (SmallDeformationLocalAssembler const &)=delete
 
 SmallDeformationLocalAssembler (SmallDeformationLocalAssembler &&)=delete
 
 SmallDeformationLocalAssembler (MeshLib::Element const &e, std::size_t const, bool const is_axially_symmetric, unsigned const integration_order, SmallDeformationProcessData< DisplacementDim > &process_data)
 
std::size_t setIPDataInitialConditions (std::string const &name, double const *values, int const integration_order) override
 Returns number of read integration points. More...
 
void initializeConcrete () override
 
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 &, const double, const double, std::vector< double > &, std::vector< double > &, std::vector< double > &local_b_data, std::vector< double > &local_Jac_data) override
 
void postTimestepConcrete (Eigen::VectorXd const &, double const t, double const dt) 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. More...
 
std::vector< double > const & getIntPtFreeEnergyDensity (const double, std::vector< GlobalVector * > const &, std::vector< NumLib::LocalToGlobalIndexMap const * > const &, std::vector< double > &cache) const override
 
std::size_t setSigma (double const *values)
 
std::vector< double > getSigma () const override
 
std::vector< double > const & getIntPtSigma (const double, std::vector< GlobalVector * > const &, std::vector< NumLib::LocalToGlobalIndexMap const * > const &, std::vector< double > &cache) const override
 
std::vector< double > const & getIntPtEpsilon (const double, std::vector< GlobalVector * > const &, std::vector< NumLib::LocalToGlobalIndexMap const * > const &, std::vector< double > &cache) const override
 
unsigned getNumberOfIntegrationPoints () const override
 
MaterialLib::Solids::MechanicsBase< DisplacementDim >::MaterialStateVariables const & getMaterialStateVariablesAt (unsigned integration_point) const override
 
void computeSecondaryVariableConcrete (double const, double const, Eigen::VectorXd const &, Eigen::VectorXd const &) override
 
- Public Member Functions inherited from ProcessLib::LocalAssemblerInterface
virtual ~LocalAssemblerInterface ()=default
 
void setInitialConditions (std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table, GlobalVector const &x, double const t, bool const use_monolithic_scheme, 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_xdot, 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_xdot, const double dxdot_dx, const double dx_dx, int const process_id, std::vector< double > &local_M_data, std::vector< double > &local_K_data, 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_dot, 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, double const t, double const dt)
 
void postNonLinearSolver (std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table, GlobalVector const &x, GlobalVector const &xdot, double const t, double const dt, bool const use_monolithic_scheme, int const process_id)
 
virtual std::vector< double > interpolateNodalValuesToIntegrationPoints (std::vector< double > const &)
 
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. More...
 
- Public Member Functions inherited from ProcessLib::SmallDeformation::MaterialForcesInterface
virtual ~MaterialForcesInterface ()=default
 
- Public Member Functions inherited from NumLib::ExtrapolatableElement
virtual ~ExtrapolatableElement ()=default
 

Private Attributes

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

Static Private Attributes

static const int displacement_size
 

Member Typedef Documentation

◆ BMatricesType

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

Definition at line 95 of file SmallDeformationFEM.h.

◆ BMatrixType

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

Definition at line 97 of file SmallDeformationFEM.h.

◆ GMatricesType

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

Definition at line 103 of file SmallDeformationFEM.h.

◆ GradientMatrixType

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

Definition at line 105 of file SmallDeformationFEM.h.

◆ GradientVectorType

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

Definition at line 104 of file SmallDeformationFEM.h.

◆ IpData

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

Definition at line 106 of file SmallDeformationFEM.h.

◆ NodalDisplacementVectorType

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

Definition at line 100 of file SmallDeformationFEM.h.

◆ NodalForceVectorType

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

Definition at line 99 of file SmallDeformationFEM.h.

◆ NodalMatrixType

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

Definition at line 92 of file SmallDeformationFEM.h.

◆ NodalVectorType

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

Definition at line 93 of file SmallDeformationFEM.h.

◆ ShapeMatrices

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

Definition at line 94 of file SmallDeformationFEM.h.

◆ ShapeMatricesType

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

Definition at line 90 of file SmallDeformationFEM.h.

◆ StiffnessMatrixType

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

Definition at line 98 of file SmallDeformationFEM.h.

Constructor & Destructor Documentation

◆ SmallDeformationLocalAssembler() [1/3]

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

◆ SmallDeformationLocalAssembler() [2/3]

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

◆ SmallDeformationLocalAssembler() [3/3]

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

Definition at line 113 of file SmallDeformationFEM.h.

119  : _process_data(process_data),
120  _integration_method(integration_order),
121  _element(e),
122  _is_axially_symmetric(is_axially_symmetric)
123  {
124  unsigned const n_integration_points =
125  _integration_method.getNumberOfPoints();
126 
127  _ip_data.reserve(n_integration_points);
128  _secondary_data.N.resize(n_integration_points);
129 
130  auto const shape_matrices =
132  DisplacementDim>(e, is_axially_symmetric,
134 
135  auto& solid_material =
137  _process_data.solid_materials,
138  _process_data.material_ids,
139  e.getID());
140 
141  for (unsigned ip = 0; ip < n_integration_points; ip++)
142  {
143  _ip_data.emplace_back(solid_material);
144  auto& ip_data = _ip_data[ip];
145  auto const& sm = shape_matrices[ip];
146  _ip_data[ip].integration_weight =
147  _integration_method.getWeightedPoint(ip).getWeight() *
148  sm.integralMeasure * sm.detJ;
149 
150  ip_data.N = sm.N;
151  ip_data.dNdx = sm.dNdx;
152 
153  static const int kelvin_vector_size =
155  DisplacementDim);
156  // Initialize current time step values
157  ip_data.sigma.setZero(kelvin_vector_size);
158  ip_data.eps.setZero(kelvin_vector_size);
159 
160  // Previous time step values are not initialized and are set later.
161  ip_data.sigma_prev.resize(kelvin_vector_size);
162  ip_data.eps_prev.resize(kelvin_vector_size);
163 
164  _secondary_data.N[ip] = shape_matrices[ip].N;
165  }
166  }
SmallDeformationProcessData< DisplacementDim > & _process_data
std::vector< IpData, Eigen::aligned_allocator< IpData > > _ip_data
ShapeMatrixPolicyType< ShapeFunction, DisplacementDim > ShapeMatricesType
SecondaryData< typename ShapeMatrices::ShapeType > _secondary_data
MechanicsBase< DisplacementDim > & selectSolidConstitutiveRelation(std::map< int, std::unique_ptr< MechanicsBase< DisplacementDim >>> 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.
Definition: KelvinVector.h:23
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
Definition: SecondaryData.h:28

References ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::_integration_method, ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::_ip_data, ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::_process_data, ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::_secondary_data, MeshLib::Element::getID(), NumLib::initShapeMatrices(), MathLib::KelvinVector::kelvin_vector_dimensions(), ProcessLib::HeatTransportBHE::SecondaryData< ShapeMatrixType >::N, and MaterialLib::Solids::selectSolidConstitutiveRelation().

Member Function Documentation

◆ assemble()

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

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

References OGS_FATAL.

◆ assembleWithJacobian()

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

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 241 of file SmallDeformationFEM.h.

249  {
250  auto const local_matrix_size = local_x.size();
251 
252  auto local_Jac = MathLib::createZeroedMatrix<StiffnessMatrixType>(
253  local_Jac_data, local_matrix_size, local_matrix_size);
254 
255  auto local_b = MathLib::createZeroedVector<NodalDisplacementVectorType>(
256  local_b_data, local_matrix_size);
257 
258  unsigned const n_integration_points =
259  _integration_method.getNumberOfPoints();
260 
261  MPL::VariableArray variables_prev;
262  MPL::VariableArray variables;
264  x_position.setElementID(_element.getID());
265 
266  auto const& b = _process_data.specific_body_force;
267 
268  for (unsigned ip = 0; ip < n_integration_points; ip++)
269  {
270  x_position.setIntegrationPoint(ip);
271  auto const& w = _ip_data[ip].integration_weight;
272  auto const& N = _ip_data[ip].N;
273  auto const& dNdx = _ip_data[ip].dNdx;
274 
275  typename ShapeMatricesType::template MatrixType<DisplacementDim,
277  N_u_op = ShapeMatricesType::template MatrixType<
278  DisplacementDim,
279  displacement_size>::Zero(DisplacementDim,
281  for (int i = 0; i < DisplacementDim; ++i)
282  {
283  N_u_op
284  .template block<1, displacement_size / DisplacementDim>(
285  i, i * displacement_size / DisplacementDim)
286  .noalias() = N;
287  }
288 
289  auto const x_coord =
290  NumLib::interpolateXCoordinate<ShapeFunction,
292  auto const B = LinearBMatrix::computeBMatrix<
293  DisplacementDim, ShapeFunction::NPOINTS,
294  typename BMatricesType::BMatrixType>(dNdx, N, x_coord,
296 
297  auto const& eps_prev = _ip_data[ip].eps_prev;
298  auto const& sigma_prev = _ip_data[ip].sigma_prev;
299 
300  auto& eps = _ip_data[ip].eps;
301  auto& sigma = _ip_data[ip].sigma;
302  auto& state = _ip_data[ip].material_state_variables;
303 
304  eps.noalias() =
305  B *
306  Eigen::Map<typename BMatricesType::NodalForceVectorType const>(
307  local_x.data(), ShapeFunction::NPOINTS * DisplacementDim);
308 
309  variables_prev[static_cast<int>(MPL::Variable::stress)]
310  .emplace<
312  sigma_prev);
313  variables_prev[static_cast<int>(MPL::Variable::mechanical_strain)]
314  .emplace<
316  eps_prev);
317 
318  double const T_ref =
319  _process_data.reference_temperature
320  ? (*_process_data.reference_temperature)(t, x_position)[0]
321  : std::numeric_limits<double>::quiet_NaN();
322 
323  variables_prev[static_cast<int>(MPL::Variable::temperature)]
324  .emplace<double>(T_ref);
325  variables[static_cast<int>(MPL::Variable::mechanical_strain)]
326  .emplace<
328  eps);
329  variables[static_cast<int>(MPL::Variable::temperature)]
330  .emplace<double>(T_ref);
331 
332  auto&& solution = _ip_data[ip].solid_material.integrateStress(
333  variables_prev, variables, t, x_position, dt, *state);
334 
335  if (!solution)
336  {
337  OGS_FATAL("Computation of local constitutive relation failed.");
338  }
339 
341  std::tie(sigma, state, C) = std::move(*solution);
342 
343  auto const rho = _process_data.solid_density(t, x_position)[0];
344  local_b.noalias() -=
345  (B.transpose() * sigma - N_u_op.transpose() * rho * b) * w;
346  local_Jac.noalias() += B.transpose() * C * B * w;
347  }
348  }
virtual std::size_t getID() const final
Returns the ID of the element.
Definition: Element.h:82
void setElementID(std::size_t element_id)
void setIntegrationPoint(unsigned integration_point)
MatrixType< _kelvin_vector_size, _number_of_dof > BMatrixType
Definition: BMatrixPolicy.h:55
@ rho
density. For some models, rho substitutes p
std::array< VariableType, static_cast< int >(Variable::number_of_variables)> VariableArray
Definition: VariableType.h:108
Eigen::Matrix< double, kelvin_vector_dimensions(DisplacementDim), 1, Eigen::ColMajor > KelvinVectorType
Definition: KelvinVector.h:48
Eigen::Matrix< double, kelvin_vector_dimensions(DisplacementDim), kelvin_vector_dimensions(DisplacementDim), Eigen::RowMajor > KelvinMatrixType
Definition: KelvinVector.h:56
double interpolateXCoordinate(MeshLib::Element const &e, typename ShapeMatricesType::ShapeMatrices::ShapeType const &N)
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.
Definition: LinearBMatrix.h:42

References ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::_element, ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::_integration_method, ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::_ip_data, ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::_is_axially_symmetric, ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::_process_data, ProcessLib::LinearBMatrix::computeBMatrix(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::displacement_size, MeshLib::Element::getID(), NumLib::interpolateXCoordinate(), OGS_FATAL, ParameterLib::SpatialPosition::setElementID(), ParameterLib::SpatialPosition::setIntegrationPoint(), and MaterialPropertyLib::temperature.

◆ computeSecondaryVariableConcrete()

template<typename ShapeFunction , typename IntegrationMethod , int DisplacementDim>
void ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::computeSecondaryVariableConcrete ( double const  ,
double const  ,
Eigen::VectorXd const &  ,
Eigen::VectorXd const &   
)
inlineoverridevirtual

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 462 of file SmallDeformationFEM.h.

465  {
466  int const elem_id = _element.getID();
468  x_position.setElementID(elem_id);
469  unsigned const n_integration_points =
470  _integration_method.getNumberOfPoints();
471 
472  auto sigma_sum = MathLib::KelvinVector::tensorToKelvin<DisplacementDim>(
473  Eigen::Matrix<double, 3, 3>::Zero());
474 
475  for (unsigned ip = 0; ip < n_integration_points; ip++)
476  {
477  x_position.setIntegrationPoint(ip);
478  auto const& sigma = _ip_data[ip].sigma;
479  sigma_sum += sigma;
480  }
481 
482  Eigen::Matrix<double, 3, 3, 0, 3, 3> const sigma_avg =
484  n_integration_points;
485 
486  Eigen::SelfAdjointEigenSolver<Eigen::Matrix<double, 3, 3>> e_s(
487  sigma_avg);
488 
489  Eigen::Map<Eigen::Vector3d>(
490  &(*_process_data.principal_stress_values)[elem_id * 3], 3) =
491  e_s.eigenvalues();
492 
493  auto eigen_vectors = e_s.eigenvectors();
494 
495  for (auto i = 0; i < 3; i++)
496  {
497  Eigen::Map<Eigen::Vector3d>(
498  &(*_process_data.principal_stress_vector[i])[elem_id * 3], 3) =
499  eigen_vectors.col(i);
500  }
501  }
Eigen::Matrix< double, 3, 3 > kelvinVectorToTensor(Eigen::Matrix< double, 4, 1, Eigen::ColMajor, 4, 1 > const &v)

References ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::_element, ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::_integration_method, ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::_ip_data, ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::_process_data, MeshLib::Element::getID(), MathLib::KelvinVector::kelvinVectorToTensor(), ParameterLib::SpatialPosition::setElementID(), and ParameterLib::SpatialPosition::setIntegrationPoint().

◆ getIntPtEpsilon()

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

◆ getIntPtFreeEnergyDensity()

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

Implements ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >.

Definition at line 399 of file SmallDeformationFEM.h.

404  {
405  cache.clear();
406  cache.reserve(_ip_data.size());
407 
408  transform(
409  cbegin(_ip_data), cend(_ip_data), back_inserter(cache),
410  [](auto const& ip_data) { return ip_data.free_energy_density; });
411 
412  return cache;
413  }

References ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::_ip_data.

◆ getIntPtSigma()

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

◆ getMaterialForces()

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

Implements ProcessLib::SmallDeformation::MaterialForcesInterface.

Definition at line 378 of file SmallDeformationFEM.h.

381  {
383  DisplacementDim, ShapeFunction, ShapeMatricesType,
386  GradientMatrixType>(local_x, nodal_values, _integration_method,
388  }
VectorType< _number_of_dof > NodalForceVectorType
Rhs residual.
Definition: BMatrixPolicy.h:44
typename GMatricesType::GradientMatrixType GradientMatrixType
typename GMatricesType::GradientVectorType GradientVectorType
typename BMatricesType::NodalForceVectorType NodalDisplacementVectorType
std::vector< double > const & getMaterialForces(std::vector< double > const &local_x, std::vector< double > &nodal_values, IntegrationMethod const &_integration_method, IPData const &_ip_data, MeshLib::Element const &element, bool const is_axially_symmetric)

References ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::_element, ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::_integration_method, ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::_ip_data, ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::_is_axially_symmetric, and ProcessLib::SmallDeformation::getMaterialForces().

◆ getMaterialStateVariablesAt()

template<typename ShapeFunction , typename IntegrationMethod , int DisplacementDim>
MaterialLib::Solids::MechanicsBase< DisplacementDim>::MaterialStateVariables const& ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::getMaterialStateVariablesAt ( unsigned  integration_point) const
inlineoverridevirtual

◆ getNumberOfIntegrationPoints()

template<typename ShapeFunction , typename IntegrationMethod , int DisplacementDim>
unsigned ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::getNumberOfIntegrationPoints ( ) const
inlineoverridevirtual

◆ getShapeMatrix()

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

Provides the shape matrix at the given integration point.

Implements NumLib::ExtrapolatableElement.

Definition at line 390 of file SmallDeformationFEM.h.

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

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

◆ getSigma()

template<typename ShapeFunction , typename IntegrationMethod , int DisplacementDim>
std::vector<double> ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::getSigma ( ) const
inlineoverridevirtual

◆ initializeConcrete()

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

Set initial stress from parameter.

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 199 of file SmallDeformationFEM.h.

200  {
201  unsigned const n_integration_points =
202  _integration_method.getNumberOfPoints();
203  for (unsigned ip = 0; ip < n_integration_points; ip++)
204  {
205  auto& ip_data = _ip_data[ip];
206 
208  if (_process_data.initial_stress != nullptr)
209  {
210  ParameterLib::SpatialPosition const x_position{
211  std::nullopt, _element.getID(), ip,
213  NumLib::interpolateCoordinates<ShapeFunction,
215  _element, ip_data.N))};
216 
217  ip_data.sigma =
219  DisplacementDim>((*_process_data.initial_stress)(
220  std::numeric_limits<
221  double>::quiet_NaN() /* time independent */,
222  x_position));
223  }
224 
225  ip_data.pushBackState();
226  }
227  }
Eigen::Matrix< double, Eigen::MatrixBase< Derived >::RowsAtCompileTime, 1 > symmetricTensorToKelvinVector(Eigen::MatrixBase< Derived > const &v)
Definition: KelvinVector.h:170
MathLib::TemplatePoint< double, 3 > Point3d
std::array< double, 3 > interpolateCoordinates(MeshLib::Element const &e, typename ShapeMatricesType::ShapeMatrices::ShapeType const &N)

References ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::_element, ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::_integration_method, ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::_ip_data, ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::_process_data, MeshLib::Element::getID(), NumLib::interpolateCoordinates(), and MathLib::KelvinVector::symmetricTensorToKelvinVector().

◆ postTimestepConcrete()

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

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 350 of file SmallDeformationFEM.h.

352  {
353  unsigned const n_integration_points =
354  _integration_method.getNumberOfPoints();
355 
356  for (unsigned ip = 0; ip < n_integration_points; ip++)
357  {
358  _ip_data[ip].pushBackState();
359  }
360 
362  x_position.setElementID(_element.getID());
363 
364  for (unsigned ip = 0; ip < n_integration_points; ip++)
365  {
366  x_position.setIntegrationPoint(ip);
367 
368  auto& ip_data = _ip_data[ip];
369 
370  // Update free energy density needed for material forces.
371  ip_data.free_energy_density =
372  ip_data.solid_material.computeFreeEnergyDensity(
373  t, x_position, dt, ip_data.eps, ip_data.sigma,
374  *ip_data.material_state_variables);
375  }
376  }

References ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::_element, ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::_integration_method, ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::_ip_data, MeshLib::Element::getID(), ParameterLib::SpatialPosition::setElementID(), and ParameterLib::SpatialPosition::setIntegrationPoint().

◆ setIPDataInitialConditions()

template<typename ShapeFunction , typename IntegrationMethod , int DisplacementDim>
std::size_t ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::setIPDataInitialConditions ( std::string const &  name,
double const *  values,
int const  integration_order 
)
inlineoverridevirtual

Returns number of read integration points.

Implements ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >.

Definition at line 169 of file SmallDeformationFEM.h.

172  {
173  if (integration_order !=
174  static_cast<int>(_integration_method.getIntegrationOrder()))
175  {
176  OGS_FATAL(
177  "Setting integration point initial conditions; The integration "
178  "order of the local assembler for element {:d} is different "
179  "from the integration order in the initial condition.",
180  _element.getID());
181  }
182 
183  if (name == "sigma_ip")
184  {
185  if (_process_data.initial_stress != nullptr)
186  {
187  OGS_FATAL(
188  "Setting initial conditions for stress from integration "
189  "point data and from a parameter '{:s}' is not possible "
190  "simultaneously.",
191  _process_data.initial_stress->name);
192  }
193  return setSigma(values);
194  }
195 
196  return 0;
197  }

References ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::_element, ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::_integration_method, ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::_process_data, MeshLib::Element::getID(), MaterialPropertyLib::name, OGS_FATAL, and ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::setSigma().

◆ setSigma()

template<typename ShapeFunction , typename IntegrationMethod , int DisplacementDim>
std::size_t ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::setSigma ( double const *  values)
inline

Member Data Documentation

◆ _element

◆ _integration_method

◆ _ip_data

template<typename ShapeFunction , typename IntegrationMethod , int DisplacementDim>
std::vector<IpData, Eigen::aligned_allocator<IpData> > ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::_ip_data
private

Definition at line 506 of file SmallDeformationFEM.h.

Referenced by ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::SmallDeformationLocalAssembler(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::assembleWithJacobian(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::getIntPtEpsilon(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::getIntPtFreeEnergyDensity(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::getIntPtSigma(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::getMaterialForces(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::getMaterialStateVariablesAt(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::getSigma(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::initializeConcrete(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::postTimestepConcrete(), and ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::setSigma().

◆ _is_axially_symmetric

◆ _process_data

◆ _secondary_data

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

◆ displacement_size

template<typename ShapeFunction , typename IntegrationMethod , int DisplacementDim>
const int ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::displacement_size
staticprivate

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