36 GradientVectorType
const& F,
47 Eigen::MatrixXd
const F_matrix =
49 .template topLeftCorner<DisplacementDim, DisplacementDim>();
50 auto const Finv = F_matrix.inverse();
52 VectorTypeForFbar FInvN =
53 VectorTypeForFbar::Zero(DisplacementDim * NPOINTS);
54 for (
int i = 0; i < NPOINTS; ++i)
56 auto const dNidx = dNdx.col(i);
57 for (
int k = 0; k < DisplacementDim; k++)
59 FInvN[k * NPOINTS + i] = Finv.col(k).dot(dNidx);
70 std::vector<IpData, Eigen::aligned_allocator<IpData>>
const& ip_data,
71 bool const compute_detF0_only, Eigen::VectorXd
const& u,
75 unsigned const n_integration_points =
79 for (
unsigned ip = 0; ip < n_integration_points; ip++)
81 auto const& w = ip_data[ip].integration_weight;
85 VectorTypeForFbar averaged_grad_N =
86 VectorTypeForFbar::Zero(DisplacementDim * ShapeFunction::NPOINTS);
87 NodalVectorType averaged_N_div_r;
88 if (is_axially_symmetric)
90 averaged_N_div_r = NodalVectorType::Zero(ShapeFunction::NPOINTS);
93 GradientVectorType F0 =
96 for (
unsigned i = 0; i < ShapeFunction::NPOINTS; i++)
98 Eigen::Vector3d
const bar_gradN =
100 ShapeMatricesType, IpData>(
101 i, element, integration_method, ip_data, is_axially_symmetric) /
103 averaged_grad_N.template segment<DisplacementDim>(i * DisplacementDim) =
104 bar_gradN.template segment<DisplacementDim>(0);
106 for (
int k = 0; k < DisplacementDim; k++)
108 F0.template segment<DisplacementDim>(k * DisplacementDim) +=
109 u[k * ShapeFunction::NPOINTS + i] *
110 bar_gradN.template segment<DisplacementDim>(0);
112 if (is_axially_symmetric)
114 averaged_N_div_r[i] = bar_gradN[2];
115 F0[4] += bar_gradN[2] * u[i];
119 if (compute_detF0_only)
124 VectorTypeForFbar F0InvN =
125 VectorTypeForFbar::Zero(DisplacementDim * ShapeFunction::NPOINTS);
127 Eigen::MatrixXd
const F_matrix =
129 .template topLeftCorner<DisplacementDim, DisplacementDim>();
130 auto const Finv = F_matrix.inverse();
132 for (
unsigned i = 0; i < ShapeFunction::NPOINTS; ++i)
134 auto const dNidx = averaged_grad_N.template segment<DisplacementDim>(
135 i * DisplacementDim);
136 for (
int k = 0; k < DisplacementDim; k++)
138 F0InvN[k * ShapeFunction::NPOINTS + i] = Finv.col(k).dot(dNidx);
150 bool const compute_detF0_only, Eigen::VectorXd
const& u,
153 auto const shape_matrices_at_element_center =
156 element, is_axially_symmetric);
158 auto const N_0 = shape_matrices_at_element_center.N;
159 auto const dNdx_0 = shape_matrices_at_element_center.dNdx;
163 GradientMatrixType G0(
164 DisplacementDim * DisplacementDim + (DisplacementDim == 2 ? 1 : 0),
165 ShapeFunction::NPOINTS * DisplacementDim);
171 dNdx_0, G0, is_axially_symmetric, N_0, x_coord);
173 GradientVectorType
const grad_u = G0 * u;
174 GradientVectorType
const F0 =
177 if (compute_detF0_only)
182 VectorTypeForFbar F0InvN =
184 VectorTypeForFbar, GradientVectorType,
185 typename ShapeMatricesType::GlobalDimNodalMatrixType>(
186 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)