39namespace LargeDeformation
45template <
typename ShapeMatrixType>
48 std::vector<ShapeMatrixType, Eigen::aligned_allocator<ShapeMatrixType>>
N;
51template <
int DisplacementDim,
typename ShapeMatricesType>
58 Eigen::Matrix<double, DisplacementDim, DisplacementDim>>;
60 using SigmaGeom = Eigen::Matrix<double,
MPL::tensorSize(DisplacementDim),
62 if constexpr (DisplacementDim == 2)
64 SigmaGeom sigma_geom = SigmaGeom::Zero(5, 5);
65 sigma_geom.template block<4, 4>(0, 0) =
66 sigma_geom_op(sigma_tensor.template block<2, 2>(0, 0).eval());
67 sigma_geom(4, 4) = sigma_tensor(2, 2);
72 if constexpr (DisplacementDim == 3)
74 return sigma_geom_op(sigma_tensor);
78template <
typename ShapeFunction,
int DisplacementDim>
113 bool const is_axially_symmetric,
116 e, integration_method, is_axially_symmetric, process_data)
118 unsigned const n_integration_points =
121 _ip_data.resize(n_integration_points);
124 auto const shape_matrices =
129 for (
unsigned ip = 0; ip < n_integration_points; ip++)
132 auto const& sm = shape_matrices[ip];
135 sm.integralMeasure * sm.detJ;
138 ip_data.dNdx = sm.dNdx;
146 unsigned const n_integration_points =
148 for (
unsigned ip = 0; ip < n_integration_points; ip++)
166 double>::quiet_NaN() ,
173 t, x_position, *material_state.material_state_variables);
175 material_state.pushBackState();
182 Eigen::Ref<Eigen::VectorXd const>
const& u,
183 Eigen::Ref<Eigen::VectorXd const>
const& u_prev,
199 auto const& N = ip_data.
N;
200 auto const& dNdx = ip_data.
dNdx;
202 NumLib::interpolateXCoordinate<ShapeFunction, ShapeMatricesType>(
208 DisplacementDim * DisplacementDim + (DisplacementDim == 2 ? 1 : 0),
209 ShapeFunction::NPOINTS * DisplacementDim);
210 Deformation::computeGMatrix<DisplacementDim, ShapeFunction::NPOINTS>(
217 ShapeFunction::NPOINTS,
222 DisplacementDim, ShapeFunction::NPOINTS,
226 auto const B = B_0 + 0.5 * B_N;
230 ? (*this->
process_data_.reference_temperature)(t, x_position)[0]
231 : std::numeric_limits<double>::quiet_NaN();
241 grad_u + MathLib::VectorizedTensor::identity<DisplacementDim>();
247 models, t, dt, x_position,
251 G * u_prev + MathLib::VectorizedTensor::identity<DisplacementDim>(),
252 current_state, prev_state, material_state, tmp, CD);
258 std::vector<double>
const& ,
259 std::vector<double>
const& ,
260 std::vector<double>& ,
261 std::vector<double>& ,
262 std::vector<double>& )
override
265 "LargeDeformationLocalAssembler: assembly without jacobian is not "
270 std::vector<double>
const& local_x,
271 std::vector<double>
const& local_x_prev,
272 std::vector<double>& ,
273 std::vector<double>& ,
274 std::vector<double>& local_b_data,
275 std::vector<double>& local_Jac_data)
override
277 auto const local_matrix_size = local_x.size();
279 auto local_Jac = MathLib::createZeroedMatrix<StiffnessMatrixType>(
280 local_Jac_data, local_matrix_size, local_matrix_size);
282 auto local_b = MathLib::createZeroedVector<NodalDisplacementVectorType>(
283 local_b_data, local_matrix_size);
286 auto [u_prev] =
localDOF(local_x_prev);
288 unsigned const n_integration_points =
295 constitutive_setting;
299 for (
unsigned ip = 0; ip < n_integration_points; ip++)
302 auto const& w =
_ip_data[ip].integration_weight;
304 auto const& dNdx =
_ip_data[ip].dNdx;
314 (DisplacementDim == 2 ? 1 : 0),
315 ShapeFunction::NPOINTS * DisplacementDim);
317 ShapeFunction::NPOINTS>(
323 DisplacementDim, ShapeFunction::NPOINTS,
328 DisplacementDim, ShapeFunction::NPOINTS,
332 auto const B = B_0 + B_N;
335 u, u_prev, x_position, t, dt,
_ip_data[ip],
341 auto const& b = *CD.volumetric_body_force;
342 auto const& C = CD.s_mech_data.stiffness_tensor;
345 (B.transpose() * sigma -
N_u_op(N).transpose() * b) * w;
347 auto const sigma_geom =
348 computeSigmaGeom<DisplacementDim, ShapeMatricesType>(
351 local_Jac.noalias() += G.transpose() * sigma_geom * G * w;
353 local_Jac.noalias() += B.transpose() * C * B * w;
358 Eigen::VectorXd
const& local_x_prev,
359 double const t,
double const dt,
362 unsigned const n_integration_points =
369 constitutive_setting;
374 for (
unsigned ip = 0; ip < n_integration_points; ip++)
379 local_x, local_x_prev, x_position, t, dt,
_ip_data[ip],
387 for (
unsigned ip = 0; ip < n_integration_points; ip++)
394 const unsigned integration_point)
const override
399 return Eigen::Map<const Eigen::RowVectorXd>(N.data(), N.size());
403 static constexpr auto localDOF(std::vector<double>
const& x)
410 std::vector<IpData, Eigen::aligned_allocator<IpData>>
_ip_data;
415 ShapeFunction::NPOINTS * DisplacementDim;
std::size_t getID() const
Returns the ID of the element.
MathLib::WeightedPoint const & getWeightedPoint(unsigned const igp) const
unsigned getNumberOfPoints() const
void setElementID(std::size_t element_id)
void setIntegrationPoint(unsigned integration_point)
MatrixType< _kelvin_vector_size, _number_of_dof > BMatrixType
MatrixType< _number_of_dof, _number_of_dof > StiffnessMatrixType
VectorType< _number_of_dof > NodalForceVectorType
Rhs residual.
VectorTypeFixedSize< MathLib::VectorizedTensor::size(DisplacementDim)> GradientVectorType
MatrixType< MathLib::VectorizedTensor::size(DisplacementDim), _number_of_dof > GradientMatrixType
constexpr int tensorSize(int dim)
See Tensor type for details.
Eigen::Matrix< double, Eigen::MatrixBase< Derived >::RowsAtCompileTime, 1 > symmetricTensorToKelvinVector(Eigen::MatrixBase< Derived > const &v)
Eigen::Matrix< double, 3, 3 > kelvinVectorToTensor(Eigen::Matrix< double, 4, 1, Eigen::ColMajor, 4, 1 > const &v)
double determinant(Eigen::MatrixBase< Derived > const &tensor)
Computes determinant of a vectorized tensor.
constexpr Eigen::CwiseNullaryOp< EigenBlockMatrixViewFunctor< D, M >, typename EigenBlockMatrixViewFunctor< D, M >::Matrix > eigenBlockMatrixView(const Eigen::MatrixBase< M > &matrix)
double interpolateXCoordinate(MeshLib::Element const &e, typename ShapeMatricesType::ShapeMatrices::ShapeType const &N)
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)
auto localDOF(ElementDOFVector const &x)
std::array< double, 3 > interpolateCoordinates(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.
BMatrixType computeBMatrix(DNDX_Type const &dNdx, N_Type const &N, GradientVectorType const &grad_u, const double radius, const bool is_axially_symmetric)
NumLib::ShapeMatrices< NodalRowVectorType, DimNodalMatrixType, DimMatrixType, GlobalDimNodalMatrixType > ShapeMatrices
MatrixType< ShapeFunction::NPOINTS, ShapeFunction::NPOINTS > NodalMatrixType
VectorType< ShapeFunction::NPOINTS > NodalVectorType
RowVectorType< ShapeFunction::NPOINTS > NodalRowVectorType
std::vector< ShapeMatrixType, Eigen::aligned_allocator< ShapeMatrixType > > N