37 template <
short_t dim,
class T >
40 m_options.addInt(
"TensionField",
"Tension field definition - 0: Strain-based, 1: Stress-based, 2: Mixed",2);
43 template <
short_t dim,
class T >
49 static_cast<const gsFunction<T>&
>(Base::m_patches->piece(patch) ).computeMap(map);
51 result.resize(1, u.cols());
52 m_thickness->piece(patch).eval_into(map.values[0], m_data.mine().m_Tmat);
53 m_density->piece(patch).eval_into(map.values[0], m_data.mine().m_rhomat);
54 for (
index_t i = 0; i != u.cols(); ++i)
56 result(0,i) = m_data.mine().m_Tmat(0,i)*m_data.mine().m_rhomat(0,i);
60 template <
short_t dim,
class T >
66 static_cast<const gsFunction<T>&
>(Base::m_patches->piece(patch) ).computeMap(map);
67 m_thickness->piece(patch).eval_into(map.values[0], result);
71 template <
short_t dim,
class T>
78 for (
index_t k=0; k!=u.cols(); k++)
80 for(
index_t j=0; j < z.rows(); ++j )
82 colIdx = j*u.cols()+k;
83 _getMetric(k, z(j, k) * m_data.mine().m_Tmat(0, k));
85 covbasis = m_data.mine().m_gcov_ori;
86 result.col(colIdx) = this->_transformation(covbasis,sbasis).
reshape(9,1);
93 template <
short_t dim,
class T>
100 for (
index_t k=0; k!=u.cols(); k++)
102 for(
index_t j=0; j < z.rows(); ++j )
104 colIdx = j*u.cols()+k;
105 _getMetric(k, z(j, k) * m_data.mine().m_Tmat(0, k));
107 conbasis = m_data.mine().m_gcov_ori;
108 result.col(colIdx) = this->_transformation(conbasis,sbasis).
reshape(9,1);
115 template <
short_t dim,
class T>
120 cartbasis.setIdentity();
122 for (
index_t k=0; k!=u.cols(); k++)
124 for(
index_t j=0; j < z.rows(); ++j )
126 colIdx = j*u.cols()+k;
127 _getMetric(k, z(j, k) * m_data.mine().m_Tmat(0, k));
128 covbasis = m_data.mine().m_gcov_ori;
129 result.col(colIdx) = this->_transformation(cartbasis,covbasis).
reshape(9,1);
136 template <
short_t dim,
class T>
141 cartbasis.setIdentity();
143 for (
index_t k=0; k!=u.cols(); k++)
145 for(
index_t j=0; j < z.rows(); ++j )
147 colIdx = j*u.cols()+k;
148 _getMetric(k, z(j, k) * m_data.mine().m_Tmat(0, k));
149 conbasis = m_data.mine().m_gcon_ori;
150 result.col(colIdx) = this->_transformation(cartbasis,conbasis).
reshape(9,1);
156 template <
short_t dim,
class T >
162 static_cast<const gsFunction<T>&
>(Base::m_patches->piece(patch) ).computeMap(map);
165 result.resize(m_pars.size(),map.values[0].cols());
167 for (
size_t v=0; v!=m_pars.size(); v++)
169 m_pars[v]->piece(patch).eval_into(map.values[0], tmp);
175 template <
short_t dim,
class T >
178 this->_computePoints(patch,u);
183 for (
index_t k=0; k!=u.cols(); k++)
185 for(
index_t j=0; j < z.rows(); ++j )
187 colIdx = j*u.cols()+k;
188 _getMetric(k, z(j, k) * m_data.mine().m_Tmat(0, k));
192 C.block(0,0,2,2) = m_data.mine().m_Gcov_def.block(0,0,2,2);
193 C(2,2) = 1./m_data.mine().m_J0_sq;
199 template <
short_t dim,
class T>
207 for (
index_t k=0; k!= u.cols(); k++)
209 for(
index_t j=0; j < z.rows(); ++j )
211 colIdx = j*u.cols()+k;
212 this->_getMetric(k, z(j, k) * m_data.mine().m_Tmat(0, k));
214 res = this->_evalStretch(C,m_data.mine().m_gcon_ori);
215 result.col(colIdx) = res.first;
221 template <
short_t dim,
class T>
229 for (
index_t k=0; k!= u.cols(); k++)
231 for(
index_t j=0; j < z.rows(); ++j )
233 colIdx = j*u.cols()+k;
234 this->_getMetric(k, z(j, k) * m_data.mine().m_Tmat(0, k));
236 res = this->_evalStretch(C,m_data.mine().m_gcon_ori);
237 result.col(colIdx) = res.second.reshape(9,1);
243 template <
short_t dim,
class T>
253 for (
index_t k=0; k!=u.cols(); k++)
255 for(
index_t j=0; j < z.rows(); ++j )
257 colIdx = j * u.cols() + k;
259 E(0,0) = Emat(0,colIdx);
260 E(1,1) = Emat(1,colIdx);
261 E(0,1) = E(1,0) = 0.5*Emat(2,colIdx);
263 res = this->_evalPStrain(E);
264 result.col(j * u.cols() + k) = res.first;
270 template <
short_t dim,
class T>
273 this->_computePoints(patch,u);
279 for (
index_t k=0; k!=u.cols(); k++)
281 for(
index_t j=0; j < z.rows(); ++j )
283 colIdx = j*u.cols()+k;
284 this->_getMetric(k, z(j, k) * m_data.mine().m_Tmat(0, k));
286 E = 0.5 * (m_data.mine().m_Gcov_def.block(0,0,2,2) - m_data.mine().m_Gcov_ori.block(0,0,2,2));
287 result(0,colIdx) = E(0,0);
288 result(1,colIdx) = E(1,1);
289 result(2,colIdx) = E(0,1) + E(1,0);
295 template <
short_t dim,
class T>
298 gsMatrix<T> Spmat = this->eval3D_pstress(patch,u,z,MaterialOutput::Generic);
299 gsMatrix<T> Epmat = this->eval3D_pstrain(patch,u,z);
303 if (m_options.getInt(
"TensionField")==0)
305 for (
index_t k=0; k!=u.cols(); k++)
307 for(
index_t j=0; j < z.rows(); ++j )
309 colIdx = j*u.cols() + k;
310 Sp = Spmat.col(colIdx);
311 Ep = Epmat.col(colIdx);
312 result.col(colIdx)<<_tensionField<0>(Sp,Ep);
316 else if (m_options.getInt(
"TensionField")==1)
318 for (
index_t k=0; k!=u.cols(); k++)
320 for(
index_t j=0; j < z.rows(); ++j )
322 colIdx = j*u.cols() + k;
323 Sp = Spmat.col(colIdx);
324 Ep = Epmat.col(colIdx);
325 result.col(colIdx)<<_tensionField<1>(Sp,Ep);
329 else if (m_options.getInt(
"TensionField")==2)
331 for (
index_t k=0; k!=u.cols(); k++)
333 for(
index_t j=0; j < z.rows(); ++j )
335 colIdx = j*u.cols() + k;
336 Sp = Spmat.col(colIdx);
337 Ep = Epmat.col(colIdx);
338 result.col(colIdx)<<_tensionField<2>(Sp,Ep);
345 template <
short_t dim,
class T>
346 template <
short_t _type>
347 typename std::enable_if<_type==0, index_t>::type
350 if (Ep[0] > 0 || (
math::abs(Ep[0]) <= Ep.maxCoeff()*1e-12) )
358 template <
short_t dim,
class T>
359 template <
short_t _type>
360 typename std::enable_if<_type==1, index_t>::type
361 gsMaterialMatrixBaseDim<dim,T>::_tensionField(
const gsVector<T> & Sp,
const gsVector<T> & )
const
363 if (Sp[0] > 0 || (
math::abs(Sp[0]) <= Sp.maxCoeff()*1e-12) )
371 template <
short_t dim,
class T>
372 template <
short_t _type>
373 typename std::enable_if<_type==2, index_t>::type
374 gsMaterialMatrixBaseDim<dim,T>::_tensionField(
const gsVector<T> & Sp,
const gsVector<T> & Ep)
const
380 if (Sp[0] > 0 || (
math::abs(Sp[0]) <= Sp.maxCoeff()*1e-12) )
388 template <
short_t dim,
class T >
389 void gsMaterialMatrixBaseDim<dim,T>::_computePoints(
const index_t patch,
const gsMatrix<T> & u)
const
393 this->_computeMetricUndeformed(patch,u);
394 if (Base::m_defpatches!=
nullptr)
395 this->_computeMetricDeformed(patch,u);
400 static_cast<const gsFunction<T>&
>(Base::m_patches->piece(patch) ).computeMap(map);
402 m_thickness->piece(patch).eval_into(map.values[0], m_data.mine().m_Tmat);
404 m_data.mine().m_parmat.resize(m_pars.size(),map.values[0].cols());
405 m_data.mine().m_parmat.setZero();
407 for (
size_t v=0; v!=m_pars.size(); v++)
409 m_pars[v]->piece(patch).eval_into(map.values[0], tmp);
410 m_data.mine().m_parmat.row(v) = tmp;
413 m_data.mine().m_parvals.resize(m_pars.size());
416 template <
short_t dim,
class T>
419 _computeMetricDeformed_impl<dim>(patch,u);
422 template <
short_t dim,
class T>
423 template <
short_t _dim>
424 typename std::enable_if<_dim==3, void>::type
430 dynamic_cast<const gsFunction<T>&
>(Base::m_defpatches->piece(patch) ).computeMap(map);
432 gsMatrix<T> deriv2(3,3), mixedB(2,2), acov(3,2), acon(3,2), ncov(3,2), Acov(2,2), Acon(2,2), Bcov(2,2);
436 normals = map.normals;
437 normals.colwise().normalize();
438 m_data.mine().m_normal_def_mat = normals;
440 m_data.mine().m_Acov_def_mat.resize(4,map.
points.cols()); m_data.mine().m_Acov_def_mat.setZero();
441 m_data.mine().m_Acon_def_mat.resize(4,map.
points.cols()); m_data.mine().m_Acon_def_mat.setZero();
442 m_data.mine().m_Bcov_def_mat.resize(4,map.
points.cols()); m_data.mine().m_Bcov_def_mat.setZero();
444 m_data.mine().m_acov_def_mat.resize(2*3,map.
points.cols()); m_data.mine().m_acov_def_mat.setZero();
445 m_data.mine().m_acon_def_mat.resize(2*3,map.
points.cols()); m_data.mine().m_acon_def_mat.setZero();
446 m_data.mine().m_ncov_def_mat.resize(2*3,map.
points.cols()); m_data.mine().m_ncov_def_mat.setZero();
450 acov = map.jacobian(k);
452 Acov = acov.transpose() * acov;
453 Acon = Acov.inverse();
456 deriv2 = map.deriv2(k).reshaped(3,3);
457 normal = normals.col(k);
459 Bcov(0,0) = deriv2.row(0).dot(normal);
460 Bcov(1,1) = deriv2.row(1).dot(normal);
461 Bcov(0,1) = Bcov(1,0) = deriv2.row(2).dot(normal);
465 acon.col(i) = Acon(i,0)*acov.col(0) + Acon(i,1)*acov.col(1);
470 mixedB(i,j) = Acon(i,0)*Bcov(0,j) + Acon(i,1)*Bcov(1,j);
473 ncov.col(i) = -mixedB(0,i)*acov.col(0) -mixedB(1,i)*acov.col(1);
476 m_data.mine().m_acov_def_mat.reshapeCol(k,3,2) = acov;
477 m_data.mine().m_acon_def_mat.reshapeCol(k,3,2) = acon;
478 m_data.mine().m_ncov_def_mat.reshapeCol(k,3,2) = ncov;
479 m_data.mine().m_Acov_def_mat.reshapeCol(k,2,2) = Acov;
480 m_data.mine().m_Acon_def_mat.reshapeCol(k,2,2) = Acon;
481 m_data.mine().m_Bcov_def_mat.reshapeCol(k,2,2) = Bcov;
485 template <
short_t dim,
class T>
486 template <
short_t _dim>
487 typename std::enable_if<_dim==2, void>::type
493 dynamic_cast<const gsFunction<T>&
>(Base::m_defpatches->piece(patch) ).computeMap(map);
496 gsMatrix<T> acov(2,2), acon(2,2), Acov(2,2), Acon(2,2);
499 m_data.mine().m_Acov_def_mat.resize(4,map.
points.cols()); m_data.mine().m_Acov_def_mat.setZero();
500 m_data.mine().m_Acon_def_mat.resize(4,map.
points.cols()); m_data.mine().m_Acon_def_mat.setZero();
501 m_data.mine().m_Bcov_def_mat.resize(4,map.
points.cols()); m_data.mine().m_Bcov_def_mat.setZero();
503 m_data.mine().m_acov_def_mat.resize(2*2,map.
points.cols()); m_data.mine().m_acov_def_mat.setZero();
504 m_data.mine().m_acon_def_mat.resize(2*2,map.
points.cols()); m_data.mine().m_acon_def_mat.setZero();
505 m_data.mine().m_ncov_def_mat.resize(2*2,map.
points.cols()); m_data.mine().m_ncov_def_mat.setZero();
510 acov = map.jacobian(k);
512 Acov = acov.transpose() * acov;
513 Acon = Acov.inverse();
517 acon.col(i) = Acon(i,0)*acov.col(0) + Acon(i,1)*acov.col(1);
520 m_data.mine().m_acov_def_mat.
reshapeCol(k,2,2) = acov;
521 m_data.mine().m_acon_def_mat.reshapeCol(k,2,2) = acon;
522 m_data.mine().m_Acov_def_mat.reshapeCol(k,2,2) = Acov;
523 m_data.mine().m_Acon_def_mat.reshapeCol(k,2,2) = Acon;
526 m_data.mine().m_Bcov_def_mat.
reshapeCol(k,2,2) = zero;
527 m_data.mine().m_ncov_def_mat.
reshapeCol(k,2,2) = zero;
534 template <
short_t dim,
class T>
537 _computeMetricUndeformed_impl<dim>(patch,u);
540 template <
short_t dim,
class T>
541 template <
short_t _dim>
542 typename std::enable_if<_dim==3, void>::type
548 dynamic_cast<const gsFunction<T>&
>(Base::m_patches->piece(patch) ).computeMap(map);
550 gsMatrix<T> deriv2(3,3), mixedB(2,2), acov(3,2), acon(3,2), ncov(3,2), Acov(2,2), Acon(2,2), Bcov(2,2);
554 normals = map.normals;
555 normals.colwise().normalize();
556 m_data.mine().m_normal_ori_mat = normals;
558 m_data.mine().m_Acov_ori_mat.resize(4,map.
points.cols()); m_data.mine().m_Acov_ori_mat.setZero();
559 m_data.mine().m_Acon_ori_mat.resize(4,map.
points.cols()); m_data.mine().m_Acon_ori_mat.setZero();
560 m_data.mine().m_Bcov_ori_mat.resize(4,map.
points.cols()); m_data.mine().m_Bcov_ori_mat.setZero();
562 m_data.mine().m_acov_ori_mat.resize(2*3,map.
points.cols()); m_data.mine().m_acov_ori_mat.setZero();
563 m_data.mine().m_acon_ori_mat.resize(2*3,map.
points.cols()); m_data.mine().m_acon_ori_mat.setZero();
564 m_data.mine().m_ncov_ori_mat.resize(2*3,map.
points.cols()); m_data.mine().m_ncov_ori_mat.setZero();
568 acov = map.jacobian(k);
570 Acov = acov.transpose() * acov;
571 Acon = Acov.inverse();
574 deriv2 = map.deriv2(k).reshaped(3,3);
575 normal = normals.col(k);
577 Bcov(0,0) = deriv2.row(0).dot(normal);
578 Bcov(1,1) = deriv2.row(1).dot(normal);
579 Bcov(0,1) = Bcov(1,0) = deriv2.row(2).dot(normal);
583 acon.col(i) = Acon(i,0)*acov.col(0) + Acon(i,1)*acov.col(1);
588 mixedB(i,j) = Acon(i,0)*Bcov(0,j) + Acon(i,1)*Bcov(1,j);
591 ncov.col(i) = -mixedB(0,i)*acov.col(0) -mixedB(1,i)*acov.col(1);
594 m_data.mine().m_acov_ori_mat.reshapeCol(k,3,2) = acov;
595 m_data.mine().m_acon_ori_mat.reshapeCol(k,3,2) = acon;
596 m_data.mine().m_ncov_ori_mat.reshapeCol(k,3,2) = ncov;
597 m_data.mine().m_Acov_ori_mat.reshapeCol(k,2,2) = Acov;
598 m_data.mine().m_Acon_ori_mat.reshapeCol(k,2,2) = Acon;
599 m_data.mine().m_Bcov_ori_mat.reshapeCol(k,2,2) = Bcov;
603 template <
short_t dim,
class T>
604 template <
short_t _dim>
605 typename std::enable_if<_dim==2, void>::type
611 dynamic_cast<const gsFunction<T>&
>(Base::m_patches->piece(patch) ).computeMap(map);
614 gsMatrix<T> acov(2,2), acon(2,2), Acov(2,2), Acon(2,2);
616 m_data.mine().m_Acov_ori_mat.resize(4,map.
points.cols()); m_data.mine().m_Acov_ori_mat.setZero();
617 m_data.mine().m_Acon_ori_mat.resize(4,map.
points.cols()); m_data.mine().m_Acon_ori_mat.setZero();
618 m_data.mine().m_Bcov_ori_mat.resize(4,map.
points.cols()); m_data.mine().m_Bcov_ori_mat.setZero();
620 m_data.mine().m_acov_ori_mat.resize(2*2,map.
points.cols()); m_data.mine().m_acov_ori_mat.setZero();
621 m_data.mine().m_acon_ori_mat.resize(2*2,map.
points.cols()); m_data.mine().m_acon_ori_mat.setZero();
622 m_data.mine().m_ncov_ori_mat.resize(2*2,map.
points.cols()); m_data.mine().m_ncov_ori_mat.setZero();
627 acov = map.jacobian(k);
629 Acov = acov.transpose() * acov;
630 Acon = Acov.inverse();
634 acon.col(i) = Acon(i,0)*acov.col(0) + Acon(i,1)*acov.col(1);
637 m_data.mine().m_acov_ori_mat.
reshapeCol(k,2,2) = acov;
638 m_data.mine().m_acon_ori_mat.reshapeCol(k,2,2) = acon;
639 m_data.mine().m_Acov_ori_mat.reshapeCol(k,2,2) = Acov;
640 m_data.mine().m_Acon_ori_mat.reshapeCol(k,2,2) = Acon;
643 m_data.mine().m_Bcov_ori_mat.
reshapeCol(k,2,2) = zero;
644 m_data.mine().m_ncov_ori_mat.
reshapeCol(k,2,2) = zero;
650 template <
short_t dim,
class T>
653 GISMO_ENSURE(m_data.mine().m_Acov_def_mat.cols()!=0,
"Is the metric initialized?");
654 return m_data.mine().m_Acov_def_mat.reshapeCol(k,2,2);
657 template <
short_t dim,
class T>
660 GISMO_ENSURE(m_data.mine().m_Acon_def_mat.cols()!=0,
"Is the metric initialized?");
661 return m_data.mine().m_Acon_def_mat.reshapeCol(k,2,2);
664 template <
short_t dim,
class T>
667 return _getBcov_def_impl<dim>(k,z);
670 template <
short_t dim,
class T>
673 return _getncov_def_impl<dim>(k,z);
676 template <
short_t dim,
class T>
679 return _getGcov_def_impl<dim>(k,z);
682 template <
short_t dim,
class T>
686 return Gcov_def.inverse();
689 template <
short_t dim,
class T>
692 GISMO_ENSURE(m_data.mine().m_acov_def_mat.cols()!=0,
"Is the basis initialized?");
693 return m_data.mine().m_acov_def_mat.reshapeCol(k,3,2);
696 template <
short_t dim,
class T>
699 GISMO_ENSURE(m_data.mine().m_acon_def_mat.cols()!=0,
"Is the basis initialized?");
700 return m_data.mine().m_acon_def_mat.reshapeCol(k,3,2);
703 template <
short_t dim,
class T>
706 return _getgcov_def_impl<dim>(k,z);
709 template <
short_t dim,
class T>
717 gcon_def.col(c) = Gcon_def(c,0) * gcov_def.col(0)
718 + Gcon_def(c,1) * gcov_def.col(1)
719 + Gcon_def(c,2) * gcov_def.col(2);
724 template <
short_t dim,
class T>
727 GISMO_ENSURE(m_data.mine().m_Acov_ori_mat.cols()!=0,
"Is the metric initialized?");
728 return m_data.mine().m_Acov_ori_mat.reshapeCol(k,2,2);
731 template <
short_t dim,
class T>
734 GISMO_ENSURE(m_data.mine().m_Acon_ori_mat.cols()!=0,
"Is the metric initialized?");
735 return m_data.mine().m_Acon_ori_mat.reshapeCol(k,2,2);
738 template <
short_t dim,
class T>
741 return _getBcov_ori_impl<dim>(k,z);
744 template <
short_t dim,
class T>
747 return _getncov_ori_impl<dim>(k,z);
750 template <
short_t dim,
class T>
753 return _getGcov_ori_impl<dim>(k,z);
756 template <
short_t dim,
class T>
760 return Gcov_ori.inverse();
763 template <
short_t dim,
class T>
766 GISMO_ENSURE(m_data.mine().m_acov_ori_mat.cols()!=0,
"Is the basis initialized?");
767 return m_data.mine().m_acov_ori_mat.reshapeCol(k,3,2);
770 template <
short_t dim,
class T>
773 GISMO_ENSURE(m_data.mine().m_acon_ori_mat.cols()!=0,
"Is the basis initialized?");
774 return m_data.mine().m_acon_ori_mat.reshapeCol(k,3,2);
777 template <
short_t dim,
class T>
780 return _getgcov_ori_impl<dim>(k,z);
783 template <
short_t dim,
class T>
791 gcon_ori.col(c) = Gcon_ori(c,0) * gcov_ori.col(0)
792 + Gcon_ori(c,1) * gcov_ori.col(1)
793 + Gcon_ori(c,2) * gcov_ori.col(2);
800 template <
short_t dim,
class T>
801 template <
short_t _dim>
802 typename std::enable_if<_dim==2, gsMatrix<T>>::type
808 template <
short_t dim,
class T>
809 template <
short_t _dim>
810 typename std::enable_if<_dim==3, gsMatrix<T>>::type
813 GISMO_ENSURE(m_data.mine().m_Bcov_def_mat.cols()!=0,
"Is the metric initialized?");
814 return m_data.mine().m_Bcov_def_mat.reshapeCol(k,2,2);
817 template <
short_t dim,
class T>
818 template <
short_t _dim>
819 typename std::enable_if<_dim==2, gsMatrix<T>>::type
825 template <
short_t dim,
class T>
826 template <
short_t _dim>
827 typename std::enable_if<_dim==3, gsMatrix<T>>::type
830 GISMO_ENSURE(m_data.mine().m_ncov_def_mat.cols()!=0,
"Is the basis initialized?");
831 return m_data.mine().m_ncov_def_mat.reshapeCol(k,3,2);
834 template <
short_t dim,
class T>
835 template <
short_t _dim>
836 typename std::enable_if<_dim==2, gsMatrix<T>>::type
845 Gcov_def.block(0,0,2,2)= Acov_def;
850 template <
short_t dim,
class T>
851 template <
short_t _dim>
852 typename std::enable_if<_dim==3, gsMatrix<T>>::type
863 Gcov_def.block(0,0,2,2)= Acov_def - 2.0 * z * Bcov_def + z*z * ncov_def.transpose()*ncov_def;
868 template <
short_t dim,
class T>
869 template <
short_t _dim>
870 typename std::enable_if<_dim==2, gsMatrix<T>>::type
877 gcov_def.block(0,0,2,2) = _getacov_def(k,z);
878 gcov_def.col(2) = normal;
882 template <
short_t dim,
class T>
883 template <
short_t _dim>
884 typename std::enable_if<_dim==3, gsMatrix<T>>::type
887 GISMO_ENSURE(m_data.mine().m_normal_def_mat.cols()!=0,
"Is the basis initialized?");
888 gsMatrix<T> normal = m_data.mine().m_normal_def_mat.reshapeCol(k,3,1);
893 gcov_def.leftCols(2) = acov_def + z * ncov_def;
894 gcov_def.col(2) = normal;
898 template <
short_t dim,
class T>
899 template <
short_t _dim>
900 typename std::enable_if<_dim==2, gsMatrix<T>>::type
906 template <
short_t dim,
class T>
907 template <
short_t _dim>
908 typename std::enable_if<_dim==3, gsMatrix<T>>::type
911 GISMO_ENSURE(m_data.mine().m_Bcov_ori_mat.cols()!=0,
"Is the metric initialized?");
912 return m_data.mine().m_Bcov_ori_mat.reshapeCol(k,2,2);
915 template <
short_t dim,
class T>
916 template <
short_t _dim>
917 typename std::enable_if<_dim==2, gsMatrix<T>>::type
923 template <
short_t dim,
class T>
924 template <
short_t _dim>
925 typename std::enable_if<_dim==3, gsMatrix<T>>::type
928 GISMO_ENSURE(m_data.mine().m_ncov_ori_mat.cols()!=0,
"Is the basis initialized?");
929 return m_data.mine().m_ncov_ori_mat.reshapeCol(k,3,2);
932 template <
short_t dim,
class T>
933 template <
short_t _dim>
934 typename std::enable_if<_dim==2, gsMatrix<T>>::type
943 Gcov_ori.block(0,0,2,2)= Acov_ori;
948 template <
short_t dim,
class T>
949 template <
short_t _dim>
950 typename std::enable_if<_dim==3, gsMatrix<T>>::type
961 Gcov_ori.block(0,0,2,2)= Acov_ori - 2.0 * z * Bcov_ori + z*z * ncov_ori.transpose()*ncov_ori;
966 template <
short_t dim,
class T>
967 template <
short_t _dim>
968 typename std::enable_if<_dim==2, gsMatrix<T>>::type
975 gcov_ori.block(0,0,2,2) = _getacov_ori(k,z);
976 gcov_ori.col(2) = normal;
980 template <
short_t dim,
class T>
981 template <
short_t _dim>
982 typename std::enable_if<_dim==3, gsMatrix<T>>::type
985 GISMO_ENSURE(m_data.mine().m_normal_ori_mat.cols()!=0,
"Is the basis initialized?");
986 gsMatrix<T> normal = m_data.mine().m_normal_ori_mat.reshapeCol(k,3,1);
991 gcov_ori.leftCols(2) = acov_ori + z * ncov_ori;
992 gcov_ori.col(2) = normal;
998 template <
short_t dim,
class T>
1001 this->_getMetricDeformed(C);
1002 this->_getMetricUndeformed(k,z);
1005 T det_ori = m_data.mine().m_Gcov_ori.determinant();
1006 T det_def = m_data.mine().m_Gcov_def.determinant();
1008 if ((det_ori==0 && det_def==0) || (math::isnan(det_ori) && math::isnan(det_def)))
1010 gsWarn<<
"Jacobian determinant is undefined: J^2 = det(Gcov_def) / det(Gcov_ori) = "<<det_def<<
"/"<<det_ori<<
"! J^2 is set to 1";
1014 ratio = det_def / det_ori;
1016 GISMO_ENSURE(ratio >= 0,
"Jacobian determinant is negative! det(Gcov_def) = "<<det_def<<
"; det(Gcov_ori) = "<<det_ori);
1017 m_data.mine().m_J0_sq = ratio;
1020 template <
short_t dim,
class T>
1023 this->_getMetricDeformed(k,z);
1024 this->_getMetricUndeformed(k,z);
1027 T det_ori = m_data.mine().m_Gcov_ori.determinant();
1028 T det_def = m_data.mine().m_Gcov_def.determinant();
1030 if ((det_ori==0 && det_def==0) || (math::isnan(det_ori) && math::isnan(det_def)))
1032 gsWarn<<
"Jacobian determinant is undefined: J^2 = det(Gcov_def) / det(Gcov_ori) = "<<det_def<<
"/"<<det_ori<<
"! J^2 is set to 1";
1036 ratio = det_def / det_ori;
1038 GISMO_ENSURE(ratio >= 0,
"Jacobian determinant is negative! det(Gcov_def) = "<<det_def<<
"; det(Gcov_ori) = "<<det_ori<<
"\nGcov_def = "<<m_data.mine().m_Gcov_def<<
"\n"<<
"Acov_def = "<<m_data.mine().m_Acov_def<<
"\nBcov_def = "<<m_data.mine().m_Bcov_def);
1039 m_data.mine().m_J0_sq = ratio;
1044 template <
short_t dim,
class T>
1051 Gcov_def(0,0) = C(0,0);
1052 Gcov_def(1,1) = C(1,0);
1054 Gcov_def(1,0) = C(2,0);
1056 Gcon_def(2,2) = 1.0;
1057 Gcon_def.block(0,0,2,2) = Gcov_def.block(0,0,2,2).inverse();
1059 m_data.mine().m_Gcov_def = Gcov_def;
1060 m_data.mine().m_Gcon_def = Gcon_def;
1062 m_data.mine().m_Acov_def.setZero();
1063 m_data.mine().m_Acon_def.setZero();
1064 m_data.mine().m_Bcov_def.setZero();
1065 m_data.mine().m_Bcon_def.setZero();
1066 m_data.mine().m_acov_def.setZero();
1067 m_data.mine().m_acon_def.setZero();
1068 m_data.mine().m_gcov_def.setZero();
1069 m_data.mine().m_gcon_def.setZero();
1072 template <
short_t dim,
class T>
1075 _getMetricDeformed_impl<dim>(k,z);
1078 template <
short_t dim,
class T>
1079 template <
short_t _dim>
1080 typename std::enable_if<_dim==3, void>::type
1083 GISMO_ENSURE(m_data.mine().m_Acov_def_mat.cols()!=0,
"Is the metric initialized?");
1084 GISMO_ENSURE(m_data.mine().m_Acon_def_mat.cols()!=0,
"Is the metric initialized?");
1085 GISMO_ENSURE(m_data.mine().m_Bcov_def_mat.cols()!=0,
"Is the metric initialized?");
1086 GISMO_ENSURE(m_data.mine().m_ncov_def_mat.cols()!=0,
"Is the basis initialized?");
1087 GISMO_ENSURE(m_data.mine().m_acov_def_mat.cols()!=0,
"Is the basis initialized?");
1088 GISMO_ENSURE(m_data.mine().m_acon_def_mat.cols()!=0,
"Is the basis initialized?");
1089 GISMO_ENSURE(m_data.mine().m_normal_def_mat.cols()!=0,
"Is the basis initialized?");
1091 gsMatrix<T> Acov_def, Acon_def, Bcov_def, ncov_def, Gcov_def(3,3), Gcon_def(3,3),
1092 acov_def, acon_def, normal(3,1), gcov_def(3,3), gcon_def(3,3);
1094 Acov_def = m_data.mine().m_Acov_def_mat.reshapeCol(k,2,2);
1095 Acon_def = m_data.mine().m_Acon_def_mat.reshapeCol(k,2,2);
1096 Bcov_def = m_data.mine().m_Bcov_def_mat.reshapeCol(k,2,2);
1097 ncov_def = m_data.mine().m_ncov_def_mat.reshapeCol(k,3,2);
1101 Gcov_def.block(0,0,2,2)= Acov_def - 2.0 * z * Bcov_def + z*z * ncov_def.transpose()*ncov_def;
1102 Gcov_def(2,2) = 1.0;
1103 Gcon_def = Gcov_def.inverse();
1106 m_data.mine().m_Acov_def = Acov_def;
1107 m_data.mine().m_Acon_def = Acon_def;
1108 m_data.mine().m_Bcov_def = Bcov_def;
1109 m_data.mine().m_ncov_def = ncov_def;
1110 m_data.mine().m_Gcov_def = Gcov_def;
1111 m_data.mine().m_Gcon_def = Gcon_def;
1114 acov_def = m_data.mine().m_acov_def_mat.reshapeCol(k,3,2);
1115 acon_def = m_data.mine().m_acon_def_mat.reshapeCol(k,3,2);
1116 normal = m_data.mine().m_normal_def_mat.reshapeCol(k,3,1);
1120 gcov_def.leftCols(2) = acov_def + z * ncov_def;
1121 gcov_def.col(2) = normal;
1124 for (
index_t c = 0; c!=3; c++)
1125 gcon_def.col(c) = Gcon_def(c,0) * gcov_def.col(0) + Gcon_def(c,1) * gcov_def.col(1) + Gcon_def(c,2) * gcov_def.col(2);
1128 m_data.mine().m_acov_def = acov_def;
1129 m_data.mine().m_acon_def = acov_def;
1130 m_data.mine().m_gcov_def = gcov_def;
1131 m_data.mine().m_gcon_def = gcon_def;
1138 template <
short_t dim,
class T>
1139 template <
short_t _dim>
1140 typename std::enable_if<_dim==2, void>::type
1143 GISMO_ENSURE(m_data.mine().m_Acov_def_mat.cols()!=0,
"Is the metric initialized?");
1144 GISMO_ENSURE(m_data.mine().m_Acon_def_mat.cols()!=0,
"Is the metric initialized?");
1145 GISMO_ENSURE(m_data.mine().m_Bcov_def_mat.cols()!=0,
"Is the metric initialized?");
1146 GISMO_ENSURE(m_data.mine().m_ncov_def_mat.cols()!=0,
"Is the basis initialized?");
1147 GISMO_ENSURE(m_data.mine().m_acov_def_mat.cols()!=0,
"Is the basis initialized?");
1148 GISMO_ENSURE(m_data.mine().m_acon_def_mat.cols()!=0,
"Is the basis initialized?");
1150 GISMO_ENSURE(m_data.mine().m_acov_def_mat.cols()!=0,
"Is the basis initialized?");
1151 GISMO_ENSURE(m_data.mine().m_acon_def_mat.cols()!=0,
"Is the basis initialized?");
1153 gsMatrix<T> Acov_def, Acon_def, Gcov_def(3,3), Gcon_def(3,3),
1154 acov_def, acon_def, normal(3,1), gcov_def(3,3), gcon_def(3,3);
1157 Acov_def = m_data.mine().m_Acov_def_mat.reshapeCol(k,2,2);
1158 Acon_def = m_data.mine().m_Acov_def_mat.reshapeCol(k,2,2);
1162 Gcov_def.block(0,0,2,2)= Acov_def;;
1163 Gcov_def(2,2) = 1.0;
1164 Gcon_def = Gcov_def.inverse();
1167 m_data.mine().m_Acov_def = Acov_def;
1168 m_data.mine().m_Acon_def = Acon_def;
1169 m_data.mine().m_Bcov_def = m_data.mine().m_Bcov_def_mat.reshapeCol(k,2,2);
1170 m_data.mine().m_ncov_def = m_data.mine().m_ncov_def_mat.reshapeCol(k,2,2);
1171 m_data.mine().m_Gcov_def = Gcov_def;
1172 m_data.mine().m_Gcon_def = Gcon_def;
1175 acov_def = m_data.mine().m_acov_def_mat.reshapeCol(k,2,2);
1176 acon_def = m_data.mine().m_acon_def_mat.reshapeCol(k,2,2);
1181 gcov_def.block(0,0,2,2) = acov_def;
1182 gcov_def.col(2) = normal;
1185 for (
index_t c = 0; c!=3; c++)
1186 gcon_def.col(c) = Gcon_def(c,0) * gcov_def.col(0) + Gcon_def(c,1) * gcov_def.col(1) + Gcon_def(c,2) * gcov_def.col(2);
1189 m_data.mine().m_acov_def = acov_def;
1190 m_data.mine().m_acon_def = acon_def;
1191 m_data.mine().m_gcov_def = gcov_def;
1192 m_data.mine().m_gcon_def = gcon_def;
1201 template <
short_t dim,
class T>
1204 _getMetricUndeformed_impl<dim>(k,z);
1207 template <
short_t dim,
class T>
1208 template <
short_t _dim>
1209 typename std::enable_if<_dim==3, void>::type
1212 GISMO_ENSURE(m_data.mine().m_Acov_ori_mat.cols()!=0,
"Is the metric initialized?");
1213 GISMO_ENSURE(m_data.mine().m_Acon_ori_mat.cols()!=0,
"Is the metric initialized?");
1214 GISMO_ENSURE(m_data.mine().m_Bcov_ori_mat.cols()!=0,
"Is the metric initialized?");
1215 GISMO_ENSURE(m_data.mine().m_ncov_ori_mat.cols()!=0,
"Is the basis initialized?");
1217 GISMO_ENSURE(m_data.mine().m_acov_ori_mat.cols()!=0,
"Is the basis initialized?");
1218 GISMO_ENSURE(m_data.mine().m_acon_ori_mat.cols()!=0,
"Is the basis initialized?");
1219 GISMO_ENSURE(m_data.mine().m_normal_ori_mat.cols()!=0,
"Is the basis initialized?");
1221 gsMatrix<T> Acov_ori, Acon_ori, Bcov_ori, ncov_ori, Gcov_ori(3,3), Gcon_ori(3,3),
1222 acov_ori, acon_ori, normal(3,1), gcov_ori(3,3), gcon_ori(3,3);
1225 Acov_ori = m_data.mine().m_Acov_ori_mat.reshapeCol(k,2,2);
1226 Acon_ori = m_data.mine().m_Acon_ori_mat.reshapeCol(k,2,2);
1227 Bcov_ori = m_data.mine().m_Bcov_ori_mat.reshapeCol(k,2,2);
1228 ncov_ori = m_data.mine().m_ncov_ori_mat.reshapeCol(k,3,2);
1232 Gcov_ori.block(0,0,2,2)= Acov_ori - 2.0 * z * Bcov_ori + z*z * ncov_ori.transpose()*ncov_ori;
1233 Gcov_ori(2,2) = 1.0;
1234 Gcon_ori = Gcov_ori.inverse();
1237 m_data.mine().m_Acov_ori = Acov_ori;
1238 m_data.mine().m_Acon_ori = Acon_ori;
1239 m_data.mine().m_Bcov_ori = Bcov_ori;
1240 m_data.mine().m_ncov_ori = ncov_ori;
1241 m_data.mine().m_Gcov_ori = Gcov_ori;
1242 m_data.mine().m_Gcon_ori = Gcon_ori;
1245 acov_ori = m_data.mine().m_acov_ori_mat.reshapeCol(k,3,2);
1246 acon_ori = m_data.mine().m_acon_ori_mat.reshapeCol(k,3,2);
1247 normal = m_data.mine().m_normal_ori_mat.reshapeCol(k,3,1);
1251 gcov_ori.leftCols(2) = acov_ori + z * ncov_ori;
1252 gcov_ori.col(2) = normal;
1255 for (
index_t c = 0; c!=3; c++)
1256 gcon_ori.col(c) = Gcon_ori(c,0) * gcov_ori.col(0) + Gcon_ori(c,1) * gcov_ori.col(1) + Gcon_ori(c,2) * gcov_ori.col(2);
1259 m_data.mine().m_acov_ori = acov_ori;
1260 m_data.mine().m_acon_ori = acov_ori;
1261 m_data.mine().m_gcov_ori = gcov_ori;
1262 m_data.mine().m_gcon_ori = gcon_ori;
1269 template <
short_t dim,
class T>
1270 template <
short_t _dim>
1271 typename std::enable_if<_dim==2, void>::type
1274 GISMO_ENSURE(m_data.mine().m_Acov_ori_mat.cols()!=0,
"Is the metric initialized?");
1275 GISMO_ENSURE(m_data.mine().m_Acon_ori_mat.cols()!=0,
"Is the metric initialized?");
1276 GISMO_ENSURE(m_data.mine().m_Bcov_ori_mat.cols()!=0,
"Is the metric initialized?");
1277 GISMO_ENSURE(m_data.mine().m_ncov_ori_mat.cols()!=0,
"Is the basis initialized?");
1279 GISMO_ENSURE(m_data.mine().m_acov_ori_mat.cols()!=0,
"Is the basis initialized?");
1280 GISMO_ENSURE(m_data.mine().m_acon_ori_mat.cols()!=0,
"Is the basis initialized?");
1282 gsMatrix<T> Acov_ori, Acon_ori, Gcov_ori(3,3), Gcon_ori(3,3),
1283 acov_ori, acon_ori, normal(3,1), gcov_ori(3,3), gcon_ori(3,3);
1286 Acov_ori = m_data.mine().m_Acov_ori_mat.reshapeCol(k,2,2);
1287 Acon_ori = m_data.mine().m_Acov_ori_mat.reshapeCol(k,2,2);
1291 Gcov_ori.block(0,0,2,2)= Acov_ori;;
1292 Gcov_ori(2,2) = 1.0;
1293 Gcon_ori = Gcov_ori.inverse();
1296 m_data.mine().m_Acov_ori = Acov_ori;
1297 m_data.mine().m_Acon_ori = Acon_ori;
1298 m_data.mine().m_Bcov_ori = m_data.mine().m_Bcov_ori_mat.reshapeCol(k,2,2);
1299 m_data.mine().m_ncov_ori = m_data.mine().m_ncov_ori_mat.reshapeCol(k,2,2);
1300 m_data.mine().m_Gcov_ori = Gcov_ori;
1301 m_data.mine().m_Gcon_ori = Gcon_ori;
1304 acov_ori = m_data.mine().m_acov_ori_mat.reshapeCol(k,2,2);
1305 acon_ori = m_data.mine().m_acon_ori_mat.reshapeCol(k,2,2);
1310 gcov_ori.block(0,0,2,2) = acov_ori;
1311 gcov_ori.col(2) = normal;
1314 for (
index_t c = 0; c!=3; c++)
1315 gcon_ori.col(c) = Gcon_ori(c,0) * gcov_ori.col(0) + Gcon_ori(c,1) * gcov_ori.col(1) + Gcon_ori(c,2) * gcov_ori.col(2);
1318 m_data.mine().m_acov_ori = acov_ori;
1319 m_data.mine().m_acon_ori = acon_ori;
1320 m_data.mine().m_gcov_ori = gcov_ori;
1321 m_data.mine().m_gcon_ori = gcon_ori;
1330 template <
short_t dim,
class T>
1336 stretches.resize(3,1); stretches.setZero();
1337 stretchvec.resize(3,3); stretchvec.setZero();
1339 typename gsEigen::SelfAdjointEigenSolver< typename gsMatrix<T>::Base > eigSolver;
1341 GISMO_ENSURE(m_data.mine().m_gcon_ori.cols()!=0,
"Is the basis initialized?");
1345 for (
index_t k = 0; k != 2; k++)
1346 for (
index_t l = 0; l != 2; l++)
1347 B += C(k,l) * gcon_ori.col(k) * gcon_ori.col(l).transpose();
1351 if (
math::abs(((B.block(0,0,2,2).diagonal()).array()-1).sum()) < 10*std::numeric_limits<T>::epsilon())
1360 eigSolver.compute(B);
1361 eigValues = eigSolver.eigenvalues();
1362 eigVectors= eigSolver.eigenvectors();
1366 stretchvec.leftCols(2) = eigVectors.rightCols(2);
1367 stretchvec.col(2) = gcon_ori.col(2);
1368 stretches.block(0,0,2,1) = eigValues.block(1,0,2,1);
1371 stretches.
at(2) = C(2,2);
1374 stretches.
at(k) = math::sqrt(stretches.
at(k));
1376 result.first = stretches;
1377 result.second = stretchvec;
1383 template <
short_t dim,
class T>
1389 pstresses.resize(2,1); pstresses.setZero();
1390 pstressvec.resize(3,2); pstressvec.setZero();
1392 typename gsEigen::SelfAdjointEigenSolver< typename gsMatrix<T>::Base > eigSolver;
1396 for (
index_t k = 0; k != 2; k++)
1397 for (
index_t l = 0; l != 2; l++)
1398 B += S(k,l) * m_data.mine().m_gcov_ori.col(k) * m_data.mine().m_gcov_ori.col(l).transpose();
1400 eigSolver.compute(B);
1404 T max = eigSolver.eigenvalues().array().abs().maxCoeff();
1405 max = (max==0) ? 1 : max;
1407 zeroIdx =
std::abs(eigSolver.eigenvalues()[k] ) / max < tol ? k : zeroIdx;
1415 if (k==zeroIdx)
continue;
1416 pstressvec.col(count) = eigSolver.eigenvectors().col(k);
1417 pstresses(count,0) = eigSolver.eigenvalues()(k,0);
1421 result.first = pstresses;
1422 result.second = pstressvec;
1427 template <
short_t dim,
class T>
1433 pstrains.resize(3,1); pstrains.setZero();
1434 pstrainvec.resize(3,3); pstrainvec.setZero();
1436 typename gsEigen::SelfAdjointEigenSolver< typename gsMatrix<T>::Base > eigSolver;
1440 for (
index_t k = 0; k != 2; k++)
1441 for (
index_t l = 0; l != 2; l++)
1442 B += S(k,l) * m_data.mine().m_gcon_ori.col(k) * m_data.mine().m_gcon_ori.col(l).transpose();
1444 eigSolver.compute(B);
1448 T max = eigSolver.eigenvalues().array().abs().maxCoeff();
1449 max = (max==0) ? 1 : max;
1451 zeroIdx =
std::abs(eigSolver.eigenvalues()[k] ) / max < tol ? k : zeroIdx;
1456 pstrainvec.col(2) = m_data.mine().m_gcon_ori.col(2);
1457 pstrains(2,0) = S(2,2);
1461 if (k==zeroIdx)
continue;
1462 pstrainvec.col(count) = eigSolver.eigenvectors().col(k);
1463 pstrains(count,0) = eigSolver.eigenvalues()(k,0);
1467 result.first = pstrains;
1468 result.second = pstrainvec;
1475 template <
short_t dim,
class T>
1478 std::pair<gsVector<T>,
gsMatrix<T>> result = _evalStretch(C,gcon_ori);
1479 m_data.mine().m_stretches = result.first;
1480 m_data.mine().m_stretchvec = result.second;
1483 template <
short_t dim,
class T>
1486 std::pair<gsVector<T>,
gsMatrix<T>> result = _evalPStress(S);
1487 m_data.mine().m_pstress = result.first;
1488 m_data.mine().m_pstressvec = result.second;
1491 template <
short_t dim,
class T>
1494 std::pair<gsVector<T>,
gsMatrix<T>> result = _evalPStrain(E);
1495 m_data.mine().m_pstrain = result.first;
1496 m_data.mine().m_pstrainvec = result.second;
1501 template <
short_t dim,
class T>
1507 for (
index_t i = 0; i!=2; i++)
1508 for (
index_t j = 0; j!=2; j++)
1509 Tmat(i,j) = math::pow(basis2.col(i).dot(basis1.col(j)),2);
1511 Tmat(2,0) = basis2.col(1).dot(basis1.col(0)) * basis2.col(0).dot(basis1.col(0));
1512 Tmat(2,1) = basis2.col(0).dot(basis1.col(1)) * basis2.col(1).dot(basis1.col(1));
1514 Tmat(0,2) = 2*basis2.col(0).dot(basis1.col(1)) * basis2.col(0).dot(basis1.col(0));
1515 Tmat(1,2) = 2*basis2.col(1).dot(basis1.col(0)) * basis2.col(1).dot(basis1.col(1));
1517 Tmat(2,2) = basis2.col(0).dot(basis1.col(1)) * basis2.col(1).dot(basis1.col(0))
1518 +basis2.col(0).dot(basis1.col(0)) * basis2.col(1).dot(basis1.col(1));
gsMatrix< T > _getAcon_def(index_t k, T z) const
Returns the contravariant a tensor on the deformed geometry.
Definition: gsMaterialMatrixBaseDim.hpp:658
MaterialOutput
This class describes the output type.
Definition: gsMaterialMatrixUtils.h:98
Provides linear material matrices.
std::enable_if< _dim==2, gsMatrix< T > >::type _getgcov_ori_impl(index_t k, T z) const
Implementation of _getMetricUndeformed for planar geometries.
Definition: gsMaterialMatrixBaseDim.hpp:969
gsMatrix< T > _getBcov_ori(index_t k, T z) const
Returns the covariant b tensor on the original geometry.
Definition: gsMaterialMatrixBaseDim.hpp:739
virtual gsMatrix< T > eval3D_pstretchDir(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixBaseDim.hpp:222
virtual void defaultOptions() override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixBaseDim.hpp:38
void _computeMetricDeformed(const index_t patch, const gsMatrix< T > &u) const
Computes metric quantities on the deformed geometry.
Definition: gsMaterialMatrixBaseDim.hpp:417
#define GISMO_NO_IMPLEMENTATION
Definition: gsDebug.h:129
std::pair< gsVector< T >, gsMatrix< T > > _evalStretch(const gsMatrix< T > &C, const gsMatrix< T > &gcon_ori) const
Computes the stretch given deformation tensor C, into a pair.
Definition: gsMaterialMatrixBaseDim.hpp:1331
gsMatrix< T > _getgcon_def(index_t k, T z) const
Returns the contravariant basis vector g on the deformed geometry.
Definition: gsMaterialMatrixBaseDim.hpp:710
Gradient of the object.
Definition: gsForwardDeclarations.h:73
std::enable_if< _dim==2, gsMatrix< T > >::type _getGcov_def_impl(index_t k, T z) const
Implementation of _getMetricUndeformed for planar geometries.
Definition: gsMaterialMatrixBaseDim.hpp:837
gsMatrix< T > _getBcov_def(index_t k, T z) const
Returns the covariant b tensor on the deformed geometry.
Definition: gsMaterialMatrixBaseDim.hpp:665
Creates a mapped object or data pointer to a matrix without copying data.
Definition: gsLinearAlgebra.h:126
virtual gsMatrix< T > eval3D_pstretch(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixBaseDim.hpp:200
gsMatrix< T > _getAcon_ori(index_t k, T z) const
Returns the contravariant a tensor on the original geometry.
Definition: gsMaterialMatrixBaseDim.hpp:732
virtual gsMatrix< T > eval3D_pstrain(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixBaseDim.hpp:244
virtual gsMatrix< T > eval3D_strain(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixBaseDim.hpp:271
gsMatrix< T > _getacon_def(index_t k, T z) const
Returns the contravariant basis vector a on the deformed geometry.
Definition: gsMaterialMatrixBaseDim.hpp:697
gsMatrix< T > _getncov_def(index_t k, T z) const
Returns the covariant n tensor on the deformed geometry.
Definition: gsMaterialMatrixBaseDim.hpp:671
virtual gsMatrix< T > eval3D_con2cart(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixBaseDim.hpp:137
gsMatrix< T > _getGcon_def(index_t k, T z) const
Returns the contravariant metric tensor on the deformed geometry.
Definition: gsMaterialMatrixBaseDim.hpp:683
virtual gsMatrix< T > eval3D_spec2cov(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixBaseDim.hpp:72
gsMatrix< T > _getacon_ori(index_t k, T z) const
Returns the contravariant basis vector a on the original geometry.
Definition: gsMaterialMatrixBaseDim.hpp:771
std::pair< gsVector< T >, gsMatrix< T > > _evalPStress(const gsMatrix< T > &S) const
Computes the principal stress given stress tensor S, into a pair.
Definition: gsMaterialMatrixBaseDim.hpp:1384
gsMatrix< T > _getGcov_ori(index_t k, T z) const
Returns the covariant metric tensor on the original geometry.
Definition: gsMaterialMatrixBaseDim.hpp:751
the gsMapData is a cache of pre-computed function (map) values.
Definition: gsFuncData.h:324
std::enable_if< _dim==2, gsMatrix< T > >::type _getBcov_def_impl(index_t k, T z) const
Implementation of _getMetricUndeformed for planar geometries.
Definition: gsMaterialMatrixBaseDim.hpp:803
virtual void density_into(const index_t patch, const gsMatrix< T > &u, gsMatrix< T > &result) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixBaseDim.hpp:44
virtual gsMatrix< T > eval3D_cov2cart(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixBaseDim.hpp:116
Provides declaration of Geometry abstract interface.
Second derivatives.
Definition: gsForwardDeclarations.h:80
#define index_t
Definition: gsConfig.h:32
#define GISMO_ENSURE(cond, message)
Definition: gsDebug.h:102
A function from a n-dimensional domain to an m-dimensional image.
Definition: gsFunction.h:59
std::enable_if< _dim==2, void >::type _computeMetricUndeformed_impl(const index_t patch, const gsMatrix< T > &u) const
Implementation of _getMetric for planar geometries.
Definition: gsMaterialMatrixBaseDim.hpp:606
virtual void parameters_into(const index_t patch, const gsMatrix< T > &u, gsMatrix< T > &result) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixBaseDim.hpp:157
void _computePStrain(const gsMatrix< T > &C) const
Computes the stretch given deformation tensor C, into class members m_stretches and m_stretchDirs...
Definition: gsMaterialMatrixBaseDim.hpp:1492
gsMatrix< T > _getacov_def(index_t k, T z) const
Returns the covariant basis vector a on the deformed geometry.
Definition: gsMaterialMatrixBaseDim.hpp:690
#define GISMO_ASSERT(cond, message)
Definition: gsDebug.h:89
gsMatrix< T > _getgcov_def(index_t k, T z) const
Returns the covariant basis vector g on the deformed geometry.
Definition: gsMaterialMatrixBaseDim.hpp:704
Base class with dimension in template; used for metric computations.
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
std::pair< gsVector< T >, gsMatrix< T > > _evalPStrain(const gsMatrix< T > &C) const
Computes the principal strain given deformation tensor C, into a pair.
Definition: gsMaterialMatrixBaseDim.hpp:1428
virtual void thickness_into(const index_t patch, const gsMatrix< T > &u, gsMatrix< T > &result) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixBaseDim.hpp:61
void _getMetricDeformed(const index_t k, const T z) const
Gets metric quantities on the deformed geometry.
Definition: gsMaterialMatrixBaseDim.hpp:1073
std::enable_if< _dim==2, void >::type _computeMetricDeformed_impl(const index_t patch, const gsMatrix< T > &u) const
Implementation of _computeMetricUndeformed for planar geometries.
Definition: gsMaterialMatrixBaseDim.hpp:488
virtual gsMatrix< T > eval3D_tensionfield(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z, enum MaterialOutput out) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixBaseDim.hpp:296
#define gsWarn
Definition: gsDebug.h:50
gsMatrix< T > _getGcon_ori(index_t k, T z) const
Returns the contravariant metric tensor on the original geometry.
Definition: gsMaterialMatrixBaseDim.hpp:757
Normal vector of the object.
Definition: gsForwardDeclarations.h:85
void _getMetricUndeformed(const index_t k, const T z) const
Gets metric quantities on the undeformed geometry.
Definition: gsMaterialMatrixBaseDim.hpp:1202
void _computeMetricUndeformed(const index_t patch, const gsMatrix< T > &u) const
Computes metric quantities on the undeformed geometry.
Definition: gsMaterialMatrixBaseDim.hpp:535
std::enable_if< _dim==2, void >::type _getMetricDeformed_impl(const index_t k, const T z) const
Implementation of _getMetricDeformed for surface geometries.
Definition: gsMaterialMatrixBaseDim.hpp:1141
std::enable_if< _dim==2, gsMatrix< T > >::type _getBcov_ori_impl(index_t k, T z) const
Implementation of _getMetricUndeformed for planar geometries.
Definition: gsMaterialMatrixBaseDim.hpp:901
std::enable_if< _dim==2, gsMatrix< T > >::type _getncov_def_impl(index_t k, T z) const
Implementation of _getMetricUndeformed for planar geometries.
Definition: gsMaterialMatrixBaseDim.hpp:820
std::enable_if< _dim==2, gsMatrix< T > >::type _getgcov_def_impl(index_t k, T z) const
Implementation of _getMetricUndeformed for planar geometries.
Definition: gsMaterialMatrixBaseDim.hpp:871
gsMatrix< T > _getAcov_ori(index_t k, T z) const
Returns the covariant a tensor on the original geometry.
Definition: gsMaterialMatrixBaseDim.hpp:725
void _computePStress(const gsMatrix< T > &C) const
Computes the principal stresses of a given stress tensor S, into class members m_pstress and m_pstres...
Definition: gsMaterialMatrixBaseDim.hpp:1484
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
T at(index_t i) const
Returns the i-th element of the vector.
Definition: gsVector.h:177
Provides hyperelastic material matrices.
This class defines the base class for material matrices.
Definition: gsMaterialMatrixBaseDim.h:35
gsMatrix< T > _transformation(const gsMatrix< T > &basis1, const gsMatrix< T > &basis2) const
Computes the stretch given deformation tensor C, into class members m_stretches and m_stretchDirs...
Definition: gsMaterialMatrixBaseDim.hpp:1502
void _computeStretch(const gsMatrix< T > &C, const gsMatrix< T > &gcon_ori) const
Computes the stretch given deformation tensor C, into class members m_stretches and m_stretchDirs...
Definition: gsMaterialMatrixBaseDim.hpp:1476
Jacobian of the object.
Definition: gsForwardDeclarations.h:75
gsMatrix< T > _getgcov_ori(index_t k, T z) const
Returns the covariant basis vector g on the original geometry.
Definition: gsMaterialMatrixBaseDim.hpp:778
gsMatrix< T > _getGcov_def(index_t k, T z) const
Returns the covariant metric tensor on the deformed geometry.
Definition: gsMaterialMatrixBaseDim.hpp:677
virtual gsMatrix< T > eval3D_spec2con(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixBaseDim.hpp:94
std::enable_if< _dim==2, gsMatrix< T > >::type _getncov_ori_impl(index_t k, T z) const
Implementation of _getMetricUndeformed for planar geometries.
Definition: gsMaterialMatrixBaseDim.hpp:918
Value of the object.
Definition: gsForwardDeclarations.h:72
gsMatrix< T > _getacov_ori(index_t k, T z) const
Returns the covariant basis vector a on the original geometry.
Definition: gsMaterialMatrixBaseDim.hpp:764
EIGEN_STRONG_INLINE abs_expr< E > abs(const E &u)
Absolute value.
Definition: gsExpressions.h:4486
std::enable_if< _dim==2, void >::type _getMetricUndeformed_impl(const index_t k, const T z) const
Implementation of _getMetricUndeformed for planar geometries.
Definition: gsMaterialMatrixBaseDim.hpp:1272
gsMatrix< T > points
input (parametric) points
Definition: gsFuncData.h:348
gsMatrix< T > _getAcov_def(index_t k, T z) const
Returns the covariant a tensor on the deformed geometry.
Definition: gsMaterialMatrixBaseDim.hpp:651
std::enable_if< _dim==2, gsMatrix< T > >::type _getGcov_ori_impl(index_t k, T z) const
Implementation of _getMetricUndeformed for planar geometries.
Definition: gsMaterialMatrixBaseDim.hpp:935
virtual gsMatrix< T > eval3D_deformation(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixBaseDim.hpp:176
gsMatrix< T > _getgcon_ori(index_t k, T z) const
Returns the contravariant basis vector g on the original geometry.
Definition: gsMaterialMatrixBaseDim.hpp:784
gsMatrix< T > _getncov_ori(index_t k, T z) const
Returns the covariant n tensor on the original geometry.
Definition: gsMaterialMatrixBaseDim.hpp:745
void _getMetric(const index_t k, const T z) const
Gets metric quantities on the deformed and undeformed geometries.
Definition: gsMaterialMatrixBaseDim.hpp:1021