231{
232 DBUG(
"Assemble EmbeddedAnchor.");
233
236
238 {
239 std::vector<GlobalIndexType> global_indices;
240 Eigen::Vector<double, 2 * GlobalDim> local_x;
241 std::vector<Eigen::RowVectorXd> shape_matrices;
242 std::array<std::size_t, 2> nodes_per_element;
245 anchor_element, nodes_per_element, shape_matrices, global_indices,
246 local_x, x, pos);
247
248 auto node_coords = [anchor_element](int const i)
249 { return anchor_element->getNode(i)->asEigenVector3d(); };
251 (node_coords(1) - node_coords(0)).template head<GlobalDim>();
252 double const l_original_norm = l_original.norm();
253
254
255 auto u = [&local_x](int const i)
258
261 (l.norm() - l_original_norm) /
262 l_original_norm;
263
265 l.transpose() / l.norm() / l_original_norm;
266
268 f, Df, shape_matrices, global_indices.size(), nodes_per_element);
269
270 b.
add(global_indices, local_rhs);
271 if (jac)
272 {
273 jac->
add({global_indices, global_indices}, local_Jac);
274 }
275 }
276}
int add(IndexType row, IndexType col, double val)
void add(IndexType rowId, double v)
add entry
std::vector< Element * > const & getElements() const
Get the element-vector for the mesh.
void getShapeMatricesAndGlobalIndicesAndDisplacements(MeshLib::Element const *const anchor_element, std::array< std::size_t, 2 > &nodes_per_element, std::vector< Eigen::RowVectorXd > &shape_matrices, std::vector< GlobalIndexType > &global_indices, Eigen::Vector< double, 2 *GlobalDim > &local_x, GlobalVector const &x, ParameterLib::SpatialPosition &pos) const
std::tuple< Eigen::VectorXd, Eigen::MatrixXd > assembleLocalBJac(Eigen::Vector< double, GlobalDim > const &f, Eigen::Matrix< double, GlobalDim, GlobalDim > const &Df, std::vector< Eigen::RowVectorXd > const &shape_matrices, std::size_t const num_dof, std::array< std::size_t, 2 > const &nodes_per_element)