30template <
short_t d,
typename T>
36 m_materialMat(materialMat),
46 m_materialMat(materialMat),
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);
86template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
92 Base(&mp,&thickness,nullptr)
97template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
107template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
118template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
127template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
137template <
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!");
152template <
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";
194template <
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);
201template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
205 this->defaultOptions();
208template <
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);
215template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
217typename std::enable_if<!_comp, void>::type
220 Base::pstretch_into(patch,u,result);
223template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
225typename 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;
256template <
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);
263template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
265typename std::enable_if<!_comp, void>::type
268 Base::pstretchDir_into(patch,u,result);
271template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
273typename 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);
303template <
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);
313template <
short_t dim,
class T, index_t matId,
bool comp, enum Material mat, enum Implementation imp >
314template <enum Material _mat,
bool _comp>
315typename 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);
323template <
short_t dim,
class T, index_t matId,
bool comp, enum Material mat, enum Implementation imp >
324template <enum Material _mat,
bool _comp>
325typename 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);
333template <
short_t dim,
class T, index_t matId,
bool comp, enum Material mat, enum Implementation imp >
334template <enum Material _mat,
bool _comp>
335typename 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);
343template <
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));
371template <
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);
377template <
short_t dim,
class T, index_t matId,
bool comp, enum Material mat, enum Implementation imp >
378template <enum Material _mat,
bool _comp>
379inline 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);
394template <
short_t dim,
class T, index_t matId,
bool comp, enum Material mat, enum Implementation imp >
395template <enum Material _mat,
bool _comp>
396inline 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);
438template <
short_t dim,
class T, index_t matId,
bool comp, enum Material mat, enum Implementation imp >
439inline 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);
451template <
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) );
457template <
short_t dim,
class T, index_t matId,
bool comp, enum Material mat, enum Implementation imp >
458template <enum Material _mat,
bool _comp>
459inline typename std::enable_if<(!_comp && _mat==Material::NH), T>::type
460gsMaterialMatrixNonlinear<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);
500template <
short_t dim,
class T, index_t matId,
bool comp, enum Material mat, enum Implementation imp >
501template <enum Material _mat,
bool _comp>
502inline typename std::enable_if<!(!_comp && _mat==Material::NH), T>::type
503gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::dCijkl_dCmn_impl(
const index_t ,
const index_t ,
const index_t ,
const index_t ,
const index_t ,
const index_t )
const
508template <
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);
518template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
519template <enum Material _mat,
bool _comp>
520typename std::enable_if<_mat==Material::SvK, gsMatrix<T>>::type
523 this->_computePoints(patch,u);
524 gsMatrix<T> result = _eval3D_Incompressible_matrix(patch, u, z);
528template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
529template <enum Material _mat,
bool _comp>
530typename 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);
538template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
539template <enum Material _mat,
bool _comp>
540typename 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);
548template <
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);
554template <
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);
560template <
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);
566template <
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;
596template <
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);
626template <
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;
658template <
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);
665template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
666template <enum Material _mat,
bool _comp>
667typename std::enable_if<_mat==Material::SvK, gsMatrix<T>>::type
670 gsMatrix<T> result = _eval3D_Incompressible_stress(patch, u, z);
674template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
675template <enum Material _mat,
bool _comp>
676typename std::enable_if<!_comp && !(_mat==Material::SvK),
gsMatrix<T>>::type
679 gsMatrix<T> result = _eval3D_Incompressible_stress(patch, u, z);
683template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
684template <enum Material _mat,
bool _comp>
685typename std::enable_if<_comp && !(_mat==Material::SvK),
gsMatrix<T>>::type
688 gsMatrix<T> result = _eval3D_Compressible_stress(patch, u, z);
692template <
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);
699template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
700template <enum Material _mat,
bool _comp>
701typename std::enable_if<_mat==Material::SvK, gsMatrix<T>>::type
704 gsMatrix<T> result = _eval3D_Incompressible_stress_C(Cmat,patch, u, z);
708template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
709template <enum Material _mat,
bool _comp>
710typename std::enable_if<!_comp && !(_mat==Material::SvK),
gsMatrix<T>>::type
713 gsMatrix<T> result = _eval3D_Incompressible_stress_C(Cmat,patch, u, z);
717template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
718template <enum Material _mat,
bool _comp>
719typename std::enable_if<_comp && !(_mat==Material::SvK),
gsMatrix<T>>::type
722 gsMatrix<T> result = _eval3D_Compressible_stress_C(Cmat,patch, u, z);
726template <
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);
775template <
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);
824template <
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);
860template <
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);
891template <
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);
898template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
899template <enum Material _mat,
bool _comp>
900typename std::enable_if<_mat==Material::SvK, gsMatrix<T>>::type
903 gsMatrix<T> result = _eval3D_Incompressible_detF(patch, u, z);
907template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
908template <enum Material _mat,
bool _comp>
909typename std::enable_if<!_comp && !(_mat==Material::SvK),
gsMatrix<T>>::type
912 gsMatrix<T> result = _eval3D_Incompressible_detF(patch, u, z);
916template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
917template <enum Material _mat,
bool _comp>
918typename std::enable_if<_comp && !(_mat==Material::SvK),
gsMatrix<T>>::type
921 gsMatrix<T> result = _eval3D_Compressible_detF(patch, u, z);
925template <
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));
952template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
960template <
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);
967template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
968template <enum Material _mat,
bool _comp>
969typename std::enable_if<_mat==Material::SvK, gsMatrix<T>>::type
972 gsMatrix<T> result = _eval3D_Incompressible_CauchyStress(patch, u, z);
976template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
977template <enum Material _mat,
bool _comp>
978typename std::enable_if<!_comp && !(_mat==Material::SvK),
gsMatrix<T>>::type
981 gsMatrix<T> result = _eval3D_Incompressible_CauchyStress(patch, u, z);
985template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
986template <enum Material _mat,
bool _comp>
987typename std::enable_if<_comp && !(_mat==Material::SvK),
gsMatrix<T>>::type
990 gsMatrix<T> result = _eval3D_Compressible_CauchyStress(patch, u, z);
994template <
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;
1024template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1028 return _eval3D_Incompressible_stress(patch,u,z);
1031template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1034 Base::setParameter(0,YoungsModulus);
1037template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1038const typename gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::function_ptr
gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::getYoungsModulus()
const
1040 return Base::getParameter(0);
1043template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1046 Base::setParameter(1,PoissonsRatio);
1049template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1050const typename gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::function_ptr
gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::getPoissonsRatio()
const
1052 return Base::getParameter(1);
1055template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1056template <enum Material _mat>
1057typename std::enable_if<_mat==Material::MR, void>::type
1060 Base::setParameter(2,Ratio);
1063template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1064template <enum Material _mat>
1065typename std::enable_if<_mat!=Material::MR, void>::type
1071template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1072template <enum Material _mat>
1073typename std::enable_if<_mat==Material::MR, const typename gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::function_ptr >::type
1076 return Base::getParameter(2);
1079template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1080template <enum Material _mat>
1081typename std::enable_if<_mat!=Material::MR, const typename gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::function_ptr >::type
1087template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1088template <enum Material _mat>
1089typename std::enable_if<_mat==Material::OG, void>::type
1092 Base::setParameter(2+2*i,Mu_i);
1095template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1096template <enum Material _mat>
1097typename std::enable_if<_mat!=Material::OG, void>::type
1103template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1104template <enum Material _mat>
1105typename 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);
1111template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1112template <enum Material _mat>
1113typename std::enable_if<_mat!=Material::OG, const typename gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::function_ptr >::type
1119template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1120template <enum Material _mat>
1121typename std::enable_if<_mat==Material::OG, void>::type
1124 Base::setParameter(2+2*i+1,Alpha_i);
1127template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1128template <enum Material _mat>
1129typename std::enable_if<_mat!=Material::OG, void>::type
1135template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1136template <enum Material _mat>
1137typename 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);
1143template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1144template <enum Material _mat>
1145typename std::enable_if<_mat!=Material::OG, const typename gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::function_ptr >::type
1152template <
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);
1189template <
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);
1230template <
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);
1239template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1240template <enum Material _mat, enum Implementation _imp>
1241inline 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));
1257template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1258template <enum Material _mat, enum Implementation _imp>
1259inline 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));
1269template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1270template <enum Material _mat, enum Implementation _imp>
1271inline 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) );
1295template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1296template <enum Material _mat, enum Implementation _imp>
1297inline 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)) )
1352template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1353template <enum Material _mat, enum Implementation _imp>
1354inline 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));
1381template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1382inline 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);
1394template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1395template <enum Implementation _imp>
1396inline typename std::enable_if< _imp==Implementation::Spectral, T>::type
1397gsMaterialMatrixNonlinear<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);
1404template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1405template <enum Implementation _imp>
1406inline typename std::enable_if<!(_imp==Implementation::Spectral), T>::type
1407gsMaterialMatrixNonlinear<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);
1413template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1414inline 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);
1420template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1421template <enum Material _mat, enum Implementation _imp>
1422inline typename std::enable_if<_mat==Material::SvK && _imp == Implementation::Analytical, T>::type
1423gsMaterialMatrixNonlinear<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?");
1428template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1429template <enum Material _mat, enum Implementation _imp>
1430inline typename std::enable_if<_mat==Material::NH && _imp == Implementation::Analytical, T>::type
1431gsMaterialMatrixNonlinear<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 );
1452template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1453template <enum Material _mat, enum Implementation _imp>
1454inline typename std::enable_if<_mat==Material::MR && _imp == Implementation::Analytical, T>::type
1455gsMaterialMatrixNonlinear<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 );
1487template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1488template <enum Material _mat, enum Implementation _imp>
1489inline typename std::enable_if<_mat==Material::NH_ext && _imp == Implementation::Analytical, T>::type
1490gsMaterialMatrixNonlinear<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> & ,
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 );
1503template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1504template <enum Material _mat, enum Implementation _imp>
1505inline typename std::enable_if<_imp == Implementation::Spectral, T>::type
1506gsMaterialMatrixNonlinear<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> & ,
const gsMatrix<T> & )
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)) )
1567template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1568template <enum Material _mat, enum Implementation _imp>
1569inline typename std::enable_if<_imp == Implementation::Generalized, T>::type
1570gsMaterialMatrixNonlinear<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);
1618template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1621 return _Sij_impl<mat,imp>(i,j);
1624template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1625template <enum Material _mat, enum Implementation _imp>
1626inline typename std::enable_if<_mat==Material::SvK && _imp == Implementation::Analytical, T>::type
1632template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1633template <enum Material _mat, enum Implementation _imp>
1634inline 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) );
1644template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1645template <enum Material _mat, enum Implementation _imp>
1646inline 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);
1667template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1668template <enum Material _mat, enum Implementation _imp>
1669inline 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)) )
1689template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1690template <enum Material _mat, enum Implementation _imp>
1691inline 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);
1702template <
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);
1708template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1709template <enum Material _mat, enum Implementation _imp>
1710inline 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);
1728template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1729template <enum Material _mat, enum Implementation _imp>
1730inline 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);
1755template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1756template <enum Material _mat, enum Implementation _imp>
1757inline 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);
1768template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1769template <enum Material _mat, enum Implementation _imp>
1770inline 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)) )
1784template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
1785template <enum Material _mat, enum Implementation _imp>
1786inline typename std::enable_if<_imp == Implementation::Generalized, T>::type
1792 return 2.0 * _dPsi(i,j,c,cinv);
1797template <
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;
1807template <
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);
1814template <
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");
1888template <
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");
1961template <
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);
2011template <
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);
2066template <
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);
2075template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2076template <enum Material _mat>
2077inline 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);
2084template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2085template <enum Material _mat>
2086inline 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) );
2108template <
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);
2117template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2118template <enum Material _mat>
2119inline typename std::enable_if<_mat==Material::NH, T>::type
2125template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2126template <enum Material _mat>
2127inline 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) );
2154template <
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);
2162template <
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;
2174template <
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);
2183template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2184template <enum Material _mat>
2185inline 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);
2197template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2198template <enum Material _mat>
2199inline 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);
2216template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2217template <enum Material _mat>
2218inline 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);
2228template <
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);
2237template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2238inline 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);
2246template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2247template <enum Material _mat>
2248inline typename std::enable_if<_mat==Material::NH, T>::type
2249gsMaterialMatrixNonlinear<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);
2265template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2266template <enum Material _mat>
2267inline typename std::enable_if<_mat==Material::MR, T>::type
2268gsMaterialMatrixNonlinear<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);
2295template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2296template <enum Material _mat>
2297inline typename std::enable_if<_mat==Material::NH_ext, T>::type
2298gsMaterialMatrixNonlinear<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> & ,
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 );
2306template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2307inline 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> & ,
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 );
2320template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2324 return _dPsi_da_impl<mat,comp>(a);
2327template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2328template <enum Material _mat,
bool _comp>
2329inline 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 )
2341template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2342template <enum Material _mat,
bool _comp>
2343inline 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;
2351template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2352template <enum Material _mat,
bool _comp>
2353inline 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 )
2371template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2372template <enum Material _mat,
bool _comp>
2373inline 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;
2386template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2387template <enum Material _mat,
bool _comp>
2388inline 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;
2395 for (index_t k=0; k!=n; k++)
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);
2404template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2405template <enum Material _mat,
bool _comp>
2406inline typename std::enable_if<!_comp && (_mat==Material::OG), T>::type
2410 index_t n = (m_pars.size()-2)/2;
2412 for (index_t k=0; k!=n; k++)
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);
2421template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2422template <enum Material _mat,
bool _comp>
2423inline 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);
2435template <
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));
2446template <
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);
2453template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2454template <enum Material _mat,
bool _comp>
2455inline 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);
2473template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2474template <enum Material _mat,
bool _comp>
2475inline 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;
2483template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2484template <enum Material _mat,
bool _comp>
2485inline 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);
2520template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2521template <enum Material _mat,
bool _comp>
2522inline 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;
2539template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2540template <enum Material _mat,
bool _comp>
2541inline 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;
2547 for (index_t k=0; k!=n; k++)
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);
2562template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2563template <enum Material _mat,
bool _comp>
2564inline typename std::enable_if<!_comp && (_mat==Material::OG), T>::type
2568 index_t n = (m_pars.size()-2)/2;
2570 for (index_t k=0; k!=n; k++)
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);
2579template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2580template <enum Material _mat,
bool _comp>
2581inline 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) );
2591template <
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) );
2604template <
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);
2612template <
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) );
2620template <
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);
2628template <
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);
2641template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2644 return _Sa_impl<comp>(a);
2647template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2648template <
bool _comp>
2649inline typename std::enable_if<_comp, T>::type
2652 return 1.0/m_data.mine().m_stretches(a) * _dPsi_da(a);
2655template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2656template <
bool _comp>
2657inline typename std::enable_if<!_comp, T>::type
2660 return 1.0/m_data.mine().m_stretches(a) * (_dPsi_da(a) - _p() * _dJ_da(a) );
2665template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2668 return _dSa_db_impl<comp>(a,b);
2671template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2672template <
bool _comp>
2673inline 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);
2682template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2683template <
bool _comp>
2684inline 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));
2695template <
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);
2701template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2702template <
bool _comp>
2703inline 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)) ))
2728template <
short_t dim,
class T,
short_t matId,
bool comp, enum Material mat, enum Implementation imp >
2729template <
bool _comp>
2730inline 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)) ))
2823template<
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 );
2856template<
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 );
2889template<
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 );
2922template<
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 );
Creates a mapped object or data pointer to a matrix without copying data.
Definition gsAsMatrix.h:32
Interface for the set of functions defined on a domain (the total number of functions in the set equa...
Definition gsFunctionSet.h:219
A function from a n-dimensional domain to an m-dimensional image.
Definition gsFunction.h:60
virtual short_t domainDim() const=0
Dimension of the (source) domain.
virtual short_t targetDim() const
Dimension of the target space.
Definition gsFunctionSet.h:595
virtual void eval_into(const gsMatrix< T > &u, gsMatrix< T > &result) const =0
Evaluate the function at points u into result.
This class defines the base class for material matrices.
Definition gsMaterialMatrixBaseDim.h:37
This class defines the base class for material matrices.
Definition gsMaterialMatrixBase.h:33
virtual void setParameters(const std::vector< function_ptr > &pars)
Sets the material parameters.
Definition gsMaterialMatrixBase.h:684
This class defines hyperelastic material matrices.
Definition gsMaterialMatrixNonlinear.h:47
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
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
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
T _dJ_da(const index_t a) const
First derivative of the compressibilty function w.r.t. the stretche .
Definition gsMaterialMatrixNonlinear.hpp:2605
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
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
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.
Definition gsMaterialMatrixNonlinear.hpp:2674
T _dPsi_da_vol(const index_t a) const
First derivative of the volumetric part of a strain energy density function w.r.t....
Definition gsMaterialMatrixNonlinear.hpp:2436
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
void pstretch_into(const index_t patch, const gsMatrix< T > &u, gsMatrix< T > &result) const override
See gsMaterialMatrixBase for details.
Definition gsMaterialMatrixNonlinear.hpp:209
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
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.
Definition gsMaterialMatrixNonlinear.hpp:2704
T _p() const
Lagrange multiplier for incompressible materials.
Definition gsMaterialMatrixNonlinear.hpp:2621
T _dPsi(const index_t i, const index_t j) const
Provides the derivative of the incompressible strain energy density function w.r.t....
Definition gsMaterialMatrixNonlinear.hpp:2067
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
void _initialize()
Initializes the object.
Definition gsMaterialMatrixNonlinear.hpp:202
void setYoungsModulus(const gsFunctionSet< T > &YoungsModulus) override
Sets the YoungsModulus.
Definition gsMaterialMatrixNonlinear.hpp:1032
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
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
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
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.
Definition gsMaterialMatrixNonlinear.hpp:218
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
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
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_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
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
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
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.
Definition gsMaterialMatrixNonlinear.hpp:266
void defaultOptions() override
See gsMaterialMatrixBase for details.
Definition gsMaterialMatrixNonlinear.hpp:195
T _Sa(const index_t a) const
Component of the stress.
Definition gsMaterialMatrixNonlinear.hpp:2642
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
std::ostream & print(std::ostream &os) const override
See gsMaterialMatrixBase for details.
Definition gsMaterialMatrixNonlinear.hpp:153
std::enable_if< _com, T >::type _Sa_impl(const index_t a) const
Specialization of _Sa(a) for compressible materials.
Definition gsMaterialMatrixNonlinear.hpp:2650
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
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
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
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
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
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
void pstretchDir_into(const index_t patch, const gsMatrix< T > &u, gsMatrix< T > &result) const override
See gsMaterialMatrixBase for details.
Definition gsMaterialMatrixNonlinear.hpp:257
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
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
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
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
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
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
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....
Definition gsMaterialMatrixNonlinear.hpp:2592
void setPoissonsRatio(const gsFunctionSet< T > &PoissonsRatio) override
Sets the Poisson's Ratio.
Definition gsMaterialMatrixNonlinear.hpp:1044
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
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_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
const function_ptr getYoungsModulus() const override
Gets the YoungsModulus.
Definition gsMaterialMatrixNonlinear.hpp:1038
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:124
const function_ptr getPoissonsRatio() const override
Gets the Poisson's Ratio.
Definition gsMaterialMatrixNonlinear.hpp:1050
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
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
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
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
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
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_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_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
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
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
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
T at(index_t i) const
Returns the i-th element of the vectorization of the matrix.
Definition gsMatrix.h:211
A vector with arbitrary coefficient type and fixed or dynamic size.
Definition gsVector.h:37
MaterialOutput
This class describes the output type.
Definition gsMaterialMatrixUtils.h:99
#define short_t
Definition gsConfig.h:35
#define index_t
Definition gsConfig.h:32
#define GISMO_NO_IMPLEMENTATION
Definition gsDebug.h:129
#define GISMO_ERROR(message)
Definition gsDebug.h:118
#define gsWarn
Definition gsDebug.h:50
#define GISMO_ENSURE(cond, message)
Definition gsDebug.h:102
#define GISMO_ASSERT(cond, message)
Definition gsDebug.h:89
Provides declaration of Function abstract interface.
Provides hyperelastic material matrices.
c1
See gismo/filedata/surfaces/simple.xml for the geometry.
Definition example_shell3D.py:40
std::string to_string(const unsigned &i)
Helper to convert small unsigned to string.
Definition gsXml.cpp:74
The G+Smo namespace, containing all definitions for the library.
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