36 #ifndef ELEMOPERSTRUCTURE_CPP 37 #define ELEMOPERSTRUCTURE_CPP 1
39 #include <lifev/structure/fem/AssemblyElementalStructure.hpp> 40 #include <boost/multi_array.hpp> 45 namespace AssemblyElementalStructure
48 void computeGradientLocalDisplacement (boost::multi_array<Real, 3>& gradientLocalDisplacement,
69 s += fe.phiDer ( i, jcoor, ig ) * uk_loc.vec() [ i + icoor * fe.nbFEDof() ];
71 gradientLocalDisplacement[ icoor ][ jcoor ][ ig ] = s;
77 void computeLocalDeformationGradient (
const VectorElemental& uk_loc, std::vector<Epetra_SerialDenseMatrix>& tensorF,
const CurrentFE& fe )
94 s += fe.phiDer ( i, jcoor, k ) * uk_loc.vec() [ i + icoor * fe.nbFEDof() ];
96 tensorF[k] ( icoor, jcoor ) = s;
100 tensorF[k] ( icoor, jcoor ) += 1.0;
107 void computeLocalDeformationGradientWithoutIdentity (
const VectorElemental& uk_loc, std::vector<Epetra_SerialDenseMatrix>& tensorF,
const CurrentFE& fe )
124 s += fe.phiDer ( i, jcoor, k ) * uk_loc.vec() [ i + icoor * fe.nbFEDof() ];
126 tensorF[k] ( icoor, jcoor ) = s;
138 void stiff_derdiv (
Real coef,
const boost::multi_array<Real, 3>& gradientLocalDisplacement,
MatrixElemental& elmat,
const CurrentFE& fe )
160 s += fe.phiDer ( i, icoor, ig ) * gradientLocalDisplacement[ jcoor ][ k ][ ig ]
161 * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
163 mat ( i, j ) += coef * s;
173 void stiff_dergradbis (
Real coef,
const boost::multi_array<Real, 3>& gradientLocalDisplacement,
195 for ( UInt k = 0; k < fe.nbLocalCoor(); ++k )
196 for ( UInt ig = 0; ig < fe.nbQuadPt(); ++ig )
197 s += fe.phiDer ( i, k, ig ) * gradientLocalDisplacement[ jcoor][ icoor ][ ig ] *
198 fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
199 mat ( i, j ) += coef * s;
215 std::vector<Real > duk (fe.nbQuadPt(), 0.0);
227 s += fe.phiDer ( i, icoor, ig ) * uk_loc.vec() [ i + icoor * fe.nbFEDof() ];
244 s += duk[ ig ] * fe.phiDer ( i, k, ig ) * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
247 mat_tmp ( i, j ) = coef * s;
265 std::vector<Real > gguk (fe.nbQuadPt(), 0.0);
279 s1 += fe.phiDer ( i, l, ig ) * uk_loc.vec() [ i + icoor * fe.nbFEDof() ];
298 s += gguk[ ig ] * fe.phiDer ( i, k, ig ) * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
301 mat_tmp ( i, j ) = coef * s;
312 void stiff_dergrad_gradbis (
Real coef,
const boost::multi_array<Real, 3>& gradientLocalDisplacement,
336 for ( UInt ig = 0; ig < fe.nbQuadPt(); ++ig )
337 s += gradientLocalDisplacement[ icoor ][ jcoor ][ ig ] * fe.phiDer ( i, k, ig ) *
338 fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
340 mat ( i, j ) += coef * s;
350 void stiff_dergrad_gradbis_Tr (
Real coef,
const boost::multi_array<Real, 3>& gradientLocalDisplacement,
373 for ( UInt ig = 0; ig < fe.nbQuadPt(); ++ig )
374 s += gradientLocalDisplacement[ icoor ][ k ][ ig ] * fe.phiDer ( j, k, ig ) *
375 fe.phiDer ( i, jcoor, ig ) * fe.weightDet ( ig );
377 mat ( i, j ) += coef * s;
394 boost::multi_array<Real, 3> guk_gukT (boost::extents[fe.nbLocalCoor()][fe.nbLocalCoor()][fe.nbQuadPt()]);
415 s += fe.phiDer ( i, n, ig ) * uk_loc.vec() [ i + icoor * fe.nbFEDof() ] *
416 fe.phiDer ( j, n, ig ) * uk_loc.vec() [ j + jcoor * fe.nbFEDof() ];
420 guk_gukT[ icoor ][ jcoor ][ ig ] = s;
437 for ( UInt k = 0; k < fe.nbLocalCoor(); ++k )
438 for ( UInt ig = 0; ig < fe.nbQuadPt(); ++ig )
439 s += fe.phiDer ( i, k, ig ) * guk_gukT[ icoor ][ jcoor ][ ig ] *
440 fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
441 mat ( i, j ) += coef * s;
452 void stiff_dergrad (
Real coef,
const boost::multi_array<Real, 3>& gradientLocalDisplacement,
473 s += fe.phiDer ( i, k, ig ) *
474 ( gradientLocalDisplacement[ jcoor ][ k ][ ig ] * fe.phiDer ( j, icoor, ig )
475 + gradientLocalDisplacement[ jcoor ][ icoor ][ ig ] * fe.phiDer ( j, k, ig ) ) * fe.weightDet ( ig );
477 mat ( i, j ) += coef * s;
487 void stiff_divgrad_2 (
Real coef,
const boost::multi_array<Real, 3>& gradientLocalDisplacement,
508 for ( UInt k = 0; k < fe.nbLocalCoor(); ++k )
509 for ( UInt ig = 0; ig < fe.nbQuadPt(); ++ig )
510 s += fe.phiDer ( j, jcoor, ig ) *
511 gradientLocalDisplacement[ icoor ][ k ][ ig ] *
512 fe.phiDer ( i, k, ig ) * fe.weightDet ( ig );
513 mat ( i, j ) += coef * s;
521 void stiff_gradgrad_2 (
Real coef,
const boost::multi_array<Real, 3>& gradientLocalDisplacement,
MatrixElemental& elmat,
const CurrentFE& fe )
540 for ( UInt ig = 0; ig < fe.nbQuadPt(); ++ig )
541 s += gradientLocalDisplacement[ jcoor ][ l ][ ig ] * fe.phiDer ( j, l, ig ) *
542 gradientLocalDisplacement[ icoor ][ k ][ ig ] * fe.phiDer (i, k, ig ) *
546 mat ( i, j ) += coef * s;
554 void stiff_dergrad_gradbis_2 (
Real coef,
const boost::multi_array<Real, 3>& gradientLocalDisplacement,
574 for ( UInt ig = 0; ig < fe.nbQuadPt(); ++ig )
575 s += gradientLocalDisplacement[ l ][ k ][ ig ] * fe.phiDer ( i, k, ig ) *
576 fe.phiDer ( j, l, ig ) * fe.weightDet ( ig );
579 mat_tmp ( i, j ) = coef * s;
590 void stiff_dergrad_gradbis_Tr_2 (
Real coef,
const boost::multi_array<Real, 3>& gradientLocalDisplacement,
611 s += gradientLocalDisplacement[ k ][ l ][ ig ] * fe.phiDer ( i, k, ig ) *
612 fe.phiDer ( j, l, ig ) * fe.weightDet ( ig );
616 mat_tmp ( i, j ) = coef * s;
630 void stiff_gradgradTr_gradbis_2 (
Real coef,
const boost::multi_array<Real, 3>& gradientLocalDisplacement,
657 s += gradientLocalDisplacement[ icoor ][ l ][ ig ] *
658 gradientLocalDisplacement[ jcoor ][ k ][ ig ] * fe.phiDer ( i, k, ig ) *
659 fe.phiDer ( j, l, ig ) * fe.weightDet ( ig );
663 mat ( i, j ) += coef * s;
677 boost::multi_array<Real, 3> guk_gukT (boost::extents[fe.nbLocalCoor()][fe.nbLocalCoor()][fe.nbQuadPt()]);
698 s += fe.phiDer ( i, n, ig ) * uk_loc.vec() [ i + icoor * fe.nbFEDof() ] *
699 fe.phiDer ( j, n, ig ) * uk_loc.vec() [ j + jcoor * fe.nbFEDof() ] ;
703 guk_gukT[ icoor ][ jcoor ][ ig ] = s;
724 s += guk_gukT[ k ][ l ][ ig ] * fe.phiDer ( i, k, ig ) * fe.phiDer ( j, l, ig ) * fe.weightDet ( ig );
728 mat_tmp ( i, j ) = coef * s;
748 void source_Pvol (
Real coef,
749 const boost::multi_array<Real, 3 >& CofFk,
750 const std::vector<Real>& Jk,
767 s += ( Jk[ig] * Jk[ig] - Jk[ig] + log ( Jk[ig] ) ) * ( 1 / Jk[ig] ) *
768 CofFk[icoor][ k][ ig] * fe.phiDer (i, k, ig) * fe.weightDet (ig);
780 void stiff_Jac_Pvol_1term (
Real coef,
781 const boost::multi_array<Real, 3 >& CofFk,
782 const std::vector<Real>& Jk,
804 s += ( 2.0 - ( 1 / Jk[ig] ) + ( 1 / ( Jk[ig] * Jk[ig] ) ) ) *
805 CofFk[ jcoor ][ l ][ ig ] * fe.phiDer ( j, l, ig ) *
806 CofFk[ icoor ][ k ][ ig ] * fe.phiDer ( i, k, ig ) *
811 mat ( i, j ) += s * coef;
820 void stiff_Jac_Pvol_2term (
Real coef,
821 const boost::multi_array<Real, 3 >& CofFk,
822 const std::vector<Real>& Jk,
844 s += ( ( 1 / Jk[ig] ) - 1. - ( 1 / ( Jk[ig] * Jk[ig] ) ) * log ( Jk[ig] ) ) *
845 CofFk[ icoor ][ l ][ ig ] * fe.phiDer ( j, l, ig ) *
846 CofFk[ jcoor ][ k ][ ig ] * fe.phiDer ( i, k, ig ) * fe.weightDet ( ig );
850 mat ( i, j ) += s * coef;
864 void source_P1iso_NH (
Real coef,
865 const boost::multi_array<Real, 3 >& CofFk,
866 const boost::multi_array<Real, 3 >& Fk,
867 const std::vector<Real>& Jk,
868 const std::vector<Real>& Ic_isok ,
885 s1 += pow ( Jk[ ig ], (-2.0 / 3.0) ) * Fk[ icoor ][ k ][ ig ] *
886 fe.phiDer ( i, k, ig ) * fe.weightDet ( ig );
888 s2 += 1.0 / 3.0 * ( Ic_isok[ ig ] * ( 1 / Jk[ig] ) ) *
889 CofFk[ icoor ][ k ][ ig ] * fe.phiDer ( i, k, ig ) * fe.weightDet ( ig );
892 vec ( i ) += (s1 - s2) * coef;
906 void stiff_Jac_P1iso_NH_1term (
Real coef,
907 const boost::multi_array<Real, 3 >& CofFk,
908 const boost::multi_array<Real, 3 >& Fk,
909 const std::vector<Real>& Jk ,
931 s += pow ( Jk[ig], -5. / 3. ) *
932 Fk[ jcoor ][ l ][ ig ] * fe.phiDer ( j, l, ig ) *
933 CofFk[ icoor ][ k ][ ig ] * fe.phiDer ( i, k, ig ) * fe.weightDet ( ig );
937 mat ( i, j ) += coef * s;
947 void stiff_Jac_P1iso_NH_2term (
Real coef,
948 const boost::multi_array<Real, 3 >& CofFk,
949 const std::vector<Real>& Jk ,
950 const std::vector<Real>& Ic_isok,
972 s += ( 1 / (Jk[ig] * Jk[ig] ) ) * Ic_isok[ig] *
973 CofFk[ jcoor ][ l ][ ig ] * fe.phiDer ( j, l, ig ) *
974 CofFk[ icoor ][ k ][ ig ] * fe.phiDer ( i, k, ig ) * fe.weightDet ( ig );
978 mat ( i, j ) += coef * s;
988 void stiff_Jac_P1iso_NH_3term (
Real coef,
989 const std::vector<Real>& Jk,
1007 s += pow ( Jk[ig], -2. / 3.) * fe.phiDer ( i, k, ig ) *
1008 fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
1011 mat_tmp ( i, j ) = coef * s;
1024 void stiff_Jac_P1iso_NH_4term (
Real coef,
1025 const boost::multi_array<Real, 3 >& CofFk,
1026 const boost::multi_array<Real, 3 >& Fk,
1027 const std::vector<Real>& Jk ,
1049 s += pow ( Jk[ig], -5. / 3. ) *
1050 Fk[ icoor ][ k ][ ig ] * fe.phiDer ( i, k, ig ) *
1051 CofFk[ jcoor ][ l ][ ig ] * fe.phiDer ( j, l, ig ) * fe.weightDet ( ig );
1055 mat ( i, j ) += coef * s;
1065 void stiff_Jac_P1iso_NH_5term (
Real coef,
1066 const boost::multi_array<Real, 3 >& CofFk,
1067 const std::vector<Real>& Jk ,
1068 const std::vector<Real>& Ic_isok,
1090 s += ( 1 / ( Jk[ig] * Jk[ig] ) ) * Ic_isok[ig] *
1091 CofFk[ icoor ][ l ][ ig ] * fe.phiDer ( j, l, ig ) *
1092 CofFk[ jcoor ][ k ][ ig ] * fe.phiDer ( i, k, ig ) * fe.weightDet ( ig );
1096 mat ( i, j ) += s * coef;
1113 void source_P1iso_Exp (
Real coef,
1115 const boost::multi_array<Real, 3 >& CofFk,
1116 const boost::multi_array<Real, 3 >& Fk,
1117 const std::vector<Real>& Jk,
1118 const std::vector<Real>& Ic_isok,
1135 s += exp ( coefExp * ( Ic_isok[ ig ] - 3.0 ) ) *
1136 (pow ( Jk[ ig ], (-2.0 / 3.0) ) * Fk[ icoor ][ k ][ ig ] -
1137 1.0 / 3.0 * ( 1 / Jk[ ig ] ) * Ic_isok[ ig ] *
1138 CofFk[ icoor ][ k ][ ig ] ) * fe.phiDer ( i, k, ig ) * fe.weightDet ( ig );
1142 vec ( i ) += s * coef;
1153 void stiff_Jac_P1iso_Exp_1term (
Real coef,
1155 const boost::multi_array<Real, 3 >& CofFk,
1156 const boost::multi_array<Real, 3 >& Fk,
1157 const std::vector<Real>& Jk ,
1158 const std::vector<Real>& Ic_isok,
1180 s += std::pow ( Jk[ig], -5. / 3. ) * exp ( coefExp * ( Ic_isok[ig] - 3 ) ) *
1181 ( 1. + coefExp * Ic_isok[ig] ) *
1182 CofFk[ jcoor ][ k ][ ig ] * fe.phiDer ( j, k, ig ) *
1183 Fk[ icoor ][ l ][ ig ] * fe.phiDer ( i, l, ig ) * fe.weightDet ( ig );
1187 mat ( i, j ) += coef * s;
1196 void stiff_Jac_P1iso_Exp_2term (
Real coef,
1198 const boost::multi_array<Real, 3 >& Fk,
1199 const std::vector<Real>& Jk,
1200 const std::vector<Real>& Ic_isok,
1222 s += std::pow ( Jk[ig], -4.0 / 3.0 ) * exp ( coefExp * ( Ic_isok[ig] - 3 ) ) *
1223 Fk[ jcoor ][ l ][ ig ] * fe.phiDer ( j, l, ig ) *
1224 Fk[ icoor ][ k ][ ig ] * fe.phiDer ( i, k, ig ) * fe.weightDet ( ig );
1228 mat ( i, j ) += coef * s;
1236 void stiff_Jac_P1iso_Exp_3term (
Real coef,
Real coefExp,
1237 const boost::multi_array<Real, 3 >& CofFk,
1238 const std::vector<Real>& Jk,
1239 const std::vector<Real>& Ic_isok,
1261 s += ( 1 / ( Jk[ig] * Jk[ig] ) ) * exp ( coefExp * ( Ic_isok[ig] - 3 ) ) *
1262 ( 1. + coefExp * Ic_isok[ig] ) * Ic_isok[ig] *
1263 CofFk[ jcoor ][ l ][ ig ] * fe.phiDer ( j, l, ig ) *
1264 CofFk[ icoor ][ k ][ ig ] * fe.phiDer ( i, k, ig ) * fe.weightDet ( ig );
1269 mat ( i, j ) += coef * s;
1277 void stiff_Jac_P1iso_Exp_4term (
Real coef,
Real coefExp,
1278 const boost::multi_array<Real, 3 >& CofFk,
1279 const boost::multi_array<Real, 3 >& Fk,
1280 const std::vector<Real>& Jk ,
1281 const std::vector<Real>& Ic_isok,
1303 s += std::pow ( Jk[ig], -5. / 3. ) * exp ( coefExp * ( Ic_isok[ig] - 3 ) ) *
1304 ( 1. + coefExp * Ic_isok[ig] ) *
1305 Fk[ jcoor ][ k ][ ig ] * fe.phiDer ( j, k, ig ) *
1306 CofFk[ icoor ][ l ][ ig ] * fe.phiDer ( i, l, ig ) * fe.weightDet ( ig );
1310 mat ( i, j ) += coef * s;
1319 void stiff_Jac_P1iso_Exp_5term (
Real coef,
1321 const std::vector<Real>& Jk,
1322 const std::vector<Real>& Ic_isok,
1338 s += std::pow (Jk[ig], -2.0 / 3.0) * exp ( coefExp * ( Ic_isok[ig] - 3 ) ) *
1339 fe.phiDer ( i, k, ig ) * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
1342 mat_tmp ( i, j ) = coef * s;
1355 void stiff_Jac_P1iso_Exp_6term (
Real coef,
1357 const boost::multi_array<Real, 3 >& CofFk,
1358 const std::vector<Real>& Jk,
1359 const std::vector<Real>& Ic_isok,
1381 s += ( 1 / ( Jk[ig] * Jk[ig] ) ) * Ic_isok[ig] *
1382 exp ( coefExp * ( Ic_isok[ig] - 3 ) ) *
1383 CofFk[ icoor ][ l ][ ig ] * fe.phiDer ( j, l, ig ) *
1384 CofFk[ jcoor ][ k ][ ig ] * fe.phiDer ( i, k, ig ) * fe.weightDet ( ig );
1388 mat ( i, j ) += s * coef;
1404 void computeInvariantsRightCauchyGreenTensor (std::vector<LifeV::Real>& invariants,
1405 const Epetra_SerialDenseMatrix& tensorF,
1406 Epetra_SerialDenseMatrix& cofactorF)
1420 C11 = tensorF (0, 0) * tensorF (0, 0) + tensorF (1, 0) * tensorF (1, 0) + tensorF (2, 0) * tensorF (2, 0);
1421 C22 = tensorF (0, 1) * tensorF (0, 1) + tensorF (1, 1) * tensorF (1, 1) + tensorF (2, 1) * tensorF (2, 1);
1422 C33 = tensorF (0, 2) * tensorF (0, 2) + tensorF (1, 2) * tensorF (1, 2) + tensorF (2, 2) * tensorF (2, 2);
1424 invariants[0] = C11 + C22 + C33;
1425 invariants[1] = 0.0;
1426 invariants[2] = 0.0;
1427 invariants[3] = tensorF (0, 0) * ( tensorF (1, 1) * tensorF (2, 2) - tensorF (1, 2) * tensorF (2, 1) ) - tensorF (0, 1) * ( tensorF (1, 0) * tensorF (2, 2) - tensorF (1, 2) * tensorF (2, 0) ) + tensorF (0, 2) * ( tensorF (1, 0) * tensorF (2, 1) - tensorF (1, 1) * tensorF (2, 0) );
1430 cofactorF ( 0 , 0 ) = ( tensorF (1, 1) * tensorF (2, 2) - tensorF (1, 2) * tensorF (2, 1) );
1431 cofactorF ( 0 , 1 ) = - ( tensorF (1, 0) * tensorF (2, 2) - tensorF (2, 0) * tensorF (1, 2) );
1432 cofactorF ( 0 , 2 ) = ( tensorF (1, 0) * tensorF (2, 1) - tensorF (1, 1) * tensorF (2, 0) );
1433 cofactorF ( 1 , 0 ) = - ( tensorF (0, 1) * tensorF (2, 2) - tensorF (0, 2) * tensorF (2, 1) );
1434 cofactorF ( 1 , 1 ) = ( tensorF (0, 0) * tensorF (2, 2) - tensorF (0, 2) * tensorF (2, 0) );
1435 cofactorF ( 1 , 2 ) = - ( tensorF (0, 0) * tensorF (2, 1) - tensorF (2, 0) * tensorF (0, 1) );
1436 cofactorF ( 2 , 0 ) = ( tensorF (0, 1) * tensorF (1, 2) - tensorF (0, 2) * tensorF (1, 1) );
1437 cofactorF ( 2 , 1 ) = - ( tensorF (0, 0) * tensorF (1, 2) - tensorF (0, 2) * tensorF (1, 0) );
1438 cofactorF ( 2 , 2 ) = ( tensorF (0, 0) * tensorF (1, 1) - tensorF (1, 0) * tensorF (0, 1) );
1440 cofactorF.Scale (1 / invariants[3]);
1444 void computeInvariantsRightCauchyGreenTensor (std::vector<LifeV::Real>& invariants,
1445 const Epetra_SerialDenseMatrix& tensorF)
1448 invariants[0] = 0.0;
1449 invariants[1] = 0.0;
1450 invariants[2] = 0.0;
1451 invariants[3] = tensorF (0, 0) * ( tensorF (1, 1) * tensorF (2, 2) - tensorF (1, 2) * tensorF (2, 1) ) - tensorF (0, 1) * ( tensorF (1, 0) * tensorF (2, 2) - tensorF (1, 2) * tensorF (2, 0) ) + tensorF (0, 2) * ( tensorF (1, 0) * tensorF (2, 1) - tensorF (1, 1) * tensorF (2, 0) );
1456 void computeCauchyStressTensor (Epetra_SerialDenseMatrix& cauchy,
1457 Epetra_SerialDenseMatrix& firstPiola,
1459 Epetra_SerialDenseMatrix& tensorF)
1462 firstPiola.Scale ( 1 / det );
1463 cauchy.Multiply (
'N',
'T', 1.0, firstPiola, tensorF, 0.0);
1467 void computeEigenvalues (
const Epetra_SerialDenseMatrix& cauchy,
1468 std::vector<LifeV::Real>& eigenvaluesR,
1469 std::vector<LifeV::Real>& eigenvaluesI)
1474 Epetra_LAPACK lapack;
1483 Int Dim = cauchy.RowDim();
1496 double* VR =
new double[length];
1497 double* VL =
new double[length];
1502 double* WORK =
new double[LWORK];
1504 double* A =
new double[length];
1509 A[nDimensions * i + j] = cauchy (i, j);
1512 lapack.GEEV (JOBVL, JOBVR, Dim, A , Dim, WR, WI, VL, LDVL, VR, LDVR, WORK, LWORK, &INFO);
1513 ASSERT_PRE ( !INFO,
"Calculation of the Eigenvalues failed!!!" );
1517 eigenvaluesR[i] = WR[i];
1518 eigenvaluesI[i] = WI[i];
1535 void source_P1iso_VKPenalized (
Real lambda,
1537 const boost::multi_array<Real, 3 >& FkMinusTransposed,
1538 const boost::multi_array<Real, 3 >& Fk,
1539 const std::vector<Real>& Ic_isok,
1540 const std::vector<Real>& Ic_k,
1541 const std::vector<Real>& Jack_k,
1558 s += std::pow ( Jack_k[ ig ], (-2.0 / 3.0) ) * ( ( lambda / 2.0 ) * Ic_isok[ ig ] - (3.0 / 2.0) * lambda - mu ) *
1559 (Fk[ icoor ][ k ][ ig ] - (1.0 / 3.0) * Ic_k[ ig ] * FkMinusTransposed[ icoor ][ k ][ ig ] ) * fe.phiDer ( i, k, ig ) * fe.weightDet ( ig );
1570 void source_P2iso_VKPenalized (
Real mu,
1571 const boost::multi_array<Real, 3 >& FkMinusTransposed,
1572 const boost::multi_array<Real, 3 >& FkCk,
1573 const std::vector<Real>& Ic_Squared,
1574 const std::vector<Real>& Jk,
1591 s += ( mu * std::pow ( Jk[ ig ], (-4.0 / 3.0) ) ) * (FkCk[ icoor ][ k ][ ig ] - (1.0 / 3.0) * Ic_Squared[ ig ] * FkMinusTransposed[ icoor ][ k ][ ig ] ) * fe.phiDer ( i, k, ig ) * fe.weightDet ( ig );
1601 void stiff_Jac_P1iso_VKPenalized_0term (
Real lambda,
Real mu,
1602 const boost::multi_array<Real, 3 >& FkMinusTransposed,
1603 const boost::multi_array<Real, 3 >& Fk,
1604 const std::vector<Real>& Jk ,
1605 const std::vector<Real>& Ic_k ,
1606 const std::vector<Real>& IcIso_k ,
1628 s += (-2.0 / 3.0) * std::pow (Jk[ ig ], (-2.0 / 3.0) ) * ( ( (lambda / 2.0) * IcIso_k[ ig ] ) - ( (3.0 / 2.0) * lambda + mu) ) *
1629 fe.phiDer ( i, l, ig ) * ( Fk[ icoor ][ l ][ ig ] - (1.0 / 3.0) * Ic_k[ ig ] * FkMinusTransposed[ icoor ][ l ][ ig ] ) *
1630 FkMinusTransposed[ jcoor ][ k ][ ig ] * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
1642 void stiff_Jac_P1iso_VKPenalized_1term (
Real coeff,
1643 const boost::multi_array<Real, 3 >& FkMinusTransposed,
1644 const boost::multi_array<Real, 3 >& Fk,
1645 const std::vector<Real>& Jk ,
1646 const std::vector<Real>& Ic_k ,
1668 s += ( -2.0 / 3.0 ) * Ic_k[ ig ] * std::pow ( Jk[ig], (-4.0 / 3.0) ) *
1669 fe.phiDer ( i, l, ig ) * Fk[ icoor ][ l ][ ig ] *
1670 FkMinusTransposed[ jcoor ][ k ][ ig ] * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
1674 mat ( i, j ) += coeff * s;
1682 void stiff_Jac_P1iso_VKPenalized_2term (
Real coef,
1683 const boost::multi_array<Real, 3 >& FkMinusTransposed,
1684 const std::vector<Real>& Jk,
1685 const std::vector<Real>& Ic_k,
1707 s += ( ( 2.0 / 9.0 ) * std::pow ( Jk[ig], (-4.0 / 3.0) ) * Ic_k[ig] * Ic_k[ig] ) *
1708 FkMinusTransposed[ icoor ][ l ][ ig ] * fe.phiDer ( i, l, ig ) *
1709 FkMinusTransposed[ jcoor ][ k ][ ig ] * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
1713 mat ( i, j ) += coef * s;
1721 void stiff_Jac_P1iso_VKPenalized_3term (
Real coef,
1722 const boost::multi_array<Real, 3 >& Fk,
1723 const std::vector<Real>& Jk,
1745 s += 2.0 * std::pow ( Jk[ig], (-4.0 / 3.0) ) *
1746 fe.phiDer ( i, l, ig ) * Fk[ icoor ][ l ][ ig ] *
1747 Fk[ jcoor ][ k ][ ig ] * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
1751 mat ( i, j ) += coef * s;
1759 void stiff_Jac_P1iso_VKPenalized_4term (
Real coef,
1760 const boost::multi_array<Real, 3 >& FkMinusTransposed,
1761 const boost::multi_array<Real, 3 >& Fk,
1762 const std::vector<Real>& Jk ,
1763 const std::vector<Real>& Ic_k,
1785 s += ( ( -2.0 / 3.0 ) * std::pow ( Jk[ig], (-4.0 / 3.0) ) * Ic_k[ig] ) *
1786 fe.phiDer ( i, l, ig ) * FkMinusTransposed[ icoor ][ l ][ ig ] *
1787 Fk[ jcoor ][ k ][ ig ] * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
1791 mat ( i, j ) += coef * s;
1799 void stiff_Jac_P1iso_VKPenalized_5term (
Real coef,
1801 const std::vector<Real>& Jk,
1802 const std::vector<Real>& Ic_isok,
1818 s += std::pow ( Jk[ ig ], (-2.0 / 3.0) ) * ( (coef / 2.0) * Ic_isok[ ig ] - ( (3.0 / 2.0) * coef + secondCoef ) ) *
1819 fe.phiDer ( i, k, ig ) * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
1822 mat_tmp ( i, j ) = s;
1835 void stiff_Jac_P1iso_VKPenalized_6term (
Real coef,
Real secondCoef,
1836 const std::vector<Real>& Jk,
1837 const std::vector<Real>& Ic_isok,
1838 const boost::multi_array<Real, 3 >& Fk,
1839 const boost::multi_array<Real, 3 >& FkMinusTransposed,
1861 s += std::pow ( Jk[ ig ], (-2.0 / 3.0) ) * (-2.0 / 3.0) * ( (coef / 2.0) * Ic_isok[ ig ] - ( (3.0 / 2.0) * coef + secondCoef ) ) *
1862 fe.phiDer ( i, l, ig ) * FkMinusTransposed[ icoor ][ l ][ ig ] *
1863 Fk[ jcoor ][ k ][ ig ] * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
1875 void stiff_Jac_P1iso_VKPenalized_7term (
Real coef,
1877 const boost::multi_array<Real, 3 >& FkMinusTransposed,
1878 const std::vector<Real>& Ic_isok,
1879 const std::vector<Real>& Ic_k,
1880 const std::vector<Real>& Jk,
1902 s += std::pow ( Jk[ ig ], (-2.0 / 3.0) ) * ( (coef / 2.0) * Ic_isok[ ig ] - ( (3.0 / 2.0) * coef + secondCoef ) ) * ( (1.0 / 3.0) * Ic_k[ ig ] ) *
1903 FkMinusTransposed[ icoor ][ l ][ ig ] * fe.phiDer ( j, l, ig ) *
1904 FkMinusTransposed[ jcoor ][ k ][ ig ] * fe.phiDer ( i, k, ig ) * fe.weightDet ( ig );
1916 void stiff_Jac_P1iso_VKPenalized_8term (
Real coef,
const std::vector<Real>& Jack_k,
1917 const boost::multi_array<Real, 3 >& FkMinusTransposed,
1918 const boost::multi_array<Real, 3 >& FkCk,
1941 s += (-4.0 / 3.0) * std::pow ( Jack_k[ ig ], (-4.0 / 3.0) ) *
1942 fe.phiDer ( i, l, ig ) * FkCk[ icoor ][ l ][ ig ] *
1943 FkMinusTransposed[ jcoor ][ k ][ ig ] * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
1947 mat ( i, j ) += s * coef;
1956 void stiff_Jac_P1iso_VKPenalized_9term (
Real coef,
const std::vector<Real>& Jack_k,
1957 const std::vector<Real>& Ic_kSquared,
1958 const boost::multi_array<Real, 3 >& FkMinusTransposed,
1979 s += ( (-4.0 / 3.0) * std::pow ( Jack_k[ ig ], (-4.0 / 3.0) ) ) *
1980 fe.phiDer ( i, l, ig ) * (-1.0 / 3.0) * Ic_kSquared[ ig ] * FkMinusTransposed[ icoor ][ l ][ ig ] *
1981 FkMinusTransposed[ jcoor ][ k ][ ig ] * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
1985 mat ( i, j ) += s * coef;
1996 void stiff_Jac_P1iso_VKPenalized_10term (
Real coef,
1997 const std::vector<Real>& Jack_k,
1998 const boost::multi_array<Real, 3 >& Ck,
2018 s += std::pow ( Jack_k[ ig ], (-4.0 / 3.0) ) * Ck[ l ][ k ][ ig ] * fe.phiDer ( i, k, ig ) *
2019 fe.phiDer ( j, l, ig ) * fe.weightDet ( ig );
2023 mat ( i, j ) += coef * s;
2030 void stiff_Jac_P1iso_VKPenalized_11term (
Real coef,
2031 const std::vector<Real>& Jk,
2032 const boost::multi_array<Real, 3 >& Fk,
2054 s += std::pow ( Jk[ ig ], (-4.0 / 3.0) ) * fe.phiDer ( i, l, ig ) * Fk[ l ][ jcoor ][ ig ] *
2055 Fk[ icoor ][ k ][ ig ] * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
2059 mat ( i, j ) += coef * s;
2067 void stiff_Jac_P1iso_VKPenalized_12term (
Real coef,
2068 const std::vector<Real>& Jk,
2069 const boost::multi_array<Real, 3 >& Fk,
2091 s += std::pow ( Jk[ig], (-4.0 / 3.0) ) * Fk[ icoor ][ p ][ ig ] * fe.phiDer ( i, k, ig ) *
2092 Fk[ jcoor ][ p ][ ig ] * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
2096 mat ( i, j ) += coef * s;
2104 void stiff_Jac_P1iso_VKPenalized_13term (
Real coef,
2105 const std::vector<Real>& Jk,
2106 const std::vector<Real>& Ic_kSquared,
2107 const boost::multi_array<Real, 3 >& FkMinusTransposed,
2129 s += ( std::pow ( Jk[ig], (-4.0 / 3.0) ) ) * ( Ic_kSquared[ig] / 3.0 ) *
2130 fe.phiDer ( j, l, ig ) * FkMinusTransposed[ icoor ][ l ][ ig ] *
2131 fe.phiDer ( i, k, ig ) * FkMinusTransposed[ jcoor ][ k ][ ig ] * fe.weightDet ( ig );
2136 mat ( i, j ) += s * coef;
2144 void stiff_Jac_P1iso_VKPenalized_14term (
Real coef,
2145 const std::vector<Real>& Jk,
2146 const boost::multi_array<Real, 3 >& FkCk,
2147 const boost::multi_array<Real, 3 >& FkMinusTransposed,
2169 s += ( std::pow ( Jk[ig], (-4.0 / 3.0) ) ) * ( -4.0 / 3.0 ) *
2170 fe.phiDer ( i, l, ig ) * FkMinusTransposed[ icoor ][ l ][ ig ] *
2171 ( FkCk[ jcoor ][ k ][ ig ] * fe.phiDer ( j, k, ig ) ) * fe.weightDet ( ig );
2175 mat ( i, j ) += s * coef;
2192 void source_P1iso_SecondOrderExponential (
Real coef,
Real coefExp,
2193 const boost::multi_array<Real, 3 >& CofFk,
2194 const boost::multi_array<Real, 3 >& Fk,
2195 const std::vector<Real>& Jk,
2196 const std::vector<Real>& Ic_isok,
2213 s += (Ic_isok[ ig ] - 3.0) * exp ( coefExp * (Ic_isok[ ig ] - 3.0) * (Ic_isok[ ig ] - 3.0) ) *
2214 (std::pow ( Jk[ ig ], (-2.0 / 3.0) ) * Fk[ icoor ][ k ][ ig ]
2215 - 1.0 / 3.0 * ( Ic_isok[ ig ] / Jk[ ig ] ) * CofFk[ icoor ][ k ][ ig ] ) * fe.phiDer ( i, k, ig ) * fe.weightDet ( ig );
2218 vec ( i ) += s * coef;
2225 void stiff_Jac_P1iso_SecondOrderExp_1term (
Real coef,
2227 const boost::multi_array<Real, 3 >& CofFk,
2228 const boost::multi_array<Real, 3 >& Fk,
2229 const std::vector<Real>& Jk ,
2230 const std::vector<Real>& Ic_isok,
2252 s += ( std::pow ( Jk[ig], -5.0 / 3.0) * exp (coefExp * (Ic_isok[ig] - 3.0) * (Ic_isok[ig] - 3.0) ) ) *
2253 ( (Ic_isok[ig] - 3.0) * ( 1.0 + 2 * coefExp * (Ic_isok[ig] - 3.0) * Ic_isok[ig] ) + Ic_isok[ig] ) *
2254 fe.phiDer ( i, l, ig ) * Fk[ icoor ][ l ][ ig ] *
2255 CofFk[ jcoor ][ k ][ ig ] * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
2259 mat ( i, j ) += coef * s;
2269 void stiff_Jac_P1iso_SecondOrderExp_2term (
Real coef,
2271 const boost::multi_array<Real, 3 >& Fk,
2272 const std::vector<Real>& Jk,
2273 const std::vector<Real>& Ic_isok,
2295 s += std::pow ( Jk[ig], -4.0 / 3.0 ) * exp ( coefExp * (Ic_isok[ig] - 3.0) * (Ic_isok[ig] - 3.0) ) *
2296 ( 1.0 + 2 * coefExp * (Ic_isok[ig] - 3.0) * (Ic_isok[ig] - 3.0) ) *
2297 fe.phiDer ( i, l, ig ) * Fk[ icoor ][ l ][ ig ] *
2298 Fk[ jcoor ][ k ][ ig ] * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
2302 mat ( i, j ) += coef * s;
2313 void stiff_Jac_P1iso_SecondOrderExp_3term (
Real coef,
Real coefExp,
2314 const boost::multi_array<Real, 3 >& CofFk,
2315 const std::vector<Real>& Jk,
2316 const std::vector<Real>& Ic_isok,
2338 s += ( ( 1 / (Jk[ig] * Jk[ig]) ) * Ic_isok[ig] * exp ( coefExp * (Ic_isok[ig] - 3.0) * (Ic_isok[ig] - 3.0) ) ) *
2339 ( (Ic_isok[ig] - 3.0) * ( 1.0 + 2.0 * coefExp * (Ic_isok[ig] - 3.0) * Ic_isok[ig] ) + Ic_isok[ig] ) *
2340 CofFk[ icoor ][ l ][ ig ] * fe.phiDer ( i, l, ig ) *
2341 CofFk[ jcoor ][ k ][ ig ] * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
2345 mat ( i, j ) += coef * s;
2357 void stiff_Jac_P1iso_SecondOrderExp_4term (
Real coef,
Real coefExp,
2358 const boost::multi_array<Real, 3 >& CofFk,
2359 const boost::multi_array<Real, 3 >& Fk,
2360 const std::vector<Real>& Jk ,
2361 const std::vector<Real>& Ic_isok,
2362 const std::vector<Real>& ,
2384 s += std::pow ( Jk[ig], (-5.0 / 3.0) ) * exp ( coefExp * (Ic_isok[ig] - 3.0) * (Ic_isok[ig] - 3.0) ) *
2385 ( Ic_isok[ig] + (Ic_isok[ig] - 3.0) * ( 1.0 + 2.0 * coefExp * (Ic_isok[ig] - 3.0) * Ic_isok[ig] ) ) *
2386 fe.phiDer ( i, l, ig ) * CofFk[ icoor ][ l ][ ig ] *
2387 Fk[ jcoor ][ k ][ ig ] * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
2391 mat ( i, j ) += coef * s;
2400 void stiff_Jac_P1iso_SecondOrderExp_5term (
Real coef,
2402 const std::vector<Real>& Jk,
2403 const std::vector<Real>& Ic_isok,
2419 s += (Ic_isok[ ig ] - 3.0) * exp ( coefExp * (Ic_isok[ig] - 3.0) * (Ic_isok[ig] - 3.0) ) *
2420 std::pow ( Jk[ig], -2.0 / 3.0 ) * fe.phiDer ( i, k, ig ) * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
2423 mat_tmp ( i, j ) = coef * s;
2436 void stiff_Jac_P1iso_SecondOrderExp_6term (
Real coef,
2438 const boost::multi_array<Real, 3 >& CofFk,
2439 const std::vector<Real>& Jk,
2440 const std::vector<Real>& Ic_isok,
2462 s += ( 1 / (Jk[ig] * Jk[ig]) ) * (Ic_isok[ig] - 3.0) *
2463 exp ( coefExp * (Ic_isok[ig] - 3.0) * (Ic_isok[ig] - 3.0) ) * Ic_isok[ig] *
2464 fe.phiDer ( j, l, ig ) * CofFk[ icoor ][ l ][ ig ] *
2465 fe.phiDer ( i, k, ig ) * CofFk[ jcoor ][ k ][ ig ] * fe.weightDet ( ig );
2469 mat ( i, j ) += s * coef;
int32_type Int
Generic integer data.
void updateInverseJacobian(const UInt &iQuadPt)
UInt nbLocalCoor() const
Getter for the number of local coordinates.
double Real
Generic real data.
CurrentFE - A primordial class for the assembly of the local matrices/vectors retaining the values on...
UInt nbFEDof() const
Getter for the number of nodes.
const UInt nDimensions(NDIM)
UInt nbQuadPt() const
Getter for the number of quadrature nodes.
uint32_type UInt
generic unsigned integer (used mainly for addressing)