22 using namespace gismo;
25 T mod(
const T x,
const T y)
27 return x - math::floor(x/y)*y;
30 template <
typename T>
class objective;
35 template <
short_t dim,
class T,
bool linear >
38 os <<
"---------------------------------------------------------------------\n"
39 <<
"---------------------Tension-Field Theory Material-------------------\n"
40 <<
"---------------------------------------------------------------------\n\n";
42 m_materialMat->print(os);
44 os <<
"---------------------------------------------------------------------\n\n";
48 template <
short_t dim,
class T,
bool linear >
58 return this->_eval3D_matrix_impl<linear>(patch,u,z);
61 template <
short_t dim,
class T,
bool linear >
64 return this->eval3D_stress(patch,u,z,out);
67 template <
short_t dim,
class T,
bool linear >
71 gsMatrix<T> result = m_materialMat->eval3D_pstress(patch,u,z,out);
73 for (
index_t k=0; k!=u.cols(); k++)
75 for(
index_t j=0; j < z.rows(); ++j )
77 colIdx = j*u.cols()+k;
78 if (TF(0,colIdx) == 1 || TF(0,colIdx) == 0)
82 else if (TF(0,colIdx) == -1)
86 result.col(colIdx) *= m_options.getReal(
"SlackMultiplier");
89 GISMO_ERROR(
"Tension field data not understood: "<<TF(0,colIdx));
95 template <
short_t dim,
class T,
bool linear >
99 gsMatrix<T> result = m_materialMat->eval3D_pstrain(patch,u,z);
101 for (
index_t k=0; k!=u.cols(); k++)
103 for(
index_t j=0; j < z.rows(); ++j )
105 colIdx = j*u.cols()+k;
106 if (TF(0,colIdx) == 1 || TF(0,colIdx) == 0)
110 else if (TF(0,colIdx) == -1)
114 result.col(colIdx) *= m_options.getReal(
"SlackMultiplier");
117 GISMO_ERROR(
"Tension field data not understood: "<<TF(0,colIdx));
123 template <
short_t dim,
class T,
bool linear >
126 gsMatrix<T> result = m_materialMat->eval3D_strain(patch,u,z);
130 for (
index_t k=0; k!=u.cols(); k++)
132 for(
index_t j=0; j < z.rows(); ++j )
134 colIdx = j*u.cols()+k;
135 if (TF(0,colIdx) == 1)
139 else if (TF(0,colIdx) == -1)
143 result.col(colIdx) *= m_options.getReal(
"SlackMultiplier");
145 else if (TF(0,colIdx) == 0)
147 gsMatrix<T> C = m_materialMat->eval3D_matrix(patch,u.col(k),z(j,k),MaterialOutput::MatrixA);
148 gsMatrix<T> N = m_materialMat->eval3D_stress(patch,u.col(k),z(j,k),MaterialOutput::VectorN);
149 gsMatrix<T> E = m_materialMat->eval3D_strain(patch,u.col(k),z(j,k));
152 result.col(colIdx) = this->_compute_E(theta,C.
reshape(3,3),N,E);
155 GISMO_ERROR(
"Tension field data not understood: "<<TF(0,colIdx));
161 template <
short_t dim,
class T,
bool linear >
169 gsMatrix<T> result = m_materialMat->eval3D_stress(patch,u,z,MaterialOutput::VectorN);
173 for (
index_t k=0; k!=u.cols(); k++)
175 for(
index_t j=0; j < z.rows(); ++j )
177 colIdx = j*u.cols()+k;
178 if (TF(0,colIdx) == 1)
182 else if (TF(0,colIdx) == -1)
186 result.col(colIdx) *= m_options.getReal(
"SlackMultiplier");
188 else if (TF(0,colIdx) == 0)
190 gsMatrix<T> C = m_materialMat->eval3D_matrix(patch,u.col(k),z(j,k),MaterialOutput::MatrixA);
192 gsMatrix<T> E = m_materialMat->eval3D_strain(patch,u.col(k),z(j,k));
196 result.col(colIdx) = this->_compute_S(theta,C.
reshape(3,3),N);
199 GISMO_ERROR(
"Tension field data not understood: "<<TF(0,colIdx));
205 template <
short_t dim,
class T,
bool linear >
213 gsMatrix<T> result = m_materialMat->eval3D_CauchyStress(patch,u,z,MaterialOutput::CauchyStressN);
218 this->_computePoints(patch,u);
219 for (
index_t k=0; k!=u.cols(); k++)
221 for(
index_t j=0; j < z.rows(); ++j )
223 colIdx = j*u.cols()+k;
224 if (TF(0,colIdx) == 1)
228 else if (TF(0,colIdx) == -1)
232 result.col(colIdx) *= m_options.getReal(
"SlackMultiplier");
234 else if (TF(0,colIdx) == 0)
236 this->_getMetric(k, z(j, k) * m_data.mine().m_Tmat(0, k));
237 gsMatrix<T> C = m_materialMat->eval3D_matrix(patch,u.col(k),z(j,k),MaterialOutput::MatrixA);
238 gsMatrix<T> N = m_materialMat->eval3D_stress(patch,u.col(k),z(j,k),MaterialOutput::VectorN);;
239 gsMatrix<T> E = m_materialMat->eval3D_strain(patch,u.col(k),z(j,k));
242 gsMatrix<T> S = this->_compute_S(theta,C.reshape(3,3),N);
243 T detF = math::sqrt(m_data.mine().m_J0_sq)*1.0;
244 result.col(colIdx) = S / math::sqrt(detF);
247 GISMO_ERROR(
"Tension field data not understood: "<<TF(0,colIdx));
304 template <
short_t dim,
class T,
bool linear >
307 return this->_compute_TF(patch,u,z);
310 template <
short_t dim,
class T,
bool linear >
317 for (
index_t k=0; k!=u.cols(); k++)
319 for(
index_t j=0; j < z.rows(); ++j )
321 colIdx = j*u.cols()+k;
322 if (TF(0,colIdx) == 1 || TF(0,colIdx) == -1)
324 result(0,colIdx) = NAN;
326 else if (TF(0,colIdx) == 0)
328 gsMatrix<T> C = m_materialMat->eval3D_matrix(patch,u.col(k),z(j,k),MaterialOutput::MatrixA);
329 gsMatrix<T> N = m_materialMat->eval3D_stress(patch,u.col(k),z(j,k),MaterialOutput::VectorN);;
330 gsMatrix<T> E = m_materialMat->eval3D_strain(patch,u.col(k),z(j,k));
333 result(0,colIdx) = thetas(0,0);
336 GISMO_ERROR(
"Tension field data not understood: "<<TF(0,colIdx));
342 template <
short_t dim,
class T,
bool linear >
349 for (
index_t k=0; k!=u.cols(); k++)
351 for(
index_t j=0; j < z.rows(); ++j )
353 colIdx = j*u.cols()+k;
354 if (TF(0,colIdx) == 1 || TF(0,colIdx) == -1)
356 result(0,colIdx) = NAN;
358 else if (TF(0,colIdx) == 0)
360 gsMatrix<T> C = m_materialMat->eval3D_matrix(patch,u.col(k),z(j,k),MaterialOutput::MatrixA);
361 gsMatrix<T> N = m_materialMat->eval3D_stress(patch,u.col(k),z(j,k),MaterialOutput::VectorN);;
362 gsMatrix<T> E = m_materialMat->eval3D_strain(patch,u.col(k),z(j,k));
368 GISMO_ERROR(
"Tension field data not understood: "<<TF(0,colIdx));
375 template <
short_t dim,
class T,
bool linear >
376 template <
bool _linear>
377 typename std::enable_if<_linear, gsMatrix<T> >::type
380 gsMatrix<T> result = m_materialMat->eval3D_matrix(patch,u,z,MaterialOutput::MatrixA);
385 for (
index_t k=0; k!=u.cols(); k++)
387 for(
index_t j=0; j < z.rows(); ++j )
389 colIdx = j*u.cols()+k;
390 if (TF(0,colIdx) == 1)
394 else if (TF(0,colIdx) == -1)
398 result.col(colIdx) *= m_options.getReal(
"SlackMultiplier");
400 else if (TF(0,colIdx) == 0)
403 gsMatrix<T> N = m_materialMat->eval3D_stress(patch,u.col(k),z(j,k),MaterialOutput::VectorN);
404 gsMatrix<T> E = m_materialMat->eval3D_strain(patch,u.col(k),z(j,k));
411 GISMO_ERROR(
"Tension field data not understood: "<<TF(0,colIdx));
417 template <
short_t dim,
class T,
bool linear >
418 template <
bool _linear>
419 typename std::enable_if<!_linear, gsMatrix<T> >::type
422 gsMatrix<T> result = m_materialMat->eval3D_matrix(patch,u,z,out);
427 for (
index_t k=0; k!=u.cols(); k++)
429 for(
index_t j=0; j < z.rows(); ++j )
431 colIdx = j*u.cols()+k;
432 if (TF(0,colIdx) == 1)
436 else if (TF(0,colIdx) == -1)
440 result.col(colIdx) *= m_options.getReal(
"SlackMultiplier");
442 else if (TF(0,colIdx) == 0)
445 gsMatrix<T> N = m_materialMat->eval3D_stress(patch,u.col(k),z(j,k),MaterialOutput::VectorN);
446 gsMatrix<T> E = m_materialMat->eval3D_strain(patch,u.col(k),z(j,k));
449 gsMatrix<T> dC = m_materialMat->eval3D_dmatrix(patch,u.col(k),z(j,k),MaterialOutput::MatrixA);
455 GISMO_ERROR(
"Tension field data not understood: "<<TF(0,colIdx));
461 template <
short_t dim,
class T,
bool linear >
464 GISMO_ASSERT(Cs.cols()==Ns.cols(),
"Number of C matrices and N vectors is different");
465 GISMO_ASSERT(Cs.cols()==Es.cols(),
"Number of C matrices and E vectors is different");
471 for (
index_t k = 0; k!=Cs.cols(); k++)
480 gsVector<T> theta_interval = _theta_interval(C, N, E);
481 objective<T> obj(C,N);
486 bool converged =
false;
487 if (theta_interval(0)!=0 && theta_interval(1)!=0)
489 arg<<theta_interval(0);
490 converged = obj.findRootBrent(f,theta_interval(0),theta_interval(1),theta,1e-18);
493 converged = obj.findRootBisection(f,theta_interval(0),theta_interval(1),theta,1e-6);
496 obj.newtonRaphson(zeros,arg,
false,1e-12,100,1);
503 if (!_check_theta_full(theta,C,N,E) || (theta_interval(0)==0 && theta_interval(1)==0))
510 for (
index_t i=0; i!=theta_vec.size(); i++)
513 f_vec(i) = obj.eval(t);
516 std::vector<std::pair<T,T>> intervals; intervals.reserve(theta_vec.size());
517 for (
index_t i=0; i!=f_vec.size()-1; i++)
518 if (f_vec(i)*f_vec(i+1) < 0)
519 intervals.push_back(std::make_pair(theta_vec(i),theta_vec(i+1)));
522 std::vector<T> thetas(intervals.size());
523 for (
size_t i = 0; i!=intervals.size(); i++)
525 arg<<intervals[i].first;
526 converged = obj.findRootBrent(f,intervals[i].first,intervals[i].second,theta,1e-18);
529 converged = obj.findRootBisection(f,intervals[i].first,intervals[i].second,theta,1e-6);
532 obj.newtonRaphson(zeros,arg,
false,1e-12,100,1);
540 if ((f_vec(0)*f_vec(f_vec.size()-1) <= 0))
541 thetas.push_back(0.0);
543 std::vector<bool> full_check(thetas.size());
544 for (
size_t i = 0; i!=thetas.size(); i++)
545 full_check[i] = _check_theta_full(thetas[i],C,N,E);
547 index_t full_check_sum = std::accumulate(full_check.begin(),full_check.end(),0);
548 if (full_check_sum!=0)
550 std::vector<bool>::iterator res = std::find_if(full_check.begin(), full_check.end(), [](
bool i) {
return i;});
556 gsWarn<<
"Everything failed??\n";
587 template <
short_t dim,
class T,
bool linear >
590 T n1 = math::cos(theta);
591 T n2 = math::sin(theta);
592 T m1 = -math::sin(theta);
593 T m2 = math::cos(theta);
598 return - ( n1_vec.transpose() * N ).value() / ( n1_vec.transpose() * C * n1_vec ).value();
601 template <
short_t dim,
class T,
bool linear >
604 T n1 = math::cos(theta);
605 T n2 = math::sin(theta);
606 T m1 = -math::sin(theta);
607 T m2 = math::cos(theta);
612 check &= ((n1_vec.transpose() * N).value() < 0);
613 check &= ((n4_vec.transpose() * E).value() > 0);
617 template <
short_t dim,
class T,
bool linear >
620 T n1 = math::cos(theta);
621 T n2 = math::sin(theta);
623 return ((n1_vec.transpose() * N).value() < 0);
626 template <
short_t dim,
class T,
bool linear >
629 GISMO_ASSERT(C.rows()==C.cols(),
"C must be a 3x3 square matrix");
630 GISMO_ASSERT(C.rows()==3,
"C must be a 3x3 square matrix");
635 objective<T> obj(C,N);
641 T R_E = math::sqrt( math::pow((E11-E22)/2.,2) + E12*E12 );
642 if (R_E==0) {R_E = 1; gsDebugVar(
"??");};
644 T cos_E0 = (E22-E11)/(2*R_E);
645 std::complex<T> sin_Esqrt = E12*E12-E11*E22;
646 std::complex<T> sin_E1_C = -math::sqrt(sin_Esqrt)/R_E;
647 T sin_E1 = sin_E1_C.real();
648 T cos_E1 = -(E11+E22)/(2*R_E);
649 std::complex<T> sin_E2_C = math::sqrt(sin_Esqrt)/R_E;
650 T sin_E2 = sin_E2_C.real();
651 T cos_E2 = -(E11+E22)/(2*R_E);
653 T theta_0E = math::atan2(sin_E0,cos_E0);
654 T theta_1E = math::atan2(sin_E1,cos_E1);
655 T theta_2E = math::atan2(sin_E2,cos_E2);
657 T pi = 4*math::atan(1);
661 T R_N = math::sqrt( math::pow((N11-N22)/2.,2) + N12*N12 );
664 T cos_N0 = (N11-N22)/(R_N);
665 std::complex<T> sin_Nsqrt = N12*N12-N11*N22;
667 std::complex<T> sin_N1_C = math::sqrt(sin_Nsqrt)/R_N;
668 T sin_N1 = sin_N1_C.real();
669 T cos_N1 = -(N11+N22)/(2*R_N);
670 std::complex<T> sin_N2_C = -math::sqrt(sin_Nsqrt)/R_N;
671 T sin_N2 = sin_N2_C.real();
672 T cos_N2 = -(N11+N22)/(2*R_N);
674 T theta_0N = math::atan2(sin_N0,cos_N0);
675 T theta_1N = math::atan2(sin_N1,cos_N1);
676 T theta_2N = math::atan2(sin_N2,cos_N2);
678 T theta_1 = mod((theta_1N - theta_0N + theta_0E + pi),(2*pi));
679 T theta_2 = mod((theta_2N - theta_0N + theta_0E + pi),(2*pi));
680 if (math::isnan(theta_1) || math::isnan(theta_2) || R_N==1 || R_E == 1)
689 gsDebugVar(sin_Esqrt);
701 gsDebugVar(sin_Nsqrt);
712 gsDebugVar(theta_1N);
713 gsDebugVar(theta_0N);
714 gsDebugVar(theta_0E);
717 T Q_E_min = theta_1E - theta_0E;
718 T Q_E_max = theta_2E - theta_0E;
722 if (theta_1 < theta_2)
724 Q_S_min = theta_1 - pi - theta_0E;
725 Q_S_max = theta_2 - pi - theta_0E;
728 min = math::max(Q_E_min,Q_S_min);
729 max = math::min(Q_E_max,Q_S_max);
734 else if (theta_1 > theta_2)
737 Q_S_min = theta_1 - pi - theta_0E;
738 Q_S_max = pi - theta_0E;
741 min = math::max(Q_E_min,Q_S_min);
742 max = math::min(Q_E_max,Q_S_max);
745 if (obj.eval(min)*obj.eval(max)>0)
748 Q_S_min = - pi - theta_0E;
749 Q_S_max = theta_2 - pi - theta_0E;
751 min = math::max(Q_E_min,Q_S_min);
752 max = math::min(Q_E_max,Q_S_max);
785 template <
short_t dim,
class T,
bool linear >
788 if (m_options.getSwitch(
"Explicit"))
790 function_ptr tmp = m_materialMat->getDeformed();
791 m_materialMat->setDeformed(m_defpatches0);
792 gsMatrix<T> TF = m_materialMat->eval3D_tensionfield(patch,u,z,MaterialOutput::TensionField);
793 m_materialMat->setDeformed(tmp);
797 return m_materialMat->eval3D_tensionfield(patch,u,z,MaterialOutput::TensionField);
800 template <
short_t dim,
class T,
bool linear >
805 return _compute_TF(patch,u,zmat);
809 template <
short_t dim,
class T,
bool linear >
814 T n1 = math::cos(theta);
815 T n2 = math::sin(theta);
819 T gamma = - ( n1_vec.transpose() * S ).value() / ( n1_vec.transpose() * C * n1_vec ).value();
826 template <
short_t dim,
class T,
bool linear >
831 T n1 = math::cos(theta);
832 T n2 = math::sin(theta);
836 T gamma = - ( n1_vec.transpose() * S ).value() / ( n1_vec.transpose() * C * n1_vec ).value();
843 template <
short_t dim,
class T,
bool linear >
846 GISMO_ASSERT(C .rows()==3,
"Number of rows of C must be 3, but is "<<C.rows());
847 GISMO_ASSERT(C .cols()==3,
"Number of cols of C must be 3, but is "<<C.cols());
848 GISMO_ASSERT(S .rows()==3,
"Number of rows of S must be 3, but is "<<S.rows());
849 GISMO_ASSERT(S .cols()==1,
"Number of cols of S must be 1, but is "<<S.cols());
853 T n1 = math::cos(theta);
854 T n2 = math::sin(theta);
855 T m1 = -math::sin(theta);
856 T m2 = math::cos(theta);
862 T gamma = - ( n1_vec.transpose() * S ).value() / ( n1_vec.transpose() * C * n1_vec ).value();
866 gsMatrix<T> dgammadE = - ( n1_vec.transpose() * C) / ( n1_vec.transpose() * C * n1_vec ).value();
867 dgammadE.transposeInPlace();
870 T tmp = ( n2_vec.transpose() * C * n1_vec ).value() / ( n1_vec.transpose() * C * n1_vec ).value();
871 T dgammadT = - 2 * gamma * tmp;
875 gsMatrix<T> dfdE = n2_vec.transpose() * C - dgammadE.transpose() * (n2_vec.transpose() * C * n1_vec).value();
876 dfdE.transposeInPlace();
882 T dfdT = (n4_vec.transpose() * S).value() + dgammadT * (n2_vec.transpose() * C * n1_vec).value() +
883 gamma * ( (n4_vec.transpose() * C * n1_vec).value() + 2*(n2_vec.transpose() * C * n2_vec).value());
889 result += C * ( n1_vec * dgammadE.transpose() + dgammadT * n1_vec * dTdE.transpose() + 2*gamma * n2_vec * dTdE.transpose() );
893 template <
short_t dim,
class T,
bool linear >
896 GISMO_ASSERT(C .rows()==3,
"Number of rows of C must be 3, but is "<<C.rows());
897 GISMO_ASSERT(C .cols()==3,
"Number of cols of C must be 3, but is "<<C.cols());
898 GISMO_ASSERT(S .rows()==3,
"Number of rows of S must be 3, but is "<<S.rows());
899 GISMO_ASSERT(S .cols()==1,
"Number of cols of S must be 1, but is "<<S.cols());
900 GISMO_ASSERT(dC.cols()==3,
"Number of cols of dC must be 3, but is "<<dC.cols());
901 GISMO_ASSERT(dC.rows()==9,
"Number of rows of dC must be 1, but is "<<dC.rows());
905 T n1 = math::cos(theta);
906 T n2 = math::sin(theta);
907 T m1 = -math::sin(theta);
908 T m2 = math::cos(theta);
915 for (
index_t d = 0; d!=dC.cols(); d++)
921 T gamma = - ( n1_vec.transpose() * S ).value() / ( n1_vec.transpose() * C * n1_vec ).value();
925 gsMatrix<T> dgammadE = - ( n1_vec.transpose() * C + gamma * ( n1_vec.transpose() * dCN1) ) / ( n1_vec.transpose() * C * n1_vec ).value();
929 T tmp = ( n2_vec.transpose() * C * n1_vec ).value() / ( n1_vec.transpose() * C * n1_vec ).value();
930 T dgammadT = - 2 * gamma * tmp;
934 gsMatrix<T> dfdE = n2_vec.transpose() * C + dgammadE * (n2_vec.transpose() * C * n1_vec).value() + gamma * ( n2_vec.transpose() * dCN1);
941 T dfdT = (n4_vec.transpose() * S).value() + dgammadT * (n2_vec.transpose() * C * n1_vec).value() +
942 gamma * ( (n4_vec.transpose() * C * n1_vec).value() + 2*(n2_vec.transpose() * C * n2_vec).value());
948 gsMatrix<T> dgamman1dE = ( n1_vec * dgammadE + dgammadT * n1_vec * dTdE + 2*gamma * n2_vec * dTdE );
949 result += dgamman1dE.transpose() * C;
950 result += gamma * dCN1;
1088 template <
typename T>
1097 m_support.resize(1,2);
1098 m_support<<0,2*3.1415926535;
1103 result.resize(1,u.cols());
1108 for (
index_t k = 0; k!=u.cols(); k++)
1111 n1 = math::cos(theta);
1112 n2 = math::sin(theta);
1113 m1 = -math::sin(theta);
1114 m2 = math::cos(theta);
1116 n1_vec<<n1*n1, n2*n2, 2*n1*n2;
1117 n2_vec<<m1*n1, m2*n2, m1*n2+m2*n1;
1119 gamma = - ( n1_vec.transpose() * m_S ).value() / ( n1_vec.transpose() * m_C * n1_vec ).value();
1121 T res = (n2_vec.transpose() * m_S).value() + gamma * (n2_vec.transpose() * m_C * n1_vec).value();
1127 T eval(
const T & theta)
const
1132 this->eval_into(t,res);
1153 result.resize(1,u.cols());
1155 T theta, gamma, dgammadT;
1158 for (
index_t k = 0; k!=u.cols(); k++)
1161 n1 = math::cos(theta);
1162 n2 = math::sin(theta);
1163 m1 = -math::sin(theta);
1164 m2 = math::cos(theta);
1166 n1_vec<<n1*n1, n2*n2, 2*n1*n2;
1167 n2_vec<<m1*n1, m2*n2, m1*n2+m2*n1;
1168 n3_vec<<m1*m1-n1*n1, m2*m2-n2*n2, 2*(m1*m2-n1*n2);
1169 n4_vec<<m1*m1, m2*m2, 2*m1*m2;
1171 gamma = - ( n1_vec.transpose() * m_S ).value() / ( n1_vec.transpose() * m_C * n1_vec ).value();
1172 T tmp = ( n2_vec.transpose() * m_C * n1_vec ).value() / ( n1_vec.transpose() * m_C * n1_vec ).value();
1173 dgammadT = - 2 * gamma * tmp;
1176 T res = (n3_vec.transpose() * m_S).value() + dgammadT * (n2_vec.transpose() * m_C * n1_vec).value()
1177 + gamma * (n3_vec.transpose() * m_C * n1_vec).value() + 2*gamma * (n2_vec.transpose() * m_C * n2_vec).value();
1201 bool findRootBisection(T & f,
const T & A,
const T & B, T & x,
const T & t = 1e-12,
const index_t & itmax = 1000)
1207 while (
math::abs(b-a) > t && it++ < itmax)
1209 if (this->eval(c)==0.0)
1211 else if (this->eval(c)*this->eval(a) < 0)
1237 bool findRootBrent(T & f,
const T & a,
const T & b, T & x,
const T & t = 1e-12,
const index_t & itmax = 1000)
1266 fa = this->eval( sa );
1267 fb = this->eval( sb );
1279 macheps = std::numeric_limits<T>::epsilon();
1281 for (
index_t it = 0; it!=itmax; it++ )
1283 if ( std::fabs ( fc ) < std::fabs ( fb ) )
1293 tol = 2.0 * macheps * std::fabs ( sb ) + t;
1294 m = 0.5 * ( c - sb );
1296 if ( std::fabs ( m ) <= tol || fb == 0.0 )
1299 f = std::fabs ( m );
1304 if ( std::fabs ( e ) < tol || std::fabs ( fa ) <= std::fabs ( fb ) )
1322 p = s * ( 2.0 * m * q * ( q - r ) - ( sb - sa ) * ( r - 1.0 ) );
1323 q = ( q - 1.0 ) * ( r - 1.0 ) * ( s - 1.0 );
1338 if ( 2.0 * p < 3.0 * m * q - std::fabs ( tol * q ) &&
1339 p < std::fabs ( 0.5 * s * q ) )
1352 if ( tol < std::fabs ( d ) )
1365 fb = this->eval( sb );
1367 if ( ( 0.0 < fb && 0.0 < fc ) || ( fb <= 0.0 && fc <= 0.0 ) )
1377 GISMO_ERROR(
"Brent's method did not find a root");
MaterialOutput
This class describes the output type.
Definition: gsMaterialMatrixUtils.h:98
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: gsMaterialMatrixTFT.hpp:162
gsMatrix< T > eval3D_strain(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixTFT.hpp:124
T distance(gsMatrix< T > const &A, gsMatrix< T > const &B, index_t i=0, index_t j=0, bool cols=false)
compute a distance between the point number in the set and the point number <j> in the set ; by def...
Creates a mapped object or data pointer to a matrix without copying data.
Definition: gsLinearAlgebra.h:126
#define short_t
Definition: gsConfig.h:35
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: gsMaterialMatrixTFT.hpp:206
gsMatrix< T > eval3D_pstress(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z, enum MaterialOutput out=MaterialOutput::Generic) const override
Definition: gsMaterialMatrixTFT.hpp:68
#define index_t
Definition: gsConfig.h:32
std::ostream & print(std::ostream &os) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixTFT.hpp:36
A function from a n-dimensional domain to an m-dimensional image.
Definition: gsFunction.h:59
#define GISMO_ASSERT(cond, message)
Definition: gsDebug.h:89
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
A vector with arbitrary coefficient type and fixed or dynamic size.
Definition: gsVector.h:35
#define gsWarn
Definition: gsDebug.h:50
gsMatrix< T > eval_theta(const gsMatrix< T > &Cs, const gsMatrix< T > &Ns, const gsMatrix< T > &Es) const
Computes theta.
Definition: gsMaterialMatrixTFT.hpp:462
gsMatrix< T > eval3D_pstrain(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixTFT.hpp:96
gsMatrix< T > eval3D_theta(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z, enum MaterialOutput out=MaterialOutput::Generic) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixTFT.hpp:311
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
This class defines a linear material.
Definition: gsMaterialMatrixTFT.h:39
std::enable_if< _linear, gsMatrix< T > >::type _eval3D_matrix_impl(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z, enum MaterialOutput out=MaterialOutput::Generic) const
Provides an implementation of eval3D_matrix for gsMaterialMatrixLinear.
Definition: gsMaterialMatrixTFT.hpp:378
Provides material matrix utilities.
gsMatrix< T > eval3D_gamma(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z, enum MaterialOutput out=MaterialOutput::Generic) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixTFT.hpp:343
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: gsMaterialMatrixTFT.hpp:49
EIGEN_STRONG_INLINE reshape_expr< E > const reshape(E const &u, index_t n, index_t m)
Reshape an expression.
Definition: gsExpressions.h:1925
gsMatrix< T > eval3D_tensionfield(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z, enum MaterialOutput out=MaterialOutput::Generic) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixTFT.hpp:305
#define GISMO_ERROR(message)
Definition: gsDebug.h:118
EIGEN_STRONG_INLINE abs_expr< E > abs(const E &u)
Absolute value.
Definition: gsExpressions.h:4486
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: gsMaterialMatrixTFT.hpp:62
Provides declaration of Function abstract interface.