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();
185 Eigen::Ref<Eigen::VectorXd const>
const& u,
186 Eigen::Ref<Eigen::VectorXd const>
const& u_prev,
202 ? (*this->
process_data_.reference_temperature)(t, x_position)[0]
203 : std::numeric_limits<double>::quiet_NaN();
220 models, t, dt, x_position,
225 current_state, prev_state, material_state, tmp, CD);
231 std::vector<double>
const& ,
232 std::vector<double>
const& ,
233 std::vector<double>& ,
234 std::vector<double>& ,
235 std::vector<double>& )
override
238 "LargeDeformationLocalAssembler: assembly without jacobian is not "
243 std::vector<double>
const& local_x,
244 std::vector<double>
const& local_x_prev,
245 std::vector<double>& local_b_data,
246 std::vector<double>& local_Jac_data)
override
248 auto const local_matrix_size = local_x.size();
251 local_Jac_data, local_matrix_size, local_matrix_size);
254 local_b_data, local_matrix_size);
257 auto [u_prev] =
localDOF(local_x_prev);
259 unsigned const n_integration_points =
266 constitutive_setting;
270 for (
unsigned ip = 0; ip < n_integration_points; ip++)
273 auto const& w =
_ip_data[ip].integration_weight;
275 auto const& dNdx =
_ip_data[ip].dNdx;
285 (DisplacementDim == 2 ? 1 : 0),
286 ShapeFunction::NPOINTS * DisplacementDim);
288 ShapeFunction::NPOINTS>(
294 DisplacementDim, ShapeFunction::NPOINTS,
299 DisplacementDim, ShapeFunction::NPOINTS,
304 B_0 + 0.5 * B_N, G, grad_u, u, u_prev, x_position, t, dt,
309 auto const B = B_0 + B_N;
312 auto const& b = *CD.volumetric_body_force;
313 auto const& C = CD.s_mech_data.stiffness_tensor;
316 (B.transpose() * sigma -
N_u_op(N).transpose() * b) * w;
318 auto const sigma_geom =
322 local_Jac.noalias() += G.transpose() * sigma_geom * G * w;
324 local_Jac.noalias() += B.transpose() * C * B * w;
329 Eigen::VectorXd
const& local_x_prev,
330 double const t,
double const dt,
333 unsigned const n_integration_points =
340 constitutive_setting;
345 for (
unsigned ip = 0; ip < n_integration_points; ip++)
349 auto const& dNdx =
_ip_data[ip].dNdx;
358 (DisplacementDim == 2 ? 1 : 0),
359 ShapeFunction::NPOINTS * DisplacementDim);
361 ShapeFunction::NPOINTS>(
368 DisplacementDim, ShapeFunction::NPOINTS,
373 DisplacementDim, ShapeFunction::NPOINTS,
375 dNdx, N, grad_u, x_coord,
379 B, G, grad_u, local_x, local_x_prev, x_position, t, dt,
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 auto identity()
constexpr Eigen::CwiseNullaryOp< EigenBlockMatrixViewFunctor< D, M >, typename EigenBlockMatrixViewFunctor< D, M >::Matrix > eigenBlockMatrixView(const Eigen::MatrixBase< M > &matrix)
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)
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