24 #error "MoFEM need to be compiled with ADOL-C"
113 template<
typename TYPE>
117 map<int,BlockMaterialData> &
dAta;
126 ublas::matrix<TYPE,ublas::row_major,ublas::bounded_array<TYPE,9> >
F;
127 ublas::matrix<TYPE,ublas::row_major,ublas::bounded_array<TYPE,9> >
FDot;
128 ublas::matrix<TYPE,ublas::row_major,ublas::bounded_array<TYPE,9> >
strainHat;
129 ublas::matrix<TYPE,ublas::row_major,ublas::bounded_array<TYPE,9> >
strainHatDot;
131 ublas::vector<TYPE,ublas::bounded_array<TYPE,3> >
gradientMu;
135 ublas::matrix<TYPE,ublas::row_major,ublas::bounded_array<TYPE,9> >
C;
136 ublas::matrix<TYPE,ublas::row_major,ublas::bounded_array<TYPE,9> >
gradientU;
137 ublas::matrix<TYPE,ublas::row_major,ublas::bounded_array<TYPE,9> >
strainTotal;
139 ublas::matrix<TYPE,ublas::row_major,ublas::bounded_array<TYPE,9> >
stressAlpha;
140 ublas::matrix<TYPE,ublas::row_major,ublas::bounded_array<TYPE,9> >
stressBeta;
141 ublas::matrix<TYPE,ublas::row_major,ublas::bounded_array<TYPE,9> >
strainHatFlux;
142 ublas::matrix<TYPE,ublas::row_major,ublas::bounded_array<TYPE,9> >
stressBetaHat;
151 ublas::matrix<TYPE,ublas::row_major,ublas::bounded_array<TYPE,9> >
stressTotal;
159 noalias(
C) = prod(trans(
F),
F);
160 PetscFunctionReturn(0);
170 for(
int ii = 0;ii<3;ii++) {
176 PetscFunctionReturn(0);
184 for(
int ii = 0;ii<3;ii++) {
187 PetscFunctionReturn(0);
203 for(
int ii = 0;ii<3;ii++) {
207 double a = 2.0*
dAta[
iD].gAlpha;
210 for(
int ii = 0; ii<3; ii++){
213 PetscFunctionReturn(0);
230 for(
int ii = 0;ii<3;ii++) {
238 for(
int ii = 0;ii<3;ii++) {
241 PetscFunctionReturn(0);
258 for(
int ii = 0;ii<3;ii++) {
262 double a = (1.0/(2.0*
dAta[
iD].gBetaHat));
265 for(
int ii = 0;ii<3;ii++) {
268 PetscFunctionReturn(0);
284 for(
int ii=0; ii<3; ii++){
287 PetscFunctionReturn(0);
298 PetscFunctionReturn(0);
305 PetscFunctionReturn(0);
323 PetscFunctionReturn(0);
335 PetscFunctionReturn(0);
413 PetscFunctionReturn(0);
427 ierr = MatAssemblyBegin(
ts_B,MAT_FLUSH_ASSEMBLY); CHKERRQ(
ierr);
428 ierr = MatAssemblyEnd(
ts_B,MAT_FLUSH_ASSEMBLY); CHKERRQ(
ierr);
431 PetscFunctionReturn(0);
456 EntityType zero_at_type = MBVERTEX
477 int nb_dofs = data.getFieldData().size();
479 PetscFunctionReturn(0);
481 int rank = data.getFieldDofs()[0]->getNbOfCoeffs();
482 int nb_gauss_pts = data.getN().size1();
487 for(
int gg = 0;gg<nb_gauss_pts;gg++) {
493 for(
int gg = 0;gg<nb_gauss_pts;gg++) {
500 for(
int gg = 0;gg<nb_gauss_pts;gg++) {
513 for(
int gg = 0;gg<nb_gauss_pts;gg++) {
516 for(
int dd = 0;
dd<nb_dofs/rank;
dd++) {
517 for(
int rr1 = 0;rr1<rank;rr1++) {
522 for(
int rr2 = 0;rr2<3;rr2++) {
530 }
catch (
const std::exception& ex) {
532 ss <<
"throw in method: " << ex.what() << endl;
533 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
536 PetscFunctionReturn(0);
544 boost::shared_ptr<Gel::ConstitutiveEquation<adouble> >
cE;
558 bool calculate_residual,
559 bool calculate_jacobian
583 PetscFunctionReturn(0);
585 cE->F.resize(3,3,
false);
586 cE->strainHat.resize(3,3,
false);
594 for(
int dd1 = 0;dd1<3;dd1++) {
595 for(
int dd2 = 0;dd2<3;dd2++) {
596 cE->F(dd1,dd2) <<=
F(dd1,dd2);
602 cE->strainHat(0,0) <<= strain_hat[0];
603 cE->strainHat(1,1) <<= strain_hat[1];
604 cE->strainHat(2,2) <<= strain_hat[2];
605 cE->strainHat(0,1) <<= strain_hat[3];
606 cE->strainHat(1,2) <<= strain_hat[4];
607 cE->strainHat(0,2) <<= strain_hat[5];
609 cE->strainHat(1,0) =
cE->strainHat(0,1);
610 cE->strainHat(2,1) =
cE->strainHat(1,2);
611 cE->strainHat(2,0) =
cE->strainHat(0,2);
615 ierr =
cE->calculateStrainTotal(); CHKERRQ(
ierr);
616 ierr =
cE->calculateStressAlpha(); CHKERRQ(
ierr);
617 ierr =
cE->calculateStressBeta(); CHKERRQ(
ierr);
618 ierr =
cE->calculateStressBetaHat(); CHKERRQ(
ierr);
620 ierr =
cE->calculateStressTotal(); CHKERRQ(
ierr);
625 for(
int d1 = 0;d1<3;d1++) {
626 for(
int d2 = 0;d2<3;d2++) {
633 }
catch (
const std::exception& ex) {
635 ss <<
"throw in method: " << ex.what() << endl;
636 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
638 PetscFunctionReturn(0);
645 PetscFunctionReturn(0);
648 cE->gradientMu.resize(3,
false);
654 for(
int ii = 0;ii<3;ii++) {
655 cE->gradientMu[ii] <<= gradient_mu(0,ii);
658 ierr =
cE->calculateSolventFlux(); CHKERRQ(
ierr);
662 for(
int d1 = 0;d1<3;d1++) {
668 }
catch (
const std::exception& ex) {
670 ss <<
"throw in method: " << ex.what() << endl;
671 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
674 PetscFunctionReturn(0);
681 PetscFunctionReturn(0);
693 cE->F.resize(3,3,
false);
694 for(
int dd1 = 0;dd1<3;dd1++) {
695 for(
int dd2 = 0;dd2<3;dd2++) {
696 cE->F(dd1,dd2) <<=
F(dd1,dd2);
700 cE->FDot.resize(3,3,
false);
701 for(
int dd1 = 0;dd1<3;dd1++) {
702 for(
int dd2 = 0;dd2<3;dd2++) {
703 cE->FDot(dd1,dd2) <<= F_dot(dd1,dd2);
707 ierr =
cE->calculateTraceStrainTotalDot(); CHKERRQ(
ierr);
708 ierr =
cE->calculateSolventConcentrationDot(); CHKERRQ(
ierr);
716 PetscFunctionReturn(0);
723 PetscFunctionReturn(0);
728 cE->F.resize(3,3,
false);
729 cE->strainHat.resize(3,3,
false);
730 cE->strainHatDot.resize(3,3,
false);
738 for(
int dd1 = 0;dd1<3;dd1++) {
739 for(
int dd2 = 0;dd2<3;dd2++) {
740 cE->F(dd1,dd2) <<=
F(dd1,dd2);
746 cE->strainHat(0,0) <<= strain_hat[0];
747 cE->strainHat(1,1) <<= strain_hat[1];
748 cE->strainHat(2,2) <<= strain_hat[2];
749 cE->strainHat(0,1) <<= strain_hat[3];
750 cE->strainHat(1,2) <<= strain_hat[4];
751 cE->strainHat(0,2) <<= strain_hat[5];
753 cE->strainHat(1,0) =
cE->strainHat(0,1);
754 cE->strainHat(2,1) =
cE->strainHat(1,2);
755 cE->strainHat(2,0) =
cE->strainHat(0,2);
757 cE->strainHatDot(0,0) <<= strain_hat_dot[0];
758 cE->strainHatDot(1,1) <<= strain_hat_dot[1];
759 cE->strainHatDot(2,2) <<= strain_hat_dot[2];
760 cE->strainHatDot(0,1) <<= strain_hat_dot[3];
761 cE->strainHatDot(1,2) <<= strain_hat_dot[4];
762 cE->strainHatDot(0,2) <<= strain_hat_dot[5];
764 cE->strainHatDot(1,0) =
cE->strainHatDot(0,1);
765 cE->strainHatDot(2,1) =
cE->strainHatDot(1,2);
766 cE->strainHatDot(2,0) =
cE->strainHatDot(0,2);
767 ierr =
cE->calculateStrainTotal(); CHKERRQ(
ierr);
768 ierr =
cE->calculateStressBeta(); CHKERRQ(
ierr);
769 ierr =
cE->calculateStrainHatFlux(); CHKERRQ(
ierr);
770 ierr =
cE->calculateResidualStrainHat(); CHKERRQ(
ierr);
783 PetscFunctionReturn(0);
801 "ADOL-C function evaluation with error r = %d",
r
805 PetscFunctionReturn(0);
822 "ADOL-C function evaluation with error"
825 }
catch (
const std::exception& ex) {
827 ss <<
"throw in method: " << ex.what() << endl;
828 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
830 PetscFunctionReturn(0);
839 PetscFunctionReturn(0);
851 int nb_active_variables = 0;
853 for(
int dd1 = 0;dd1<3;dd1++) {
854 for(
int dd2 = 0;dd2<3;dd2++) {
860 for(
int ii = 0;ii<6;ii++) {
868 PETSC_COMM_SELF,MOFEM_IMPOSIBLE_CASE,
869 "Number of active variables does not much"
899 }
catch (
const std::exception& ex) {
901 ss <<
"throw in method: " << ex.what() << endl;
902 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
905 PetscFunctionReturn(0);
912 PetscFunctionReturn(0);
921 int nb_active_variables = 0;
923 for(
int ii = 0;ii<3;ii++) {
928 PETSC_COMM_SELF,MOFEM_IMPOSIBLE_CASE,
"Number of active variables does not much"
955 PetscFunctionReturn(0);
962 PetscFunctionReturn(0);
972 int nb_active_variables = 0;
974 for(
int dd1 = 0;dd1<3;dd1++) {
975 for(
int dd2 = 0;dd2<3;dd2++) {
979 for(
int dd1 = 0;dd1<3;dd1++) {
980 for(
int dd2 = 0;dd2<3;dd2++) {
986 PETSC_COMM_SELF,MOFEM_IMPOSIBLE_CASE,
"Number of active variables does not much"
1003 PetscFunctionReturn(0);
1011 PetscFunctionReturn(0);
1019 int nb_active_variables = 0;
1021 for(
int dd1 = 0;dd1<3;dd1++) {
1022 for(
int dd2 = 0;dd2<3;dd2++) {
1028 for(
int ii = 0;ii<6;ii++) {
1032 for(
int ii = 0;ii<6;ii++) {
1037 PETSC_COMM_SELF,MOFEM_IMPOSIBLE_CASE,
"Number of active variables does not much"
1067 }
catch (
const std::exception& ex) {
1069 ss <<
"throw in method: " << ex.what() << endl;
1070 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1073 PetscFunctionReturn(0);
1083 if(row_type != MBVERTEX) PetscFunctionReturn(0);
1089 mField.get_moab().tag_get_handle(
"BLOCK_ID",th_block_id);
CHKERRQ_MOAB(
rval);
1107 }
catch (
const std::exception& ex) {
1109 ss <<
"throw in method: " << ex.what() << endl;
1110 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1113 PetscFunctionReturn(0);
1129 int nb_dofs = row_data.getIndices().size();
1130 int *indices_ptr = &row_data.getIndices()[0];
1134 }
catch (
const std::exception& ex) {
1136 ss <<
"throw in method: " << ex.what() << endl;
1137 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1139 PetscFunctionReturn(0);
1165 int nb_dofs = row_data.getIndices().size();
1167 PetscFunctionReturn(0);
1169 nF.resize(nb_dofs,
false);
1171 int nb_gauss_pts = row_data.getN().size1();
1172 for(
int gg = 0;gg!=nb_gauss_pts;gg++) {
1173 const MatrixAdaptor &diffN = row_data.getDiffN(gg,nb_dofs/3);
1176 if(getHoGaussPtsDetJac().size()>0) {
1177 val *= getHoGaussPtsDetJac()[gg];
1179 for(
int dd = 0;
dd<nb_dofs/3;
dd++) {
1180 for(
int rr = 0;rr<3;rr++) {
1181 for(
int nn = 0;nn<3;nn++) {
1182 nF[3*
dd+rr] += val*diffN(
dd,nn)*stress(rr,nn);
1188 }
catch (
const std::exception& ex) {
1190 ss <<
"throw in method: " << ex.what() << endl;
1191 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1193 PetscFunctionReturn(0);
1219 int nb_dofs = row_data.getIndices().size();
1221 PetscFunctionReturn(0);
1223 nF.resize(nb_dofs,
false);
1225 int nb_gauss_pts = row_data.getN().size1();
1226 for(
int gg = 0;gg!=nb_gauss_pts;gg++) {
1230 if(getHoGaussPtsDetJac().size()>0) {
1231 val *= getHoGaussPtsDetJac()[gg];
1233 for(
int dd = 0;
dd<nb_dofs;
dd++) {
1234 for(
int jj = 0;jj<3;jj++) {
1235 nF[
dd] += val*diffN(
dd,jj)*flux(jj);
1240 }
catch (
const std::exception& ex) {
1242 ss <<
"throw in method: " << ex.what() << endl;
1243 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1245 PetscFunctionReturn(0);
1271 int nb_dofs = row_data.getIndices().size();
1273 PetscFunctionReturn(0);
1275 nF.resize(nb_dofs,
false);
1277 int nb_gauss_pts = row_data.getN().size1();
1278 for(
int gg = 0;gg!=nb_gauss_pts;gg++) {
1282 if(getHoGaussPtsDetJac().size()>0) {
1283 val *= getHoGaussPtsDetJac()[gg];
1285 nF += val*
N*solvent_dot_dot;
1288 }
catch (
const std::exception& ex) {
1290 ss <<
"throw in method: " << ex.what() << endl;
1291 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1293 PetscFunctionReturn(0);
1322 int nb_dofs = row_data.getIndices().size();
1324 PetscFunctionReturn(0);
1326 nF.resize(nb_dofs,
false);
1328 int nb_gauss_pts = row_data.getN().size1();
1329 for(
int gg = 0;gg!=nb_gauss_pts;gg++) {
1333 if(getHoGaussPtsDetJac().size()>0) {
1334 val *= getHoGaussPtsDetJac()[gg];
1336 for(
int dd = 0;
dd<nb_dofs/6;
dd++) {
1337 for(
int rr = 0;rr<6;rr++) {
1338 nF[
dd*6+rr] += val*
N[
dd]*residual_strain_hat[rr];
1343 }
catch (
const std::exception& ex) {
1345 ss <<
"throw in method: " << ex.what() << endl;
1346 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1348 PetscFunctionReturn(0);
1360 int row_side,
int col_side,
1361 EntityType row_type,EntityType col_type,
1367 int nb_row = row_data.getIndices().size();
1368 int nb_col = col_data.getIndices().size();
1369 int *row_indices_ptr = &row_data.getIndices()[0];
1370 int *col_indices_ptr = &col_data.getIndices()[0];
1374 nb_row,row_indices_ptr,
1375 nb_col,col_indices_ptr,
1380 if(row_side != col_side || row_type != col_type) {
1381 transK.resize(nb_col,nb_row,
false);
1385 nb_col,col_indices_ptr,
1386 nb_row,row_indices_ptr,
1391 }
catch (
const std::exception& ex) {
1393 ss <<
"throw in method: " << ex.what() << endl;
1394 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1396 PetscFunctionReturn(0);
1406 common_data.spatialPositionName,
1407 common_data.spatialPositionName
1417 int nb_col = col_data.getIndices().size();
1424 for(
int dd = 0;
dd<nb_col/3;
dd++) {
1425 for(
int jj = 0;jj<3;jj++) {
1426 double a = diffN(
dd,jj);
1427 for(
int rr = 0;rr<3;rr++) {
1428 for(
int ii = 0;ii<9;ii++) {
1434 }
catch (
const std::exception& ex) {
1436 ss <<
"throw in method: " << ex.what() << endl;
1437 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1439 PetscFunctionReturn(0);
1442 int row_side,
int col_side,
1443 EntityType row_type,EntityType col_type,
1448 int nb_row = row_data.getIndices().size();
1449 int nb_col = col_data.getIndices().size();
1450 if(nb_row == 0) PetscFunctionReturn(0);
1451 if(nb_col == 0) PetscFunctionReturn(0);
1453 K.resize(nb_row,nb_col,
false);
1455 int nb_gauss_pts = row_data.getN().size1();
1456 for(
int gg = 0;gg!=nb_gauss_pts;gg++) {
1459 if(getHoGaussPtsDetJac().size()>0) {
1460 val *= getHoGaussPtsDetJac()[gg];
1464 const MatrixAdaptor &diffN = row_data.getDiffN(gg,nb_row/3);
1466 for(
int dd1 = 0;dd1<nb_row/3;dd1++) {
1467 for(
int rr1 = 0;rr1<3;rr1++) {
1468 for(
int dd2 = 0;dd2<nb_col/3;dd2++) {
1469 for(
int rr2 = 0;rr2<3;rr2++) {
1470 K(3*dd1+rr1,3*dd2+rr2) += (
1483 row_side,col_side,row_type,col_type,row_data,col_data
1486 }
catch (
const std::exception& ex) {
1488 ss <<
"throw in method: " << ex.what() << endl;
1489 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1491 PetscFunctionReturn(0);
1501 common_data.spatialPositionName,common_data.muName
1512 int nb_col = col_data.getIndices().size();
1517 for(
int dd = 0;
dd<nb_col;
dd++) {
1519 for(
int ii = 0;ii<9;ii++) {
1523 }
catch (
const std::exception& ex) {
1525 ss <<
"throw in method: " << ex.what() << endl;
1526 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1528 PetscFunctionReturn(0);
1531 int row_side,
int col_side,
1532 EntityType row_type,EntityType col_type,
1537 int nb_row = row_data.getIndices().size();
1538 int nb_col = col_data.getIndices().size();
1539 if(nb_row == 0) PetscFunctionReturn(0);
1540 if(nb_col == 0) PetscFunctionReturn(0);
1542 K.resize(nb_row,nb_col,
false);
1544 int nb_gauss_pts = row_data.getN().size1();
1545 for(
int gg = 0;gg!=nb_gauss_pts;gg++) {
1548 if(getHoGaussPtsDetJac().size()>0) {
1549 val *= getHoGaussPtsDetJac()[gg];
1552 const MatrixAdaptor &diffN = row_data.getDiffN(gg,nb_row/3);
1554 for(
int dd1 = 0;dd1<nb_row/3;dd1++) {
1555 for(
int rr1 = 0;rr1<3;rr1++) {
1556 for(
int dd2 = 0;dd2<nb_col;dd2++) {
1567 row_side,col_side,row_type,col_type,row_data,col_data
1569 }
catch (
const std::exception& ex) {
1571 ss <<
"throw in method: " << ex.what() << endl;
1572 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1574 PetscFunctionReturn(0);
1584 common_data.spatialPositionName,common_data.strainHatName
1595 int nb_col = col_data.getIndices().size();
1604 for(
int dd = 0;
dd<nb_col/6;
dd++) {
1606 for(
int ii = 0;ii<9;ii++) {
1607 for(
int rr = 0;rr<6;rr++) {
1612 }
catch (
const std::exception& ex) {
1614 ss <<
"throw in method: " << ex.what() << endl;
1615 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1617 PetscFunctionReturn(0);
1620 int row_side,
int col_side,
1621 EntityType row_type,EntityType col_type,
1626 int nb_row = row_data.getIndices().size();
1627 int nb_col = col_data.getIndices().size();
1628 if(nb_row == 0) PetscFunctionReturn(0);
1629 if(nb_col == 0) PetscFunctionReturn(0);
1631 K.resize(nb_row,nb_col,
false);
1633 int nb_gauss_pts = row_data.getN().size1();
1634 for(
int gg = 0;gg!=nb_gauss_pts;gg++) {
1637 if(getHoGaussPtsDetJac().size()>0) {
1638 val *= getHoGaussPtsDetJac()[gg];
1641 const MatrixAdaptor &diffN = row_data.getDiffN(gg,nb_row/3);
1643 for(
int dd1 = 0;dd1<nb_row/3;dd1++) {
1644 for(
int rr1 = 0;rr1<3;rr1++) {
1645 for(
int dd2 = 0;dd2<nb_col/6;dd2++) {
1646 for(
int rr2 = 0;rr2<6;rr2++) {
1647 K(3*dd1+rr1,6*dd2+rr2) +=
1658 row_side,col_side,row_type,col_type,row_data,col_data
1660 }
catch (
const std::exception& ex) {
1662 ss <<
"throw in method: " << ex.what() << endl;
1663 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1665 PetscFunctionReturn(0);
1675 common_data.strainHatName,common_data.strainHatName
1685 int nb_col = col_data.getIndices().size();
1690 for(
int dd = 0;
dd<nb_col/6;
dd++) {
1692 for(
int ii = 0;ii<6;ii++) {
1693 for(
int rr = 0;rr<6;rr++) {
1699 }
catch (
const std::exception& ex) {
1701 ss <<
"throw in method: " << ex.what() << endl;
1702 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1704 PetscFunctionReturn(0);
1707 int row_side,
int col_side,
1708 EntityType row_type,EntityType col_type,
1713 int nb_row = row_data.getIndices().size();
1714 int nb_col = col_data.getIndices().size();
1715 if(nb_row == 0) PetscFunctionReturn(0);
1716 if(nb_col == 0) PetscFunctionReturn(0);
1718 K.resize(nb_row,nb_col,
false);
1720 int nb_gauss_pts = row_data.getN().size1();
1721 for(
int gg = 0;gg!=nb_gauss_pts;gg++) {
1724 if(getHoGaussPtsDetJac().size()>0) {
1725 val *= getHoGaussPtsDetJac()[gg];
1730 for(
int dd1 = 0;dd1<nb_row/6;dd1++) {
1731 for(
int rr1 = 0;rr1<6;rr1++) {
1732 for(
int dd2 = 0;dd2<nb_col;dd2++) {
1740 row_side,col_side,row_type,col_type,row_data,col_data
1742 }
catch (
const std::exception& ex) {
1744 ss <<
"throw in method: " << ex.what() << endl;
1745 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1747 PetscFunctionReturn(0);
1757 common_data.strainHatName,common_data.spatialPositionName
1768 int nb_col = col_data.getIndices().size();
1775 for(
int dd = 0;
dd<nb_col/3;
dd++) {
1776 for(
int jj = 0;jj<3;jj++) {
1777 double a = diffN(
dd,jj);
1778 for(
int ii = 0;ii<6;ii++) {
1779 for(
int rr2 = 0;rr2<3;rr2++) {
1785 }
catch (
const std::exception& ex) {
1787 ss <<
"throw in method: " << ex.what() << endl;
1788 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1790 PetscFunctionReturn(0);
1793 int row_side,
int col_side,
1794 EntityType row_type,EntityType col_type,
1799 int nb_row = row_data.getIndices().size();
1800 int nb_col = col_data.getIndices().size();
1801 if(nb_row == 0) PetscFunctionReturn(0);
1802 if(nb_col == 0) PetscFunctionReturn(0);
1804 K.resize(nb_row,nb_col,
false);
1806 int nb_gauss_pts = row_data.getN().size1();
1807 for(
int gg = 0;gg!=nb_gauss_pts;gg++) {
1810 if(getHoGaussPtsDetJac().size()>0) {
1811 val *= getHoGaussPtsDetJac()[gg];
1817 for(
int dd1 = 0;dd1<nb_row/6;dd1++) {
1818 for(
int rr1 = 0;rr1<6;rr1++) {
1819 for(
int dd2 = 0;dd2<nb_col/3;dd2++) {
1820 for(
int rr2 = 0;rr2<3;rr2++) {
1829 row_side,col_side,row_type,col_type,row_data,col_data
1831 }
catch (
const std::exception& ex) {
1833 ss <<
"throw in method: " << ex.what() << endl;
1834 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1836 PetscFunctionReturn(0);
1846 common_data.muName,common_data.muName
1856 int nb_col = col_data.getIndices().size();
1861 for(
int dd = 0;
dd<nb_col;
dd++) {
1862 for(
int jj = 0;jj<3;jj++) {
1863 double a = diffN(
dd,jj);
1864 for(
int rr2 = 0;rr2<3;rr2++) {
1869 }
catch (
const std::exception& ex) {
1871 ss <<
"throw in method: " << ex.what() << endl;
1872 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1874 PetscFunctionReturn(0);
1877 int row_side,
int col_side,
1878 EntityType row_type,EntityType col_type,
1883 int nb_row = row_data.getIndices().size();
1884 int nb_col = col_data.getIndices().size();
1885 if(nb_row == 0) PetscFunctionReturn(0);
1886 if(nb_col == 0) PetscFunctionReturn(0);
1888 K.resize(nb_row,nb_col,
false);
1890 int nb_gauss_pts = row_data.getN().size1();
1891 for(
int gg = 0;gg!=nb_gauss_pts;gg++) {
1894 if(getHoGaussPtsDetJac().size()>0) {
1895 val *= getHoGaussPtsDetJac()[gg];
1901 for(
int dd1 = 0;dd1<nb_row;dd1++) {
1902 for(
int dd2 = 0;dd2<nb_col;dd2++) {
1903 for(
int jj = 0;jj<3;jj++) {
1911 row_side,col_side,row_type,col_type,row_data,col_data
1913 }
catch (
const std::exception& ex) {
1915 ss <<
"throw in method: " << ex.what() << endl;
1916 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1918 PetscFunctionReturn(0);
1929 common_data.muName,common_data.spatialPositionName
1940 int nb_col = col_data.getIndices().size();
1947 for(
int dd = 0;
dd<nb_col/3;
dd++) {
1948 for(
int jj = 0;jj<3;jj++) {
1949 double a = diffN(
dd,jj);
1950 for(
int rr2 = 0;rr2<3;rr2++) {
1957 }
catch (
const std::exception& ex) {
1959 ss <<
"throw in method: " << ex.what() << endl;
1960 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1962 PetscFunctionReturn(0);
1965 int row_side,
int col_side,
1966 EntityType row_type,EntityType col_type,
1971 int nb_row = row_data.getIndices().size();
1972 int nb_col = col_data.getIndices().size();
1973 if(nb_row == 0) PetscFunctionReturn(0);
1974 if(nb_col == 0) PetscFunctionReturn(0);
1976 K.resize(nb_row,nb_col,
false);
1978 int nb_gauss_pts = row_data.getN().size1();
1979 for(
int gg = 0;gg!=nb_gauss_pts;gg++) {
1982 if(getHoGaussPtsDetJac().size()>0) {
1983 val *= getHoGaussPtsDetJac()[gg];
1989 for(
int dd1 = 0;dd1<nb_row;dd1++) {
1990 for(
int dd2 = 0;dd2<nb_col;dd2++) {
1997 row_side,col_side,row_type,col_type,row_data,col_data
1999 }
catch (
const std::exception& ex) {
2001 ss <<
"throw in method: " << ex.what() << endl;
2002 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
2004 PetscFunctionReturn(0);
2023 std::vector<EntityHandle> &map_gauss_pts,
2046 if(
type!=MBVERTEX) PetscFunctionReturn(9);
2048 bzero(def_VAL,9*
sizeof(
double));
2049 Tag th_stress_total;
2051 "STRESS_TOTAL",9,MB_TYPE_DOUBLE,th_stress_total,MB_TAG_CREAT|MB_TAG_SPARSE,def_VAL
2055 "FLUX_CHEMICAL_LOAD",3,MB_TYPE_DOUBLE,th_flux,MB_TAG_CREAT|MB_TAG_SPARSE,def_VAL
2059 for(
int gg = 0;gg!=nb_gauss_pts;gg++) {
2064 PetscFunctionReturn(0);
2077 boost::shared_ptr<Gel::ConstitutiveEquation<adouble> > &
cE;
2103 PetscBool flg = PETSC_TRUE;
2105 PETSC_NULL,PETSC_NULL,
"-my_output_prt",&
pRT,&flg
2106 ); CHKERRABORT(PETSC_COMM_WORLD,
ierr);
2107 if(flg!=PETSC_TRUE) {
2114 PetscFunctionReturn(0);
2119 PetscFunctionReturn(0);
2151 ierr = TSGetTimeStepNumber(
ts,&step); CHKERRQ(
ierr);
2156 sss <<
"out_" << step <<
".h5m";
2159 PetscFunctionReturn(0);
2168 #endif //__GEL_HPP__