28 result.setZero(targetDim(),u.cols());
34 geometryMap m_ori = ev.
getMap(*m_patches);
35 geometryMap m_def = ev.
getMap(*m_defpatches);
40 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorN> m_N0(m_materialMatrices,m_defpatches);
42 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorM> m_N1(m_materialMatrices,m_defpatches);
45 gsMaterialMatrixIntegrate<T,MaterialOutput::CauchyVectorN> m_Nc0(m_materialMatrices,m_defpatches);
47 gsMaterialMatrixIntegrate<T,MaterialOutput::CauchyVectorM> m_Nc1(m_materialMatrices,m_defpatches);
50 gsMaterialMatrixEval<T,MaterialOutput::StressN> m_S0(m_materialMatrices,m_defpatches,z);
52 gsMaterialMatrixEval<T,MaterialOutput::StressM> m_S1(m_materialMatrices,m_defpatches,z);
55 gsMaterialMatrixEval<T,MaterialOutput::CauchyStressN> m_Sc0(m_materialMatrices,m_defpatches,z);
57 gsMaterialMatrixEval<T,MaterialOutput::CauchyStressM> m_Sc1(m_materialMatrices,m_defpatches,z);
60 gsMaterialMatrixEval<T,MaterialOutput::PStress> m_Sp(m_materialMatrices,m_defpatches,z);
62 gsMaterialMatrixEval<T,MaterialOutput::PStressDir> m_pstressdir(m_materialMatrices,m_defpatches,z);
65 gsMaterialMatrixEval<T,MaterialOutput::PCauchyStressN> m_Sp0(m_materialMatrices,m_defpatches,z);
67 gsMaterialMatrixEval<T,MaterialOutput::PCauchyStressM> m_Sp1(m_materialMatrices,m_defpatches,z);
70 gsMaterialMatrixEval<T,MaterialOutput::PStrainN> m_Ep0(m_materialMatrices,m_defpatches,z);
72 gsMaterialMatrixEval<T,MaterialOutput::PStrainM> m_Ep1(m_materialMatrices,m_defpatches,z);
75 gsMaterialMatrixEval<real_t,MaterialOutput::TensionField> m_TF(m_materialMatrices,m_defpatches,z);
78 gsMaterialMatrixEval<T,MaterialOutput::Stretch> m_lambda(m_materialMatrices,m_defpatches,z);
80 gsMaterialMatrixEval<T,MaterialOutput::StretchDir> m_lambdadir(m_materialMatrices,m_defpatches,z);
88 auto That = cartcon(m_ori);
89 auto Ttilde = cartcov(m_ori);
90 auto Ttilde_def = cartcov(m_def);
92 auto E_m = 0.5 * ( flat(jac(m_def).tr()*jac(m_def)) - flat(jac(m_ori).tr()* jac(m_ori)) ) * reshape(m_m12,3,3) * That.tr();
93 auto E_f = ( expr::deriv2(m_ori,sn(m_ori).normalized().tr()) - expr::deriv2(m_def,sn(m_def).normalized().tr()) ) * reshape(m_m2,3,3) * That.tr();
95 auto N_m = N0.tr() * Ttilde.tr();
96 auto N_f = N1.tr() * Ttilde.tr();
98 auto Nc_m = Nc0.tr() * Ttilde_def.tr();
99 auto Nc_f = Nc1.tr() * Ttilde_def.tr();
101 auto S_m = S0.tr() * Ttilde.tr();
102 auto S_f = S1.tr() * Ttilde.tr();
104 auto Sc_m = Sc0.tr() * Ttilde_def.tr();
105 auto Sc_f = Sc1.tr() * Ttilde_def.tr();
109 switch (m_stress_type)
111 case stress_type::displacement :
112 for (
index_t k = 0; k != u.cols(); ++k)
113 result.col(k) = ev.
eval(m_def-m_ori,u.col(k),m_patchID);
117 for (
index_t k = 0; k != u.cols(); ++k)
118 result.col(k) = (ev.
eval(Sc_m,u.col(k),m_patchID)).transpose();
122 for (
index_t k = 0; k != u.cols(); ++k)
123 result.col(k) = (ev.
eval(Sc_f,u.col(k),m_patchID)).transpose();
127 for (
index_t k = 0; k != u.cols(); ++k)
128 result.col(k) = (ev.
eval(S_m,u.col(k),m_patchID)).transpose();
132 for (
index_t k = 0; k != u.cols(); ++k)
133 result.col(k) = (ev.
eval(S_f,u.col(k),m_patchID)).transpose();
137 for (
index_t k = 0; k != u.cols(); ++k)
138 result.col(k) = (ev.
eval(Nc_m,u.col(k),m_patchID)).transpose();
142 for (
index_t k = 0; k != u.cols(); ++k)
143 result.col(k) = (ev.
eval(Nc_f,u.col(k),m_patchID)).transpose();
147 for (
index_t k = 0; k != u.cols(); ++k)
148 result.col(k) = (ev.
eval(N_m,u.col(k),m_patchID)).transpose();
152 for (
index_t k = 0; k != u.cols(); ++k)
153 result.col(k) = (ev.
eval(N_f,u.col(k),m_patchID)).transpose();
157 case stress_type::von_mises :
158 for (
index_t k = 0; k != u.cols(); ++k)
164 result(0,k) = math::sqrt(S(0,0)*S(0,0)+S(1,0)*S(1,0)-S(0,0)*S(1,0)+3*S(2,0)*S(2,0));
166 result(1,k) = math::sqrt(S(0,0)*S(0,0)+S(1,0)*S(1,0)-S(0,0)*S(1,0)+3*S(2,0)*S(2,0));
171 for (
index_t k = 0; k != u.cols(); ++k)
174 result(0,k) = math::sqrt(S(0,0)*S(0,0)+S(1,0)*S(1,0)-S(0,0)*S(1,0)+3*S(2,0)*S(2,0));
179 for (
index_t k = 0; k != u.cols(); ++k)
182 result(0,k) = math::sqrt(S(0,0)*S(0,0)+S(1,0)*S(1,0)-S(0,0)*S(1,0)+3*S(2,0)*S(2,0));
187 case stress_type::membrane_strain :
188 for (
index_t k = 0; k != u.cols(); ++k)
189 result.col(k) = ev.
eval(E_m.tr(),u.col(k),m_patchID);
191 case stress_type::flexural_strain :
192 for (
index_t k = 0; k != u.cols(); ++k)
193 result.col(k) = ev.
eval(E_f.tr(),u.col(k),m_patchID);
195 case stress_type::principal_membrane_strain:
196 for (
index_t k = 0; k != u.cols(); ++k)
197 result.col(k) = ev.
eval(Ep0,u.col(k),m_patchID);
199 case stress_type::principal_flexural_strain :
200 for (
index_t k = 0; k != u.cols(); ++k)
201 result.col(k) = ev.
eval(Ep1,u.col(k),m_patchID);
203 case stress_type::principal_stretch :
204 for (
index_t k = 0; k != u.cols(); ++k)
205 result.col(k) = ev.
eval(lambda,u.col(k),m_patchID);
208 for (
index_t k = 0; k != u.cols(); ++k)
209 result.col(k) = ev.
eval(Sp,u.col(k));
212 for (
index_t k = 0; k != u.cols(); ++k)
213 result.col(k) = ev.
eval(Sp0,u.col(k),m_patchID);
216 for (
index_t k = 0; k != u.cols(); ++k)
217 result.col(k) = ev.
eval(Sp1,u.col(k),m_patchID);
220 for (
index_t k = 0; k != u.cols(); ++k)
222 tmp = ev.
eval(lambdadir,u.col(k),m_patchID);
223 result.col(k) = tmp.
reshape(3,3).col(0);
227 for (
index_t k = 0; k != u.cols(); ++k)
229 tmp = ev.
eval(lambdadir,u.col(k),m_patchID);
230 result.col(k) = tmp.
reshape(3,3).col(1);
234 for (
index_t k = 0; k != u.cols(); ++k)
236 tmp = ev.
eval(lambdadir,u.col(k),m_patchID);
237 result.col(k) = tmp.
reshape(3,3).col(2);
241 for (
index_t k = 0; k != u.cols(); ++k)
243 tmp = ev.
eval(pstressdir,u.col(k));
244 result.col(k) = tmp.
reshape(3,3).col(0);
248 for (
index_t k = 0; k != u.cols(); ++k)
250 tmp = ev.
eval(pstressdir,u.col(k));
251 result.col(k) = tmp.
reshape(3,3).col(1);
255 for (
index_t k = 0; k != u.cols(); ++k)
257 tmp = ev.
eval(pstressdir,u.col(k));
258 result.col(k) = tmp.
reshape(3,3).col(2);
262 for (
index_t k = 0; k != u.cols(); ++k)
264 result.col(k) = ev.
eval(TF,u.col(k),m_patchID);
268 gsWarn<<
"Stress type 'total' not implemented\n";