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 &, 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, 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 &  ,
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.

248  {
249  auto const local_matrix_size = local_x.size();
250 
251  auto local_Jac = MathLib::createZeroedMatrix<StiffnessMatrixType>(
252  local_Jac_data, local_matrix_size, local_matrix_size);
253 
254  auto local_b = MathLib::createZeroedVector<NodalDisplacementVectorType>(
255  local_b_data, local_matrix_size);
256 
257  unsigned const n_integration_points =
258  _integration_method.getNumberOfPoints();
259 
260  MPL::VariableArray variables_prev;
261  MPL::VariableArray variables;
263  x_position.setElementID(_element.getID());
264 
265  auto const& b = _process_data.specific_body_force;
266 
267  for (unsigned ip = 0; ip < n_integration_points; ip++)
268  {
269  x_position.setIntegrationPoint(ip);
270  auto const& w = _ip_data[ip].integration_weight;
271  auto const& N = _ip_data[ip].N;
272  auto const& dNdx = _ip_data[ip].dNdx;
273 
274  typename ShapeMatricesType::template MatrixType<DisplacementDim,
276  N_u_op = ShapeMatricesType::template MatrixType<
277  DisplacementDim,
278  displacement_size>::Zero(DisplacementDim,
280  for (int i = 0; i < DisplacementDim; ++i)
281  {
282  N_u_op
283  .template block<1, displacement_size / DisplacementDim>(
284  i, i * displacement_size / DisplacementDim)
285  .noalias() = N;
286  }
287 
288  auto const x_coord =
289  NumLib::interpolateXCoordinate<ShapeFunction,
291  auto const B = LinearBMatrix::computeBMatrix<
292  DisplacementDim, ShapeFunction::NPOINTS,
293  typename BMatricesType::BMatrixType>(dNdx, N, x_coord,
295 
296  auto const& eps_prev = _ip_data[ip].eps_prev;
297  auto const& sigma_prev = _ip_data[ip].sigma_prev;
298 
299  auto& eps = _ip_data[ip].eps;
300  auto& sigma = _ip_data[ip].sigma;
301  auto& state = _ip_data[ip].material_state_variables;
302 
303  eps.noalias() =
304  B *
305  Eigen::Map<typename BMatricesType::NodalForceVectorType const>(
306  local_x.data(), ShapeFunction::NPOINTS * DisplacementDim);
307 
308  variables_prev[static_cast<int>(MPL::Variable::stress)]
309  .emplace<
311  sigma_prev);
312  variables_prev[static_cast<int>(MPL::Variable::mechanical_strain)]
313  .emplace<
315  eps_prev);
316 
317  double const T_ref =
318  _process_data.reference_temperature
319  ? (*_process_data.reference_temperature)(t, x_position)[0]
320  : std::numeric_limits<double>::quiet_NaN();
321 
322  variables_prev[static_cast<int>(MPL::Variable::temperature)]
323  .emplace<double>(T_ref);
324  variables[static_cast<int>(MPL::Variable::mechanical_strain)]
325  .emplace<
327  eps);
328  variables[static_cast<int>(MPL::Variable::temperature)]
329  .emplace<double>(T_ref);
330 
331  auto&& solution = _ip_data[ip].solid_material.integrateStress(
332  variables_prev, variables, t, x_position, dt, *state);
333 
334  if (!solution)
335  {
336  OGS_FATAL("Computation of local constitutive relation failed.");
337  }
338 
340  std::tie(sigma, state, C) = std::move(*solution);
341 
342  auto const rho = _process_data.solid_density(t, x_position)[0];
343  local_b.noalias() -=
344  (B.transpose() * sigma - N_u_op.transpose() * rho * b) * w;
345  local_Jac.noalias() += B.transpose() * C * B * w;
346  }
347  }
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
static const double t
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(), MathLib::t, 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 461 of file SmallDeformationFEM.h.

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

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

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 377 of file SmallDeformationFEM.h.

380  {
382  DisplacementDim, ShapeFunction, ShapeMatricesType,
385  GradientMatrixType>(local_x, nodal_values, _integration_method,
387  }
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 389 of file SmallDeformationFEM.h.

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

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 349 of file SmallDeformationFEM.h.

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

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(), ParameterLib::SpatialPosition::setIntegrationPoint(), and MathLib::t.

◆ 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 505 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: