44 GradientVectorType
const& F,
55 Eigen::MatrixXd
const F_matrix =
57 .template topLeftCorner<DisplacementDim, DisplacementDim>();
58 auto const Finv = F_matrix.inverse();
60 VectorTypeForFbar FInvN =
61 VectorTypeForFbar::Zero(DisplacementDim * NPOINTS);
62 for (
int i = 0; i < NPOINTS; ++i)
64 auto const dNidx = dNdx.col(i);
65 for (
int k = 0; k < DisplacementDim; k++)
67 FInvN[k * NPOINTS + i] = Finv.col(k).dot(dNidx);
78 std::vector<IpData, Eigen::aligned_allocator<IpData>>
const& ip_data,
79 bool const compute_detF0_only, Eigen::VectorXd
const& u,
83 unsigned const n_integration_points =
87 for (
unsigned ip = 0; ip < n_integration_points; ip++)
89 auto const& w = ip_data[ip].integration_weight;
93 VectorTypeForFbar averaged_grad_N =
94 VectorTypeForFbar::Zero(DisplacementDim * ShapeFunction::NPOINTS);
95 NodalVectorType averaged_N_div_r;
96 if (is_axially_symmetric)
98 averaged_N_div_r = NodalVectorType::Zero(ShapeFunction::NPOINTS);
101 GradientVectorType F0 =
104 for (
unsigned i = 0; i < ShapeFunction::NPOINTS; i++)
106 Eigen::Vector3d
const bar_gradN =
108 ShapeMatricesType, IpData>(
109 i, element, integration_method, ip_data, is_axially_symmetric) /
111 averaged_grad_N.template segment<DisplacementDim>(i * DisplacementDim) =
112 bar_gradN.template segment<DisplacementDim>(0);
114 for (
int k = 0; k < DisplacementDim; k++)
116 F0.template segment<DisplacementDim>(k * DisplacementDim) +=
117 u[k * ShapeFunction::NPOINTS + i] *
118 bar_gradN.template segment<DisplacementDim>(0);
120 if (is_axially_symmetric)
122 averaged_N_div_r[i] = bar_gradN[2];
123 F0[4] += bar_gradN[2] * u[i];
127 if (compute_detF0_only)
132 VectorTypeForFbar F0InvN =
133 VectorTypeForFbar::Zero(DisplacementDim * ShapeFunction::NPOINTS);
135 Eigen::MatrixXd
const F_matrix =
137 .template topLeftCorner<DisplacementDim, DisplacementDim>();
138 auto const Finv = F_matrix.inverse();
140 for (
unsigned i = 0; i < ShapeFunction::NPOINTS; ++i)
142 auto const dNidx = averaged_grad_N.template segment<DisplacementDim>(
143 i * DisplacementDim);
144 for (
int k = 0; k < DisplacementDim; k++)
146 F0InvN[k * ShapeFunction::NPOINTS + i] = Finv.col(k).dot(dNidx);
158 bool const compute_detF0_only, Eigen::VectorXd
const& u,
161 auto const shape_matrices_at_element_center =
163 ShapeFunction, ShapeMatricesType, DisplacementDim>(
164 element, is_axially_symmetric);
166 auto const N_0 = shape_matrices_at_element_center.N;
167 auto const dNdx_0 = shape_matrices_at_element_center.dNdx;
171 GradientMatrixType G0(
172 DisplacementDim * DisplacementDim + (DisplacementDim == 2 ? 1 : 0),
173 ShapeFunction::NPOINTS * DisplacementDim);
179 dNdx_0, G0, is_axially_symmetric, N_0, x_coord);
181 GradientVectorType
const grad_u = G0 * u;
182 GradientVectorType
const F0 =
185 if (compute_detF0_only)
190 VectorTypeForFbar F0InvN =
192 VectorTypeForFbar, GradientVectorType,
193 typename ShapeMatricesType::GlobalDimNodalMatrixType>(
194 dNdx_0, F0, is_axially_symmetric);
Eigen::Vector3d averageGradShapeFunction(int const local_node_id, MeshLib::Element const &element, NumLib::GenericIntegrationMethod const &integration_method, std::vector< IpData, Eigen::aligned_allocator< IpData > > const &ip_data, const bool is_axially_symmetric)
std::tuple< double, VectorTypeForFbar > computeFBarInitialVariablesAverage(std::vector< IpData, Eigen::aligned_allocator< IpData > > const &ip_data, bool const compute_detF0_only, Eigen::VectorXd const &u, NumLib::GenericIntegrationMethod const &integration_method, MeshLib::Element const &element, bool const is_axially_symmetric)