36 #ifndef ELEMOPERSTRUCTURE_CPP 37 #define ELEMOPERSTRUCTURE_CPP 1
39 #include <lifev/fsi_blocks/solver/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;
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;
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;
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;
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();
1509 A[nDimensions * i + j] = cauchy (i, j);
1512 lapack.GEEV (JOBVL, JOBVR, Dim, A , Dim, &WR[0], &WI[0], 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];
1529 void source_P1iso_VKPenalized (
Real lambda,
1531 const boost::multi_array<Real, 3 >& FkMinusTransposed,
1532 const boost::multi_array<Real, 3 >& Fk,
1533 const std::vector<Real>& Ic_isok,
1534 const std::vector<Real>& Ic_k,
1535 const std::vector<Real>& Jack_k,
1552 s += std::pow ( Jack_k[ ig ], (-2.0 / 3.0) ) * ( ( lambda / 2.0 ) * Ic_isok[ ig ] - (3.0 / 2.0) * lambda - mu ) *
1553 (Fk[ icoor ][ k ][ ig ] - (1.0 / 3.0) * Ic_k[ ig ] * FkMinusTransposed[ icoor ][ k ][ ig ] ) * fe.phiDer ( i, k, ig ) * fe.weightDet ( ig );
1564 void source_P2iso_VKPenalized (
Real mu,
1565 const boost::multi_array<Real, 3 >& FkMinusTransposed,
1566 const boost::multi_array<Real, 3 >& FkCk,
1567 const std::vector<Real>& Ic_Squared,
1568 const std::vector<Real>& Jk,
1585 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 );
1595 void stiff_Jac_P1iso_VKPenalized_0term (
Real lambda,
Real mu,
1596 const boost::multi_array<Real, 3 >& FkMinusTransposed,
1597 const boost::multi_array<Real, 3 >& Fk,
1598 const std::vector<Real>& Jk ,
1599 const std::vector<Real>& Ic_k ,
1600 const std::vector<Real>& IcIso_k ,
1622 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) ) *
1623 fe.phiDer ( i, l, ig ) * ( Fk[ icoor ][ l ][ ig ] - (1.0 / 3.0) * Ic_k[ ig ] * FkMinusTransposed[ icoor ][ l ][ ig ] ) *
1624 FkMinusTransposed[ jcoor ][ k ][ ig ] * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
1636 void stiff_Jac_P1iso_VKPenalized_1term (
Real coeff,
1637 const boost::multi_array<Real, 3 >& FkMinusTransposed,
1638 const boost::multi_array<Real, 3 >& Fk,
1639 const std::vector<Real>& Jk ,
1640 const std::vector<Real>& Ic_k ,
1662 s += ( -2.0 / 3.0 ) * Ic_k[ ig ] * std::pow ( Jk[ig], (-4.0 / 3.0) ) *
1663 fe.phiDer ( i, l, ig ) * Fk[ icoor ][ l ][ ig ] *
1664 FkMinusTransposed[ jcoor ][ k ][ ig ] * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
1668 mat ( i, j ) += coeff * s;
1676 void stiff_Jac_P1iso_VKPenalized_2term (
Real coef,
1677 const boost::multi_array<Real, 3 >& FkMinusTransposed,
1678 const std::vector<Real>& Jk,
1679 const std::vector<Real>& Ic_k,
1701 s += ( ( 2.0 / 9.0 ) * std::pow ( Jk[ig], (-4.0 / 3.0) ) * Ic_k[ig] * Ic_k[ig] ) *
1702 FkMinusTransposed[ icoor ][ l ][ ig ] * fe.phiDer ( i, l, ig ) *
1703 FkMinusTransposed[ jcoor ][ k ][ ig ] * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
1707 mat ( i, j ) += coef * s;
1715 void stiff_Jac_P1iso_VKPenalized_3term (
Real coef,
1716 const boost::multi_array<Real, 3 >& Fk,
1717 const std::vector<Real>& Jk,
1739 s += 2.0 * std::pow ( Jk[ig], (-4.0 / 3.0) ) *
1740 fe.phiDer ( i, l, ig ) * Fk[ icoor ][ l ][ ig ] *
1741 Fk[ jcoor ][ k ][ ig ] * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
1745 mat ( i, j ) += coef * s;
1753 void stiff_Jac_P1iso_VKPenalized_4term (
Real coef,
1754 const boost::multi_array<Real, 3 >& FkMinusTransposed,
1755 const boost::multi_array<Real, 3 >& Fk,
1756 const std::vector<Real>& Jk ,
1757 const std::vector<Real>& Ic_k,
1779 s += ( ( -2.0 / 3.0 ) * std::pow ( Jk[ig], (-4.0 / 3.0) ) * Ic_k[ig] ) *
1780 fe.phiDer ( i, l, ig ) * FkMinusTransposed[ icoor ][ l ][ ig ] *
1781 Fk[ jcoor ][ k ][ ig ] * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
1785 mat ( i, j ) += coef * s;
1793 void stiff_Jac_P1iso_VKPenalized_5term (
Real coef,
1795 const std::vector<Real>& Jk,
1796 const std::vector<Real>& Ic_isok,
1812 s += std::pow ( Jk[ ig ], (-2.0 / 3.0) ) * ( (coef / 2.0) * Ic_isok[ ig ] - ( (3.0 / 2.0) * coef + secondCoef ) ) *
1813 fe.phiDer ( i, k, ig ) * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
1816 mat_tmp ( i, j ) = s;
1829 void stiff_Jac_P1iso_VKPenalized_6term (
Real coef,
Real secondCoef,
1830 const std::vector<Real>& Jk,
1831 const std::vector<Real>& Ic_isok,
1832 const boost::multi_array<Real, 3 >& Fk,
1833 const boost::multi_array<Real, 3 >& FkMinusTransposed,
1855 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 ) ) *
1856 fe.phiDer ( i, l, ig ) * FkMinusTransposed[ icoor ][ l ][ ig ] *
1857 Fk[ jcoor ][ k ][ ig ] * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
1869 void stiff_Jac_P1iso_VKPenalized_7term (
Real coef,
1871 const boost::multi_array<Real, 3 >& FkMinusTransposed,
1872 const std::vector<Real>& Ic_isok,
1873 const std::vector<Real>& Ic_k,
1874 const std::vector<Real>& Jk,
1896 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 ] ) *
1897 FkMinusTransposed[ icoor ][ l ][ ig ] * fe.phiDer ( j, l, ig ) *
1898 FkMinusTransposed[ jcoor ][ k ][ ig ] * fe.phiDer ( i, k, ig ) * fe.weightDet ( ig );
1910 void stiff_Jac_P1iso_VKPenalized_8term (
Real coef,
const std::vector<Real>& Jack_k,
1911 const boost::multi_array<Real, 3 >& FkMinusTransposed,
1912 const boost::multi_array<Real, 3 >& FkCk,
1935 s += (-4.0 / 3.0) * std::pow ( Jack_k[ ig ], (-4.0 / 3.0) ) *
1936 fe.phiDer ( i, l, ig ) * FkCk[ icoor ][ l ][ ig ] *
1937 FkMinusTransposed[ jcoor ][ k ][ ig ] * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
1941 mat ( i, j ) += s * coef;
1950 void stiff_Jac_P1iso_VKPenalized_9term (
Real coef,
const std::vector<Real>& Jack_k,
1951 const std::vector<Real>& Ic_kSquared,
1952 const boost::multi_array<Real, 3 >& FkMinusTransposed,
1973 s += ( (-4.0 / 3.0) * std::pow ( Jack_k[ ig ], (-4.0 / 3.0) ) ) *
1974 fe.phiDer ( i, l, ig ) * (-1.0 / 3.0) * Ic_kSquared[ ig ] * FkMinusTransposed[ icoor ][ l ][ ig ] *
1975 FkMinusTransposed[ jcoor ][ k ][ ig ] * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
1979 mat ( i, j ) += s * coef;
1990 void stiff_Jac_P1iso_VKPenalized_10term (
Real coef,
1991 const std::vector<Real>& Jack_k,
1992 const boost::multi_array<Real, 3 >& Ck,
2012 s += std::pow ( Jack_k[ ig ], (-4.0 / 3.0) ) * Ck[ l ][ k ][ ig ] * fe.phiDer ( i, k, ig ) *
2013 fe.phiDer ( j, l, ig ) * fe.weightDet ( ig );
2017 mat ( i, j ) += coef * s;
2024 void stiff_Jac_P1iso_VKPenalized_11term (
Real coef,
2025 const std::vector<Real>& Jk,
2026 const boost::multi_array<Real, 3 >& Fk,
2048 s += std::pow ( Jk[ ig ], (-4.0 / 3.0) ) * fe.phiDer ( i, l, ig ) * Fk[ l ][ jcoor ][ ig ] *
2049 Fk[ icoor ][ k ][ ig ] * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
2053 mat ( i, j ) += coef * s;
2061 void stiff_Jac_P1iso_VKPenalized_12term (
Real coef,
2062 const std::vector<Real>& Jk,
2063 const boost::multi_array<Real, 3 >& Fk,
2085 s += std::pow ( Jk[ig], (-4.0 / 3.0) ) * Fk[ icoor ][ p ][ ig ] * fe.phiDer ( i, k, ig ) *
2086 Fk[ jcoor ][ p ][ ig ] * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
2090 mat ( i, j ) += coef * s;
2098 void stiff_Jac_P1iso_VKPenalized_13term (
Real coef,
2099 const std::vector<Real>& Jk,
2100 const std::vector<Real>& Ic_kSquared,
2101 const boost::multi_array<Real, 3 >& FkMinusTransposed,
2123 s += ( std::pow ( Jk[ig], (-4.0 / 3.0) ) ) * ( Ic_kSquared[ig] / 3.0 ) *
2124 fe.phiDer ( j, l, ig ) * FkMinusTransposed[ icoor ][ l ][ ig ] *
2125 fe.phiDer ( i, k, ig ) * FkMinusTransposed[ jcoor ][ k ][ ig ] * fe.weightDet ( ig );
2130 mat ( i, j ) += s * coef;
2138 void stiff_Jac_P1iso_VKPenalized_14term (
Real coef,
2139 const std::vector<Real>& Jk,
2140 const boost::multi_array<Real, 3 >& FkCk,
2141 const boost::multi_array<Real, 3 >& FkMinusTransposed,
2163 s += ( std::pow ( Jk[ig], (-4.0 / 3.0) ) ) * ( -4.0 / 3.0 ) *
2164 fe.phiDer ( i, l, ig ) * FkMinusTransposed[ icoor ][ l ][ ig ] *
2165 ( FkCk[ jcoor ][ k ][ ig ] * fe.phiDer ( j, k, ig ) ) * fe.weightDet ( ig );
2169 mat ( i, j ) += s * coef;
2186 void source_P1iso_SecondOrderExponential (
Real coef,
Real coefExp,
2187 const boost::multi_array<Real, 3 >& CofFk,
2188 const boost::multi_array<Real, 3 >& Fk,
2189 const std::vector<Real>& Jk,
2190 const std::vector<Real>& Ic_isok,
2207 s += (Ic_isok[ ig ] - 3.0) * exp ( coefExp * (Ic_isok[ ig ] - 3.0) * (Ic_isok[ ig ] - 3.0) ) *
2208 (std::pow ( Jk[ ig ], (-2.0 / 3.0) ) * Fk[ icoor ][ k ][ ig ]
2209 - 1.0 / 3.0 * ( Ic_isok[ ig ] / Jk[ ig ] ) * CofFk[ icoor ][ k ][ ig ] ) * fe.phiDer ( i, k, ig ) * fe.weightDet ( ig );
2212 vec ( i ) += s * coef;
2219 void stiff_Jac_P1iso_SecondOrderExp_1term (
Real coef,
2221 const boost::multi_array<Real, 3 >& CofFk,
2222 const boost::multi_array<Real, 3 >& Fk,
2223 const std::vector<Real>& Jk ,
2224 const std::vector<Real>& Ic_isok,
2246 s += ( std::pow ( Jk[ig], -5.0 / 3.0) * exp (coefExp * (Ic_isok[ig] - 3.0) * (Ic_isok[ig] - 3.0) ) ) *
2247 ( (Ic_isok[ig] - 3.0) * ( 1.0 + 2 * coefExp * (Ic_isok[ig] - 3.0) * Ic_isok[ig] ) + Ic_isok[ig] ) *
2248 fe.phiDer ( i, l, ig ) * Fk[ icoor ][ l ][ ig ] *
2249 CofFk[ jcoor ][ k ][ ig ] * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
2253 mat ( i, j ) += coef * s;
2263 void stiff_Jac_P1iso_SecondOrderExp_2term (
Real coef,
2265 const boost::multi_array<Real, 3 >& Fk,
2266 const std::vector<Real>& Jk,
2267 const std::vector<Real>& Ic_isok,
2289 s += std::pow ( Jk[ig], -4.0 / 3.0 ) * exp ( coefExp * (Ic_isok[ig] - 3.0) * (Ic_isok[ig] - 3.0) ) *
2290 ( 1.0 + 2 * coefExp * (Ic_isok[ig] - 3.0) * (Ic_isok[ig] - 3.0) ) *
2291 fe.phiDer ( i, l, ig ) * Fk[ icoor ][ l ][ ig ] *
2292 Fk[ jcoor ][ k ][ ig ] * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
2296 mat ( i, j ) += coef * s;
2307 void stiff_Jac_P1iso_SecondOrderExp_3term (
Real coef,
Real coefExp,
2308 const boost::multi_array<Real, 3 >& CofFk,
2309 const std::vector<Real>& Jk,
2310 const std::vector<Real>& Ic_isok,
2332 s += ( ( 1 / (Jk[ig] * Jk[ig]) ) * Ic_isok[ig] * exp ( coefExp * (Ic_isok[ig] - 3.0) * (Ic_isok[ig] - 3.0) ) ) *
2333 ( (Ic_isok[ig] - 3.0) * ( 1.0 + 2.0 * coefExp * (Ic_isok[ig] - 3.0) * Ic_isok[ig] ) + Ic_isok[ig] ) *
2334 CofFk[ icoor ][ l ][ ig ] * fe.phiDer ( i, l, ig ) *
2335 CofFk[ jcoor ][ k ][ ig ] * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
2339 mat ( i, j ) += coef * s;
2351 void stiff_Jac_P1iso_SecondOrderExp_4term (
Real coef,
Real coefExp,
2352 const boost::multi_array<Real, 3 >& CofFk,
2353 const boost::multi_array<Real, 3 >& Fk,
2354 const std::vector<Real>& Jk ,
2355 const std::vector<Real>& Ic_isok,
2356 const std::vector<Real>& ,
2378 s += std::pow ( Jk[ig], (-5.0 / 3.0) ) * exp ( coefExp * (Ic_isok[ig] - 3.0) * (Ic_isok[ig] - 3.0) ) *
2379 ( Ic_isok[ig] + (Ic_isok[ig] - 3.0) * ( 1.0 + 2.0 * coefExp * (Ic_isok[ig] - 3.0) * Ic_isok[ig] ) ) *
2380 fe.phiDer ( i, l, ig ) * CofFk[ icoor ][ l ][ ig ] *
2381 Fk[ jcoor ][ k ][ ig ] * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
2385 mat ( i, j ) += coef * s;
2394 void stiff_Jac_P1iso_SecondOrderExp_5term (
Real coef,
2396 const std::vector<Real>& Jk,
2397 const std::vector<Real>& Ic_isok,
2413 s += (Ic_isok[ ig ] - 3.0) * exp ( coefExp * (Ic_isok[ig] - 3.0) * (Ic_isok[ig] - 3.0) ) *
2414 std::pow ( Jk[ig], -2.0 / 3.0 ) * fe.phiDer ( i, k, ig ) * fe.phiDer ( j, k, ig ) * fe.weightDet ( ig );
2417 mat_tmp ( i, j ) = coef * s;
2430 void stiff_Jac_P1iso_SecondOrderExp_6term (
Real coef,
2432 const boost::multi_array<Real, 3 >& CofFk,
2433 const std::vector<Real>& Jk,
2434 const std::vector<Real>& Ic_isok,
2456 s += ( 1 / (Jk[ig] * Jk[ig]) ) * (Ic_isok[ig] - 3.0) *
2457 exp ( coefExp * (Ic_isok[ig] - 3.0) * (Ic_isok[ig] - 3.0) ) * Ic_isok[ig] *
2458 fe.phiDer ( j, l, ig ) * CofFk[ icoor ][ l ][ ig ] *
2459 fe.phiDer ( i, k, ig ) * CofFk[ jcoor ][ k ][ ig ] * fe.weightDet ( ig );
2463 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)