28 using namespace gismo;
30 template <
short_t d,
typename T>
36 m_materialMat(materialMat),
46 m_materialMat(materialMat),
56 result.resize(targetDim(),C.cols());
58 for (
index_t k=0; k!=C.cols(); k++)
62 result.col(k) = m_materialMat->eval3D_matrix_C(Ctmp,m_patchID,m_points,m_z,MaterialOutput::MatrixA);
86 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
92 Base(&mp,&thickness,nullptr)
97 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
107 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
118 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
127 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
137 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
145 Base(mp,thickness,Density)
147 GISMO_ASSERT(pars.size()>=2,
"Two or more material parameters should be assigned!");
152 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
155 os <<
"---------------------------------------------------------------------\n"
156 <<
"---------------------Hyperelastic Material Info----------------------\n"
157 <<
"---------------------------------------------------------------------\n\n";
159 os <<
"Material model: \t";
163 os<<
"Incompressible ";
165 if (mat==Material::SvK)
166 os<<
"Saint-Venant Kirchhoff";
167 else if (mat==Material::NH)
169 else if (mat==Material::MR)
171 else if (mat==Material::OG)
173 else if (mat==Material::NH_ext)
174 os<<
"Neo-Hookean Extended";
179 os <<
"Implementation: \t";
180 if (imp==Implementation::Analytical)
182 else if (imp==Implementation::Generalized)
184 else if (imp==Implementation::Spectral)
188 os<<
" implementation\n";
190 os <<
"---------------------------------------------------------------------\n\n";
194 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
197 Base::defaultOptions();
198 m_options.addInt(
"NumGauss",
"Number of Gaussian points through thickness",4);
201 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
205 this->defaultOptions();
208 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
211 this->_computePoints(patch,u);
212 _pstretch_into_impl<comp>(patch,u,result);
215 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
216 template <
bool _comp>
217 typename std::enable_if<!_comp, void>::type
220 Base::pstretch_into(patch,u,result);
223 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
224 template <
bool _comp>
225 typename std::enable_if<_comp, void>::type
228 result.resize(3, u.cols());
233 gsMatrix<T> C33s = _eval3D_Compressible_C33(patch,u,zmat);
236 for (
index_t i=0; i!= u.cols(); i++)
238 for (
index_t v=0; v!=m_data.mine().m_parmat.rows(); v++)
239 m_data.mine().m_parvals.
at(v) = m_data.mine().m_parmat(v,i);
241 this->_getMetric(i,0.0);
247 c.block(0,0,2,2) = m_data.mine().m_Gcov_def.block(0,0,2,2);
250 res = this->_evalStretch(c,m_data.mine().m_gcon_ori);
251 result.col(i) = res.first;
256 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
259 this->_computePoints(patch,u);
260 _pstretchDir_into_impl<comp>(patch,u,result);
263 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
264 template <
bool _comp>
265 typename std::enable_if<!_comp, void>::type
268 Base::pstretchDir_into(patch,u,result);
271 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
272 template <
bool _comp>
273 typename std::enable_if<_comp, void>::type
276 result.resize(9, u.cols());
281 gsMatrix<T> C33s = _eval3D_Compressible_C33(patch,u,zmat);
284 for (
index_t i=0; i!= u.cols(); i++)
286 for (
index_t v=0; v!=m_data.mine().m_parmat.rows(); v++)
287 m_data.mine().m_parvals.
at(v) = m_data.mine().m_parmat(v,i);
289 this->_getMetric(i,0.0);
295 c.block(0,0,2,2) = m_data.mine().m_Gcov_def.block(0,0,2,2);
298 res = this->_evalStretch(c,m_data.mine().m_gcon_ori);
299 result.col(i) = res.second.
reshape(9,1);
303 template <
short_t dim,
class T, index_t matId,
bool comp, enum Material mat, enum Implementation imp >
310 return _eval3D_matrix_C_impl<mat,comp>(Cmat,patch,u,z);
313 template <
short_t dim,
class T, index_t matId,
bool comp, enum Material mat, enum Implementation imp >
314 template <enum Material _mat,
bool _comp>
315 typename std::enable_if<_mat==Material::SvK, gsMatrix<T>>::type
318 this->_computePoints(patch,u);
319 gsMatrix<T> result = _eval3D_Incompressible_matrix_C(Cmat,patch, u, z);
323 template <
short_t dim,
class T, index_t matId,
bool comp, enum Material mat, enum Implementation imp >
324 template <enum Material _mat,
bool _comp>
325 typename std::enable_if<!_comp && !(_mat==Material::SvK), gsMatrix<T>>::type
328 this->_computePoints(patch,u);
329 gsMatrix<T> result = _eval3D_Incompressible_matrix_C(Cmat,patch, u, z);
333 template <
short_t dim,
class T, index_t matId,
bool comp, enum Material mat, enum Implementation imp >
334 template <enum Material _mat,
bool _comp>
335 typename std::enable_if<_comp && !(_mat==Material::SvK), gsMatrix<T>>::type
338 this->_computePoints(patch,u);
339 gsMatrix<T> result = _eval3D_Compressible_matrix_C(Cmat,patch, u, z);
343 template <
short_t dim,
class T, index_t matId,
bool comp, enum Material mat, enum Implementation imp >
348 this->_computePoints(patch,u);
353 for (
index_t k=0; k!=u.cols(); k++)
356 for (
index_t v=0; v!=m_data.mine().m_parmat.rows(); v++)
357 m_data.mine().m_parvals.at(v) = m_data.mine().m_parmat(v,k);
359 for(
index_t j=0; j < z.rows(); ++j )
361 colIdx = j*u.cols()+k;
362 this->_getMetric(k, z(j, k) * m_data.mine().m_Tmat(0, k));
363 result.col(colIdx) = dCijkl(patch,u.col(k),z(j,k));
371 template <
short_t dim,
class T, index_t matId,
bool comp, enum Material mat, enum Implementation imp >
374 return dCijkl_impl<mat,comp>(patch,u,z);
377 template <
short_t dim,
class T, index_t matId,
bool comp, enum Material mat, enum Implementation imp >
378 template <enum Material _mat,
bool _comp>
379 constexpr
typename std::enable_if<!(!_comp && _mat==Material::NH), gsMatrix<T>>::type
383 Cfun<dim,T> Cfunc(
this,patch,u,z);
386 Cvoight(0,0) = m_data.mine().m_Gcov_def(0,0);
387 Cvoight(1,0) = m_data.mine().m_Gcov_def(1,1);
388 Cvoight(2,0) = m_data.mine().m_Gcov_def(0,1);
390 Cfunc.deriv_into(Cvoight,result);
394 template <
short_t dim,
class T, index_t matId,
bool comp, enum Material mat, enum Implementation imp >
395 template <enum Material _mat,
bool _comp>
396 constexpr
typename std::enable_if<(!_comp && _mat==Material::NH), gsMatrix<T>>::type
400 dCdC(0,0) = dCijkl_dCmn(0,0,0,0, 0,0);
401 dCdC(1,0) = dCijkl_dCmn(0,0,0,0, 1,1);
402 dCdC(2,0) = dCijkl_dCmn(0,0,0,0, 0,1);
404 dCdC(0,1) = dCijkl_dCmn(0,0,1,1, 0,0);
405 dCdC(1,1) = dCijkl_dCmn(0,0,1,1, 1,1);
406 dCdC(2,1) = dCijkl_dCmn(0,0,1,1, 0,1);
408 dCdC(0,2) = dCijkl_dCmn(0,0,0,1, 0,0);
409 dCdC(1,2) = dCijkl_dCmn(0,0,0,1, 1,1);
410 dCdC(2,2) = dCijkl_dCmn(0,0,0,1, 0,1);
412 dCdC(0,3) = dCijkl_dCmn(1,1,0,0, 0,0);
413 dCdC(1,3) = dCijkl_dCmn(1,1,0,0, 1,1);
414 dCdC(2,3) = dCijkl_dCmn(1,1,0,0, 0,1);
416 dCdC(0,4) = dCijkl_dCmn(1,1,1,1, 0,0);
417 dCdC(1,4) = dCijkl_dCmn(1,1,1,1, 1,1);
418 dCdC(2,4) = dCijkl_dCmn(1,1,1,1, 0,1);
420 dCdC(0,5) = dCijkl_dCmn(1,1,0,1, 0,0);
421 dCdC(1,5) = dCijkl_dCmn(1,1,0,1, 1,1);
422 dCdC(2,5) = dCijkl_dCmn(1,1,0,1, 0,1);
424 dCdC(0,6) = dCijkl_dCmn(0,1,0,0, 0,0);
425 dCdC(1,6) = dCijkl_dCmn(0,1,0,0, 1,1);
426 dCdC(2,6) = dCijkl_dCmn(0,1,0,0, 0,1);
428 dCdC(0,7) = dCijkl_dCmn(0,1,1,1, 0,0);
429 dCdC(1,7) = dCijkl_dCmn(0,1,1,1, 1,1);
430 dCdC(2,7) = dCijkl_dCmn(0,1,1,1, 0,1);
432 dCdC(0,8) = dCijkl_dCmn(0,1,0,1, 0,0);
433 dCdC(1,8) = dCijkl_dCmn(0,1,0,1, 1,1);
434 dCdC(2,8) = dCijkl_dCmn(0,1,0,1, 0,1);
435 return dCdC.reshape(27,1);
438 template <
short_t dim,
class T, index_t matId,
bool comp, enum Material mat, enum Implementation imp >
439 constexpr T
gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::dCijkl_dCmn(
const index_t i,
const index_t j,
const index_t k,
const index_t l,
const index_t m,
const index_t n)
const
441 return dCijkl_dCmn_impl<mat,comp>(i,j,k,l,m,n);
451 template <
short_t dim,
class T, index_t matId,
bool comp, enum Material mat, enum Implementation imp >
454 return -1./2. * ( gcon(i,k) * gcon(j,l) + gcon(i,l) * gcon(j,k) );
457 template <
short_t dim,
class T, index_t matId,
bool comp, enum Material mat, enum Implementation imp >
458 template <enum Material _mat,
bool _comp>
459 constexpr
typename std::enable_if<(!_comp && _mat==Material::NH), T>::type
460 gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::dCijkl_dCmn_impl(
const index_t i,
const index_t j,
const index_t k,
const index_t l,
const index_t m,
const index_t n)
const
466 const T J0_sq = m_data.mine().m_J0_sq;
468 const T X = (2.*Cinv(i,j)*Cinv(k,l) + Cinv(i,k)*Cinv(j,l) + Cinv(i,l)*Cinv(j,k));
469 const T dX= (2.*(_dgconij_dCkl(Cinv,i,j,m,n)*Cinv(k,l) + Cinv(i,j)*_dgconij_dCkl(Cinv,k,l,m,n))
470 + _dgconij_dCkl(Cinv,i,k,m,n)*Cinv(j,l) + Cinv(i,k)*_dgconij_dCkl(Cinv,j,l,m,n)
471 + _dgconij_dCkl(Cinv,i,l,m,n)*Cinv(j,k) + Cinv(i,l)*_dgconij_dCkl(Cinv,j,k,m,n)
474 const T mu = m_data.mine().m_parvals.at(0) / (2.*(1. + m_data.mine().m_parvals.at(1)));
475 return mu * (- 1. / J0_sq * Cinv(m,n) * X + 1. / J0_sq *dX);
500 template <
short_t dim,
class T, index_t matId,
bool comp, enum Material mat, enum Implementation imp >
501 template <enum Material _mat,
bool _comp>
502 constexpr
typename std::enable_if<!(!_comp && _mat==Material::NH), T>::type
503 gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::dCijkl_dCmn_impl(
const index_t i,
const index_t j,
const index_t k,
const index_t l,
const index_t m,
const index_t n)
const
508 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
515 return _eval3D_matrix_impl<mat,comp>(patch,u,z);
518 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
519 template <enum Material _mat,
bool _comp>
520 typename std::enable_if<_mat==Material::SvK, gsMatrix<T>>::type
523 this->_computePoints(patch,u);
524 gsMatrix<T> result = _eval3D_Incompressible_matrix(patch, u, z);
528 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
529 template <enum Material _mat,
bool _comp>
530 typename std::enable_if<!_comp && !(_mat==Material::SvK), gsMatrix<T>>::type
533 this->_computePoints(patch,u);
534 gsMatrix<T> result = _eval3D_Incompressible_matrix(patch, u, z);
538 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
539 template <enum Material _mat,
bool _comp>
540 typename std::enable_if<_comp && !(_mat==Material::SvK), gsMatrix<T>>::type
543 this->_computePoints(patch,u);
544 gsMatrix<T> result = _eval3D_Compressible_matrix(patch, u, z);
548 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
551 return this->eval3D_stress(patch,u,z,out);
554 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
557 return this->eval3D_stress_C(Cmat,patch,u,z,out);
560 template <
short_t dim,
class T, index_t matId,
bool comp, enum Material mat, enum Implementation imp >
563 return this->eval3D_CauchyStress(patch,u,z,out);
566 template <
short_t dim,
class T, index_t matId,
bool comp, enum Material mat, enum Implementation imp >
575 for (
index_t k=0; k!=u.cols(); k++)
578 for (
index_t v=0; v!=m_data.mine().m_parmat.rows(); v++)
579 m_data.mine().m_parvals.
at(v) = m_data.mine().m_parmat(v,k);
581 for(
index_t j=0; j < z.rows(); ++j )
583 colIdx = j * u.cols() + k;
585 S(0,0) = Smat(0,colIdx);
586 S(1,1) = Smat(1,colIdx);
587 S(0,1) = S(1,0) = Smat(2,colIdx);
589 res = this->_evalPStress(S);
590 result.col(colIdx) = res.first;
596 template <
short_t dim,
class T, index_t matId,
bool comp, enum Material mat, enum Implementation imp >
605 for (
index_t k=0; k!=u.cols(); k++)
608 for (
index_t v=0; v!=m_data.mine().m_parmat.rows(); v++)
609 m_data.mine().m_parvals.
at(v) = m_data.mine().m_parmat(v,k);
611 for(
index_t j=0; j < z.rows(); ++j )
613 colIdx = j * u.cols() + k;
615 S(0,0) = Smat(0,colIdx);
616 S(1,1) = Smat(1,colIdx);
617 S(0,1) = S(1,0) = Smat(2,colIdx);
619 res = this->_evalPStress(S);
620 result.col(colIdx) = res.second.
reshape(9,1);
626 template <
short_t dim,
class T, index_t matId,
bool comp, enum Material mat, enum Implementation imp >
629 gsMatrix<T> Smat = eval3D_CauchyStress(patch,u,z,out);
635 for (
index_t k=0; k!=u.cols(); k++)
638 for (
index_t v=0; v!=m_data.mine().m_parmat.rows(); v++)
639 m_data.mine().m_parvals.
at(v) = m_data.mine().m_parmat(v,k);
641 for(
index_t j=0; j < z.rows(); ++j )
643 colIdx = j * u.cols() + k;
645 S(0,0) = Smat(0,colIdx);
646 S(1,1) = Smat(1,colIdx);
647 S(0,1) = S(1,0) = Smat(2,colIdx);
649 res = this->_evalPStress(S);
650 result.col(j * u.cols() + k) = res.first;
658 template <
short_t dim,
class T, index_t matId,
bool comp, enum Material mat, enum Implementation imp >
661 this->_computePoints(patch,u);
662 return this->_eval3D_stress_impl<mat,comp>(patch,u,z);
665 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
666 template <enum Material _mat,
bool _comp>
667 typename std::enable_if<_mat==Material::SvK, gsMatrix<T>>::type
670 gsMatrix<T> result = _eval3D_Incompressible_stress(patch, u, z);
674 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
675 template <enum Material _mat,
bool _comp>
676 typename std::enable_if<!_comp && !(_mat==Material::SvK), gsMatrix<T>>::type
679 gsMatrix<T> result = _eval3D_Incompressible_stress(patch, u, z);
683 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
684 template <enum Material _mat,
bool _comp>
685 typename std::enable_if<_comp && !(_mat==Material::SvK), gsMatrix<T>>::type
688 gsMatrix<T> result = _eval3D_Compressible_stress(patch, u, z);
692 template <
short_t dim,
class T, index_t matId,
bool comp, enum Material mat, enum Implementation imp >
695 this->_computePoints(patch,u);
696 return this->_eval3D_stress_C_impl<mat,comp>(Cmat,patch,u,z);
699 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
700 template <enum Material _mat,
bool _comp>
701 typename std::enable_if<_mat==Material::SvK, gsMatrix<T>>::type
704 gsMatrix<T> result = _eval3D_Incompressible_stress_C(Cmat,patch, u, z);
708 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
709 template <enum Material _mat,
bool _comp>
710 typename std::enable_if<!_comp && !(_mat==Material::SvK), gsMatrix<T>>::type
713 gsMatrix<T> result = _eval3D_Incompressible_stress_C(Cmat,patch, u, z);
717 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
718 template <enum Material _mat,
bool _comp>
719 typename std::enable_if<_comp && !(_mat==Material::SvK), gsMatrix<T>>::type
722 gsMatrix<T> result = _eval3D_Compressible_stress_C(Cmat,patch, u, z);
726 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
735 gsMatrix<T> C33s = _eval3D_Compressible_C33(patch,u,z);
739 for (
index_t k=0; k!=u.cols(); k++)
742 for (
index_t v=0; v!=m_data.mine().m_parmat.rows(); v++)
743 m_data.mine().m_parvals.at(v) = m_data.mine().m_parmat(v,k);
745 for(
index_t j=0; j < z.rows(); ++j )
747 colIdx = j*u.cols()+k;
748 this->_getMetric(k, z(j, k) * m_data.mine().m_Tmat(0, k));
752 result.col(colIdx).setZero();
755 C33 = C33s(0,colIdx);
759 c.block(0,0,2,2) = m_data.mine().m_Gcov_def.block(0,0,2,2);
762 cinv.block(0,0,2,2) = m_data.mine().m_Gcon_def.block(0,0,2,2);
764 m_data.mine().m_J_sq = m_data.mine().m_J0_sq * C33;
766 result(0,colIdx) = _Sij(0,0,c,cinv);
767 result(1,colIdx) = _Sij(1,1,c,cinv);
768 result(2,colIdx) = _Sij(0,1,c,cinv);
775 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
788 gsMatrix<T> C33s = _eval3D_Compressible_C33(Cmat,patch,u,zmat);
792 for (
index_t k=0; k!=u.cols(); k++)
795 for (
index_t v=0; v!=m_data.mine().m_parmat.rows(); v++)
796 m_data.mine().m_parvals.
at(v) = m_data.mine().m_parmat(v,k);
798 this->_getMetric(0, z * m_data.mine().m_Tmat(0, 0), Cmat);
802 result.col(k).setZero();
809 c.block(0,0,2,2) = m_data.mine().m_Gcov_def.block(0,0,2,2);
812 cinv.block(0,0,2,2) = m_data.mine().m_Gcon_def.block(0,0,2,2);
814 m_data.mine().m_J_sq = m_data.mine().m_J0_sq * C33;
816 result(0,k) = _Sij(0,0,c,cinv);
817 result(1,k) = _Sij(1,1,c,cinv);
818 result(2,k) = _Sij(0,1,c,cinv);
824 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
835 for (
index_t k=0; k!=u.cols(); k++)
838 for (
index_t v=0; v!=m_data.mine().m_parmat.rows(); v++)
839 m_data.mine().m_parvals.at(v) = m_data.mine().m_parmat(v,k);
841 for(
index_t j=0; j < z.rows(); ++j )
843 colIdx = j * u.cols() + k;
844 this->_getMetric(k, z(j, k) * m_data.mine().m_Tmat(0, k));
848 result.col(colIdx).setZero();
851 result(0, colIdx) = _Sij(0, 0);
852 result(1, colIdx) = _Sij(1, 1);
853 result(2, colIdx) = _Sij(0, 1);
860 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
870 for (
index_t k=0; k!=u.cols(); k++)
873 for (
index_t v=0; v!=m_data.mine().m_parmat.rows(); v++)
874 m_data.mine().m_parvals.
at(v) = m_data.mine().m_parmat(v,k);
876 this->_getMetric(0, z * m_data.mine().m_Tmat(0, 0), Cmat);
880 result.col(k).setZero();
883 result(0, k) = _Sij(0, 0);
884 result(1, k) = _Sij(1, 1);
885 result(2, k) = _Sij(0, 1);
891 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
894 this->_computePoints(patch,u);
895 return this->_eval3D_detF_impl<mat,comp>(patch,u,z);
898 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
899 template <enum Material _mat,
bool _comp>
900 typename std::enable_if<_mat==Material::SvK, gsMatrix<T>>::type
903 gsMatrix<T> result = _eval3D_Incompressible_detF(patch, u, z);
907 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
908 template <enum Material _mat,
bool _comp>
909 typename std::enable_if<!_comp && !(_mat==Material::SvK), gsMatrix<T>>::type
912 gsMatrix<T> result = _eval3D_Incompressible_detF(patch, u, z);
916 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
917 template <enum Material _mat,
bool _comp>
918 typename std::enable_if<_comp && !(_mat==Material::SvK), gsMatrix<T>>::type
921 gsMatrix<T> result = _eval3D_Compressible_detF(patch, u, z);
925 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
934 gsMatrix<T> C33s = _eval3D_Compressible_C33(patch,u,z);
936 for (
index_t k=0; k!=u.cols(); k++)
939 for (
index_t v=0; v!=m_data.mine().m_parmat.rows(); v++)
940 m_data.mine().m_parvals.at(v) = m_data.mine().m_parmat(v,k);
942 for(
index_t j=0; j < z.rows(); ++j )
944 colIdx = j*u.cols()+k;
945 this->_getMetric(k, z(j, k) * m_data.mine().m_Tmat(0, k));
946 result(0,colIdx) = math::sqrt(m_data.mine().m_J0_sq*C33s(0,colIdx));
952 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
960 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
963 this->_computePoints(patch,u);
964 return this->_eval3D_CauchyStress_impl<mat,comp>(patch,u,z);
967 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
968 template <enum Material _mat,
bool _comp>
969 typename std::enable_if<_mat==Material::SvK, gsMatrix<T>>::type
972 gsMatrix<T> result = _eval3D_Incompressible_CauchyStress(patch, u, z);
976 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
977 template <enum Material _mat,
bool _comp>
978 typename std::enable_if<!_comp && !(_mat==Material::SvK), gsMatrix<T>>::type
981 gsMatrix<T> result = _eval3D_Incompressible_CauchyStress(patch, u, z);
985 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
986 template <enum Material _mat,
bool _comp>
987 typename std::enable_if<_comp && !(_mat==Material::SvK), gsMatrix<T>>::type
990 gsMatrix<T> result = _eval3D_Compressible_CauchyStress(patch, u, z);
994 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1002 gsMatrix<T> Smat = _eval3D_Compressible_stress(patch,u,z);
1006 gsMatrix<T> C33s = _eval3D_Compressible_C33(patch,u,z);
1010 for (
index_t k=0; k!=u.cols(); k++)
1012 for(
index_t j=0; j < z.rows(); ++j )
1014 colIdx = j * u.cols() + k;
1015 this->_getMetric(k, z(j, k) * m_data.mine().m_Tmat(0, k));
1016 C33 = C33s(0,colIdx);
1017 detF = math::sqrt(m_data.mine().m_J0_sq*C33);
1018 Smat.col(colIdx) /= detF;
1024 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1028 return _eval3D_Incompressible_stress(patch,u,z);
1031 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1034 Base::setParameter(0,YoungsModulus);
1037 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1038 const typename gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::function_ptr
gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::getYoungsModulus()
const
1040 return Base::getParameter(0);
1043 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1046 Base::setParameter(1,PoissonsRatio);
1049 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1050 const typename gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::function_ptr
gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::getPoissonsRatio()
const
1052 return Base::getParameter(1);
1055 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1056 template <enum Material _mat>
1057 typename std::enable_if<_mat==Material::MR, void>::type
1060 Base::setParameter(2,Ratio);
1063 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1064 template <enum Material _mat>
1065 typename std::enable_if<_mat!=Material::MR, void>::type
1071 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1072 template <enum Material _mat>
1073 typename std::enable_if<_mat==Material::MR, const typename gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::function_ptr >::type
1076 return Base::getParameter(2);
1079 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1080 template <enum Material _mat>
1081 typename std::enable_if<_mat!=Material::MR, const typename gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::function_ptr >::type
1087 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1088 template <enum Material _mat>
1089 typename std::enable_if<_mat==Material::OG, void>::type
1092 Base::setParameter(2+2*i,Mu_i);
1095 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1096 template <enum Material _mat>
1097 typename std::enable_if<_mat!=Material::OG, void>::type
1103 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1104 template <enum Material _mat>
1105 typename std::enable_if<_mat==Material::OG, const typename gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::function_ptr >::type
1108 return Base::getParameter(2+2*i);
1111 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1112 template <enum Material _mat>
1113 typename std::enable_if<_mat!=Material::OG, const typename gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::function_ptr >::type
1119 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1120 template <enum Material _mat>
1121 typename std::enable_if<_mat==Material::OG, void>::type
1124 Base::setParameter(2+2*i+1,Alpha_i);
1127 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1128 template <enum Material _mat>
1129 typename std::enable_if<_mat!=Material::OG, void>::type
1135 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1136 template <enum Material _mat>
1137 typename std::enable_if<_mat==Material::OG, const typename gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::function_ptr >::type
1140 return Base::getParameter(2+2*i+1);
1143 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1144 template <enum Material _mat>
1145 typename std::enable_if<_mat!=Material::OG, const typename gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::function_ptr >::type
1152 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1164 for (
index_t k=0; k!=u.cols(); k++)
1167 for (
index_t v=0; v!=m_data.mine().m_parmat.rows(); v++)
1168 m_data.mine().m_parvals.
at(v) = m_data.mine().m_parmat(v,k);
1170 this->_getMetric(0, z * m_data.mine().m_Tmat(0, 0), Cmat);
1178 C(0,0) = _Cijkl(0,0,0,0);
1179 C(1,1) = _Cijkl(1,1,1,1);
1180 C(2,2) = _Cijkl(0,1,0,1);
1181 C(1,0) = C(0,1) = _Cijkl(0,0,1,1);
1182 C(2,0) = C(0,2) = _Cijkl(0,0,0,1);
1183 C(2,1) = C(1,2) = _Cijkl(1,1,0,1);
1189 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1201 for (
index_t k=0; k!=u.cols(); k++)
1204 for (
index_t v=0; v!=m_data.mine().m_parmat.rows(); v++)
1205 m_data.mine().m_parvals.at(v) = m_data.mine().m_parmat(v,k);
1207 for(
index_t j=0; j < z.rows(); ++j )
1209 colIdx = j*u.cols()+k;
1210 this->_getMetric(k,z(j,k) * m_data.mine().m_Tmat(0,k) );
1218 C(0,0) = _Cijkl(0,0,0,0);
1219 C(1,1) = _Cijkl(1,1,1,1);
1220 C(2,2) = _Cijkl(0,1,0,1);
1221 C(1,0) = C(0,1) = _Cijkl(0,0,1,1);
1222 C(2,0) = C(0,2) = _Cijkl(0,0,0,1);
1223 C(2,1) = C(1,2) = _Cijkl(1,1,0,1);
1230 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1233 GISMO_ENSURE( ( (i < 2) && (j < 2) && (k < 2) && (l < 2) ) ,
"Index out of range. i="<<i<<
", j="<<j<<
", k="<<k<<
", l="<<l);
1234 GISMO_ENSURE(!comp,
"Material model is not incompressible?");
1236 return _Cijkl_impl<mat,imp>(i,j,k,l);
1239 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1240 template <enum Material _mat, enum Implementation _imp>
1241 constexpr
typename std::enable_if<_mat==Material::SvK && _imp==Implementation::Analytical, T>::type
1247 T lambda, mu, Cconstant;
1249 mu = m_data.mine().m_parvals.at(0) / (2.*(1. + m_data.mine().m_parvals.at(1)));
1250 GISMO_ENSURE((1.-2.*m_data.mine().m_parvals.at(1)) != 0,
"Division by zero in construction of SvK material parameters! (1.-2.*m_data.mine().m_parvals.at(1)) = "<<(1.-2.*m_data.mine().m_parvals.at(1))<<
"; m_data.mine().m_parvals.at(1) = "<<m_data.mine().m_parvals.at(1));
1251 lambda = m_data.mine().m_parvals.at(0) * m_data.mine().m_parvals.at(1) / ( (1. + m_data.mine().m_parvals.at(1))*(1.-2.*m_data.mine().m_parvals.at(1))) ;
1252 Cconstant = 2*lambda*mu/(lambda+2*mu);
1254 return Cconstant*m_data.mine().m_Acon_ori(i,j)*m_data.mine().m_Acon_ori(k,l) + mu*(m_data.mine().m_Acon_ori(i,k)*m_data.mine().m_Acon_ori(j,l) + m_data.mine().m_Acon_ori(i,l)*m_data.mine().m_Acon_ori(j,k));
1257 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1258 template <enum Material _mat, enum Implementation _imp>
1259 constexpr
typename std::enable_if<_mat==Material::NH && _imp==Implementation::Analytical, T>::type
1265 T mu = m_data.mine().m_parvals.at(0) / (2.*(1. + m_data.mine().m_parvals.at(1)));
1266 return mu*1./m_data.mine().m_J0_sq*(2.*m_data.mine().m_Gcon_def(i,j)*m_data.mine().m_Gcon_def(k,l) + m_data.mine().m_Gcon_def(i,k)*m_data.mine().m_Gcon_def(j,l) + m_data.mine().m_Gcon_def(i,l)*m_data.mine().m_Gcon_def(j,k));
1269 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1270 template <enum Material _mat, enum Implementation _imp>
1271 constexpr
typename std::enable_if<_mat==Material::MR && _imp==Implementation::Analytical, T>::type
1278 GISMO_ENSURE(m_pars.size()==3,
"Mooney-Rivlin model needs to be a 3 parameter model");
1279 T traceCt = m_data.mine().m_Gcov_def(0,0)*m_data.mine().m_Gcon_ori(0,0) +
1280 m_data.mine().m_Gcov_def(0,1)*m_data.mine().m_Gcon_ori(0,1) +
1281 m_data.mine().m_Gcov_def(1,0)*m_data.mine().m_Gcon_ori(1,0) +
1282 m_data.mine().m_Gcov_def(1,1)*m_data.mine().m_Gcon_ori(1,1);
1284 T mu = m_data.mine().m_parvals.at(0) / (2.*(1. + m_data.mine().m_parvals.at(1)));
1285 T c2 = mu/(m_data.mine().m_parvals.at(2) + 1);
1286 T c1 = m_data.mine().m_parvals.at(2)*c2;
1288 T Gabcd = - 1./2. * ( m_data.mine().m_Gcon_def(i,k)*m_data.mine().m_Gcon_def(j,l) + m_data.mine().m_Gcon_def(i,l)*m_data.mine().m_Gcon_def(j,k) );
1290 return (c1 + c2 * traceCt) *1./m_data.mine().m_J0_sq*(2.*m_data.mine().m_Gcon_def(i,j)*m_data.mine().m_Gcon_def(k,l) + m_data.mine().m_Gcon_def(i,k)*m_data.mine().m_Gcon_def(j,l) + m_data.mine().m_Gcon_def(i,l)*m_data.mine().m_Gcon_def(j,k))
1291 - 2. * c2 / m_data.mine().m_J0_sq * ( m_data.mine().m_Gcon_ori(i,j) * m_data.mine().m_Gcon_def(k,l) + m_data.mine().m_Gcon_def(i,j)*m_data.mine().m_Gcon_ori(k,l))
1292 + 2. * c2 * m_data.mine().m_J0_sq * ( Gabcd + m_data.mine().m_Gcon_def(i,j)*m_data.mine().m_Gcon_def(k,l) );
1295 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1296 template <enum Material _mat, enum Implementation _imp>
1297 constexpr
typename std::enable_if<_imp==Implementation::Spectral, T>::type
1306 C.block(0,0,2,2) = m_data.mine().m_Gcov_def.block(0,0,2,2);
1309 C(2,2) = 1./m_data.mine().m_J0_sq;
1311 this->_computeStretch(C,m_data.mine().m_gcon_ori);
1314 for (
index_t a = 0; a != 2; a++)
1317 tmp += _Cabcd(a,a,a,a)*(
1318 ( m_data.mine().m_gcon_ori.col(i).dot(m_data.mine().m_stretchvec.col(a)) )*( m_data.mine().m_gcon_ori.col(j).dot(m_data.mine().m_stretchvec.col(a)) )*
1319 ( m_data.mine().m_gcon_ori.col(k).dot(m_data.mine().m_stretchvec.col(a)) )*( m_data.mine().m_gcon_ori.col(l).dot(m_data.mine().m_stretchvec.col(a)) )
1322 for (
index_t b = a+1; b != 2; b++)
1325 tmp += _Cabcd(a,a,b,b)*(
1326 ( m_data.mine().m_gcon_ori.col(i).dot(m_data.mine().m_stretchvec.col(a)) )*( m_data.mine().m_gcon_ori.col(j).dot(m_data.mine().m_stretchvec.col(a)) )*
1327 ( m_data.mine().m_gcon_ori.col(k).dot(m_data.mine().m_stretchvec.col(b)) )*( m_data.mine().m_gcon_ori.col(l).dot(m_data.mine().m_stretchvec.col(b)) )
1329 ( m_data.mine().m_gcon_ori.col(i).dot(m_data.mine().m_stretchvec.col(b)) )*( m_data.mine().m_gcon_ori.col(j).dot(m_data.mine().m_stretchvec.col(b)) )*
1330 ( m_data.mine().m_gcon_ori.col(k).dot(m_data.mine().m_stretchvec.col(a)) )*( m_data.mine().m_gcon_ori.col(l).dot(m_data.mine().m_stretchvec.col(a)) )
1334 tmp += _Cabcd(a,b,a,b)*(
1335 ( m_data.mine().m_gcon_ori.col(i).dot(m_data.mine().m_stretchvec.col(a)) )*( m_data.mine().m_gcon_ori.col(j).dot(m_data.mine().m_stretchvec.col(b)) )*
1336 ( m_data.mine().m_gcon_ori.col(k).dot(m_data.mine().m_stretchvec.col(a)) )*( m_data.mine().m_gcon_ori.col(l).dot(m_data.mine().m_stretchvec.col(b)) )
1338 ( m_data.mine().m_gcon_ori.col(i).dot(m_data.mine().m_stretchvec.col(b)) )*( m_data.mine().m_gcon_ori.col(j).dot(m_data.mine().m_stretchvec.col(a)) )*
1339 ( m_data.mine().m_gcon_ori.col(k).dot(m_data.mine().m_stretchvec.col(b)) )*( m_data.mine().m_gcon_ori.col(l).dot(m_data.mine().m_stretchvec.col(a)) )
1341 ( m_data.mine().m_gcon_ori.col(i).dot(m_data.mine().m_stretchvec.col(a)) )*( m_data.mine().m_gcon_ori.col(j).dot(m_data.mine().m_stretchvec.col(b)) )*
1342 ( m_data.mine().m_gcon_ori.col(k).dot(m_data.mine().m_stretchvec.col(b)) )*( m_data.mine().m_gcon_ori.col(l).dot(m_data.mine().m_stretchvec.col(a)) )
1344 ( m_data.mine().m_gcon_ori.col(i).dot(m_data.mine().m_stretchvec.col(b)) )*( m_data.mine().m_gcon_ori.col(j).dot(m_data.mine().m_stretchvec.col(a)) )*
1345 ( m_data.mine().m_gcon_ori.col(k).dot(m_data.mine().m_stretchvec.col(a)) )*( m_data.mine().m_gcon_ori.col(l).dot(m_data.mine().m_stretchvec.col(b)) )
1352 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1353 template <enum Material _mat, enum Implementation _imp>
1354 constexpr
typename std::enable_if<_imp==Implementation::Generalized, T>::type
1360 return 4.0 * _d2Psi(i,j,k,l) + 4.0 * _d2Psi(2,2,2,2)*math::pow(m_data.mine().m_J0_sq,-2.0)*m_data.mine().m_Gcon_def(i,j)*m_data.mine().m_Gcon_def(k,l)
1361 - 4.0/ m_data.mine().m_J0_sq * ( _d2Psi(2,2,i,j)*m_data.mine().m_Gcon_def(k,l) + _d2Psi(2,2,k,l)*m_data.mine().m_Gcon_def(i,j) )
1362 + 2.0 * _dPsi(2,2) / m_data.mine().m_J0_sq * (2.*m_data.mine().m_Gcon_def(i,j)*m_data.mine().m_Gcon_def(k,l) + m_data.mine().m_Gcon_def(i,k)*m_data.mine().m_Gcon_def(j,l) + m_data.mine().m_Gcon_def(i,l)*m_data.mine().m_Gcon_def(j,k));
1381 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1382 constexpr T
gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::_Cijkl(
const index_t i,
const index_t j,
const index_t k,
const index_t l,
const gsMatrix<T> & c,
const gsMatrix<T> & cinv)
const
1384 GISMO_ENSURE(c.cols()==c.rows(),
"Matrix c must be square");
1386 GISMO_ENSURE(cinv.cols()==cinv.rows(),
"Matrix cinv must be square");
1387 GISMO_ENSURE(cinv.cols()==3,
"Matrix cinv must be 3x3");
1388 GISMO_ENSURE( ( (i <2) && (j <2) && (k <2) && (l <2) ) ,
"Index out of range. i="<<i<<
", j="<<j<<
", k="<<k<<
", l="<<l);
1389 GISMO_ENSURE(comp,
"Material model is not compressible?");
1391 return _Cijkl_impl<imp>(i,j,k,l,c,cinv);
1394 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1395 template <enum Implementation _imp>
1396 constexpr
typename std::enable_if< _imp==Implementation::Spectral, T>::type
1397 gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::_Cijkl_impl(
const index_t i,
const index_t j,
const index_t k,
const index_t l,
const gsMatrix<T> & c,
const gsMatrix<T> & cinv)
const
1400 this->_computeStretch(c,m_data.mine().m_gcon_ori);
1401 return _Cijkl3D(i,j,k,l,c,cinv);
1404 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1405 template <enum Implementation _imp>
1406 constexpr
typename std::enable_if<!(_imp==Implementation::Spectral), T>::type
1407 gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::_Cijkl_impl(
const index_t i,
const index_t j,
const index_t k,
const index_t l,
const gsMatrix<T> & c,
const gsMatrix<T> & cinv)
const
1409 return _Cijkl3D(i,j,k,l,c,cinv) - ( _Cijkl3D(i,j,2,2,c,cinv) * _Cijkl3D(2,2,k,l,c,cinv) ) / _Cijkl3D(2,2,2,2,c,cinv);
1413 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1414 constexpr T
gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::_Cijkl3D(
const index_t i,
const index_t j,
const index_t k,
const index_t l,
const gsMatrix<T> & c,
const gsMatrix<T> & cinv)
const
1416 GISMO_ENSURE( ( (i <3) && (j <3) && (k <3) && (l <3) ) ,
"Index out of range. i="<<i<<
", j="<<j<<
", k="<<k<<
", l="<<l);
1417 return _Cijkl3D_impl<mat,imp>(i,j,k,l,c,cinv);
1420 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1421 template <enum Material _mat, enum Implementation _imp>
1422 constexpr
typename std::enable_if<_mat==Material::SvK && _imp == Implementation::Analytical, T>::type
1423 gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::_Cijkl3D_impl(
const index_t i,
const index_t j,
const index_t k,
const index_t l,
const gsMatrix<T> & c,
const gsMatrix<T> & cinv)
const
1425 GISMO_ERROR(
"Compressible material matrix requested, but not needed. How?");
1428 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1429 template <enum Material _mat, enum Implementation _imp>
1430 constexpr
typename std::enable_if<_mat==Material::NH && _imp == Implementation::Analytical, T>::type
1431 gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::_Cijkl3D_impl(
const index_t i,
const index_t j,
const index_t k,
const index_t l,
const gsMatrix<T> & c,
const gsMatrix<T> & cinv)
const
1437 T mu = m_data.mine().m_parvals.at(0) / (2 * (1 + m_data.mine().m_parvals.at(1)));
1438 GISMO_ENSURE(3 - 6 * m_data.mine().m_parvals.at(1) != 0,
"Bulk modulus is infinity for compressible material model. Try to use incompressible models.");
1440 T K = m_data.mine().m_parvals.at(0) / ( 3 - 6 * m_data.mine().m_parvals.at(1));
1441 T dCinv = - 1./2.*( cinv(i,k)*cinv(j,l) + cinv(i,l)*cinv(j,k) );
1442 T traceCt = m_data.mine().m_Gcov_def(0,0)*m_data.mine().m_Gcon_ori(0,0) +
1443 m_data.mine().m_Gcov_def(0,1)*m_data.mine().m_Gcon_ori(0,1) +
1444 m_data.mine().m_Gcov_def(1,0)*m_data.mine().m_Gcon_ori(1,0) +
1445 m_data.mine().m_Gcov_def(1,1)*m_data.mine().m_Gcon_ori(1,1);
1446 T I_1 = traceCt + c(2,2);
1447 return 1.0 / 9.0 * mu * math::pow( m_data.mine().m_J_sq , -1.0/3.0 ) * ( 2.0 * I_1 * ( cinv(i,j)*cinv(k,l) - 3.0 * dCinv )
1448 - 6.0 *( m_data.mine().m_Gcon_ori(i,j)*cinv(k,l) + cinv(i,j)*m_data.mine().m_Gcon_ori(k,l) ) )
1449 + K * ( m_data.mine().m_J_sq*cinv(i,j)*cinv(k,l) + (m_data.mine().m_J_sq-1)*dCinv );
1452 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1453 template <enum Material _mat, enum Implementation _imp>
1454 constexpr
typename std::enable_if<_mat==Material::MR && _imp == Implementation::Analytical, T>::type
1455 gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::_Cijkl3D_impl(
const index_t i,
const index_t j,
const index_t k,
const index_t l,
const gsMatrix<T> & c,
const gsMatrix<T> & cinv)
const
1460 GISMO_ENSURE(m_pars.size()==3,
"Mooney-Rivlin model needs to be a 3 parameter model");
1462 T mu = m_data.mine().m_parvals.at(0) / (2 * (1 + m_data.mine().m_parvals.at(1)));
1463 GISMO_ENSURE(3 - 6 * m_data.mine().m_parvals.at(1) != 0,
"Bulk modulus is infinity for compressible material model. Try to use incompressible models.");
1465 T K = m_data.mine().m_parvals.at(0) / ( 3 - 6 * m_data.mine().m_parvals.at(1));
1466 T dCinv = - 1./2.*( cinv(i,k)*cinv(j,l) + cinv(i,l)*cinv(j,k) );
1467 T traceCt = m_data.mine().m_Gcov_def(0,0)*m_data.mine().m_Gcon_ori(0,0) +
1468 m_data.mine().m_Gcov_def(0,1)*m_data.mine().m_Gcon_ori(0,1) +
1469 m_data.mine().m_Gcov_def(1,0)*m_data.mine().m_Gcon_ori(1,0) +
1470 m_data.mine().m_Gcov_def(1,1)*m_data.mine().m_Gcon_ori(1,1);
1471 T I_1 = traceCt + c(2,2);
1472 T I_2 = c(2,2) * traceCt + m_data.mine().m_J0_sq;
1473 T d2I_2 = idelta(i,2)*idelta(j,2)*idelta(k,2)*idelta(l,2)*( m_data.mine().m_J0_sq*( cinv(i,j)*cinv(k,l) + dCinv ) )
1474 + delta(i,2)*delta(j,2)*idelta(k,2)*idelta(l,2)*_dI_1(k,l)
1475 + idelta(i,2)*idelta(j,2)*delta(k,2)*delta(l,2)*_dI_1(i,j);
1476 T c2 = mu/(m_data.mine().m_parvals.at(2) + 1);
1477 T c1 = m_data.mine().m_parvals.at(2)*c2;
1479 return 1.0/9.0 * c1 * math::pow(m_data.mine().m_J_sq, -1.0/3.0) * ( 2.0*I_1*cinv(i,j)*cinv(k,l) - 6.0*I_1*dCinv
1480 - 6.0*_dI_1(i,j)*cinv(k,l) - 6.0*cinv(i,j)*_dI_1(k,l) )
1481 + 1.0/9.0 * c2 * math::pow(m_data.mine().m_J_sq, -2.0/3.0) * ( 8.0*I_2*cinv(i,j)*cinv(k,l) - 12.0*I_2*dCinv
1482 - 12.0*_dI_2(i,j,c,cinv)*cinv(k,l)- 12.0*cinv(i,j)*_dI_2(k,l,c,cinv)
1484 + K * ( m_data.mine().m_J_sq*cinv(i,j)*cinv(k,l) + (m_data.mine().m_J_sq-1)*dCinv );
1487 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1488 template <enum Material _mat, enum Implementation _imp>
1489 constexpr
typename std::enable_if<_mat==Material::NH_ext && _imp == Implementation::Analytical, T>::type
1490 gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::_Cijkl3D_impl(
const index_t i,
const index_t j,
const index_t k,
const index_t l,
const gsMatrix<T> & c,
const gsMatrix<T> & cinv)
const
1495 T mu = m_data.mine().m_parvals.at(0) / (2 * (1 + m_data.mine().m_parvals.at(1)));
1496 T lambda = m_data.mine().m_parvals.at(0) * m_data.mine().m_parvals.at(1) / ( (1. + m_data.mine().m_parvals.at(1))*(1.-2.*m_data.mine().m_parvals.at(1)));
1497 GISMO_ENSURE(3 - 6 * m_data.mine().m_parvals.at(1) != 0,
"Bulk modulus is infinity for compressible material model. Try to use incompressible models.");
1499 T dCinv = - 1./2.*( cinv(i,k)*cinv(j,l) + cinv(i,l)*cinv(j,k) );
1500 return - 2.0 * mu * dCinv + lambda * ( m_data.mine().m_J_sq*cinv(i,j)*cinv(k,l) + (m_data.mine().m_J_sq-1)*dCinv );
1503 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1504 template <enum Material _mat, enum Implementation _imp>
1505 constexpr
typename std::enable_if<_imp == Implementation::Spectral, T>::type
1506 gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::_Cijkl3D_impl(
const index_t i,
const index_t j,
const index_t k,
const index_t l,
const gsMatrix<T> & c,
const gsMatrix<T> & cinv)
const
1512 if ( (i==2) && (j==2) && (k==2) && (l==2) )
1513 tmp = _Cabcd(2,2,2,2);
1518 T C2222 = _Cabcd(2,2,2,2);
1520 for (
index_t a = 0; a != 2; a++)
1525 C = _Cabcd(a,a,a,a) - math::pow(_Cabcd(2,2,a,a),2) / C2222;
1527 ( m_data.mine().m_gcon_ori.col(i).dot(m_data.mine().m_stretchvec.col(a)) )*( m_data.mine().m_gcon_ori.col(j).dot(m_data.mine().m_stretchvec.col(a)) )*
1528 ( m_data.mine().m_gcon_ori.col(k).dot(m_data.mine().m_stretchvec.col(a)) )*( m_data.mine().m_gcon_ori.col(l).dot(m_data.mine().m_stretchvec.col(a)) )
1531 for (
index_t b = a+1; b != 2; b++)
1535 C = _Cabcd(a,a,b,b) - _Cabcd(a,a,2,2) * _Cabcd(2,2,b,b) / C2222;
1537 ( m_data.mine().m_gcon_ori.col(i).dot(m_data.mine().m_stretchvec.col(a)) )*( m_data.mine().m_gcon_ori.col(j).dot(m_data.mine().m_stretchvec.col(a)) )*
1538 ( m_data.mine().m_gcon_ori.col(k).dot(m_data.mine().m_stretchvec.col(b)) )*( m_data.mine().m_gcon_ori.col(l).dot(m_data.mine().m_stretchvec.col(b)) )
1540 ( m_data.mine().m_gcon_ori.col(i).dot(m_data.mine().m_stretchvec.col(b)) )*( m_data.mine().m_gcon_ori.col(j).dot(m_data.mine().m_stretchvec.col(b)) )*
1541 ( m_data.mine().m_gcon_ori.col(k).dot(m_data.mine().m_stretchvec.col(a)) )*( m_data.mine().m_gcon_ori.col(l).dot(m_data.mine().m_stretchvec.col(a)) )
1546 C = _Cabcd(a,b,a,b) - math::pow(_Cabcd(2,2,a,b),2) / C2222;
1548 ( m_data.mine().m_gcon_ori.col(i).dot(m_data.mine().m_stretchvec.col(a)) )*( m_data.mine().m_gcon_ori.col(j).dot(m_data.mine().m_stretchvec.col(b)) )*
1549 ( m_data.mine().m_gcon_ori.col(k).dot(m_data.mine().m_stretchvec.col(a)) )*( m_data.mine().m_gcon_ori.col(l).dot(m_data.mine().m_stretchvec.col(b)) )
1551 ( m_data.mine().m_gcon_ori.col(i).dot(m_data.mine().m_stretchvec.col(b)) )*( m_data.mine().m_gcon_ori.col(j).dot(m_data.mine().m_stretchvec.col(a)) )*
1552 ( m_data.mine().m_gcon_ori.col(k).dot(m_data.mine().m_stretchvec.col(b)) )*( m_data.mine().m_gcon_ori.col(l).dot(m_data.mine().m_stretchvec.col(a)) )
1554 ( m_data.mine().m_gcon_ori.col(i).dot(m_data.mine().m_stretchvec.col(a)) )*( m_data.mine().m_gcon_ori.col(j).dot(m_data.mine().m_stretchvec.col(b)) )*
1555 ( m_data.mine().m_gcon_ori.col(k).dot(m_data.mine().m_stretchvec.col(b)) )*( m_data.mine().m_gcon_ori.col(l).dot(m_data.mine().m_stretchvec.col(a)) )
1557 ( m_data.mine().m_gcon_ori.col(i).dot(m_data.mine().m_stretchvec.col(b)) )*( m_data.mine().m_gcon_ori.col(j).dot(m_data.mine().m_stretchvec.col(a)) )*
1558 ( m_data.mine().m_gcon_ori.col(k).dot(m_data.mine().m_stretchvec.col(a)) )*( m_data.mine().m_gcon_ori.col(l).dot(m_data.mine().m_stretchvec.col(b)) )
1567 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1568 template <enum Material _mat, enum Implementation _imp>
1569 constexpr
typename std::enable_if<_imp == Implementation::Generalized, T>::type
1570 gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::_Cijkl3D_impl(
const index_t i,
const index_t j,
const index_t k,
const index_t l,
const gsMatrix<T> & c,
const gsMatrix<T> & cinv)
const
1575 return 4.0 * _d2Psi(i,j,k,l,c,cinv);
1618 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1621 return _Sij_impl<mat,imp>(i,j);
1624 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1625 template <enum Material _mat, enum Implementation _imp>
1626 constexpr
typename std::enable_if<_mat==Material::SvK && _imp == Implementation::Analytical, T>::type
1632 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1633 template <enum Material _mat, enum Implementation _imp>
1634 constexpr
typename std::enable_if<_mat==Material::NH && _imp == Implementation::Analytical, T>::type
1640 T mu = m_data.mine().m_parvals.at(0) / (2.*(1. + m_data.mine().m_parvals.at(1)));
1641 return mu * (m_data.mine().m_Gcon_ori(i,j) - 1./m_data.mine().m_J0_sq * m_data.mine().m_Gcon_def(i,j) );
1644 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1645 template <enum Material _mat, enum Implementation _imp>
1646 constexpr
typename std::enable_if<_mat==Material::MR && _imp == Implementation::Analytical, T>::type
1653 GISMO_ENSURE(m_pars.size()==3,
"Mooney-Rivlin model needs to be a 3 parameter model");
1654 T mu = m_data.mine().m_parvals.at(0) / (2.*(1. + m_data.mine().m_parvals.at(1)));
1655 T traceCt = m_data.mine().m_Gcov_def(0,0)*m_data.mine().m_Gcon_ori(0,0) +
1656 m_data.mine().m_Gcov_def(0,1)*m_data.mine().m_Gcon_ori(0,1) +
1657 m_data.mine().m_Gcov_def(1,0)*m_data.mine().m_Gcon_ori(1,0) +
1658 m_data.mine().m_Gcov_def(1,1)*m_data.mine().m_Gcon_ori(1,1);
1660 T c2 = mu/(m_data.mine().m_parvals.at(2)+1);
1661 T c1 = m_data.mine().m_parvals.at(2)*c2;
1663 return c1 * ( m_data.mine().m_Gcon_ori(i,j) - 1/m_data.mine().m_J0_sq * m_data.mine().m_Gcon_def(i,j) )
1664 + c2 / m_data.mine().m_J0_sq * (m_data.mine().m_Gcon_ori(i,j) - traceCt * m_data.mine().m_Gcon_def(i,j) ) + c2 * m_data.mine().m_J0_sq * m_data.mine().m_Gcon_def(i,j);
1667 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1668 template <enum Material _mat, enum Implementation _imp>
1669 constexpr
typename std::enable_if<_imp == Implementation::Spectral, T>::type
1675 C.block(0,0,2,2) = m_data.mine().m_Gcov_def.block(0,0,2,2);
1676 C(2,2) = 1./m_data.mine().m_J0_sq;
1678 this->_computeStretch(C,m_data.mine().m_gcon_ori);
1680 for (
index_t a = 0; a != 2; a++)
1683 ( m_data.mine().m_gcon_ori.col(i).dot(m_data.mine().m_stretchvec.col(a)) )*( m_data.mine().m_gcon_ori.col(j).dot(m_data.mine().m_stretchvec.col(a)) )
1689 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1690 template <enum Material _mat, enum Implementation _imp>
1691 constexpr
typename std::enable_if<_imp == Implementation::Generalized, T>::type
1697 return 2.0 * _dPsi(i,j) - 2.0 * _dPsi(2,2) * math::pow(m_data.mine().m_J0_sq,-1.0)*m_data.mine().m_Gcon_def(i,j);
1702 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1705 return _Sij_impl<mat,imp>(i,j,c,cinv);
1708 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1709 template <enum Material _mat, enum Implementation _imp>
1710 constexpr
typename std::enable_if<_mat==Material::NH && _imp == Implementation::Analytical, T>::type
1716 T mu = m_data.mine().m_parvals.at(0) / (2.*(1. + m_data.mine().m_parvals.at(1)));
1717 T K = m_data.mine().m_parvals.at(0) / ( 3 - 6 * m_data.mine().m_parvals.at(1));
1718 T traceCt = m_data.mine().m_Gcov_def(0,0)*m_data.mine().m_Gcon_ori(0,0) +
1719 m_data.mine().m_Gcov_def(0,1)*m_data.mine().m_Gcon_ori(0,1) +
1720 m_data.mine().m_Gcov_def(1,0)*m_data.mine().m_Gcon_ori(1,0) +
1721 m_data.mine().m_Gcov_def(1,1)*m_data.mine().m_Gcon_ori(1,1);
1722 T I_1 = traceCt + c(2,2);
1724 return mu * math::pow( m_data.mine().m_J_sq , -1.0/3.0 ) * ( m_data.mine().m_Gcon_ori(i,j) - 1.0/3.0 * I_1 * cinv(i,j) )
1725 + K * 0.5 * ( m_data.mine().m_J_sq - 1.0 ) * cinv(i,j);
1728 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1729 template <enum Material _mat, enum Implementation _imp>
1730 constexpr
typename std::enable_if<_mat==Material::MR && _imp == Implementation::Analytical, T>::type
1737 GISMO_ENSURE(m_pars.size()==3,
"Mooney-Rivlin model needs to be a 3 parameter model");
1738 T mu = m_data.mine().m_parvals.at(0) / (2.*(1. + m_data.mine().m_parvals.at(1)));
1739 T K = m_data.mine().m_parvals.at(0) / ( 3 - 6 * m_data.mine().m_parvals.at(1));
1740 T traceCt = m_data.mine().m_Gcov_def(0,0)*m_data.mine().m_Gcon_ori(0,0) +
1741 m_data.mine().m_Gcov_def(0,1)*m_data.mine().m_Gcon_ori(0,1) +
1742 m_data.mine().m_Gcov_def(1,0)*m_data.mine().m_Gcon_ori(1,0) +
1743 m_data.mine().m_Gcov_def(1,1)*m_data.mine().m_Gcon_ori(1,1);
1744 T I_1 = traceCt + c(2,2);
1745 T I_2 = c(2,2) * traceCt + m_data.mine().m_J0_sq;
1747 T c2 = mu/(m_data.mine().m_parvals.at(2)+1);
1748 T c1 = m_data.mine().m_parvals.at(2)*c2;
1750 return c1 * math::pow( m_data.mine().m_J_sq , -1.0/3.0 ) * ( m_data.mine().m_Gcon_ori(i,j) - 1.0/3.0 * I_1 * cinv(i,j) )
1751 + c2 * math::pow( m_data.mine().m_J_sq , -2.0/3.0 ) * ( _dI_2(i,j,c,cinv)- 2.0/3.0 * I_2 * cinv(i,j) )
1752 + K * 0.5 * ( m_data.mine().m_J_sq - 1.0 ) * cinv(i,j);
1755 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1756 template <enum Material _mat, enum Implementation _imp>
1757 constexpr
typename std::enable_if<_mat==Material::NH_ext && _imp == Implementation::Analytical, T>::type
1763 T mu = m_data.mine().m_parvals.at(0) / (2.*(1. + m_data.mine().m_parvals.at(1)));
1764 T lambda = m_data.mine().m_parvals.at(0) * m_data.mine().m_parvals.at(1) / ( (1. + m_data.mine().m_parvals.at(1))*(1.-2.*m_data.mine().m_parvals.at(1)));
1765 return mu * m_data.mine().m_Gcon_ori(i,j) - mu * cinv(i,j) + lambda / 2.0 * ( m_data.mine().m_J_sq - 1 ) * cinv(i,j);
1768 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1769 template <enum Material _mat, enum Implementation _imp>
1770 constexpr
typename std::enable_if<_imp == Implementation::Spectral, T>::type
1774 this->_computeStretch(c,m_data.mine().m_gcon_ori);
1775 for (
index_t a = 0; a != 3; a++)
1778 ( m_data.mine().m_gcon_ori.col(i).dot(m_data.mine().m_stretchvec.col(a)) )*( m_data.mine().m_gcon_ori.col(j).dot(m_data.mine().m_stretchvec.col(a)) )
1784 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1785 template <enum Material _mat, enum Implementation _imp>
1786 constexpr
typename std::enable_if<_imp == Implementation::Generalized, T>::type
1792 return 2.0 * _dPsi(i,j,c,cinv);
1797 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1802 C.block(0,0,2,2) = m_data.mine().m_Gcov_def.block(0,0,2,2);
1803 C(2,2) = 1./m_data.mine().m_J0_sq;
1807 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1810 this->_computeStretch(c,m_data.mine().m_gcon_ori);
1814 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1821 this->_computePoints(patch,u);
1825 for (
index_t k=0; k!=u.cols(); k++)
1828 for (
index_t v=0; v!=m_data.mine().m_parmat.rows(); v++)
1829 m_data.mine().m_parvals.at(v) = m_data.mine().m_parmat(v,k);
1831 for(
index_t j=0; j < z.rows(); ++j )
1833 colIdx = j*u.cols()+k;
1834 this->_getMetric(k, z(j, k) * m_data.mine().m_Tmat(0, k));
1849 c.block(0,0,2,2) = m_data.mine().m_Gcov_def.block(0,0,2,2);
1850 c(2,2) = math::pow(m_data.mine().m_J0_sq,-1.0);
1853 cinv.block(0,0,2,2) = m_data.mine().m_Gcon_def.block(0,0,2,2);
1854 cinv(2,2) = 1.0/c(2,2);
1856 m_data.mine().m_J_sq = m_data.mine().m_J0_sq * c(2,2);
1857 S33 = _Sij(2,2,c,cinv);
1859 C3333 = _Cijkl3D(2,2,2,2,c,cinv);
1861 dc33 = -2. * S33 / C3333;
1862 for (
index_t it = 0; it < itmax; it++)
1867 cinv(2,2) = 1.0/c(2,2);
1869 m_data.mine().m_J_sq = m_data.mine().m_J0_sq * c(2,2) ;
1871 S33 = _Sij(2,2,c,cinv);
1872 C3333 = _Cijkl3D(2,2,2,2,c,cinv);
1874 dc33 = -2. * S33 / C3333;
1875 if (math::lessthan(
math::abs(dc33),tol))
1877 result(0,colIdx) = c(2,2);
1880 GISMO_ENSURE(it != itmax-1,
"Error: Method did not converge, S33 = "<<S33<<
", dc33 = "<<dc33<<
" and tolerance = "<<tol<<
"\n");
1888 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1895 this->_computePoints(patch,u);
1899 for (
index_t k=0; k!=u.cols(); k++)
1902 for (
index_t v=0; v!=m_data.mine().m_parmat.rows(); v++)
1903 m_data.mine().m_parvals.at(v) = m_data.mine().m_parmat(v,k);
1905 for(
index_t j=0; j < z.rows(); ++j )
1907 colIdx = j*u.cols()+k;
1908 this->_getMetric(k, z(j, k) * m_data.mine().m_Tmat(0, k),Cmat);
1923 c.block(0,0,2,2) = m_data.mine().m_Gcov_def.block(0,0,2,2);
1924 c(2,2) = math::pow(m_data.mine().m_J0_sq,-1.0);
1927 cinv.block(0,0,2,2) = m_data.mine().m_Gcon_def.block(0,0,2,2);
1928 cinv(2,2) = 1.0/c(2,2);
1930 m_data.mine().m_J_sq = m_data.mine().m_J0_sq * c(2,2);
1931 S33 = _Sij(2,2,c,cinv);
1933 C3333 = _Cijkl3D(2,2,2,2,c,cinv);
1935 dc33 = -2. * S33 / C3333;
1936 for (
index_t it = 0; it < itmax; it++)
1941 cinv(2,2) = 1.0/c(2,2);
1943 m_data.mine().m_J_sq = m_data.mine().m_J0_sq * c(2,2) ;
1945 S33 = _Sij(2,2,c,cinv);
1946 C3333 = _Cijkl3D(2,2,2,2,c,cinv);
1948 dc33 = -2. * S33 / C3333;
1949 if (math::lessthan(
math::abs(dc33),tol))
1951 result(0,colIdx) = c(2,2);
1954 GISMO_ENSURE(it != itmax-1,
"Error: Method did not converge, S33 = "<<S33<<
", dc33 = "<<dc33<<
" and tolerance = "<<tol<<
"\n");
1961 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1972 gsMatrix<T> C33s = _eval3D_Compressible_C33(Cmat,patch,u,zmat);
1976 for (
index_t k=0; k!=u.cols(); k++)
1979 for (
index_t v=0; v!=m_data.mine().m_parmat.rows(); v++)
1980 m_data.mine().m_parvals.
at(v) = m_data.mine().m_parmat(v,k);
1982 this->_getMetric(0, z * m_data.mine().m_Tmat(0, 0), Cmat);
1988 c.block(0,0,2,2) = m_data.mine().m_Gcov_def.block(0,0,2,2);
1991 cinv.block(0,0,2,2) = m_data.mine().m_Gcon_def.block(0,0,2,2);
1992 cinv(2,2) = 1.0/C33;
1993 m_data.mine().m_J_sq = m_data.mine().m_J0_sq * C33;
2001 C(0,0) = _Cijkl(0,0,0,0,c,cinv);
2002 C(1,1) = _Cijkl(1,1,1,1,c,cinv);
2003 C(2,2) = _Cijkl(0,1,0,1,c,cinv);
2004 C(1,0) = C(0,1) = _Cijkl(0,0,1,1,c,cinv);
2005 C(2,0) = C(0,2) = _Cijkl(0,0,0,1,c,cinv);
2006 C(2,1) = C(1,2) = _Cijkl(1,1,0,1,c,cinv);
2011 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2020 gsMatrix<T> C33s = _eval3D_Compressible_C33(patch,u,z);
2024 for (
index_t k=0; k!=u.cols(); k++)
2027 for (
index_t v=0; v!=m_data.mine().m_parmat.rows(); v++)
2028 m_data.mine().m_parvals.at(v) = m_data.mine().m_parmat(v,k);
2030 for(
index_t j=0; j < z.rows(); ++j )
2032 colIdx = j*u.cols()+k;
2033 this->_getMetric(k, z(j, k) * m_data.mine().m_Tmat(0, k));
2035 C33 = C33s(0,colIdx);
2039 c.block(0,0,2,2) = m_data.mine().m_Gcov_def.block(0,0,2,2);
2042 cinv.block(0,0,2,2) = m_data.mine().m_Gcon_def.block(0,0,2,2);
2043 cinv(2,2) = 1.0/C33;
2044 m_data.mine().m_J_sq = m_data.mine().m_J0_sq * C33;
2052 C(0,0) = _Cijkl(0,0,0,0,c,cinv);
2053 C(1,1) = _Cijkl(1,1,1,1,c,cinv);
2054 C(2,2) = _Cijkl(0,1,0,1,c,cinv);
2055 C(1,0) = C(0,1) = _Cijkl(0,0,1,1,c,cinv);
2056 C(2,0) = C(0,2) = _Cijkl(0,0,0,1,c,cinv);
2057 C(2,1) = C(1,2) = _Cijkl(1,1,0,1,c,cinv);
2066 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2069 GISMO_ENSURE( ( (i < 3) && (j < 3) ) ,
"Index out of range. i="<<i<<
", j="<<j);
2070 GISMO_ENSURE(!comp,
"Material model is not incompressible?");
2071 GISMO_ENSURE(imp==Implementation::Generalized,
"Not generalized implementation");
2072 return _dPsi_impl<mat>(i,j);
2075 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2076 template <enum Material _mat>
2077 constexpr
typename std::enable_if<_mat==Material::NH, T>::type
2080 T mu = m_data.mine().m_parvals.at(0) / (2. * (1. + m_data.mine().m_parvals.at(1)));
2081 return 0.5 * mu * m_data.mine().m_Gcon_ori(i,j);
2084 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2085 template <enum Material _mat>
2086 constexpr
typename std::enable_if<_mat==Material::MR, T>::type
2089 T mu = m_data.mine().m_parvals.at(0) / (2. * (1. + m_data.mine().m_parvals.at(1)));
2090 T c2 = mu/(m_data.mine().m_parvals.at(2)+1);
2091 T c1 = m_data.mine().m_parvals.at(2)*c2;
2093 if ((i==2) && (j==2))
2095 T traceCt = m_data.mine().m_Gcov_def(0,0)*m_data.mine().m_Gcon_ori(0,0) +
2096 m_data.mine().m_Gcov_def(0,1)*m_data.mine().m_Gcon_ori(0,1) +
2097 m_data.mine().m_Gcov_def(1,0)*m_data.mine().m_Gcon_ori(1,0) +
2098 m_data.mine().m_Gcov_def(1,1)*m_data.mine().m_Gcon_ori(1,1);
2099 tmp = c1/2.0 + c2 / 2.0 * traceCt;
2102 tmp = c1 / 2. * m_data.mine().m_Gcon_ori(i,j) + c2 / 2. * ( 1. / m_data.mine().m_J0_sq * m_data.mine().m_Gcon_ori(i,j) + m_data.mine().m_J0_sq * m_data.mine().m_Gcon_def(i,j) );
2108 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2111 GISMO_ENSURE( ( (i < 3) && (j < 3) && (k < 3) && (l < 3) ) ,
"Index out of range. i="<<i<<
", j="<<j<<
", k="<<k<<
", l="<<l);
2112 GISMO_ENSURE(!comp,
"Material model is not incompressible?");
2113 GISMO_ENSURE(imp==Implementation::Generalized,
"Not generalized implementation");
2114 return _d2Psi_impl<mat>(i,j,k,l);
2117 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2118 template <enum Material _mat>
2119 constexpr
typename std::enable_if<_mat==Material::NH, T>::type
2125 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2126 template <enum Material _mat>
2127 constexpr
typename std::enable_if<_mat==Material::MR, T>::type
2131 T mu = m_data.mine().m_parvals.at(0) / (2. * (1. + m_data.mine().m_parvals.at(1)));
2132 T c2 = mu/(m_data.mine().m_parvals.at(2)+1);
2134 if ( ((i==2) && (j==2)) && !((k==2) || (l==2)) )
2135 tmp = c2 / 2.0 * m_data.mine().m_Gcon_ori(k,l);
2136 else if ( !((i==2) && (j==2)) && ((k==2) || (l==2)) )
2137 tmp = c2 / 2.0 * m_data.mine().m_Gcon_ori(i,j);
2138 else if ( ((i==2) && (j==2)) && ((k==2) || (l==2)) )
2142 T Gabcd = - 1./2. * ( m_data.mine().m_Gcon_def(i,k)*m_data.mine().m_Gcon_def(j,l) + m_data.mine().m_Gcon_def(i,l)*m_data.mine().m_Gcon_def(j,k) );
2143 tmp = c2 / 2.0 * m_data.mine().m_J0_sq * ( Gabcd + m_data.mine().m_Gcon_def(i,j)*m_data.mine().m_Gcon_def(k,l) );
2154 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2157 return m_data.mine().m_Gcon_ori(i,j);
2162 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2165 T traceCt = m_data.mine().m_Gcov_def(0,0)*m_data.mine().m_Gcon_ori(0,0) +
2166 m_data.mine().m_Gcov_def(0,1)*m_data.mine().m_Gcon_ori(0,1) +
2167 m_data.mine().m_Gcov_def(1,0)*m_data.mine().m_Gcon_ori(1,0) +
2168 m_data.mine().m_Gcov_def(1,1)*m_data.mine().m_Gcon_ori(1,1);
2169 return idelta(i,2)*idelta(j,2)*( c(2,2)*_dI_1(i,j) + m_data.mine().m_J0_sq*cinv(i,j) ) + delta(i,2)*delta(j,2)*traceCt;
2174 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2177 GISMO_ENSURE(imp==Implementation::Generalized,
"Not generalized implementation");
2178 return _dPsi_impl<mat>(i,j,c,cinv);
2183 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2184 template <enum Material _mat>
2185 constexpr
typename std::enable_if<_mat==Material::NH, T>::type
2188 T mu = m_data.mine().m_parvals.at(0) / (2. * (1. + m_data.mine().m_parvals.at(1)));
2189 T traceCt = m_data.mine().m_Gcov_def(0,0)*m_data.mine().m_Gcon_ori(0,0) +
2190 m_data.mine().m_Gcov_def(0,1)*m_data.mine().m_Gcon_ori(0,1) +
2191 m_data.mine().m_Gcov_def(1,0)*m_data.mine().m_Gcon_ori(1,0) +
2192 m_data.mine().m_Gcov_def(1,1)*m_data.mine().m_Gcon_ori(1,1);
2193 T I_1 = traceCt + c(2,2);
2194 return mu/2.0 * math::pow(m_data.mine().m_J_sq,-1./3.) * ( - 1.0/3.0 * I_1 * cinv(i,j) + _dI_1(i,j) ) + _dPsi_vol(i,j,c,cinv);
2197 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2198 template <enum Material _mat>
2199 constexpr
typename std::enable_if<_mat==Material::MR, T>::type
2202 T mu = m_data.mine().m_parvals.at(0) / (2. * (1. + m_data.mine().m_parvals.at(1)));
2203 T traceCt = m_data.mine().m_Gcov_def(0,0)*m_data.mine().m_Gcon_ori(0,0) +
2204 m_data.mine().m_Gcov_def(0,1)*m_data.mine().m_Gcon_ori(0,1) +
2205 m_data.mine().m_Gcov_def(1,0)*m_data.mine().m_Gcon_ori(1,0) +
2206 m_data.mine().m_Gcov_def(1,1)*m_data.mine().m_Gcon_ori(1,1);
2207 T I_1 = traceCt + c(2,2);
2208 T I_2 = c(2,2) * traceCt + m_data.mine().m_J0_sq;
2209 T c2= mu/(m_data.mine().m_parvals.at(2)+1);
2210 T c1= m_data.mine().m_parvals.at(2)*c2;
2211 return c1/2.0 * math::pow(m_data.mine().m_J_sq,-1./3.) * ( - 1.0/3.0 * I_1 * cinv(i,j) + _dI_1(i,j) )
2212 + c2/2.0 * math::pow(m_data.mine().m_J_sq,-2./3.) * ( - 2.0/3.0 * I_2 * cinv(i,j) + _dI_2(i,j,c,cinv) )
2213 + _dPsi_vol(i,j,c,cinv);
2216 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2217 template <enum Material _mat>
2218 constexpr
typename std::enable_if<_mat==Material::NH_ext, T>::type
2221 T mu = m_data.mine().m_parvals.at(0) / (2. * (1. + m_data.mine().m_parvals.at(1)));
2222 T lambda = m_data.mine().m_parvals.at(0) * m_data.mine().m_parvals.at(1) / ( (1. + m_data.mine().m_parvals.at(1))*(1.-2.*m_data.mine().m_parvals.at(1)));
2223 return mu / 2.0 * _dI_1(i,j) - mu / 2.0 * cinv(i,j) + lambda / 4.0 * ( m_data.mine().m_J_sq - 1 ) * cinv(i,j);
2228 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2231 T K = m_data.mine().m_parvals.at(0) / ( 3 - 6 * m_data.mine().m_parvals.at(1));
2232 return K * 0.25 * (m_data.mine().m_J_sq - 1.0) * cinv(i,j);
2237 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2238 constexpr T
gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::_d2Psi(
const index_t i,
const index_t j,
const index_t k,
const index_t l,
const gsMatrix<T> & c,
const gsMatrix<T> & cinv)
const
2240 GISMO_ENSURE( ( (i < 3) && (j < 3) && (k < 3) && (l < 3) ) ,
"Index out of range. i="<<i<<
", j="<<j<<
", k="<<k<<
", l="<<l);
2241 GISMO_ENSURE(comp,
"Material model is not compressible?");
2242 GISMO_ENSURE(imp==Implementation::Generalized,
"Not generalized implementation");
2243 return _d2Psi_impl<mat>(i,j,k,l,c,cinv);
2246 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2247 template <enum Material _mat>
2248 constexpr
typename std::enable_if<_mat==Material::NH, T>::type
2249 gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::_d2Psi_impl(
const index_t i,
const index_t j,
const index_t k,
const index_t l,
const gsMatrix<T> & c,
const gsMatrix<T> & cinv)
const
2251 GISMO_ENSURE(3 - 6 * m_data.mine().m_parvals.at(1) != 0,
"Bulk modulus is infinity for compressible material model. Try to use incompressible models.");
2252 T mu = m_data.mine().m_parvals.at(0) / (2. * (1. + m_data.mine().m_parvals.at(1)));
2253 T dCinv = - 1./2.*( cinv(i,k)*cinv(j,l) + cinv(i,l)*cinv(j,k) );
2254 T traceCt = m_data.mine().m_Gcov_def(0,0)*m_data.mine().m_Gcon_ori(0,0) +
2255 m_data.mine().m_Gcov_def(0,1)*m_data.mine().m_Gcon_ori(0,1) +
2256 m_data.mine().m_Gcov_def(1,0)*m_data.mine().m_Gcon_ori(1,0) +
2257 m_data.mine().m_Gcov_def(1,1)*m_data.mine().m_Gcon_ori(1,1);
2258 T I_1 = traceCt + c(2,2);
2259 return 1.0/9.0 * mu / 2.0 * math::pow(m_data.mine().m_J_sq, -1.0/3.0) * ( I_1*cinv(i,j)*cinv(k,l)
2260 - 3.0*_dI_1(i,j)*cinv(k,l) - 3.0*cinv(i,j)*_dI_1(k,l)
2262 + _d2Psi_vol(i,j,k,l,c,cinv);
2265 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2266 template <enum Material _mat>
2267 constexpr
typename std::enable_if<_mat==Material::MR, T>::type
2268 gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::_d2Psi_impl(
const index_t i,
const index_t j,
const index_t k,
const index_t l,
const gsMatrix<T> & c,
const gsMatrix<T> & cinv)
const
2270 GISMO_ENSURE(3 - 6 * m_data.mine().m_parvals.at(1) != 0,
"Bulk modulus is infinity for compressible material model. Try to use incompressible models.");
2271 T mu = m_data.mine().m_parvals.at(0) / (2. * (1. + m_data.mine().m_parvals.at(1)));
2272 T dCinv = - 1./2.*( cinv(i,k)*cinv(j,l) + cinv(i,l)*cinv(j,k) );
2273 T traceCt = m_data.mine().m_Gcov_def(0,0)*m_data.mine().m_Gcon_ori(0,0) +
2274 m_data.mine().m_Gcov_def(0,1)*m_data.mine().m_Gcon_ori(0,1) +
2275 m_data.mine().m_Gcov_def(1,0)*m_data.mine().m_Gcon_ori(1,0) +
2276 m_data.mine().m_Gcov_def(1,1)*m_data.mine().m_Gcon_ori(1,1);
2277 T I_1 = traceCt + c(2,2);
2278 T I_2 = c(2,2) * traceCt + m_data.mine().m_J0_sq;
2279 T d2I_2 = idelta(i,2)*idelta(j,2)*idelta(k,2)*idelta(l,2)*( m_data.mine().m_J0_sq*( cinv(i,j)*cinv(k,l) + dCinv ) )
2280 + delta(i,2)*delta(j,2)*idelta(k,2)*idelta(l,2)*_dI_1(k,l)
2281 + idelta(i,2)*idelta(j,2)*delta(k,2)*delta(l,2)*_dI_1(i,j);
2282 T c2 = mu/(m_data.mine().m_parvals.at(2)+1);
2283 T c1 = m_data.mine().m_parvals.at(2)*c2;
2286 1.0/9.0 * c1 / 2.0 * math::pow(m_data.mine().m_J_sq, -1.0/3.0) * ( I_1*cinv(i,j)*cinv(k,l)
2287 - 3.0*_dI_1(i,j)*cinv(k,l) - 3.0*cinv(i,j)*_dI_1(k,l)
2289 + 1.0/9.0 * c2 / 2.0 * math::pow(m_data.mine().m_J_sq, -2.0/3.0) * ( 4.0*I_2*cinv(i,j)*cinv(k,l) - 6.0*I_2*dCinv
2290 - 6.0*_dI_2(i,j,c,cinv)*cinv(k,l)- 6.0*cinv(i,j)*_dI_2(k,l,c,cinv)
2292 + _d2Psi_vol(i,j,k,l,c,cinv);
2295 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2296 template <enum Material _mat>
2297 constexpr
typename std::enable_if<_mat==Material::NH_ext, T>::type
2298 gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::_d2Psi_impl(
const index_t i,
const index_t j,
const index_t k,
const index_t l,
const gsMatrix<T> & c,
const gsMatrix<T> & cinv)
const
2300 T mu = m_data.mine().m_parvals.at(0) / (2. * (1. + m_data.mine().m_parvals.at(1)));
2301 T dCinv = - 1./2.*( cinv(i,k)*cinv(j,l) + cinv(i,l)*cinv(j,k) );
2302 T lambda = m_data.mine().m_parvals.at(0) * m_data.mine().m_parvals.at(1) / ( (1. + m_data.mine().m_parvals.at(1))*(1.-2.*m_data.mine().m_parvals.at(1)));
2303 return - mu / 2.0 * dCinv + lambda / 4.0 * ( m_data.mine().m_J_sq*cinv(i,j)*cinv(k,l) + (m_data.mine().m_J_sq-1.0)*dCinv );
2306 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2307 constexpr T
gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::_d2Psi_vol(
const index_t i,
const index_t j,
const index_t k,
const index_t l,
const gsMatrix<T> & c,
const gsMatrix<T> & cinv)
const
2309 T dCinv = - 1./2.*( cinv(i,k)*cinv(j,l) + cinv(i,l)*cinv(j,k) );
2310 T K = m_data.mine().m_parvals.at(0) / ( 3 - 6 * m_data.mine().m_parvals.at(1));
2311 return K * 0.25 * ( m_data.mine().m_J_sq*cinv(i,j)*cinv(k,l) + (m_data.mine().m_J_sq-1.0)*dCinv );
2320 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2324 return _dPsi_da_impl<mat,comp>(a);
2327 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2328 template <enum Material _mat,
bool _comp>
2329 constexpr
typename std::enable_if<_comp && (_mat==Material::NH), T>::type
2333 T mu = m_data.mine().m_parvals.at(0) / (2 * (1 + m_data.mine().m_parvals.at(1)));
2334 T I_1 = m_data.mine().m_stretches(0)*m_data.mine().m_stretches(0) + m_data.mine().m_stretches(1)*m_data.mine().m_stretches(1) + m_data.mine().m_stretches(2)*m_data.mine().m_stretches(2);
2335 T _dI_1a = 2*m_data.mine().m_stretches(a);
2337 return mu/2.0 * math::pow(m_data.mine().m_J_sq,-1./3.) * ( -2./3. * I_1 / m_data.mine().m_stretches(a) + _dI_1a )
2341 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2342 template <enum Material _mat,
bool _comp>
2343 constexpr
typename std::enable_if<!_comp && (_mat==Material::NH), T>::type
2346 T mu = m_data.mine().m_parvals.at(0) / (2 * (1 + m_data.mine().m_parvals.at(1)));
2347 T _dI_1a = 2*m_data.mine().m_stretches(a);
2348 return mu/2 * _dI_1a;
2351 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2352 template <enum Material _mat,
bool _comp>
2353 constexpr
typename std::enable_if<_comp && (_mat==Material::MR), T>::type
2356 T mu = m_data.mine().m_parvals.at(0) / (2 * (1 + m_data.mine().m_parvals.at(1)));
2357 T I_1 = m_data.mine().m_stretches(0)*m_data.mine().m_stretches(0) + m_data.mine().m_stretches(1)*m_data.mine().m_stretches(1) + m_data.mine().m_stretches(2)*m_data.mine().m_stretches(2);
2358 T _dI_1a = 2*m_data.mine().m_stretches(a);
2359 T I_2 = math::pow(m_data.mine().m_stretches(0),2.)*math::pow(m_data.mine().m_stretches(1),2.)
2360 + math::pow(m_data.mine().m_stretches(1),2.)*math::pow(m_data.mine().m_stretches(2),2.)
2361 + math::pow(m_data.mine().m_stretches(0),2.)*math::pow(m_data.mine().m_stretches(2),2.);
2362 T _dI_2a = 2*m_data.mine().m_stretches(a)*( I_1 - math::pow(m_data.mine().m_stretches(a),2.0) );
2364 T c2= mu/(m_data.mine().m_parvals.at(2)+1);
2365 T c1= m_data.mine().m_parvals.at(2)*c2;
2366 return c1/2.0 * math::pow(m_data.mine().m_J_sq,-1./3.) * ( -2./3. * I_1 / m_data.mine().m_stretches(a) + _dI_1a )
2367 + c2/2.0 * math::pow(m_data.mine().m_J_sq,-2./3.) * ( -4./3. * I_2 / m_data.mine().m_stretches(a) + _dI_2a )
2371 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2372 template <enum Material _mat,
bool _comp>
2373 constexpr
typename std::enable_if<!_comp && (_mat==Material::MR), T>::type
2376 T mu = m_data.mine().m_parvals.at(0) / (2 * (1 + m_data.mine().m_parvals.at(1)));
2377 T I_1 = m_data.mine().m_stretches(0)*m_data.mine().m_stretches(0) + m_data.mine().m_stretches(1)*m_data.mine().m_stretches(1) + m_data.mine().m_stretches(2)*m_data.mine().m_stretches(2);
2378 T _dI_1a = 2*m_data.mine().m_stretches(a);
2379 T _dI_2a = 2*m_data.mine().m_stretches(a)*( I_1 - math::pow(m_data.mine().m_stretches(a),2.0) );
2381 T c2 = mu/(m_data.mine().m_parvals.at(2)+1);
2382 T c1 = m_data.mine().m_parvals.at(2)*c2;
2383 return c1/2.0*_dI_1a + c2/2.0*_dI_2a;
2386 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2387 template <enum Material _mat,
bool _comp>
2388 constexpr
typename std::enable_if<_comp && (_mat==Material::OG), T>::type
2391 GISMO_ENSURE(3 - 6 * m_data.mine().m_parvals.at(1) != 0,
"Bulk modulus is infinity for compressible material model. Try to use incompressible models.");
2393 index_t n = (m_pars.size()-2)/2;
2394 T alpha_i, mu_i, Lambda;
2397 alpha_i = m_data.mine().m_parvals.at(2*(k+1)+1);
2398 mu_i = m_data.mine().m_parvals.at(2*(k+1));
2399 Lambda = math::pow(m_data.mine().m_stretches(0),alpha_i) + math::pow(m_data.mine().m_stretches(1),alpha_i) + math::pow(m_data.mine().m_stretches(2),alpha_i);
2400 tmp += mu_i * math::pow(m_data.mine().m_J_sq,-alpha_i/6.0) * ( math::pow(m_data.mine().m_stretches(a),alpha_i-1) - 1./3. * 1./m_data.mine().m_stretches(a) * Lambda );
2402 return tmp + _dPsi_da_vol(a);
2404 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2405 template <enum Material _mat,
bool _comp>
2406 constexpr
typename std::enable_if<!_comp && (_mat==Material::OG), T>::type
2410 index_t n = (m_pars.size()-2)/2;
2414 alpha_i = m_data.mine().m_parvals.at(2*(k+1)+1);
2415 mu_i = m_data.mine().m_parvals.at(2*(k+1));
2416 tmp += mu_i*math::pow(m_data.mine().m_stretches(a),alpha_i-1);
2421 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2422 template <enum Material _mat,
bool _comp>
2423 constexpr
typename std::enable_if<_comp && (_mat==Material::NH_ext), T>::type
2426 T mu = m_data.mine().m_parvals.at(0) / (2 * (1 + m_data.mine().m_parvals.at(1)));
2427 T _dI_1a = 2*m_data.mine().m_stretches(a);
2428 GISMO_ENSURE(3 - 6 * m_data.mine().m_parvals.at(1) != 0,
"Bulk modulus is infinity for compressible material model. Try to use incompressible models.");
2430 T lambda = m_data.mine().m_parvals.at(0) * m_data.mine().m_parvals.at(1) / ( (1. + m_data.mine().m_parvals.at(1))*(1.-2.*m_data.mine().m_parvals.at(1)));
2432 return mu/2.0 * _dI_1a - mu / m_data.mine().m_stretches(a) + lambda / (m_data.mine().m_stretches(a)*2) * (m_data.mine().m_J_sq-1.0);
2435 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2438 GISMO_ENSURE(3 - 6 * m_data.mine().m_parvals.at(1) != 0,
"Bulk modulus is infinity for compressible material model. Try to use incompressible models.");
2440 T K = m_data.mine().m_parvals.at(0) / ( 3 - 6 * m_data.mine().m_parvals.at(1));
2441 return K / (m_data.mine().m_stretches(a)*beta) * (1.0 - math::pow(m_data.mine().m_J_sq,-beta/2.0));
2446 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2449 GISMO_ENSURE( ( (a < 3) && (b < 3) ) ,
"Index out of range. a="<<a<<
", b="<<b);
2450 return _d2Psi_dab_impl<mat,comp>(a,b);
2453 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2454 template <enum Material _mat,
bool _comp>
2455 constexpr
typename std::enable_if<_comp && (_mat==Material::NH), T>::type
2458 T mu = m_data.mine().m_parvals.at(0) / (2 * (1 + m_data.mine().m_parvals.at(1)));
2460 T I_1 = m_data.mine().m_stretches(0)*m_data.mine().m_stretches(0) + m_data.mine().m_stretches(1)*m_data.mine().m_stretches(1) + m_data.mine().m_stretches(2)*m_data.mine().m_stretches(2);
2461 T _dI_1a = 2*m_data.mine().m_stretches(a);
2462 T _dI_1b = 2*m_data.mine().m_stretches(b);
2463 T d2I_1 = 2*delta(a,b);
2464 return mu/2.0 * math::pow(m_data.mine().m_J_sq,-1./3.) * (
2465 -2./3. * 1. / m_data.mine().m_stretches(b) * ( -2./3. * I_1 / m_data.mine().m_stretches(a) + _dI_1a )
2466 -2./3. * 1. / m_data.mine().m_stretches(a) * _dI_1b
2468 +2./3. * delta(a,b) * I_1 / (m_data.mine().m_stretches(a)*m_data.mine().m_stretches(a))
2470 + _d2Psi_dab_vol(a,b);
2473 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2474 template <enum Material _mat,
bool _comp>
2475 constexpr
typename std::enable_if<!_comp && (_mat==Material::NH), T>::type
2478 T mu = m_data.mine().m_parvals.at(0) / (2 * (1 + m_data.mine().m_parvals.at(1)));
2479 T d2I_1 = 2*delta(a,b);
2480 return mu/2 * d2I_1;
2483 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2484 template <enum Material _mat,
bool _comp>
2485 constexpr
typename std::enable_if<_comp && (_mat==Material::MR), T>::type
2488 T mu = m_data.mine().m_parvals.at(0) / (2 * (1 + m_data.mine().m_parvals.at(1)));
2490 T I_1 = m_data.mine().m_stretches(0)*m_data.mine().m_stretches(0) + m_data.mine().m_stretches(1)*m_data.mine().m_stretches(1) + m_data.mine().m_stretches(2)*m_data.mine().m_stretches(2);
2491 T _dI_1a = 2*m_data.mine().m_stretches(a);
2492 T _dI_1b = 2*m_data.mine().m_stretches(b);
2493 T d2I_1 = 2*delta(a,b);
2495 T I_2 = math::pow(m_data.mine().m_stretches(0),2.)*math::pow(m_data.mine().m_stretches(1),2.)
2496 + math::pow(m_data.mine().m_stretches(1),2.)*math::pow(m_data.mine().m_stretches(2),2.)
2497 + math::pow(m_data.mine().m_stretches(0),2.)*math::pow(m_data.mine().m_stretches(2),2.);
2498 T _dI_2a = 2*m_data.mine().m_stretches(a)*( I_1 - math::pow(m_data.mine().m_stretches(a),2.0) );
2499 T _dI_2b = 2*m_data.mine().m_stretches(b)*( I_1 - math::pow(m_data.mine().m_stretches(b),2.0) );
2500 T d2I_2 = idelta(a,b)*4.0*m_data.mine().m_stretches(a)*m_data.mine().m_stretches(b) + delta(a,b)*2.0*(I_1 - m_data.mine().m_stretches(a)*m_data.mine().m_stretches(a));
2502 T c2 = mu/(m_data.mine().m_parvals.at(2)+1);
2503 T c1 = m_data.mine().m_parvals.at(2)*c2;
2505 c1/2.0 * math::pow(m_data.mine().m_J_sq,-1./3.) * (
2506 -2./3. * 1. / m_data.mine().m_stretches(b) * ( -2./3. * I_1 / m_data.mine().m_stretches(a) + _dI_1a )
2507 -2./3. * 1. / m_data.mine().m_stretches(a) * _dI_1b
2509 +2./3. * delta(a,b) * I_1 / (m_data.mine().m_stretches(a)*m_data.mine().m_stretches(a))
2511 + c2/2.0 * math::pow(m_data.mine().m_J_sq,-2./3.) * (
2512 -4./3. * 1. / m_data.mine().m_stretches(b) * ( -4./3. * I_2 / m_data.mine().m_stretches(a) + _dI_2a )
2513 -4./3. * 1. / m_data.mine().m_stretches(a) * _dI_2b
2515 +4./3. * delta(a,b) * I_2 / (m_data.mine().m_stretches(a)*m_data.mine().m_stretches(a))
2517 + _d2Psi_dab_vol(a,b);
2520 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2521 template <enum Material _mat,
bool _comp>
2522 constexpr
typename std::enable_if<!_comp && (_mat==Material::MR), T>::type
2525 GISMO_ENSURE(m_pars.size()==3,
"Mooney-Rivlin model needs to be a 3 parameter model");
2526 T mu = m_data.mine().m_parvals.at(0) / (2 * (1 + m_data.mine().m_parvals.at(1)));
2528 T I_1 = m_data.mine().m_stretches(0)*m_data.mine().m_stretches(0) + m_data.mine().m_stretches(1)*m_data.mine().m_stretches(1) + m_data.mine().m_stretches(2)*m_data.mine().m_stretches(2);
2529 T d2I_1 = 2*delta(a,b);
2531 T d2I_2 = idelta(a,b)*4.0*m_data.mine().m_stretches(a)*m_data.mine().m_stretches(b) + delta(a,b)*2.0*(I_1 - m_data.mine().m_stretches(a)*m_data.mine().m_stretches(a));
2533 T c2 = mu/(m_data.mine().m_parvals.at(2)+1);
2534 T c1 = m_data.mine().m_parvals.at(2)*c2;
2536 return c1/2.0 * d2I_1 + c2/2.0 * d2I_2;
2539 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2540 template <enum Material _mat,
bool _comp>
2541 constexpr
typename std::enable_if<_comp && (_mat==Material::OG), T>::type
2545 index_t n = (m_pars.size()-2)/2;
2546 T alpha_i, mu_i, Lambda;
2549 alpha_i = m_data.mine().m_parvals.at(2*(k+1)+1);
2550 mu_i = m_data.mine().m_parvals.at(2*(k+1));
2551 Lambda = math::pow(m_data.mine().m_stretches(0),alpha_i) + math::pow(m_data.mine().m_stretches(1),alpha_i) + math::pow(m_data.mine().m_stretches(2),alpha_i);
2552 tmp += mu_i * math::pow(m_data.mine().m_J_sq,-alpha_i/6.0) *
2553 ( - alpha_i/3. * ( math::pow(m_data.mine().m_stretches(a),alpha_i-1.0) / m_data.mine().m_stretches(b) + math::pow(m_data.mine().m_stretches(b),alpha_i-1.0) / m_data.mine().m_stretches(a)
2554 - 1./3. * 1. / (m_data.mine().m_stretches(a)*m_data.mine().m_stretches(b)) * Lambda )
2555 + delta(a,b) * ( (alpha_i - 1.) * math::pow(m_data.mine().m_stretches(a),alpha_i-2.0) + Lambda / 3. * math::pow(m_data.mine().m_stretches(a),-2.0) )
2558 tmp += _d2Psi_dab_vol(a,b);
2562 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2563 template <enum Material _mat,
bool _comp>
2564 constexpr
typename std::enable_if<!_comp && (_mat==Material::OG), T>::type
2568 index_t n = (m_pars.size()-2)/2;
2572 alpha_i = m_data.mine().m_parvals.at(2*(k+1)+1);
2573 mu_i = m_data.mine().m_parvals.at(2*(k+1));
2574 tmp += mu_i*math::pow(m_data.mine().m_stretches(a),alpha_i-2)*(alpha_i-1)*delta(a,b);
2579 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2580 template <enum Material _mat,
bool _comp>
2581 constexpr
typename std::enable_if<_comp && (_mat==Material::NH_ext), T>::type
2584 T mu = m_data.mine().m_parvals.at(0) / (2 * (1 + m_data.mine().m_parvals.at(1)));
2585 T d2I_1 = 2*delta(a,b);
2586 T lambda = m_data.mine().m_parvals.at(0) * m_data.mine().m_parvals.at(1) / ( (1. + m_data.mine().m_parvals.at(1))*(1.-2.*m_data.mine().m_parvals.at(1)));
2588 return mu/2.0 * d2I_1 + mu * delta(a,b) / ( m_data.mine().m_stretches(a) * m_data.mine().m_stretches(b) ) + lambda / (2*m_data.mine().m_stretches(a)*m_data.mine().m_stretches(b)) * ( 2*m_data.mine().m_J_sq - delta(a,b) * (m_data.mine().m_J_sq - 1.0) );
2591 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2594 GISMO_ENSURE(3 - 6 * m_data.mine().m_parvals.at(1) != 0,
"Bulk modulus is infinity for compressible material model. Try to use incompressible models.");
2595 m_data.mine().m_J_sq = math::pow(m_data.mine().m_stretches(0)*m_data.mine().m_stretches(1)*m_data.mine().m_stretches(2),2.0);
2597 T K = m_data.mine().m_parvals.at(0) / ( 3 - 6 * m_data.mine().m_parvals.at(1));
2598 return K / (beta*m_data.mine().m_stretches(a)*m_data.mine().m_stretches(b)) * ( beta*math::pow(m_data.mine().m_J_sq,-beta/2.0) + delta(a,b) * (math::pow(m_data.mine().m_J_sq,-beta/2.0) - 1.0) );
2604 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2607 return 1.0/m_data.mine().m_stretches(a);
2612 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2615 return (a==b) ? 0.0 : 1.0 / ( m_data.mine().m_stretches(a) * m_data.mine().m_stretches(b) );
2620 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2623 return m_data.mine().m_stretches(2) * _dPsi_da(2);
2628 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2632 return m_data.mine().m_stretches(2) * _d2Psi_dab(2,a) + _dPsi_da(2);
2634 return m_data.mine().m_stretches(2) * _d2Psi_dab(2,a);
2641 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2644 return _Sa_impl<comp>(a);
2647 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2648 template <
bool _comp>
2649 constexpr
typename std::enable_if<_comp, T>::type
2652 return 1.0/m_data.mine().m_stretches(a) * _dPsi_da(a);
2655 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2656 template <
bool _comp>
2657 constexpr
typename std::enable_if<!_comp, T>::type
2660 return 1.0/m_data.mine().m_stretches(a) * (_dPsi_da(a) - _p() * _dJ_da(a) );
2665 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2668 return _dSa_db_impl<comp>(a,b);
2671 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2672 template <
bool _comp>
2673 constexpr
typename std::enable_if<_comp, T>::type
2676 T tmp = 1.0/m_data.mine().m_stretches(a) * _d2Psi_dab(a,b);
2678 tmp += - 1.0 / math::pow(m_data.mine().m_stretches(a),2) * _dPsi_da(a);
2682 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2683 template <
bool _comp>
2684 constexpr
typename std::enable_if<!_comp, T>::type
2687 T tmp = 1.0/m_data.mine().m_stretches(a) * ( _d2Psi_dab(a,b) - _dp_da(a)*_dJ_da(b) - _dp_da(b)*_dJ_da(a) - _p() * _d2J_dab(a,b) );
2689 tmp += - 1.0 / math::pow(m_data.mine().m_stretches(a),2) * (_dPsi_da(a) - _p() * _dJ_da(a));
2695 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2698 return _Cabcd_impl<comp>(a,b,c,d);
2701 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2702 template <
bool _comp>
2703 constexpr
typename std::enable_if<_comp, T>::type
2710 if (
abs((m_data.mine().m_stretches(a) - m_data.mine().m_stretches(b)) / m_data.mine().m_stretches(a)) < 1e-14)
2713 frac = 1.0 / (2.0 * m_data.mine().m_stretches(a) ) * ( _dSa_db(b,b) - _dSa_db(a,b));
2716 frac = ( _Sa(b)-_Sa(a) ) / (math::pow(m_data.mine().m_stretches(b),2) - math::pow(m_data.mine().m_stretches(a),2));
2718 GISMO_ENSURE( ( (a < 3) && (b < 3) && (c < 3) && (d < 3) ) ,
"Index out of range. a="<<a<<
", b="<<b<<
", c="<<c<<
", d="<<d);
2719 if ( ( (a==b) && (c==d)) )
2720 tmp = 1/m_data.mine().m_stretches(c) * _dSa_db(a,c);
2721 else if (( (a==d) && (b==c) && (a!=b) ) || ( ( (a==c) && (b==d) && (a!=b)) ))
2728 template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2729 template <
bool _comp>
2730 constexpr
typename std::enable_if<!_comp, T>::type
2737 if (
abs((m_data.mine().m_stretches(a) - m_data.mine().m_stretches(b)) / m_data.mine().m_stretches(a)) < 1e-14)
2740 frac = 1.0 / (2.0 * m_data.mine().m_stretches(a) ) * ( _dSa_db(b,b) - _dSa_db(a,b));
2743 frac = ( _Sa(b)-_Sa(a) ) / (math::pow(m_data.mine().m_stretches(b),2) - math::pow(m_data.mine().m_stretches(a),2));
2745 GISMO_ENSURE( ( (a < 2) && (b < 2) && (c < 2) && (d < 2) ) ,
"Index out of range. a="<<a<<
", b="<<b<<
", c="<<c<<
", d="<<d);
2746 if ( ( (a==b) && (c==d)) )
2747 tmp = 1/m_data.mine().m_stretches(c) * _dSa_db(a,c) + 1/(math::pow(m_data.mine().m_stretches(a),2) * math::pow(m_data.mine().m_stretches(c),2)) * ( math::pow(m_data.mine().m_stretches(2),2) * _d2Psi_dab(2,2) + 2*_dPsi_da(2)*m_data.mine().m_stretches(2) );
2748 else if (( (a==d) && (b==c) && (a!=b) ) || ( ( (a==c) && (b==d) && (a!=b)) ))
2823 template<
short_t d,
class T,
bool comp>
2832 static std::string tag () {
return "MaterialMatrix"; }
2833 static std::string type ()
2835 std::string comp_str = ((comp) ?
"Compressible" :
"Incompressible");
2839 GSXML_GET_POINTER(Object);
2841 static void get_into(gsXmlNode * node,Object & obj)
2843 obj = getMaterialMatrixFromXml< Object >( node );
2846 static gsXmlNode * put (
const Object & obj,
2849 return putMaterialMatrixToXml< Object >( obj,data );
2856 template<
short_t d,
class T,
bool comp>
2865 static std::string tag () {
return "MaterialMatrix"; }
2866 static std::string type ()
2868 std::string comp_str = ((comp) ?
"Compressible" :
"Incompressible");
2872 GSXML_GET_POINTER(Object);
2874 static void get_into(gsXmlNode * node,Object & obj)
2876 obj = getMaterialMatrixFromXml< Object >( node );
2879 static gsXmlNode * put (
const Object & obj,
2882 return putMaterialMatrixToXml< Object >( obj,data );
2889 template<
short_t d,
class T,
bool comp>
2898 static std::string tag () {
return "MaterialMatrix"; }
2899 static std::string type ()
2901 std::string comp_str = ((comp) ?
"Compressible" :
"Incompressible");
2905 GSXML_GET_POINTER(Object);
2907 static void get_into(gsXmlNode * node,Object & obj)
2909 obj = getMaterialMatrixFromXml< Object >( node );
2912 static gsXmlNode * put (
const Object & obj,
2915 return putMaterialMatrixToXml< Object >( obj,data );
2922 template<
short_t d,
class T,
bool comp>
2931 static std::string tag () {
return "MaterialMatrix"; }
2932 static std::string type ()
2934 std::string comp_str = ((comp) ?
"Compressible" :
"Incompressible");
2938 GSXML_GET_POINTER(Object);
2940 static void get_into(gsXmlNode * node,Object & obj)
2942 obj = getMaterialMatrixFromXml< Object >( node );
2945 static gsXmlNode * put (
const Object & obj,
2948 return putMaterialMatrixToXml< Object >( obj,data );
constexpr T _d2Psi_vol(const index_t i, const index_t j, const index_t k, const index_t l, const gsMatrix< T > &c, const gsMatrix< T > &cinv) const
Provides the second (mixed) derivative of the volumetric part of the compressible strain energy densi...
Definition: gsMaterialMatrixNonlinear.hpp:2307
MaterialOutput
This class describes the output type.
Definition: gsMaterialMatrixUtils.h:98
void setPoissonsRatio(const gsFunctionSet< T > &PoissonsRatio) override
Sets the Poisson's Ratio.
Definition: gsMaterialMatrixNonlinear.hpp:1044
constexpr std::enable_if< _mat==Material::SvK &&_imp==Implementation::Analytical, T >::type _Cijkl3D_impl(const index_t i, const index_t j, const index_t k, const index_t l, const gsMatrix< T > &c, const gsMatrix< T > &cinv) const
Specialization for compressible Cijkl3D(i,j,k,l,c,cinv) for SvK materials implemented analytically...
Definition: gsMaterialMatrixNonlinear.hpp:1423
std::enable_if< _com, void >::type _pstretchDir_into_impl(const index_t patch, const gsMatrix< T > &u, gsMatrix< T > &result) const
Implementation of stretchDir_into, specialization for compressible materials.
virtual void setParameters(const std::vector< function_ptr > &pars)
Sets the material parameters.
Definition: gsMaterialMatrixBase.h:684
void pstretch_into(const index_t patch, const gsMatrix< T > &u, gsMatrix< T > &result) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixNonlinear.hpp:209
This class defines hyperelastic material matrices.
Definition: gsMaterialMatrixNonlinear.h:47
#define GISMO_NO_IMPLEMENTATION
Definition: gsDebug.h:129
gsMatrix< T > eval3D_matrix_C(const gsMatrix< T > &Cmat, const index_t patch, const gsVector< T > &u, const T z, enum MaterialOutput out=MaterialOutput::Generic) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixNonlinear.hpp:304
constexpr std::enable_if< _mat==Material::NH, T >::type _dPsi_impl(const index_t i, const index_t j) const
Implementation of _dPsi(i,j) for NH materials.
Definition: gsMaterialMatrixNonlinear.hpp:2078
gsMatrix< T > eval3D_detF(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z, enum MaterialOutput out) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixNonlinear.hpp:892
Creates a mapped object or data pointer to a matrix without copying data.
Definition: gsLinearAlgebra.h:126
constexpr T _dp_da(const index_t a) const
First derivative of the Lagrange multiplier for incompressible materials w.r.t. the stretch ...
Definition: gsMaterialMatrixNonlinear.hpp:2629
#define short_t
Definition: gsConfig.h:35
gsMatrix< T > _eval3D_Compressible_matrix(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const
Evalluates the compressible material matrix.
Definition: gsMaterialMatrixNonlinear.hpp:2012
void defaultOptions() override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixNonlinear.hpp:195
constexpr std::enable_if< _com, T >::type _dSa_db_impl(const index_t a, const index_t b) const
Specialization of _dSa_db(a,b) for compressible materials.
constexpr T _Cijkl3D(const index_t i, const index_t j, const index_t k, const index_t l, const gsMatrix< T > &c, const gsMatrix< T > &cinv) const
Returns an entry of the material tensor C for compressible materials without static condensation...
Definition: gsMaterialMatrixNonlinear.hpp:1414
constexpr T _dPsi_da(const index_t a) const
First derivative of a strain energy density function w.r.t. the stretch .
Definition: gsMaterialMatrixNonlinear.hpp:2321
gsMatrix< T > eval3D_matrix(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z, enum MaterialOutput out=MaterialOutput::Generic) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixNonlinear.hpp:509
gsMatrix< T > eval3D_pstress(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z, enum MaterialOutput out=MaterialOutput::Generic) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixNonlinear.hpp:567
constexpr T _Cabcd(const index_t a, const index_t b, const index_t c, const index_t d) const
The material matrix for stretch-based implementations.
Definition: gsMaterialMatrixNonlinear.hpp:2696
constexpr T _Sa(const index_t a) const
Component of the stress.
Definition: gsMaterialMatrixNonlinear.hpp:2642
constexpr T _Cijkl(const index_t i, const index_t j, const index_t k, const index_t l) const
Returns an entry of the material tensor C for incompressible materials.
Definition: gsMaterialMatrixNonlinear.hpp:1231
#define index_t
Definition: gsConfig.h:32
#define GISMO_ENSURE(cond, message)
Definition: gsDebug.h:102
constexpr T _d2Psi_dab(const index_t a, const index_t b) const
Second derivative of a strain energy density function w.r.t. the stretches and .
Definition: gsMaterialMatrixNonlinear.hpp:2447
void setYoungsModulus(const gsFunctionSet< T > &YoungsModulus) override
Sets the YoungsModulus.
Definition: gsMaterialMatrixNonlinear.hpp:1032
A function from a n-dimensional domain to an m-dimensional image.
Definition: gsFunction.h:59
std::enable_if< _mat==Material::SvK, gsMatrix< T > >::type _eval3D_detF_impl(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const
Implementation of jacobina determinant (detF)
Definition: gsMaterialMatrixNonlinear.hpp:901
gsMatrix< T > _eval3D_Compressible_C33(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const
Evaluates the C33 (through thickness) component of the deformation tensor C for compressible material...
Definition: gsMaterialMatrixNonlinear.hpp:1815
gsMatrix< T > eval3D_stress_C(const gsMatrix< T > &Cmat, const index_t patch, const gsVector< T > &u, const T z, enum MaterialOutput out=MaterialOutput::Generic) const
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixNonlinear.hpp:693
#define GISMO_ASSERT(cond, message)
Definition: gsDebug.h:89
This class defines the base class for material matrices.
Definition: gsMaterialMatrixBase.h:32
gsAsMatrix< T, Dynamic, Dynamic > reshape(index_t n, index_t m)
Returns the matrix resized to n x m matrix (data is not copied) This function assumes that the matrix...
Definition: gsMatrix.h:221
constexpr T _dI_2(const index_t i, const index_t j, const gsMatrix< T > &c, const gsMatrix< T > &cinv) const
Provides the derivative of the second invariant for compressible materials w.r.t. component C_{ij} of...
Definition: gsMaterialMatrixNonlinear.hpp:2163
T at(index_t i) const
Returns the i-th element of the vectorization of the matrix.
Definition: gsMatrix.h:211
gsMatrix< T > eval3D_vector(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z, enum MaterialOutput out=MaterialOutput::Generic) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixNonlinear.hpp:549
constexpr std::enable_if< _mat==Material::SvK &&_imp==Implementation::Analytical, T >::type _Cijkl_impl(const index_t i, const index_t j, const index_t k, const index_t l) const
Specialization for incompressible Cijkl(i,j,k,l) for SvK materials implemented analytically.
Definition: gsMaterialMatrixNonlinear.hpp:1242
constexpr T _dPsi_vol(const index_t i, const index_t j, const gsMatrix< T > &c, const gsMatrix< T > &cinv) const
Provides the derivative of the volumetric part of the compressible strain energy density function w...
Definition: gsMaterialMatrixNonlinear.hpp:2229
std::string to_string(const unsigned &i)
Helper to convert small unsigned to string.
Definition: gsXml.cpp:74
#define gsWarn
Definition: gsDebug.h:50
gsMatrix< T > eval3D_CauchyStress(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z, enum MaterialOutput out) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixNonlinear.hpp:961
const function_ptr getPoissonsRatio() const override
Gets the Poisson's Ratio.
Definition: gsMaterialMatrixNonlinear.hpp:1050
constexpr T _d2J_dab(const index_t a, const index_t b) const
First derivative of the compressibilty function w.r.t. the stretches and .
Definition: gsMaterialMatrixNonlinear.hpp:2613
constexpr T _dSa_db(const index_t a, const index_t b) const
First derivative of the component of the stress w.r.t. the stretch .
Definition: gsMaterialMatrixNonlinear.hpp:2666
constexpr std::enable_if< _mat==Material::SvK &&_imp==Implementation::Analytical, T >::type _Sij_impl(const index_t i, const index_t j) const
Specialization for incompressible Sij(i,j) for SvK materials implemented analytically.
Definition: gsMaterialMatrixNonlinear.hpp:1627
constexpr T _d2Psi(const index_t i, const index_t j, const index_t k, const index_t l) const
Provides the second (mixed) derivative of the incompressible strain energy density function w...
Definition: gsMaterialMatrixNonlinear.hpp:2109
gsMatrix< T > eval3D_pstressDir(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z, enum MaterialOutput out=MaterialOutput::Generic) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixNonlinear.hpp:597
constexpr T _p() const
Lagrange multiplier for incompressible materials.
Definition: gsMaterialMatrixNonlinear.hpp:2621
constexpr std::enable_if< _com, T >::type _Cabcd_impl(const index_t a, const index_t b, const index_t c, const index_t d) const
Specialization of _Cabcd(a,b,c,d) for compressible materials.
constexpr std::enable_if< _mat==Material::NH, T >::type _d2Psi_impl(const index_t i, const index_t j, const index_t k, const index_t l) const
Implementation of _d2Psi(i,j) for NH materials.
Definition: gsMaterialMatrixNonlinear.hpp:2120
Interface for the set of functions defined on a domain (the total number of functions in the set equa...
Definition: gsFuncData.h:23
gsAsMatrix< T, Dynamic, Dynamic > reshapeCol(index_t c, index_t n, index_t m)
Returns column c of the matrix resized to n x m matrix This function assumes that the matrix is size ...
Definition: gsMatrix.h:231
const function_ptr getYoungsModulus() const override
Gets the YoungsModulus.
Definition: gsMaterialMatrixNonlinear.hpp:1038
std::enable_if< _mat==Material::SvK, gsMatrix< T > >::type _eval3D_matrix_impl(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const
Implementation of the 3D (in-plane+thickness) evaluator of the material matrix, specialization for Sv...
Definition: gsMaterialMatrixNonlinear.hpp:521
gsMatrix< T > eval3D_CauchyPStress(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z, enum MaterialOutput out=MaterialOutput::Generic) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixNonlinear.hpp:627
constexpr T _Sii(const index_t i) const
Returns an entry of the diagonal of the stress tensor S for incompressible materials.
Definition: gsMaterialMatrixNonlinear.hpp:1798
gsMaterialMatrixNonlinear()
Destructor.
Definition: gsMaterialMatrixNonlinear.h:125
gsMatrix< T > _eval3D_Incompressible_matrix(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const
Evalluates the incompressible material matrix.
Definition: gsMaterialMatrixNonlinear.hpp:1190
Provides hyperelastic material matrices.
gsMatrix< T > _eval3D_Incompressible_stress(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const
Evalluates the incompressible stress vector.
Definition: gsMaterialMatrixNonlinear.hpp:825
constexpr T _dI_1(const index_t i, const index_t j) const
Provides the derivative of the first invariant compressible materials w.r.t. component C_{ij} of the ...
Definition: gsMaterialMatrixNonlinear.hpp:2155
void _initialize()
Initializes the object.
Definition: gsMaterialMatrixNonlinear.hpp:202
constexpr T _dPsi_da_vol(const index_t a) const
First derivative of the volumetric part of a strain energy density function w.r.t. the stretch .
Definition: gsMaterialMatrixNonlinear.hpp:2436
constexpr T _d2Psi_dab_vol(const index_t a, const index_t b) const
Second derivative of the volumetric part of a strain energy density function w.r.t. the stretches and .
Definition: gsMaterialMatrixNonlinear.hpp:2592
std::enable_if< _mat==Material::SvK, gsMatrix< T > >::type _eval3D_stress_impl(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const
Implementation of the 3D (in-plane+thickness) evaluator of the stress vector, specialization for SvK ...
Definition: gsMaterialMatrixNonlinear.hpp:668
void pstretchDir_into(const index_t patch, const gsMatrix< T > &u, gsMatrix< T > &result) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixNonlinear.hpp:257
gsMatrix< T > _eval3D_Compressible_stress(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const
Evalluates the compressible stress vector.
Definition: gsMaterialMatrixNonlinear.hpp:727
gsMatrix< T > eval3D_dmatrix(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z, enum MaterialOutput out=MaterialOutput::Generic) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixNonlinear.hpp:344
#define GISMO_ERROR(message)
Definition: gsDebug.h:118
constexpr std::enable_if< _com &&(_mat==Material::NH), T >::type _d2Psi_dab_impl(const index_t a, const index_t b) const
Specialization of _d2Psi_dab(a,b) for compressible NH materials.
EIGEN_STRONG_INLINE abs_expr< E > abs(const E &u)
Absolute value.
Definition: gsExpressions.h:4486
std::enable_if< _com, void >::type _pstretch_into_impl(const index_t patch, const gsMatrix< T > &u, gsMatrix< T > &result) const
Implementation of pstretch_into, specialization for compressible materials.
gsMatrix< T > eval3D_stress(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z, enum MaterialOutput out) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixNonlinear.hpp:659
gsMatrix< T > eval3D_vector_C(const gsMatrix< T > &Cmat, const index_t patch, const gsVector< T > &u, const T z, enum MaterialOutput out=MaterialOutput::Generic) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixNonlinear.hpp:555
gsMatrix< T > eval3D_CauchyVector(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z, enum MaterialOutput out=MaterialOutput::Generic) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixNonlinear.hpp:561
constexpr T _dJ_da(const index_t a) const
First derivative of the compressibilty function w.r.t. the stretche .
Definition: gsMaterialMatrixNonlinear.hpp:2605
gsMatrix< T > _eval3D_Compressible_detF(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const
Evaluates the jacobian determinant for compressible materials.
Definition: gsMaterialMatrixNonlinear.hpp:926
Provides declaration of Function abstract interface.
std::ostream & print(std::ostream &os) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixNonlinear.hpp:153
constexpr std::enable_if< _com &&(_mat==Material::NH), T >::type _dPsi_da_impl(const index_t a) const
Specialization of _dPsi_da(a) for compressible NH materials.
gsMatrix< T > _eval3D_Incompressible_detF(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const
Evaluates the jacobian determinant for compressible materials.
Definition: gsMaterialMatrixNonlinear.hpp:953
constexpr T _Sij(const index_t i, const index_t j) const
Returns an entry of the stress tensor S for incompressible materials.
Definition: gsMaterialMatrixNonlinear.hpp:1619
bool gsAllCloseRelativeToMax(const matrix_t1 &a, const matrix_t2 &b, const typename matrix_t1::Scalar &tol)
tests if the difference between two matrices is bounded by tol in norm
Definition: gsMath.h:452
constexpr T _dPsi(const index_t i, const index_t j) const
Provides the derivative of the incompressible strain energy density function w.r.t. component C_{ij} of the deformation tensor.
Definition: gsMaterialMatrixNonlinear.hpp:2067
constexpr std::enable_if< _com, T >::type _Sa_impl(const index_t a) const
Specialization of _Sa(a) for compressible materials.