v0.14.0
Gels.hpp
Go to the documentation of this file.
1 /** \file Gels.hpp
2  \brief Implementation of Gel finite element
3  \ingroup gel
4 */
5 
6 /* This file is part of MoFEM.
7  * MoFEM is free software: you can redistribute it and/or modify it under
8  * the terms of the GNU Lesser General Public License as published by the
9  * Free Software Foundation, either version 3 of the License, or (at your
10  * option) any later version.
11  *
12  * MoFEM is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15  * License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with MoFEM. If not, see <http://www.gnu.org/licenses/>. */
19 
20 #ifndef __GEL_HPP__
21 #define __GEL_HPP__
22 
23 #ifndef WITH_ADOL_C
24  #error "MoFEM need to be compiled with ADOL-C"
25 #endif
26 
27 namespace GelModule {
28 
29 /** \brief Implementation of Gel constitutive model
30 \ingroup gel
31 
32 Implementation follows constitutive equation from:
33 
34 VISCOELASTICITY AND POROELASTICITY IN ELASTOMERIC GELS
35 Acta Mechanica Solida Sinica, Vol. 25, No. 5,
36 Yuhang Hu Zhigang Suo
37 
38 Note1: Following implementation is tailored for large strain analysis,
39 however in current version the engineering strain is used, i.e. assuming small deformation.
40 Moreover calculation of solvent flux and other physical quantities is with
41 assumption that those values are nonlinear.
42 
43 Note2: Basic implementation is with linear constitutive equations, however
44 adding nonlinearities to model should be simple, since all tangent matrices
45 are calculated using adloc-c.
46 
47 System of equations of equations in the form is assembled:
48 \f[
49 \left[
50 \begin{array}{ccc}
51 \mathbf{K}_{xx} & \mathbf{K}_{x\mu} & \mathbf{K}_{x\hat{\varepsilon}} \\
52 \mathbf{K}_{\mu x} & \mathbf{K}_{\mu \mu} & \mathbf{K}_{\mu \hat{\varepsilon}} \\
53 \mathbf{K}_{\hat{\varepsilon} x} & \mathbf{K}_{\hat{\varepsilon} \mu} & \mathbf{K}_{\hat{\varepsilon} \hat{\varepsilon}}
54 \end{array}
55 \right]
56 \left[
57 \begin{array}{c}
58 \mathbf{q}_{x}\\
59 \mathbf{q}_{\mu}\\
60 \mathbf{q}_{\hat{\varepsilon}}
61 \end{array}
62 \right]
63 =
64 \left[
65 \begin{array}{l}
66 \mathbf{f}^\textrm{internal}_{x}\\
67 \mathbf{f}^V_{\mu}+\mathbf{f}^J_{\mu}\\
68 \mathbf{r}_{\hat{\varepsilon}}
69 \end{array}
70 \right]
71 \f]
72 
73 */
74 struct Gel {
75 
76  enum TagEvaluate {
81  };
82 
84 
85  /** \brief Gel material parameters
86  \ingroup gel
87  */
89 
90  // FIXME: Need to have hood description for each parameter and units
91  double vAlpha; ///< Poisson ratio spring alpha
92  double gAlpha; ///< Shear modulus spring alpha
93  double vBeta; ///< Poisson ratio spring beta
94  double gBeta; ///< Shear modulus spring beta
95  double vBetaHat; ///< Poisson ratio dashpot
96  double gBetaHat; ///< Shear modulus dashpot
97  double pErmeability; ///< Permeability of Gel
98  double vIscosity; ///< Viscosity of Gel
99  double oMega; ///< Volume per solvent molecule
100  double mU0; ///< equilibrated chemical potential/load
101 
102  Range tEts; ///< Test in the block
103 
104  };
105  map<int,BlockMaterialData> blockMaterialData;
106 
107  /** \brief Constitutive model functions
108  \ingroup gel
109 
110  \image html gel_spring_daspot_model.png "Gel model" width=700px
111 
112  */
113  template<typename TYPE>
115 
116  int iD;
117  map<int,BlockMaterialData> &dAta;
118 
119  ConstitutiveEquation(map<int,BlockMaterialData> &data):
120  dAta(data) {
121  }
123 
124  // Input
125 
126  ublas::matrix<TYPE,ublas::row_major,ublas::bounded_array<TYPE,9> > F; ///< Gradient of deformation
127  ublas::matrix<TYPE,ublas::row_major,ublas::bounded_array<TYPE,9> > FDot; ///< Rate of gradient of deformation
128  ublas::matrix<TYPE,ublas::row_major,ublas::bounded_array<TYPE,9> > strainHat; ///< Internal variable, strain in dashpot beta
129  ublas::matrix<TYPE,ublas::row_major,ublas::bounded_array<TYPE,9> > strainHatDot; ///< Internal variable, strain in dashpot beta
130  TYPE mU; ///< Solvent concentration
131  ublas::vector<TYPE,ublas::bounded_array<TYPE,3> > gradientMu; ///< Gradient of solvent concentration
132 
133  // Internal use
134 
135  ublas::matrix<TYPE,ublas::row_major,ublas::bounded_array<TYPE,9> > C; ///< Cauchy deformation
136  ublas::matrix<TYPE,ublas::row_major,ublas::bounded_array<TYPE,9> > gradientU; ///< Gradient of displacements
137  ublas::matrix<TYPE,ublas::row_major,ublas::bounded_array<TYPE,9> > strainTotal; ///< Total strain applied at integration point
138 
139  ublas::matrix<TYPE,ublas::row_major,ublas::bounded_array<TYPE,9> > stressAlpha; ///< Stress generated by spring alpha
140  ublas::matrix<TYPE,ublas::row_major,ublas::bounded_array<TYPE,9> > stressBeta; ///< Stress generated by spring beta
141  ublas::matrix<TYPE,ublas::row_major,ublas::bounded_array<TYPE,9> > strainHatFlux; ///< Rate of dashpot (beta) strain
142  ublas::matrix<TYPE,ublas::row_major,ublas::bounded_array<TYPE,9> > stressBetaHat; ///< Stress as result of volume change due to solvent concentration
143 
148 
149  // Output
150 
151  ublas::matrix<TYPE,ublas::row_major,ublas::bounded_array<TYPE,9> > stressTotal; ///< Total stress
152  ublas::vector<TYPE,ublas::bounded_array<TYPE,9> > solventFlux; ///< Solvent flux
153  TYPE solventConcentrationDot; ///< Volume rate change
154  ublas::matrix<TYPE,ublas::row_major,ublas::bounded_array<TYPE,9> > residualStrainHat; ///< Residual for calculation epsilon hat
155 
156  virtual PetscErrorCode calculateCauchyDefromationTensor() {
157  PetscFunctionBegin;
158  C.resize(3,3);
159  noalias(C) = prod(trans(F),F);
160  PetscFunctionReturn(0);
161  }
162 
163  /** \brief Calculate total strain
164 
165  */
166  virtual PetscErrorCode calculateStrainTotal() {
167  PetscFunctionBegin;
168  gradientU.resize(3,3,false);
169  noalias(gradientU) = F;
170  for(int ii = 0;ii<3;ii++) {
171  gradientU(ii,ii) -= 1;
172  }
173  strainTotal.resize(3,3,false);
174  noalias(strainTotal) = gradientU + trans(gradientU);
175  strainTotal *= 0.5;
176  PetscFunctionReturn(0);
177  }
178 
179  /** \berief Calculate trace of rate of gradient of deformation
180  */
181  virtual PetscErrorCode calculateTraceStrainTotalDot() {
182  PetscFunctionBegin;
184  for(int ii = 0;ii<3;ii++) {
185  traceStrainTotalDot += FDot(ii,ii);
186  }
187  PetscFunctionReturn(0);
188  }
189 
190  /** \brief Calculate stress in spring alpha
191 
192  \f[
193  \sigma^\alpha_{ij} = 2G^\alpha\left(\varepsilon_{ij} + \frac{v^\alpha}{1-2v^\alpha}\varepsilon_{kk}\delta_{ij}\right)
194  \f]
195 
196  Note: In general implementation for large strain this function should calculate
197  Piola-Kirchhoff Stress I.
198 
199  */
200  virtual PetscErrorCode calculateStressAlpha() {
201  PetscFunctionBegin;
202  traceStrainTotal = 0;
203  for(int ii = 0;ii<3;ii++) {
204  traceStrainTotal += strainTotal(ii,ii);
205  }
206  stressAlpha.resize(3,3,false);
207  double a = 2.0*dAta[iD].gAlpha;
208  double b = a*(dAta[iD].vAlpha/(1.0-2.0*dAta[iD].vAlpha));
209  noalias(stressAlpha) = a*strainTotal;
210  for(int ii = 0; ii<3; ii++){
211  stressAlpha(ii,ii) += b*traceStrainTotal;
212  }
213  PetscFunctionReturn(0);
214  }
215 
216  /** \brief Calculate stress in spring beta
217 
218  \f[
219  \sigma^\beta_{ij} = 2G^\beta\left[
220  (\varepsilon_{ij}-\hat{\varepsilon}_{ij})
221  + \frac{v^\beta}{1-2v^\beta}(\varepsilon_{kk}-\hat{\varepsilon}_{kk})\delta_{ij}
222  \right]
223  \f]
224 
225  */
226  virtual PetscErrorCode calculateStressBeta() {
227  PetscFunctionBegin;
228  traceStrainTotal = 0;
229  traceStrainHat = 0;
230  for(int ii = 0;ii<3;ii++) {
231  traceStrainHat += strainHat(ii,ii);
232  traceStrainTotal += strainTotal(ii,ii);
233  }
234  stressBeta.resize(3,3,false);
235  double a = 2.0*dAta[iD].gBeta;
236  double b = a*(dAta[iD].vBeta/(1.0-2.0*dAta[iD].vBeta));
237  noalias(stressBeta) = a*(strainTotal-strainHat);
238  for(int ii = 0;ii<3;ii++) {
240  }
241  PetscFunctionReturn(0);
242  }
243 
244  /** \brief Calculate rate of strain hat
245 
246  \f[
247  \frac{\partial \hat{\varepsilon}_{ij}}{\partial t} =
248  \frac{1}{2\hat{G}^\beta}
249  \left(
250  \sigma_{ij}^\beta - \frac{\hat{v}^\beta}{1+\hat{v}^\beta}\sigma_{kk}^\beta\delta_{ij}
251  \right)
252  \f]
253 
254  */
255  virtual PetscErrorCode calculateStrainHatFlux() {
256  PetscFunctionBegin;
257  traceStressBeta = 0;
258  for(int ii = 0;ii<3;ii++) {
259  traceStressBeta = stressBeta(ii,ii);
260  }
261  strainHatFlux.resize(3,3,false);
262  double a = (1.0/(2.0*dAta[iD].gBetaHat));
263  noalias(strainHatFlux) = a*stressBeta;
264  double b = a*(dAta[iD].vBetaHat/(1.0+dAta[iD].vBetaHat));
265  for(int ii = 0;ii<3;ii++) {
266  strainHatFlux(ii,ii) -= b*traceStressBeta;
267  }
268  PetscFunctionReturn(0);
269  }
270 
271  /** \brief Calculate stress due to concentration of solvent molecules
272 
273  \f[
274  \hat{\sigma}_{ij}^\beta = \frac{\Delta\mu}{\Omega}\delta_{ij}
275  \f]
276  note that \f$\Delta\mu = \mu-\mu_0\f$. In current version of code
277  value of \f$\Delta\mu\f$ is approximated.
278 
279  */
280  virtual PetscErrorCode calculateStressBetaHat() {
281  PetscFunctionBegin;
282  stressBetaHat.resize(3,3,false);
283  stressBetaHat.clear();
284  for(int ii=0; ii<3; ii++){
285  stressBetaHat(ii,ii) = -(mU-dAta[iD].mU0)/dAta[iD].oMega;
286  }
287  PetscFunctionReturn(0);
288  }
289 
290  // Functions calculating output variables
291 
292  virtual PetscErrorCode calculateStressTotal() {
293  PetscFunctionBegin;
294  stressTotal.resize(3,3,false);
295  noalias(stressTotal) = stressAlpha;
296  noalias(stressTotal) += stressBeta;
297  noalias(stressTotal) += stressBetaHat;
298  PetscFunctionReturn(0);
299  }
300 
301  virtual PetscErrorCode calculateResidualStrainHat() {
302  PetscFunctionBegin;
303  residualStrainHat.resize(3,3,false);
305  PetscFunctionReturn(0);
306  }
307 
308  /** \brief Calculate flux
309 
310  \f[
311  J_k =
312  -\left(
313  \frac{\kappa}{\eta\Omega^2}
314  \right)
315  \mu_{,i}
316  \f]
317 
318  */
319  virtual PetscErrorCode calculateSolventFlux() {
320  PetscFunctionBegin;
321  double a = dAta[iD].pErmeability/(dAta[iD].vIscosity*dAta[iD].oMega/**dAta[iD].oMega*/);
323  PetscFunctionReturn(0);
324  }
325 
326  /** \brief Calculate solvent concentration rate
327 
328  FIXME: For simplicity as first approximation set volume change
329  as trace of gradient total strain
330 
331  */
332  virtual PetscErrorCode calculateSolventConcentrationDot() {
333  PetscFunctionBegin;
334  solventConcentrationDot = traceStrainTotalDot/*/dAta[iD].oMega*/;
335  PetscFunctionReturn(0);
336  }
337 
338  };
339 
340  boost::shared_ptr<Gel::ConstitutiveEquation<adouble> > constitutiveEquationPtr;
341 
342  /** \brief Common data for gel model
343  \ingroup gel
344  */
345  struct CommonData {
346 
351  string muName;
352  string muNameDot;
353 
354  map<string,vector<VectorDouble> > dataAtGaussPts;
355  map<string,vector<MatrixDouble> > gradAtGaussPts;
356 
357  vector<MatrixDouble3by3> stressTotal;
358  vector<VectorDouble3> solventFlux;
359  vector<double> solventConcentrationDot;
360  vector<VectorDouble9> residualStrainHat;
361 
362  vector<double*> jacRowPtr;
363  vector<MatrixDouble> jacStressTotal;
364  vector<MatrixDouble> jacSolventFlux;
365  vector<VectorDouble> jacSolventDot;
366  vector<MatrixDouble> jacStrainHat;
367 
368  bool recordOn;
370 
372  recordOn(true) {
373  }
374 
375  };
377 
378  /// \brief definition of volume element
380 
382  int addToRule; ///< Takes into account HO geometry
383 
384  GelFE(MoFEM::Interface &m_field,CommonData &common_data):
386  commonData(common_data),
387  addToRule(1) {
388  }
389 
390  int getRule(int order) {
391  return 2*(order-1)+addToRule;
392  }
393 
394  PetscErrorCode preProcess() {
395 
396  PetscFunctionBegin;
398 
399  if(ts_ctx == CTX_TSSETIFUNCTION) {
400 
401  ierr = mField.set_other_local_ghost_vector(
403  ); CHKERRQ(ierr);
404  ierr = mField.set_other_local_ghost_vector(
405  problemPtr,commonData.muName,commonData.muNameDot,COL,ts_u_t,INSERT_VALUES,SCATTER_REVERSE
406  ); CHKERRQ(ierr);
407  ierr = mField.set_other_local_ghost_vector(
409  ); CHKERRQ(ierr);
410 
411  }
412 
413  PetscFunctionReturn(0);
414  }
415 
416  PetscErrorCode postProcess() {
417 
418  PetscFunctionBegin;
419 
421 
422  if(ts_ctx == CTX_TSSETIFUNCTION) {
423  ierr = VecAssemblyBegin(ts_F); CHKERRQ(ierr);
424  ierr = VecAssemblyEnd(ts_F); CHKERRQ(ierr);
425  }
426  if(ts_ctx == CTX_TSSETIJACOBIAN) {
427  ierr = MatAssemblyBegin(ts_B,MAT_FLUSH_ASSEMBLY); CHKERRQ(ierr);
428  ierr = MatAssemblyEnd(ts_B,MAT_FLUSH_ASSEMBLY); CHKERRQ(ierr);
429  }
430 
431  PetscFunctionReturn(0);
432  }
433 
434  };
435 
437 
439  mFiled(m_field),
440  feRhs(m_field,commonData),
441  feLhs(m_field,commonData) {
442  }
443 
445 
447  bool calcVal;
448  bool calcGrad;
449  EntityType zeroAtType;
450 
452  const string field_name,
453  CommonData &common_data,
454  bool calc_val,
455  bool calc_grad,
456  EntityType zero_at_type = MBVERTEX
457  ):
458  MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator(
460  ),
461  commonData(common_data),
462  calcVal(calc_val),
463  calcGrad(calc_grad),
464  zeroAtType(zero_at_type) {
465  }
466 
467  /** \brief Operator field value
468  *
469  */
470  PetscErrorCode doWork(
471  int side,EntityType type,DataForcesAndSurcesCore::EntData &data
472  ){
473  PetscFunctionBegin;
474 
475  try {
476 
477  int nb_dofs = data.getFieldData().size();
478  if(nb_dofs == 0) {
479  PetscFunctionReturn(0);
480  }
481  int rank = data.getFieldDofs()[0]->getNbOfCoeffs();
482  int nb_gauss_pts = data.getN().size1();
483 
484  // Initialize
485  if(calcVal) {
486  commonData.dataAtGaussPts[rowFieldName].resize(nb_gauss_pts);
487  for(int gg = 0;gg<nb_gauss_pts;gg++) {
488  commonData.dataAtGaussPts[rowFieldName][gg].resize(rank,false);
489  }
490  }
491  if(calcGrad) {
492  commonData.gradAtGaussPts[rowFieldName].resize(nb_gauss_pts);
493  for(int gg = 0;gg<nb_gauss_pts;gg++) {
494  commonData.gradAtGaussPts[rowFieldName][gg].resize(rank,3,false);
495  }
496  }
497 
498  // Zero values
499  if(type == zeroAtType) {
500  for(int gg = 0;gg<nb_gauss_pts;gg++) {
501  if(calcVal) {
503  }
504  if(calcGrad) {
506  }
507  }
508  }
509 
510  VectorDouble &values = data.getFieldData();
511 
512  // Calculate values at integration points
513  for(int gg = 0;gg<nb_gauss_pts;gg++) {
514  VectorDouble N = data.getN(gg,nb_dofs/rank);
515  MatrixDouble diffN = data.getDiffN(gg,nb_dofs/rank);
516  for(int dd = 0;dd<nb_dofs/rank;dd++) {
517  for(int rr1 = 0;rr1<rank;rr1++) {
518  if(calcVal) {
519  commonData.dataAtGaussPts[rowFieldName][gg][rr1] += N[dd]*values[rank*dd+rr1];
520  }
521  if(calcGrad) {
522  for(int rr2 = 0;rr2<3;rr2++) {
523  commonData.gradAtGaussPts[rowFieldName][gg](rr1,rr2) += diffN(dd,rr2)*values[rank*dd+rr1];
524  }
525  }
526  }
527  }
528  }
529 
530  } catch (const std::exception& ex) {
531  ostringstream ss;
532  ss << "throw in method: " << ex.what() << endl;
533  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
534  }
535 
536  PetscFunctionReturn(0);
537  }
538 
539  };
540 
542 
543  vector<int> tagS;
544  boost::shared_ptr<Gel::ConstitutiveEquation<adouble> > cE;
546 
549  bool &recordOn;
550  map<int,int> &nbActiveVariables;
551  map<int,int> &nbActiveResults;
552 
554  const string field_name,
555  vector<int> tags,
556  boost::shared_ptr<Gel::ConstitutiveEquation<adouble> > ce,
557  CommonData &common_data,
558  bool calculate_residual,
559  bool calculate_jacobian
560  ):
561  MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator(
563  ),
564  tagS(tags),
565  cE(ce),
566  commonData(common_data),
567  calculateResidualBool(calculate_residual),
568  calculateJacobianBool(calculate_jacobian),
569  recordOn(common_data.recordOn),
571  nbActiveResults(common_data.nbActiveResults) {
572  }
573 
576 
577  PetscErrorCode recordStressTotal() {
578 
579  PetscFunctionBegin;
580 
581  try {
582  if(tagS[STRESSTOTAL]<0) {
583  PetscFunctionReturn(0);
584  }
585  cE->F.resize(3,3,false);
586  cE->strainHat.resize(3,3,false);
590  trace_on(tagS[STRESSTOTAL]);
591  {
592  // Activate gradient of defamation
594  for(int dd1 = 0;dd1<3;dd1++) {
595  for(int dd2 = 0;dd2<3;dd2++) {
596  cE->F(dd1,dd2) <<= F(dd1,dd2);
598  }
599  }
600  // Using vector notation to store hatStrain
601  // xx,yy,zz,2xy,2yz,2zy
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);
612  cE->mU <<= mu[0];
614  // Do calculations
615  ierr = cE->calculateStrainTotal(); CHKERRQ(ierr);
616  ierr = cE->calculateStressAlpha(); CHKERRQ(ierr);
617  ierr = cE->calculateStressBeta(); CHKERRQ(ierr);
618  ierr = cE->calculateStressBetaHat(); CHKERRQ(ierr);
619  // Finally calculate result
620  ierr = cE->calculateStressTotal(); CHKERRQ(ierr);
621  // Results
624  commonData.stressTotal[0].resize(3,3,false);
625  for(int d1 = 0;d1<3;d1++) {
626  for(int d2 = 0;d2<3;d2++) {
627  cE->stressTotal(d1,d2) >>= (commonData.stressTotal[0])(d1,d2);
629  }
630  }
631  }
632  trace_off();
633  } catch (const std::exception& ex) {
634  ostringstream ss;
635  ss << "throw in method: " << ex.what() << endl;
636  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
637  }
638  PetscFunctionReturn(0);
639  }
640 
641  PetscErrorCode recordSolventFlux() {
642  PetscFunctionBegin;
643  try {
644  if(tagS[SOLVENTFLUX]<0) {
645  PetscFunctionReturn(0);
646  }
647 
648  cE->gradientMu.resize(3,false);
650  trace_on(tagS[SOLVENTFLUX]);
651  {
652  // Activate rate of gradient of defamation
654  for(int ii = 0;ii<3;ii++) {
655  cE->gradientMu[ii] <<= gradient_mu(0,ii);
657  }
658  ierr = cE->calculateSolventFlux(); CHKERRQ(ierr);
661  commonData.solventFlux[0].resize(3,false);
662  for(int d1 = 0;d1<3;d1++) {
663  cE->solventFlux[d1] >>= commonData.solventFlux[0][d1];
665  }
666  }
667  trace_off();
668  } catch (const std::exception& ex) {
669  ostringstream ss;
670  ss << "throw in method: " << ex.what() << endl;
671  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
672  }
673 
674  PetscFunctionReturn(0);
675  }
676 
677  PetscErrorCode recordSolventConcentrationDot() {
678  PetscFunctionBegin;
679 
680  if(tagS[SOLVENTRATE]<0) {
681  PetscFunctionReturn(0);
682  }
683 
684 
685 
688 
689  trace_on(tagS[SOLVENTRATE]);
690  {
691  // Activate rate of gradient of defamation
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);
698  }
699  }
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);
705  }
706  }
707  ierr = cE->calculateTraceStrainTotalDot(); CHKERRQ(ierr);
708  ierr = cE->calculateSolventConcentrationDot(); CHKERRQ(ierr);
711  cE->solventConcentrationDot >>= commonData.solventConcentrationDot[0];
713  }
714  trace_off();
715 
716  PetscFunctionReturn(0);
717  }
718 
719  PetscErrorCode recordResidualStrainHat() {
720  PetscFunctionBegin;
721 
722  if(tagS[RESIDUALSTRAINHAT]<0) {
723  PetscFunctionReturn(0);
724  }
725 
726 
727 
728  cE->F.resize(3,3,false);
729  cE->strainHat.resize(3,3,false);
730  cE->strainHatDot.resize(3,3,false);
734  trace_on(tagS[RESIDUALSTRAINHAT]);
735  {
736  // Activate gradient of defamation
738  for(int dd1 = 0;dd1<3;dd1++) {
739  for(int dd2 = 0;dd2<3;dd2++) {
740  cE->F(dd1,dd2) <<= F(dd1,dd2);
742  }
743  }
744  // Using vector notation to store hatStrain
745  // xx,yy,zz,2xy,2yz,2zy
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);
756  // Activate strain hat dot
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);
773  commonData.residualStrainHat[0].resize(6,false);
774  cE->residualStrainHat(0,0) >>= commonData.residualStrainHat[0][nbActiveResults[tagS[RESIDUALSTRAINHAT]]++];
775  cE->residualStrainHat(1,1) >>= commonData.residualStrainHat[0][nbActiveResults[tagS[RESIDUALSTRAINHAT]]++];
776  cE->residualStrainHat(2,2) >>= commonData.residualStrainHat[0][nbActiveResults[tagS[RESIDUALSTRAINHAT]]++];
777  cE->residualStrainHat(0,1) >>= commonData.residualStrainHat[0][nbActiveResults[tagS[RESIDUALSTRAINHAT]]++];
778  cE->residualStrainHat(1,2) >>= commonData.residualStrainHat[0][nbActiveResults[tagS[RESIDUALSTRAINHAT]]++];
779  cE->residualStrainHat(0,2) >>= commonData.residualStrainHat[0][nbActiveResults[tagS[RESIDUALSTRAINHAT]]++];
780  }
781  trace_off();
782 
783  PetscFunctionReturn(0);
784  }
785 
786  PetscErrorCode calculateFunction(TagEvaluate te,double *ptr) {
787  PetscFunctionBegin;
788 
789  int r;
790  //play recorder for values
791  r = ::function(
792  tagS[te],
793  nbActiveResults[tagS[te]],
794  nbActiveVariables[tagS[te]],
795  &activeVariables[0],
796  ptr
797  );
798  if(r<3) { // function is locally analytic
799  SETERRQ1(
800  PETSC_COMM_SELF,MOFEM_OPERATION_UNSUCCESSFUL,
801  "ADOL-C function evaluation with error r = %d",r
802  );
803  }
804 
805  PetscFunctionReturn(0);
806  }
807 
808  PetscErrorCode calculateJacobian(TagEvaluate te) {
809  PetscFunctionBegin;
810  try {
811  int r;
812  r = jacobian(
813  tagS[te],
814  nbActiveResults[tagS[te]],
815  nbActiveVariables[tagS[te]],
816  &activeVariables[0],
817  &(commonData.jacRowPtr[0])
818  );
819  if(r<3) {
820  SETERRQ(
821  PETSC_COMM_SELF,MOFEM_OPERATION_UNSUCCESSFUL,
822  "ADOL-C function evaluation with error"
823  );
824  }
825  } catch (const std::exception& ex) {
826  ostringstream ss;
827  ss << "throw in method: " << ex.what() << endl;
828  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
829  }
830  PetscFunctionReturn(0);
831  }
832 
833  PetscErrorCode calculateAtIntPtsStressTotal() {
834  PetscFunctionBegin;
835 
836  try {
837 
838  if(tagS[STRESSTOTAL]<0) {
839  PetscFunctionReturn(0);
840  }
841 
842 
843 
845 
846  for(int gg = 0;gg<nbGaussPts;gg++) {
847 
850  double mu = (commonData.dataAtGaussPts[commonData.muName])[gg][0];
851  int nb_active_variables = 0;
852  // Activate gradient of defamation
853  for(int dd1 = 0;dd1<3;dd1++) {
854  for(int dd2 = 0;dd2<3;dd2++) {
855  activeVariables[nb_active_variables++] = F(dd1,dd2);
856  }
857  }
858  // Using vector notation to store hatStrain
859  // xx,yy,zz,2xy,2yz,2zy
860  for(int ii = 0;ii<6;ii++) {
861  activeVariables[nb_active_variables++] = strain_hat[ii];
862  }
863  // chemical load
864  activeVariables[nb_active_variables++] = mu;
865 
866  if(nb_active_variables!=nbActiveVariables[tagS[STRESSTOTAL]]) {
867  SETERRQ(
868  PETSC_COMM_SELF,MOFEM_IMPOSIBLE_CASE,
869  "Number of active variables does not much"
870  );
871  }
872 
874  if(gg == 0) {
876  }
877  commonData.stressTotal[gg].resize(3,3,false);
879  }
880 
882  if(gg == 0) {
885  }
886  commonData.jacStressTotal[gg].resize(
889  false
890  );
891  for(int dd = 0;dd<nbActiveResults[tagS[STRESSTOTAL]];dd++) {
893  }
894  ierr = calculateJacobian(STRESSTOTAL); CHKERRQ(ierr);
895  }
896 
897  }
898 
899  } catch (const std::exception& ex) {
900  ostringstream ss;
901  ss << "throw in method: " << ex.what() << endl;
902  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
903  }
904 
905  PetscFunctionReturn(0);
906  }
907 
908  PetscErrorCode calculateAtIntPtsSolventFlux() {
909  PetscFunctionBegin;
910 
911  if(tagS[SOLVENTFLUX]<0) {
912  PetscFunctionReturn(0);
913  }
914 
915 
916 
918 
919  for(int gg = 0;gg<nbGaussPts;gg++) {
921  int nb_active_variables = 0;
922  // Activate rate of gradient of defamation
923  for(int ii = 0;ii<3;ii++) {
924  activeVariables[nb_active_variables++] = gradient_mu(0,ii);
925  }
926  if(nb_active_variables!=nbActiveVariables[tagS[SOLVENTFLUX]]) {
927  SETERRQ(
928  PETSC_COMM_SELF,MOFEM_IMPOSIBLE_CASE,"Number of active variables does not much"
929  );
930  }
932  commonData.solventFlux[gg].resize(3,false);
934  SOLVENTFLUX,
935  &(commonData.solventFlux[gg][0])
936  ); CHKERRQ(ierr);
937  }
939  if(gg == 0) {
942  }
943  commonData.jacSolventFlux[gg].resize(
946  false
947  );
948  for(int dd = 0;dd<nbActiveResults[tagS[SOLVENTFLUX]];dd++) {
950  }
951  ierr = calculateJacobian(SOLVENTFLUX); CHKERRQ(ierr);
952  }
953  }
954 
955  PetscFunctionReturn(0);
956  }
957 
958  PetscErrorCode calculateAtIntPtsSolventDot() {
959  PetscFunctionBegin;
960 
961  if(tagS[SOLVENTRATE]<0) {
962  PetscFunctionReturn(0);
963  }
964 
965 
966 
968 
969  for(int gg = 0;gg<nbGaussPts;gg++) {
972  int nb_active_variables = 0;
973  // Activate gradient of defamation
974  for(int dd1 = 0;dd1<3;dd1++) {
975  for(int dd2 = 0;dd2<3;dd2++) {
976  activeVariables[nb_active_variables++] = F(dd1,dd2);
977  }
978  }
979  for(int dd1 = 0;dd1<3;dd1++) {
980  for(int dd2 = 0;dd2<3;dd2++) {
981  activeVariables[nb_active_variables++] = F_dot(dd1,dd2);
982  }
983  }
984  if(nb_active_variables!=nbActiveVariables[tagS[SOLVENTRATE]]) {
985  SETERRQ(
986  PETSC_COMM_SELF,MOFEM_IMPOSIBLE_CASE,"Number of active variables does not much"
987  );
988  }
991  }
993  if(gg == 0) {
996  }
999  ierr = calculateJacobian(SOLVENTRATE); CHKERRQ(ierr);
1000  }
1001  }
1002 
1003  PetscFunctionReturn(0);
1004  }
1005 
1007  PetscFunctionBegin;
1008 
1009  try {
1010  if(tagS[RESIDUALSTRAINHAT]<0) {
1011  PetscFunctionReturn(0);
1012  }
1013 
1015  for(int gg = 0;gg<nbGaussPts;gg++) {
1019  int nb_active_variables = 0;
1020  // Activate gradient of defamation
1021  for(int dd1 = 0;dd1<3;dd1++) {
1022  for(int dd2 = 0;dd2<3;dd2++) {
1023  activeVariables[nb_active_variables++] = F(dd1,dd2);
1024  }
1025  }
1026  // Using vector notation to store hatStrain
1027  // xx,yy,zz,2xy,2yz,2zy
1028  for(int ii = 0;ii<6;ii++) {
1029  activeVariables[nb_active_variables++] = strain_hat[ii];
1030  }
1031  // Using vector notation to store hatStrainDot
1032  for(int ii = 0;ii<6;ii++) {
1033  activeVariables[nb_active_variables++] = strain_hat_dot[ii];
1034  }
1035  if(nb_active_variables!=nbActiveVariables[tagS[RESIDUALSTRAINHAT]]) {
1036  SETERRQ(
1037  PETSC_COMM_SELF,MOFEM_IMPOSIBLE_CASE,"Number of active variables does not much"
1038  );
1039  }
1040  if(calculateResidualBool) {
1041  if(gg == 0) {
1043  }
1044  commonData.residualStrainHat[gg].resize(6,false);
1047  ); CHKERRQ(ierr);
1048  }
1049  if(calculateJacobianBool) {
1050  if(gg == 0) {
1053  }
1054  commonData.jacStrainHat[gg].resize(
1057  false
1058  );
1059  for(int dd = 0;dd<nbActiveResults[tagS[RESIDUALSTRAINHAT]];dd++) {
1061  }
1063  }
1064  }
1065 
1066 
1067  } catch (const std::exception& ex) {
1068  ostringstream ss;
1069  ss << "throw in method: " << ex.what() << endl;
1070  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1071  }
1072 
1073  PetscFunctionReturn(0);
1074  }
1075 
1076  PetscErrorCode doWork(
1077  int row_side,EntityType row_type,DataForcesAndSurcesCore::EntData &row_data
1078  ) {
1079  PetscFunctionBegin;
1080 
1081 
1082 
1083  if(row_type != MBVERTEX) PetscFunctionReturn(0);
1084  nbGaussPts = row_data.getN().size1();
1085 
1086  Tag th_block_id;
1087  EntityHandle ent = getNumeredEntFiniteElementPtr()->getEnt();
1088  rval = getVolumeFE()->
1089  mField.get_moab().tag_get_handle("BLOCK_ID",th_block_id); CHKERRQ_MOAB(rval);
1090  rval = getVolumeFE()->
1091  mField.get_moab().tag_get_data(th_block_id,&ent,1,&(cE->iD)); CHKERRQ_MOAB(rval);
1092 
1093  try {
1094 
1095  if(recordOn) {
1096  ierr = recordStressTotal(); CHKERRQ(ierr);
1097  ierr = recordSolventFlux(); CHKERRQ(ierr);
1098  ierr = recordSolventConcentrationDot(); CHKERRQ(ierr);
1099  ierr = recordResidualStrainHat(); CHKERRQ(ierr);
1100  }
1101 
1102  ierr = calculateAtIntPtsStressTotal(); CHKERRQ(ierr);
1103  ierr = calculateAtIntPtsSolventFlux(); CHKERRQ(ierr);
1104  ierr = calculateAtIntPtsSolventDot(); CHKERRQ(ierr);
1106 
1107  } catch (const std::exception& ex) {
1108  ostringstream ss;
1109  ss << "throw in method: " << ex.what() << endl;
1110  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1111  }
1112 
1113  PetscFunctionReturn(0);
1114  }
1115 
1116  };
1117 
1120  MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator(field_name,UserDataOperator::OPROW) {
1121  }
1122 
1124  PetscErrorCode aSemble(
1125  int row_side,EntityType row_type,DataForcesAndSurcesCore::EntData &row_data
1126  ) {
1127  PetscFunctionBegin;
1128  try {
1129  int nb_dofs = row_data.getIndices().size();
1130  int *indices_ptr = &row_data.getIndices()[0];
1131  ierr = VecSetValues(
1132  getFEMethod()->ts_F,nb_dofs,indices_ptr,&nF[0],ADD_VALUES
1133  ); CHKERRQ(ierr);
1134  } catch (const std::exception& ex) {
1135  ostringstream ss;
1136  ss << "throw in method: " << ex.what() << endl;
1137  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1138  }
1139  PetscFunctionReturn(0);
1140  }
1141  };
1142 
1143  /** \brief Assemble internal force vector
1144  \ingroup gel
1145 
1146  \f[
1147  (\mathbf{f}^\textrm{internal}_x)_i =
1148  \int_V
1149  \frac{\partial N_i}{\partial X_j} \sigma_{ij}
1150  \textrm{d}V
1151  \f]
1152 
1153  */
1157  AssembleVector(common_data.spatialPositionName),
1158  commonData(common_data) {
1159  }
1160  PetscErrorCode doWork(
1161  int row_side,EntityType row_type,DataForcesAndSurcesCore::EntData &row_data
1162  ) {
1163  PetscFunctionBegin;
1164  try {
1165  int nb_dofs = row_data.getIndices().size();
1166  if(!nb_dofs) {
1167  PetscFunctionReturn(0);
1168  }
1169  nF.resize(nb_dofs,false);
1170  nF.clear();
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);
1174  const MatrixDouble& stress = commonData.stressTotal[gg];
1175  double val = getVolume()*getGaussPts()(3,gg);
1176  if(getHoGaussPtsDetJac().size()>0) {
1177  val *= getHoGaussPtsDetJac()[gg]; ///< higher order geometry
1178  }
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);
1183  }
1184  }
1185  }
1186  }
1187  ierr = aSemble(row_side,row_type,row_data); CHKERRQ(ierr);
1188  } catch (const std::exception& ex) {
1189  ostringstream ss;
1190  ss << "throw in method: " << ex.what() << endl;
1191  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1192  }
1193  PetscFunctionReturn(0);
1194  }
1195  };
1196 
1197  /** \brief Calculate internal forces for solvent flux
1198  \ingroup gel
1199 
1200  \f[
1201  (\mathbf{f}^J_{\mu})_j =
1202  \int_V
1203  \frac{\partial N_j}{\partial X_k} J_k
1204  \textrm{d}V
1205  \f]
1206 
1207  */
1211  AssembleVector(common_data.muName),
1212  commonData(common_data) {
1213  }
1214  PetscErrorCode doWork(
1215  int row_side,EntityType row_type,DataForcesAndSurcesCore::EntData &row_data
1216  ) {
1217  PetscFunctionBegin;
1218  try {
1219  int nb_dofs = row_data.getIndices().size();
1220  if(!nb_dofs) {
1221  PetscFunctionReturn(0);
1222  }
1223  nF.resize(nb_dofs,false);
1224  nF.clear();
1225  int nb_gauss_pts = row_data.getN().size1();
1226  for(int gg = 0;gg!=nb_gauss_pts;gg++) {
1227  const MatrixAdaptor &diffN = row_data.getDiffN(gg,nb_dofs);
1228  const VectorDouble& flux = commonData.solventFlux[gg];
1229  double val = getVolume()*getGaussPts()(3,gg);
1230  if(getHoGaussPtsDetJac().size()>0) {
1231  val *= getHoGaussPtsDetJac()[gg]; ///< higher order geometry
1232  }
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);
1236  }
1237  }
1238  }
1239  ierr = aSemble(row_side,row_type,row_data); CHKERRQ(ierr);
1240  } catch (const std::exception& ex) {
1241  ostringstream ss;
1242  ss << "throw in method: " << ex.what() << endl;
1243  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1244  }
1245  PetscFunctionReturn(0);
1246  }
1247  };
1248 
1249  /** \brief Calculating right hand side
1250  \ingroup gel
1251 
1252  \f[
1253  (\mathbf{f}^V_\mu)_j =
1254  \int_V
1255  N_j \frac{\partial V}{\partial t}
1256  \textrm{d}V
1257  \f]
1258 
1259  */
1263  AssembleVector(common_data.muName),
1264  commonData(common_data) {
1265  }
1266  PetscErrorCode doWork(
1267  int row_side,EntityType row_type,DataForcesAndSurcesCore::EntData &row_data
1268  ) {
1269  PetscFunctionBegin;
1270  try {
1271  int nb_dofs = row_data.getIndices().size();
1272  if(!nb_dofs) {
1273  PetscFunctionReturn(0);
1274  }
1275  nF.resize(nb_dofs,false);
1276  nF.clear();
1277  int nb_gauss_pts = row_data.getN().size1();
1278  for(int gg = 0;gg!=nb_gauss_pts;gg++) {
1279  const VectorAdaptor &N = row_data.getN(gg,nb_dofs);
1280  double solvent_dot_dot = commonData.solventConcentrationDot[gg];
1281  double val = getVolume()*getGaussPts()(3,gg);
1282  if(getHoGaussPtsDetJac().size()>0) {
1283  val *= getHoGaussPtsDetJac()[gg]; ///< higher order geometry
1284  }
1285  nF += val*N*solvent_dot_dot;
1286  }
1287  ierr = aSemble(row_side,row_type,row_data); CHKERRQ(ierr);
1288  } catch (const std::exception& ex) {
1289  ostringstream ss;
1290  ss << "throw in method: " << ex.what() << endl;
1291  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1292  }
1293  PetscFunctionReturn(0);
1294  }
1295  };
1296 
1297  /** \brief Residual strain hat
1298  \ingroup gel
1299 
1300  \f[
1301  (\mathbf{r}_{\hat{\varepsilon}})_j =
1302  \int_V
1303  N_j \left(
1304  \frac{\partial \hat{\varepsilon}}{\partial t}-
1305  f(\sigma^\beta)
1306  \right)
1307  \textrm{d}V
1308  \f]
1309 
1310  */
1314  AssembleVector(common_data.strainHatName),
1315  commonData(common_data) {
1316  }
1317  PetscErrorCode doWork(
1318  int row_side,EntityType row_type,DataForcesAndSurcesCore::EntData &row_data
1319  ) {
1320  PetscFunctionBegin;
1321  try {
1322  int nb_dofs = row_data.getIndices().size();
1323  if(!nb_dofs) {
1324  PetscFunctionReturn(0);
1325  }
1326  nF.resize(nb_dofs,false);
1327  nF.clear();
1328  int nb_gauss_pts = row_data.getN().size1();
1329  for(int gg = 0;gg!=nb_gauss_pts;gg++) {
1330  const VectorAdaptor &N = row_data.getN(gg,nb_dofs/6);
1331  VectorDouble9& residual_strain_hat = commonData.residualStrainHat[gg];
1332  double val = getVolume()*getGaussPts()(3,gg);
1333  if(getHoGaussPtsDetJac().size()>0) {
1334  val *= getHoGaussPtsDetJac()[gg]; ///< higher order geometry
1335  }
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];
1339  }
1340  }
1341  }
1342  ierr = aSemble(row_side,row_type,row_data); CHKERRQ(ierr);
1343  } catch (const std::exception& ex) {
1344  ostringstream ss;
1345  ss << "throw in method: " << ex.what() << endl;
1346  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1347  }
1348  PetscFunctionReturn(0);
1349  }
1350  };
1351 
1353  AssembleMatrix(string row_name,string col_name):
1354  MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator(
1355  row_name,col_name,UserDataOperator::OPROWCOL) {
1356  }
1357 
1359  PetscErrorCode aSemble(
1360  int row_side,int col_side,
1361  EntityType row_type,EntityType col_type,
1364  ) {
1365  PetscFunctionBegin;
1366  try {
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];
1371  // cerr << K << endl;
1372  ierr = MatSetValues(
1373  getFEMethod()->ts_B,
1374  nb_row,row_indices_ptr,
1375  nb_col,col_indices_ptr,
1376  &K(0,0),ADD_VALUES
1377  ); CHKERRQ(ierr);
1378  if(sYmm) {
1379  // Assemble of diagonal terms
1380  if(row_side != col_side || row_type != col_type) {
1381  transK.resize(nb_col,nb_row,false);
1382  noalias(transK) = trans(K);
1383  ierr = MatSetValues(
1384  getFEMethod()->ts_B,
1385  nb_col,col_indices_ptr,
1386  nb_row,row_indices_ptr,
1387  &transK(0,0),ADD_VALUES
1388  ); CHKERRQ(ierr);
1389  }
1390  }
1391  } catch (const std::exception& ex) {
1392  ostringstream ss;
1393  ss << "throw in method: " << ex.what() << endl;
1394  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1395  }
1396  PetscFunctionReturn(0);
1397  }
1398  };
1399 
1400  /** \brief Assemble matrix \f$\mathbf{K}_{xx}\f$
1401  */
1402  struct OpLhsdxdx: public AssembleMatrix {
1404  OpLhsdxdx(CommonData &common_data):
1406  common_data.spatialPositionName,
1407  common_data.spatialPositionName
1408  ),
1409  commonData(common_data) {
1410  }
1412  PetscErrorCode get_dStress_dx(
1413  DataForcesAndSurcesCore::EntData &col_data,int gg
1414  ) {
1415  PetscFunctionBegin;
1416  try {
1417  int nb_col = col_data.getIndices().size();
1418  dStress_dx.resize(9,nb_col,false);
1419  dStress_dx.clear();
1420  const MatrixAdaptor diffN = col_data.getDiffN(gg,nb_col/3);
1421  MatrixDouble &jac_stress = commonData.jacStressTotal[gg];
1422  // FIXME: This can be implemented more efficiently. At this stage is
1423  // efficiency bottle neck.
1424  for(int dd = 0;dd<nb_col/3;dd++) { // DoFs in column
1425  for(int jj = 0;jj<3;jj++) { // cont. DoFs in column
1426  double a = diffN(dd,jj);
1427  for(int rr = 0;rr<3;rr++) { // Loop over dsigma_ii/dX_rr
1428  for(int ii = 0;ii<9;ii++) { // ii represents components of stress tensor
1429  dStress_dx(ii,3*dd+rr) += jac_stress(ii,3*rr+jj)*a;
1430  }
1431  }
1432  }
1433  }
1434  } catch (const std::exception& ex) {
1435  ostringstream ss;
1436  ss << "throw in method: " << ex.what() << endl;
1437  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1438  }
1439  PetscFunctionReturn(0);
1440  }
1441  PetscErrorCode doWork(
1442  int row_side,int col_side,
1443  EntityType row_type,EntityType col_type,
1446  ) {
1447  PetscFunctionBegin;
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);
1452  try {
1453  K.resize(nb_row,nb_col,false);
1454  K.clear();
1455  int nb_gauss_pts = row_data.getN().size1();
1456  for(int gg = 0;gg!=nb_gauss_pts;gg++) {
1457  ierr = get_dStress_dx(col_data,gg); CHKERRQ(ierr);
1458  double val = getVolume()*getGaussPts()(3,gg);
1459  if(getHoGaussPtsDetJac().size()>0) {
1460  val *= getHoGaussPtsDetJac()[gg]; ///< higher order geometry
1461  }
1462  //cerr << dStress_dx << endl;
1463  dStress_dx *= val;
1464  const MatrixAdaptor &diffN = row_data.getDiffN(gg,nb_row/3);
1465  { //integrate element stiffness matrix
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) += (
1471  diffN(dd1,0)*dStress_dx(3*rr1+0,3*dd2+rr2)+
1472  diffN(dd1,1)*dStress_dx(3*rr1+1,3*dd2+rr2)+
1473  diffN(dd1,2)*dStress_dx(3*rr1+2,3*dd2+rr2)
1474  );
1475  }
1476  }
1477  }
1478  }
1479  }
1480  }
1481  //cerr << "G " << getMoFEMFEPtr()->get_ref_ent() << endl << K << endl;
1482  ierr = aSemble(
1483  row_side,col_side,row_type,col_type,row_data,col_data
1484  ); CHKERRQ(ierr);
1485 
1486  } catch (const std::exception& ex) {
1487  ostringstream ss;
1488  ss << "throw in method: " << ex.what() << endl;
1489  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1490  }
1491  PetscFunctionReturn(0);
1492  }
1493  };
1494 
1495  /** \brief Assemble matrix \f$\mathbf{K}_{x\mu}\f$
1496  */
1497  struct OpLhsdxdMu: public AssembleMatrix {
1499  OpLhsdxdMu(CommonData &common_data):
1501  common_data.spatialPositionName,common_data.muName
1502  ),
1503  commonData(common_data) {
1504  sYmm = false;
1505  }
1507  PetscErrorCode get_dStress_dx(
1508  DataForcesAndSurcesCore::EntData &col_data,int gg
1509  ) {
1510  PetscFunctionBegin;
1511  try {
1512  int nb_col = col_data.getIndices().size();
1513  dStress_dMu.resize(9,nb_col,false);
1514  dStress_dMu.clear();
1515  const VectorAdaptor N = col_data.getN(gg);
1516  MatrixDouble &jac_stress = commonData.jacStressTotal[gg];
1517  for(int dd = 0;dd<nb_col;dd++) {
1518  double a = N[dd];
1519  for(int ii = 0;ii<9;ii++) {
1520  dStress_dMu(ii,dd) += jac_stress(ii,9+6+0)*a;
1521  }
1522  }
1523  } catch (const std::exception& ex) {
1524  ostringstream ss;
1525  ss << "throw in method: " << ex.what() << endl;
1526  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1527  }
1528  PetscFunctionReturn(0);
1529  }
1530  PetscErrorCode doWork(
1531  int row_side,int col_side,
1532  EntityType row_type,EntityType col_type,
1535  ) {
1536  PetscFunctionBegin;
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);
1541  try {
1542  K.resize(nb_row,nb_col,false);
1543  K.clear();
1544  int nb_gauss_pts = row_data.getN().size1();
1545  for(int gg = 0;gg!=nb_gauss_pts;gg++) {
1546  ierr = get_dStress_dx(col_data,gg); CHKERRQ(ierr);
1547  double val = getVolume()*getGaussPts()(3,gg);
1548  if(getHoGaussPtsDetJac().size()>0) {
1549  val *= getHoGaussPtsDetJac()[gg]; ///< higher order geometry
1550  }
1551  dStress_dMu *= val;
1552  const MatrixAdaptor &diffN = row_data.getDiffN(gg,nb_row/3);
1553  { //integrate element stiffness matrix
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++) {
1557  K(3*dd1+rr1,dd2) +=
1558  diffN(dd1,0)*dStress_dMu(3*rr1+0,dd2)+
1559  diffN(dd1,1)*dStress_dMu(3*rr1+1,dd2)+
1560  diffN(dd1,2)*dStress_dMu(3*rr1+2,dd2);
1561  }
1562  }
1563  }
1564  }
1565  }
1566  ierr = aSemble(
1567  row_side,col_side,row_type,col_type,row_data,col_data
1568  ); CHKERRQ(ierr);
1569  } catch (const std::exception& ex) {
1570  ostringstream ss;
1571  ss << "throw in method: " << ex.what() << endl;
1572  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1573  }
1574  PetscFunctionReturn(0);
1575  }
1576  };
1577 
1578  /** \brief Assemble matrix \f$\mathbf{K}_{x\hat{\varepsilon}}\f$
1579  */
1584  common_data.spatialPositionName,common_data.strainHatName
1585  ),
1586  commonData(common_data) {
1587  sYmm = false;
1588  }
1590  PetscErrorCode get_dStress_dStrainHat(
1591  DataForcesAndSurcesCore::EntData &col_data,int gg
1592  ) {
1593  PetscFunctionBegin;
1594  try {
1595  int nb_col = col_data.getIndices().size();
1596  dStress_dStrainHat.resize(9,nb_col,false);
1597  dStress_dStrainHat.clear();
1598  const VectorAdaptor N = col_data.getN(gg);
1599  MatrixDouble &jac_stress = commonData.jacStressTotal[gg];
1600  /*cerr << N << endl;
1601  cerr << jac_stress << endl;
1602  cerr << dStress_dStrainHat << endl;
1603  cerr << nb_col << endl;*/
1604  for(int dd = 0;dd<nb_col/6;dd++) { /// DoFS in column
1605  double a = N[dd];
1606  for(int ii = 0;ii<9;ii++) { // ii for elements in stress matrix
1607  for(int rr = 0;rr<6;rr++) {
1608  dStress_dStrainHat(ii,6*dd+rr) += jac_stress(ii,9+rr)*a;
1609  }
1610  }
1611  }
1612  } catch (const std::exception& ex) {
1613  ostringstream ss;
1614  ss << "throw in method: " << ex.what() << endl;
1615  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1616  }
1617  PetscFunctionReturn(0);
1618  }
1619  PetscErrorCode doWork(
1620  int row_side,int col_side,
1621  EntityType row_type,EntityType col_type,
1624  ) {
1625  PetscFunctionBegin;
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);
1630  try {
1631  K.resize(nb_row,nb_col,false);
1632  K.clear();
1633  int nb_gauss_pts = row_data.getN().size1();
1634  for(int gg = 0;gg!=nb_gauss_pts;gg++) {
1635  ierr = get_dStress_dStrainHat(col_data,gg); CHKERRQ(ierr);
1636  double val = getVolume()*getGaussPts()(3,gg);
1637  if(getHoGaussPtsDetJac().size()>0) {
1638  val *= getHoGaussPtsDetJac()[gg]; ///< higher order geometry
1639  }
1640  dStress_dStrainHat *= val;
1641  const MatrixAdaptor &diffN = row_data.getDiffN(gg,nb_row/3);
1642  { //integrate element stiffness matrix
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) +=
1648  diffN(dd1,0)*dStress_dStrainHat(3*rr1+0,6*dd2+rr2)+
1649  diffN(dd1,1)*dStress_dStrainHat(3*rr1+1,6*dd2+rr2)+
1650  diffN(dd1,2)*dStress_dStrainHat(3*rr1+2,6*dd2+rr2);
1651  }
1652  }
1653  }
1654  }
1655  }
1656  }
1657  ierr = aSemble(
1658  row_side,col_side,row_type,col_type,row_data,col_data
1659  ); CHKERRQ(ierr);
1660  } catch (const std::exception& ex) {
1661  ostringstream ss;
1662  ss << "throw in method: " << ex.what() << endl;
1663  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1664  }
1665  PetscFunctionReturn(0);
1666  }
1667  };
1668 
1669  /** \brief Assemble matrix \f$\mathbf{K}_{\hat{\varepsilon}\hat{\varepsilon}}\f$
1670  */
1675  common_data.strainHatName,common_data.strainHatName
1676  ),
1677  commonData(common_data) {
1678  }
1681  DataForcesAndSurcesCore::EntData &col_data,int gg
1682  ) {
1683  PetscFunctionBegin;
1684  try {
1685  int nb_col = col_data.getIndices().size();
1686  dStrainHat_dStrainHat.resize(6,nb_col,false);
1687  dStrainHat_dStrainHat.clear();
1688  const VectorAdaptor N = col_data.getN(gg);
1689  MatrixDouble &jac_res_strain_hat = commonData.jacStrainHat[gg];
1690  for(int dd = 0;dd<nb_col/6;dd++) { /// DoFS in column
1691  double a = N[dd];
1692  for(int ii = 0;ii<6;ii++) { // ii for elements in stress matrix
1693  for(int rr = 0;rr<6;rr++) {
1694  dStrainHat_dStrainHat(ii,6*dd+rr) += jac_res_strain_hat(ii,9+rr)*a;
1695  dStrainHat_dStrainHat(ii,6*dd+rr) += jac_res_strain_hat(ii,9+6+rr)*a*getFEMethod()->ts_a; // Time dependent element
1696  }
1697  }
1698  }
1699  } catch (const std::exception& ex) {
1700  ostringstream ss;
1701  ss << "throw in method: " << ex.what() << endl;
1702  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1703  }
1704  PetscFunctionReturn(0);
1705  }
1706  PetscErrorCode doWork(
1707  int row_side,int col_side,
1708  EntityType row_type,EntityType col_type,
1711  ) {
1712  PetscFunctionBegin;
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);
1717  try {
1718  K.resize(nb_row,nb_col,false);
1719  K.clear();
1720  int nb_gauss_pts = row_data.getN().size1();
1721  for(int gg = 0;gg!=nb_gauss_pts;gg++) {
1722  ierr = get_dStrainHat_dStrainHat(col_data,gg); CHKERRQ(ierr);
1723  double val = getVolume()*getGaussPts()(3,gg);
1724  if(getHoGaussPtsDetJac().size()>0) {
1725  val *= getHoGaussPtsDetJac()[gg]; ///< higher order geometry
1726  }
1727  dStrainHat_dStrainHat *= val;
1728  const VectorAdaptor &N = row_data.getN(gg);
1729  { //integrate element stiffness matrix
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++) {
1733  K(6*dd1+rr1,dd2) += N[dd1]*dStrainHat_dStrainHat(rr1,dd2);
1734  }
1735  }
1736  }
1737  }
1738  }
1739  ierr = aSemble(
1740  row_side,col_side,row_type,col_type,row_data,col_data
1741  ); CHKERRQ(ierr);
1742  } catch (const std::exception& ex) {
1743  ostringstream ss;
1744  ss << "throw in method: " << ex.what() << endl;
1745  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1746  }
1747  PetscFunctionReturn(0);
1748  }
1749  };
1750 
1751  /** \brief Assemble matrix \f$\mathbf{K}_{\hat{\varepsilon}x}\f$
1752  */
1757  common_data.strainHatName,common_data.spatialPositionName
1758  ),
1759  commonData(common_data) {
1760  sYmm = false;
1761  }
1763  PetscErrorCode get_dStrainHat_dx(
1764  DataForcesAndSurcesCore::EntData &col_data,int gg
1765  ) {
1766  PetscFunctionBegin;
1767  try {
1768  int nb_col = col_data.getIndices().size();
1769  dStrainHat_dx.resize(6,nb_col,false);
1770  dStrainHat_dx.clear();
1771  const MatrixAdaptor diffN = col_data.getDiffN(gg,nb_col/3);
1772  MatrixDouble &jac_res_strain_hat = commonData.jacStrainHat[gg];
1773  //cerr << "a\n" << diffN << endl;
1774  //cerr << "b\n" << jac_res_strain_hat << endl;
1775  for(int dd = 0;dd<nb_col/3;dd++) { // DoFs in column
1776  for(int jj = 0;jj<3;jj++) { // cont. DoFs in column
1777  double a = diffN(dd,jj);
1778  for(int ii = 0;ii<6;ii++) { // ii for elements in strain hat
1779  for(int rr2 = 0;rr2<3;rr2++) {
1780  dStrainHat_dx(ii,3*dd+rr2) += jac_res_strain_hat(ii,3*rr2+jj)*a;
1781  }
1782  }
1783  }
1784  }
1785  } catch (const std::exception& ex) {
1786  ostringstream ss;
1787  ss << "throw in method: " << ex.what() << endl;
1788  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1789  }
1790  PetscFunctionReturn(0);
1791  }
1792  PetscErrorCode doWork(
1793  int row_side,int col_side,
1794  EntityType row_type,EntityType col_type,
1797  ) {
1798  PetscFunctionBegin;
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);
1803  try {
1804  K.resize(nb_row,nb_col,false);
1805  K.clear();
1806  int nb_gauss_pts = row_data.getN().size1();
1807  for(int gg = 0;gg!=nb_gauss_pts;gg++) {
1808  ierr = get_dStrainHat_dx(col_data,gg); CHKERRQ(ierr);
1809  double val = getVolume()*getGaussPts()(3,gg);
1810  if(getHoGaussPtsDetJac().size()>0) {
1811  val *= getHoGaussPtsDetJac()[gg]; ///< higher order geometry
1812  }
1813  dStrainHat_dx *= val;
1814  //cerr << dStrainHat_dx << endl;
1815  const VectorAdaptor &N = row_data.getN(gg);
1816  { //integrate element stiffness matrix
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++) {
1821  K(6*dd1+rr1,3*dd2+rr2) += N[dd1]*dStrainHat_dx(rr1,3*dd2+rr2);
1822  }
1823  }
1824  }
1825  }
1826  }
1827  }
1828  ierr = aSemble(
1829  row_side,col_side,row_type,col_type,row_data,col_data
1830  ); CHKERRQ(ierr);
1831  } catch (const std::exception& ex) {
1832  ostringstream ss;
1833  ss << "throw in method: " << ex.what() << endl;
1834  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1835  }
1836  PetscFunctionReturn(0);
1837  }
1838  };
1839 
1840  /** \brief Assemble matrix \f$\mathbf{K}_{\mu \mu}\f$
1841  */
1842  struct OpLhsdMudMu: public AssembleMatrix {
1844  OpLhsdMudMu(CommonData &common_data):
1846  common_data.muName,common_data.muName
1847  ),
1848  commonData(common_data) {
1849  }
1851  PetscErrorCode get_dSolventFlux_dmu(
1852  DataForcesAndSurcesCore::EntData &col_data,int gg
1853  ) {
1854  PetscFunctionBegin;
1855  try {
1856  int nb_col = col_data.getIndices().size();
1857  dSolventFlux_dmu.resize(3,nb_col,false);
1858  dSolventFlux_dmu.clear();
1859  const MatrixAdaptor diffN = col_data.getDiffN(gg);
1860  MatrixDouble &jac_solvent_flux = commonData.jacSolventFlux[gg];
1861  for(int dd = 0;dd<nb_col;dd++) { // DoFs in column
1862  for(int jj = 0;jj<3;jj++) {
1863  double a = diffN(dd,jj);
1864  for(int rr2 = 0;rr2<3;rr2++) {
1865  dSolventFlux_dmu(rr2,dd) += jac_solvent_flux(rr2,jj)*a;
1866  }
1867  }
1868  }
1869  } catch (const std::exception& ex) {
1870  ostringstream ss;
1871  ss << "throw in method: " << ex.what() << endl;
1872  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1873  }
1874  PetscFunctionReturn(0);
1875  }
1876  PetscErrorCode doWork(
1877  int row_side,int col_side,
1878  EntityType row_type,EntityType col_type,
1881  ) {
1882  PetscFunctionBegin;
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);
1887  try {
1888  K.resize(nb_row,nb_col,false);
1889  K.clear();
1890  int nb_gauss_pts = row_data.getN().size1();
1891  for(int gg = 0;gg!=nb_gauss_pts;gg++) {
1892  ierr = get_dSolventFlux_dmu(col_data,gg); CHKERRQ(ierr);
1893  double val = getVolume()*getGaussPts()(3,gg);
1894  if(getHoGaussPtsDetJac().size()>0) {
1895  val *= getHoGaussPtsDetJac()[gg]; ///< higher order geometry
1896  }
1897  dSolventFlux_dmu *= val;
1898  //cerr << dSolventFlux_dmu << endl;
1899  const MatrixAdaptor &diffN = row_data.getDiffN(gg);
1900  { //integrate element stiffness matrix
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++) {
1904  K(dd1,dd2) += diffN(dd1,jj)*dSolventFlux_dmu(jj,dd2);
1905  }
1906  }
1907  }
1908  }
1909  }
1910  ierr = aSemble(
1911  row_side,col_side,row_type,col_type,row_data,col_data
1912  ); CHKERRQ(ierr);
1913  } catch (const std::exception& ex) {
1914  ostringstream ss;
1915  ss << "throw in method: " << ex.what() << endl;
1916  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1917  }
1918  PetscFunctionReturn(0);
1919  }
1920  };
1921 
1922 
1923  /** \brief Assemble matrix \f$\mathbf{K}_{\mu x}\f$
1924  */
1925  struct OpLhsdMudx: public AssembleMatrix {
1927  OpLhsdMudx(CommonData &common_data):
1929  common_data.muName,common_data.spatialPositionName
1930  ),
1931  commonData(common_data) {
1932  sYmm = false;
1933  }
1935  PetscErrorCode get_dSolventDot_dx(
1936  DataForcesAndSurcesCore::EntData &col_data,int gg
1937  ) {
1938  PetscFunctionBegin;
1939  try {
1940  int nb_col = col_data.getIndices().size();
1941  dSolventDot_dx.resize(nb_col,false);
1942  dSolventDot_dx.clear();
1943  const MatrixAdaptor diffN = col_data.getDiffN(gg);
1944  VectorDouble &jac_solvent_rate = commonData.jacSolventDot[gg];
1945  //cerr << dSolventDot_dx << endl;
1946  //cerr << jac_solvent_rate << endl;
1947  for(int dd = 0;dd<nb_col/3;dd++) { // DoFs in column
1948  for(int jj = 0;jj<3;jj++) {
1949  double a = diffN(dd,jj);
1950  for(int rr2 = 0;rr2<3;rr2++) {
1951  dSolventDot_dx[3*dd+rr2] += jac_solvent_rate(0+3*rr2+jj)*a;
1952  dSolventDot_dx[3*dd+rr2] += jac_solvent_rate(9+3*rr2+jj)*a*getFEMethod()->ts_a;
1953  }
1954  }
1955  }
1956  //cerr << dSolventDot_dx << endl;
1957  } catch (const std::exception& ex) {
1958  ostringstream ss;
1959  ss << "throw in method: " << ex.what() << endl;
1960  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1961  }
1962  PetscFunctionReturn(0);
1963  }
1964  PetscErrorCode doWork(
1965  int row_side,int col_side,
1966  EntityType row_type,EntityType col_type,
1969  ) {
1970  PetscFunctionBegin;
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);
1975  try {
1976  K.resize(nb_row,nb_col,false);
1977  K.clear();
1978  int nb_gauss_pts = row_data.getN().size1();
1979  for(int gg = 0;gg!=nb_gauss_pts;gg++) {
1980  ierr = get_dSolventDot_dx(col_data,gg); CHKERRQ(ierr);
1981  double val = getVolume()*getGaussPts()(3,gg);
1982  if(getHoGaussPtsDetJac().size()>0) {
1983  val *= getHoGaussPtsDetJac()[gg]; ///< higher order geometry
1984  }
1985  dSolventDot_dx *= val;
1986  //cerr << dSolventDot_dx << endl;
1987  const VectorAdaptor &N = row_data.getN(gg);
1988  { //integrate element stiffness matrix
1989  for(int dd1 = 0;dd1<nb_row;dd1++) {
1990  for(int dd2 = 0;dd2<nb_col;dd2++) {
1991  K(dd1,dd2) += N[dd1]*dSolventDot_dx[dd2];
1992  }
1993  }
1994  }
1995  }
1996  ierr = aSemble(
1997  row_side,col_side,row_type,col_type,row_data,col_data
1998  ); CHKERRQ(ierr);
1999  } catch (const std::exception& ex) {
2000  ostringstream ss;
2001  ss << "throw in method: " << ex.what() << endl;
2002  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
2003  }
2004  PetscFunctionReturn(0);
2005  }
2006  };
2007 
2008  /**
2009  * \brief Used to post proc stresses, energy, source term.
2010  *
2011  * calculation of principal stresses. for e.g.
2012  *
2013  */
2015 
2018  std::vector<EntityHandle> &mapGaussPts;
2019 
2021  const string field_name,
2022  moab::Interface &post_proc_mesh,
2023  std::vector<EntityHandle> &map_gauss_pts,
2024  CommonData &common_data
2025  ):
2026  MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator(field_name,UserDataOperator::OPROW),
2027  commonData(common_data),
2028  postProcMesh(post_proc_mesh),
2029  mapGaussPts(map_gauss_pts) {
2030  // Set that this operator is executed only for vertices on element
2031  doVertices = true;
2032  doEdges = false;
2033  doQuads = false;
2034  doTris = false;
2035  doTets = false;
2036  doPrisms = false;
2037  }
2038 
2039  PetscErrorCode doWork(
2040  int side,EntityType type,DataForcesAndSurcesCore::EntData &data
2041  ) {
2042  //
2043 
2044  PetscFunctionBegin;
2045 
2046  if(type!=MBVERTEX) PetscFunctionReturn(9);
2047  double def_VAL[9];
2048  bzero(def_VAL,9*sizeof(double));
2049  Tag th_stress_total;
2050  rval = postProcMesh.tag_get_handle(
2051  "STRESS_TOTAL",9,MB_TYPE_DOUBLE,th_stress_total,MB_TAG_CREAT|MB_TAG_SPARSE,def_VAL
2052  ); CHKERRQ_MOAB(rval);
2053  Tag th_flux;
2054  rval = postProcMesh.tag_get_handle(
2055  "FLUX_CHEMICAL_LOAD",3,MB_TYPE_DOUBLE,th_flux,MB_TAG_CREAT|MB_TAG_SPARSE,def_VAL
2056  ); CHKERRQ_MOAB(rval);
2057 
2058  const int nb_gauss_pts = mapGaussPts.size();
2059  for(int gg = 0;gg!=nb_gauss_pts;gg++) {
2060  rval = postProcMesh.tag_set_data(th_stress_total,&mapGaussPts[gg],1,&(commonData.stressTotal[gg](0,0))); CHKERRQ_MOAB(rval);
2061  rval = postProcMesh.tag_set_data(th_flux,&mapGaussPts[gg],1,&(commonData.solventFlux[gg][0])); CHKERRQ_MOAB(rval);
2062  }
2063 
2064  PetscFunctionReturn(0);
2065 
2066  }
2067 
2068  };
2069 
2070 
2072 
2074  string pRoblem;
2075  string fE;
2077  boost::shared_ptr<Gel::ConstitutiveEquation<adouble> > &cE;
2078  vector<int> tAgs;
2079 
2081 
2082  bool iNit;
2083  int pRT;
2084 
2086  MoFEM::Interface &m_field,
2087  string problem,
2088  string fe,
2089  CommonData &common_data,
2090  boost::shared_ptr<Gel::ConstitutiveEquation<adouble> > &ce,
2091  vector<int> tags
2092  ):
2093  FEMethod(),
2094  mField(m_field),
2095  pRoblem(problem),
2096  fE(fe),
2097  commonData(common_data),
2098  cE(ce),
2099  tAgs(tags),
2100  postProc(m_field),
2101  iNit(false) {
2102 
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) {
2108  pRT = 1;
2109  }
2110  }
2111 
2112  PetscErrorCode preProcess() {
2113  PetscFunctionBegin;
2114  PetscFunctionReturn(0);
2115  }
2116 
2117  PetscErrorCode operator()() {
2118  PetscFunctionBegin;
2119  PetscFunctionReturn(0);
2120  }
2121 
2122  PetscErrorCode postProcess() {
2123  PetscFunctionBegin;
2124 
2125  if(!iNit) {
2126 
2132  postProc.getOpPtrVector().push_back
2133  (new Gel::OpGetDataAtGaussPts("SPATIAL_POSITION",commonData,false,true));
2134  postProc.getOpPtrVector().push_back
2135  (new Gel::OpGetDataAtGaussPts("SPATIAL_POSITION_DOT",commonData,false,true));
2136  postProc.getOpPtrVector().push_back
2137  (new Gel::OpGetDataAtGaussPts("CHEMICAL_LOAD",commonData,true,true));
2138  postProc.getOpPtrVector().push_back
2139  (new Gel::OpGetDataAtGaussPts("HAT_EPS",commonData,true,false,MBTET));
2140  postProc.getOpPtrVector().push_back
2141  (new Gel::OpGetDataAtGaussPts("HAT_EPS_DOT",commonData,true,false,MBTET));
2142  postProc.getOpPtrVector().push_back
2143  (new Gel::OpJacobian("SPATIAL_POSITION",tAgs,cE,commonData,true,false));
2144  postProc.getOpPtrVector().push_back
2146 
2147 
2148  iNit = true;
2149  }
2150  int step;
2151  ierr = TSGetTimeStepNumber(ts,&step); CHKERRQ(ierr);
2152 
2153  if((step)%pRT==0) {
2155  ostringstream sss;
2156  sss << "out_" << step << ".h5m";
2157  rval = postProc.postProcMesh.write_file(sss.str().c_str(),"MOAB","PARALLEL=WRITE_PART"); CHKERRQ_MOAB(rval);
2158  }
2159  PetscFunctionReturn(0);
2160  }
2161 
2162  };
2163 
2164 };
2165 
2166 }
2167 
2168 #endif //__GEL_HPP__
2169 
2170 /***************************************************************************//**
2171  * \defgroup gel Gel model
2172  * \ingroup user_modules
2173  ******************************************************************************/
GelModule::Gel::feLhs
GelFE feLhs
Definition: Gels.hpp:436
GelModule::Gel::OpJacobian::tagS
vector< int > tagS
Definition: Gels.hpp:543
GelModule::Gel::BlockMaterialData::vBeta
double vBeta
Poisson ratio spring beta.
Definition: Gels.hpp:93
GelModule::Gel::OpLhsdMudx::doWork
PetscErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, DataForcesAndSurcesCore::EntData &row_data, DataForcesAndSurcesCore::EntData &col_data)
Definition: Gels.hpp:1964
GelModule::Gel::blockMaterialData
map< int, BlockMaterialData > blockMaterialData
Definition: Gels.hpp:105
GelModule::Gel::OpLhsdxdStrainHat::commonData
CommonData & commonData
Definition: Gels.hpp:1581
GelModule::Gel::ConstitutiveEquation::dAta
map< int, BlockMaterialData > & dAta
Definition: Gels.hpp:117
GelModule::Gel::SOLVENTFLUX
@ SOLVENTFLUX
Definition: Gels.hpp:78
GelModule::Gel::AssembleMatrix
Definition: Gels.hpp:1352
MoFEM::DataOperator::doTris
bool & doTris
\deprectaed
Definition: DataOperators.hpp:93
GelModule::Gel::OpLhsdxdMu::commonData
CommonData & commonData
Definition: Gels.hpp:1498
GelModule::Gel::CommonData::strainHatName
string strainHatName
Definition: Gels.hpp:349
GelModule::Gel::MonitorPostProc::cE
boost::shared_ptr< Gel::ConstitutiveEquation< adouble > > & cE
Definition: Gels.hpp:2077
MoFEM::CoreInterface::loop_finite_elements
virtual MoFEMErrorCode loop_finite_elements(const std::string problem_name, const std::string &fe_name, FEMethod &method, boost::shared_ptr< NumeredEntFiniteElement_multiIndex > fe_ptr=nullptr, MoFEMTypes bh=MF_EXIST, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr(), int verb=DEFAULT_VERBOSITY)=0
Make a loop over finite elements.
GelModule::Gel::ConstitutiveEquation::calculateCauchyDefromationTensor
virtual PetscErrorCode calculateCauchyDefromationTensor()
Definition: Gels.hpp:156
GelModule::Gel::OpLhsdMudMu::commonData
CommonData & commonData
Definition: Gels.hpp:1843
GelModule::Gel::BlockMaterialData::pErmeability
double pErmeability
Permeability of Gel.
Definition: Gels.hpp:97
GelModule::Gel::ConstitutiveEquation::solventConcentrationDot
TYPE solventConcentrationDot
Volume rate change.
Definition: Gels.hpp:153
GelModule::Gel::OpLhsdStrainHatdx
Assemble matrix .
Definition: Gels.hpp:1753
GelModule::Gel::CommonData::strainHatNameDot
string strainHatNameDot
Definition: Gels.hpp:350
MoFEM::MatSetValues
MoFEMErrorCode MatSetValues(Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const double *ptr, InsertMode iora)
Assemble PETSc matrix.
Definition: EntitiesFieldData.hpp:1631
MoFEM::TSMethod::ts_a
PetscReal ts_a
shift for U_t (see PETSc Time Solver)
Definition: LoopMethods.hpp:160
GelModule::Gel::ConstitutiveEquation::solventFlux
ublas::vector< TYPE, ublas::bounded_array< TYPE, 9 > > solventFlux
Solvent flux.
Definition: Gels.hpp:152
GelModule::Gel::GelFE::commonData
CommonData & commonData
Definition: Gels.hpp:381
GelModule::Gel::OpJacobian::cE
boost::shared_ptr< Gel::ConstitutiveEquation< adouble > > cE
Definition: Gels.hpp:544
GelModule::Gel::AssembleMatrix::aSemble
PetscErrorCode aSemble(int row_side, int col_side, EntityType row_type, EntityType col_type, DataForcesAndSurcesCore::EntData &row_data, DataForcesAndSurcesCore::EntData &col_data)
Definition: Gels.hpp:1359
GelModule::Gel::ConstitutiveEquation::iD
int iD
Definition: Gels.hpp:116
GelModule::Gel::OpLhsdMudMu::get_dSolventFlux_dmu
PetscErrorCode get_dSolventFlux_dmu(DataForcesAndSurcesCore::EntData &col_data, int gg)
Definition: Gels.hpp:1851
GelModule::Gel::OpJacobian
Definition: Gels.hpp:541
EntityHandle
GelModule::Gel::OpPostProcGel::commonData
CommonData & commonData
Definition: Gels.hpp:2016
GelModule::Gel::OpPostProcGel::OpPostProcGel
OpPostProcGel(const string field_name, moab::Interface &post_proc_mesh, std::vector< EntityHandle > &map_gauss_pts, CommonData &common_data)
Definition: Gels.hpp:2020
MoFEM::TSMethod::ts_F
Vec & ts_F
residual vector
Definition: LoopMethods.hpp:168
PostProcTemplateOnRefineMesh::postProcMesh
moab::Interface & postProcMesh
Definition: PostProcOnRefMesh.hpp:122
MoFEM::FEMethod
structure for User Loop Methods on finite elements
Definition: LoopMethods.hpp:369
CHKERRQ_MOAB
#define CHKERRQ_MOAB(a)
check error code of MoAB function
Definition: definitions.h:454
GelModule::Gel::OpLhsdMudx::get_dSolventDot_dx
PetscErrorCode get_dSolventDot_dx(DataForcesAndSurcesCore::EntData &col_data, int gg)
Definition: Gels.hpp:1935
GelModule::Gel::OpGetDataAtGaussPts::OpGetDataAtGaussPts
OpGetDataAtGaussPts(const string field_name, CommonData &common_data, bool calc_val, bool calc_grad, EntityType zero_at_type=MBVERTEX)
Definition: Gels.hpp:451
GelModule::Gel::CommonData::recordOn
bool recordOn
Definition: Gels.hpp:368
GelModule::Gel::OpJacobian::calculateJacobianBool
bool calculateJacobianBool
Definition: Gels.hpp:548
GelModule::Gel::OpLhsdxdStrainHat::doWork
PetscErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, DataForcesAndSurcesCore::EntData &row_data, DataForcesAndSurcesCore::EntData &col_data)
Definition: Gels.hpp:1619
GelModule::Gel::GelFE::GelFE
GelFE(MoFEM::Interface &m_field, CommonData &common_data)
Definition: Gels.hpp:384
GelModule::Gel::CommonData::spatialPositionName
string spatialPositionName
Definition: Gels.hpp:347
GelModule::Gel::CommonData::jacStrainHat
vector< MatrixDouble > jacStrainHat
Definition: Gels.hpp:366
GelModule::Gel::MonitorPostProc::mField
MoFEM::Interface & mField
Definition: Gels.hpp:2073
GelModule::Gel::SOLVENTRATE
@ SOLVENTRATE
Definition: Gels.hpp:79
GelModule::Gel::BlockMaterialData::gBeta
double gBeta
Shear modulus spring beta.
Definition: Gels.hpp:94
GelModule::Gel::ConstitutiveEquation::gradientU
ublas::matrix< TYPE, ublas::row_major, ublas::bounded_array< TYPE, 9 > > gradientU
Gradient of displacements.
Definition: Gels.hpp:136
GelModule::Gel::ConstitutiveEquation::calculateStrainHatFlux
virtual PetscErrorCode calculateStrainHatFlux()
Calculate rate of strain hat.
Definition: Gels.hpp:255
MoFEM::Types::MatrixDouble
UBlasMatrix< double > MatrixDouble
Definition: Types.hpp:77
GelModule::Gel::CommonData::stressTotal
vector< MatrixDouble3by3 > stressTotal
Definition: Gels.hpp:357
GelModule::Gel::ConstitutiveEquation::traceStrainTotal
TYPE traceStrainTotal
Definition: Gels.hpp:144
GelModule::Gel::OpLhsdxdx::OpLhsdxdx
OpLhsdxdx(CommonData &common_data)
Definition: Gels.hpp:1404
GelModule
Definition: Gels.hpp:27
GelModule::Gel::OpJacobian::activeVariables
VectorDouble activeVariables
Definition: Gels.hpp:575
GelModule::Gel::CommonData::gradAtGaussPts
map< string, vector< MatrixDouble > > gradAtGaussPts
Definition: Gels.hpp:355
GelModule::Gel::OpLhsdStrainHatdStrainHat::doWork
PetscErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, DataForcesAndSurcesCore::EntData &row_data, DataForcesAndSurcesCore::EntData &col_data)
Definition: Gels.hpp:1706
GelModule::Gel::CommonData::nbActiveVariables
map< int, int > nbActiveVariables
Definition: Gels.hpp:369
GelModule::Gel::CommonData::jacSolventDot
vector< VectorDouble > jacSolventDot
Definition: Gels.hpp:365
GelModule::Gel::OpRhsStrainHat::doWork
PetscErrorCode doWork(int row_side, EntityType row_type, DataForcesAndSurcesCore::EntData &row_data)
Definition: Gels.hpp:1317
GelModule::Gel::OpJacobian::OpJacobian
OpJacobian(const string field_name, vector< int > tags, boost::shared_ptr< Gel::ConstitutiveEquation< adouble > > ce, CommonData &common_data, bool calculate_residual, bool calculate_jacobian)
Definition: Gels.hpp:553
MoFEM::DataOperator::doPrisms
bool & doPrisms
\deprectaed
Definition: DataOperators.hpp:95
GelModule::Gel::ConstitutiveEquation::gradientMu
ublas::vector< TYPE, ublas::bounded_array< TYPE, 3 > > gradientMu
Gradient of solvent concentration.
Definition: Gels.hpp:131
GelModule::Gel::AssembleMatrix::transK
MatrixDouble transK
Definition: Gels.hpp:1358
MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator::getVolume
double getVolume() const
element volume (linear geometry)
Definition: VolumeElementForcesAndSourcesCore.hpp:161
MoFEM::ForcesAndSourcesCore::UserDataOperator::rowFieldName
std::string rowFieldName
Definition: ForcesAndSourcesCore.hpp:577
GelModule::Gel::ConstitutiveEquation::stressTotal
ublas::matrix< TYPE, ublas::row_major, ublas::bounded_array< TYPE, 9 > > stressTotal
Total stress.
Definition: Gels.hpp:151
GelModule::Gel::AssembleVector::AssembleVector
AssembleVector(string field_name)
Definition: Gels.hpp:1119
GelModule::Gel::CommonData::spatialPositionNameDot
string spatialPositionNameDot
Definition: Gels.hpp:348
MoFEM::DataOperator::doTets
bool & doTets
\deprectaed
Definition: DataOperators.hpp:94
MoFEM::ForcesAndSourcesCore::preProcess
virtual MoFEMErrorCode preProcess()
function is run at the beginning of loop
Definition: ForcesAndSourcesCore.cpp:1958
GelModule::Gel::OpLhsdMudMu::dSolventFlux_dmu
MatrixDouble dSolventFlux_dmu
Definition: Gels.hpp:1850
GelModule::Gel::BlockMaterialData::mU0
double mU0
equilibrated chemical potential/load
Definition: Gels.hpp:100
GelModule::Gel::OpLhsdStrainHatdStrainHat::OpLhsdStrainHatdStrainHat
OpLhsdStrainHatdStrainHat(CommonData &common_data)
Definition: Gels.hpp:1673
GelModule::Gel::STRESSTOTAL
@ STRESSTOTAL
Definition: Gels.hpp:77
GelModule::Gel::CommonData::solventConcentrationDot
vector< double > solventConcentrationDot
Definition: Gels.hpp:359
GelModule::Gel::OpRhsStrainHat
Residual strain hat.
Definition: Gels.hpp:1311
GelModule::Gel::OpRhsStressTotal::doWork
PetscErrorCode doWork(int row_side, EntityType row_type, DataForcesAndSurcesCore::EntData &row_data)
Definition: Gels.hpp:1160
GelModule::Gel::OpLhsdxdMu
Assemble matrix .
Definition: Gels.hpp:1497
MoFEM::ForcesAndSourcesCore::UserDataOperator::OPROWCOL
@ OPROWCOL
operator doWork is executed on FE rows &columns
Definition: ForcesAndSourcesCore.hpp:569
GelModule::Gel::BlockMaterialData::gBetaHat
double gBetaHat
Shear modulus dashpot.
Definition: Gels.hpp:96
MoFEM::DataOperator::doVertices
bool & doVertices
\deprectaed If false skip vertices
Definition: DataOperators.hpp:90
GelModule::Gel::mFiled
MoFEM::Interface & mFiled
Definition: Gels.hpp:83
GelModule::Gel::ConstitutiveEquation::calculateStressTotal
virtual PetscErrorCode calculateStressTotal()
Definition: Gels.hpp:292
GelModule::Gel::ConstitutiveEquation::ConstitutiveEquation
ConstitutiveEquation(map< int, BlockMaterialData > &data)
Definition: Gels.hpp:119
MoFEM::VecSetValues
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
Definition: EntitiesFieldData.hpp:1576
sdf.r
int r
Definition: sdf.py:8
GelModule::Gel::ConstitutiveEquation::traceStressBeta
TYPE traceStressBeta
Definition: Gels.hpp:146
GelModule::Gel::OpJacobian::calculateAtIntPtsSolventFlux
PetscErrorCode calculateAtIntPtsSolventFlux()
Definition: Gels.hpp:908
order
constexpr int order
Definition: dg_projection.cpp:18
GelModule::Gel
Implementation of Gel constitutive model.
Definition: Gels.hpp:74
GelModule::Gel::CommonData::muName
string muName
Definition: Gels.hpp:351
MoFEM::DeprecatedCoreInterface
Deprecated interface functions.
Definition: DeprecatedCoreInterface.hpp:16
MoFEM::Interface
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1975
GelModule::Gel::OpLhsdStrainHatdStrainHat::dStrainHat_dStrainHat
MatrixDouble dStrainHat_dStrainHat
Definition: Gels.hpp:1679
MoFEM::ForcesAndSourcesCore::UserDataOperator::getGaussPts
MatrixDouble & getGaussPts()
matrix of integration (Gauss) points for Volume Element
Definition: ForcesAndSourcesCore.hpp:1235
GelModule::Gel::OpLhsdMudx
Assemble matrix .
Definition: Gels.hpp:1925
GelModule::Gel::OpLhsdStrainHatdStrainHat::get_dStrainHat_dStrainHat
PetscErrorCode get_dStrainHat_dStrainHat(DataForcesAndSurcesCore::EntData &col_data, int gg)
Definition: Gels.hpp:1680
GelModule::Gel::ConstitutiveEquation::calculateStressAlpha
virtual PetscErrorCode calculateStressAlpha()
Calculate stress in spring alpha.
Definition: Gels.hpp:200
GelModule::Gel::OpLhsdxdx::dStress_dx
MatrixDouble dStress_dx
Definition: Gels.hpp:1411
GelModule::Gel::BlockMaterialData::tEts
Range tEts
Test in the block.
Definition: Gels.hpp:102
MoFEM::VolumeElementForcesAndSourcesCore::VolumeElementForcesAndSourcesCore
VolumeElementForcesAndSourcesCore(Interface &m_field, const EntityType type=MBTET)
Definition: VolumeElementForcesAndSourcesCore.cpp:9
GelModule::Gel::MonitorPostProc::fE
string fE
Definition: Gels.hpp:2075
GelModule::Gel::OpJacobian::commonData
CommonData & commonData
Definition: Gels.hpp:545
GelModule::Gel::MonitorPostProc::preProcess
PetscErrorCode preProcess()
function is run at the beginning of loop
Definition: Gels.hpp:2112
GelModule::Gel::ConstitutiveEquation::C
ublas::matrix< TYPE, ublas::row_major, ublas::bounded_array< TYPE, 9 > > C
Cauchy deformation.
Definition: Gels.hpp:135
GelModule::Gel::OpLhsdMudMu::OpLhsdMudMu
OpLhsdMudMu(CommonData &common_data)
Definition: Gels.hpp:1844
MoFEM::Exceptions::rval
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Exceptions.hpp:74
GelModule::Gel::GelFE::postProcess
PetscErrorCode postProcess()
function is run at the end of loop
Definition: Gels.hpp:416
GelModule::Gel::ConstitutiveEquation::calculateStrainTotal
virtual PetscErrorCode calculateStrainTotal()
Calculate total strain.
Definition: Gels.hpp:166
FEMethod
GelModule::Gel::MonitorPostProc::postProcess
PetscErrorCode postProcess()
function is run at the end of loop
Definition: Gels.hpp:2122
GelModule::Gel::MonitorPostProc::iNit
bool iNit
Definition: Gels.hpp:2082
GelModule::Gel::ConstitutiveEquation::stressAlpha
ublas::matrix< TYPE, ublas::row_major, ublas::bounded_array< TYPE, 9 > > stressAlpha
Stress generated by spring alpha.
Definition: Gels.hpp:139
GelModule::Gel::BlockMaterialData
Gel material parameters.
Definition: Gels.hpp:88
GelModule::Gel::OpLhsdStrainHatdx::get_dStrainHat_dx
PetscErrorCode get_dStrainHat_dx(DataForcesAndSurcesCore::EntData &col_data, int gg)
Definition: Gels.hpp:1763
GelModule::Gel::OpRhsSolventConcetrationDot::commonData
CommonData & commonData
Definition: Gels.hpp:1261
GelModule::Gel::AssembleMatrix::K
MatrixDouble K
Definition: Gels.hpp:1358
MoFEM
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
GelModule::Gel::OpRhsSolventFlux::OpRhsSolventFlux
OpRhsSolventFlux(CommonData &common_data)
Definition: Gels.hpp:1210
GelModule::Gel::OpPostProcGel
Used to post proc stresses, energy, source term.
Definition: Gels.hpp:2014
a
constexpr double a
Definition: approx_sphere.cpp:30
GelModule::Gel::feRhs
GelFE feRhs
Definition: Gels.hpp:436
GelModule::Gel::AssembleVector::aSemble
PetscErrorCode aSemble(int row_side, EntityType row_type, DataForcesAndSurcesCore::EntData &row_data)
Definition: Gels.hpp:1124
GelModule::Gel::OpJacobian::recordResidualStrainHat
PetscErrorCode recordResidualStrainHat()
Definition: Gels.hpp:719
GelModule::Gel::OpJacobian::calculateAtIntPtsStressTotal
PetscErrorCode calculateAtIntPtsStressTotal()
Definition: Gels.hpp:833
GelModule::Gel::OpJacobian::calculateResidualBool
bool calculateResidualBool
Definition: Gels.hpp:547
GelModule::Gel::OpPostProcGel::doWork
PetscErrorCode doWork(int side, EntityType type, DataForcesAndSurcesCore::EntData &data)
Definition: Gels.hpp:2039
MoFEM::ForcesAndSourcesCore::UserDataOperator
Definition: ForcesAndSourcesCore.hpp:549
GelModule::Gel::OpJacobian::nbActiveResults
map< int, int > & nbActiveResults
Definition: Gels.hpp:551
MoFEM::TSMethod::ts
TS ts
time solver
Definition: LoopMethods.hpp:155
convert.type
type
Definition: convert.py:64
GelModule::Gel::OpRhsStressTotal::commonData
CommonData & commonData
Definition: Gels.hpp:1155
MoFEM::TSMethod::CTX_TSSETIJACOBIAN
@ CTX_TSSETIJACOBIAN
Definition: LoopMethods.hpp:143
GelModule::Gel::MonitorPostProc
Definition: Gels.hpp:2071
MoFEM::ForcesAndSourcesCore::UserDataOperator::OPCOL
@ OPCOL
operator doWork function is executed on FE columns
Definition: ForcesAndSourcesCore.hpp:568
GelModule::Gel::CommonData
Common data for gel model.
Definition: Gels.hpp:345
GelModule::Gel::OpJacobian::doWork
PetscErrorCode doWork(int row_side, EntityType row_type, DataForcesAndSurcesCore::EntData &row_data)
Definition: Gels.hpp:1076
GelModule::Gel::OpLhsdxdStrainHat::OpLhsdxdStrainHat
OpLhsdxdStrainHat(CommonData &common_data)
Definition: Gels.hpp:1582
GelModule::Gel::ConstitutiveEquation::calculateStressBetaHat
virtual PetscErrorCode calculateStressBetaHat()
Calculate stress due to concentration of solvent molecules.
Definition: Gels.hpp:280
MoFEM::TSMethod::ts_u_t
Vec & ts_u_t
time derivative of state vector
Definition: LoopMethods.hpp:166
GelModule::Gel::OpLhsdMudx::dSolventDot_dx
VectorDouble dSolventDot_dx
Definition: Gels.hpp:1934
GelModule::Gel::TagEvaluate
TagEvaluate
Definition: Gels.hpp:76
GelModule::Gel::CommonData::muNameDot
string muNameDot
Definition: Gels.hpp:352
GelModule::Gel::OpRhsSolventFlux::commonData
CommonData & commonData
Definition: Gels.hpp:1209
COL
@ COL
Definition: definitions.h:123
GelModule::Gel::OpLhsdxdMu::dStress_dMu
MatrixDouble dStress_dMu
Definition: Gels.hpp:1506
GelModule::Gel::OpLhsdMudx::commonData
CommonData & commonData
Definition: Gels.hpp:1926
GelModule::Gel::MonitorPostProc::pRoblem
string pRoblem
Definition: Gels.hpp:2074
GelModule::Gel::ConstitutiveEquation::residualStrainHat
ublas::matrix< TYPE, ublas::row_major, ublas::bounded_array< TYPE, 9 > > residualStrainHat
Residual for calculation epsilon hat.
Definition: Gels.hpp:154
GelModule::Gel::MonitorPostProc::tAgs
vector< int > tAgs
Definition: Gels.hpp:2078
GelModule::Gel::ConstitutiveEquation::calculateSolventFlux
virtual PetscErrorCode calculateSolventFlux()
Calculate flux.
Definition: Gels.hpp:319
GelModule::Gel::OpRhsSolventFlux::doWork
PetscErrorCode doWork(int row_side, EntityType row_type, DataForcesAndSurcesCore::EntData &row_data)
Definition: Gels.hpp:1214
GelModule::Gel::ConstitutiveEquation::~ConstitutiveEquation
virtual ~ConstitutiveEquation()
Definition: Gels.hpp:122
MoFEM::ForcesAndSourcesCore::UserDataOperator::getNumeredEntFiniteElementPtr
boost::shared_ptr< const NumeredEntFiniteElement > getNumeredEntFiniteElementPtr() const
Return raw pointer to NumeredEntFiniteElement.
Definition: ForcesAndSourcesCore.hpp:999
MoFEM::TSMethod::ts_ctx
TSContext ts_ctx
Definition: LoopMethods.hpp:157
GelModule::Gel::OpRhsStrainHat::commonData
CommonData & commonData
Definition: Gels.hpp:1312
GelModule::Gel::OpLhsdxdx::get_dStress_dx
PetscErrorCode get_dStress_dx(DataForcesAndSurcesCore::EntData &col_data, int gg)
Definition: Gels.hpp:1412
GelModule::Gel::ConstitutiveEquation::traceStrainHat
TYPE traceStrainHat
Definition: Gels.hpp:145
PostProcTemplateVolumeOnRefinedMesh::generateReferenceElementMesh
MoFEMErrorCode generateReferenceElementMesh()
Generate reference mesh on single element.
Definition: PostProcOnRefMesh.hpp:301
PostProcTemplateOnRefineMesh::addFieldValuesGradientPostProc
MoFEMErrorCode addFieldValuesGradientPostProc(const std::string field_name, Vec v=PETSC_NULL)
Add operator to post-process L2 or H1 field gradient.
Definition: PostProcOnRefMesh.hpp:195
GelModule::Gel::OpGetDataAtGaussPts
Definition: Gels.hpp:444
GelModule::Gel::OpGetDataAtGaussPts::calcGrad
bool calcGrad
Definition: Gels.hpp:448
MoFEM::DataOperator::doQuads
bool & doQuads
\deprectaed
Definition: DataOperators.hpp:92
MOFEM_OPERATION_UNSUCCESSFUL
@ MOFEM_OPERATION_UNSUCCESSFUL
Definition: definitions.h:34
GelModule::Gel::OpLhsdStrainHatdx::dStrainHat_dx
MatrixDouble dStrainHat_dx
Definition: Gels.hpp:1762
GelModule::Gel::OpLhsdxdStrainHat::dStress_dStrainHat
MatrixDouble dStress_dStrainHat
Definition: Gels.hpp:1589
GelModule::Gel::GelFE::getRule
int getRule(int order)
Definition: Gels.hpp:390
GelModule::Gel::ConstitutiveEquation::strainTotal
ublas::matrix< TYPE, ublas::row_major, ublas::bounded_array< TYPE, 9 > > strainTotal
Total strain applied at integration point.
Definition: Gels.hpp:137
GelModule::Gel::OpJacobian::recordSolventFlux
PetscErrorCode recordSolventFlux()
Definition: Gels.hpp:641
GelModule::Gel::OpJacobian::calculateJacobian
PetscErrorCode calculateJacobian(TagEvaluate te)
Definition: Gels.hpp:808
GelModule::Gel::OpJacobian::calculateAtIntPtrsResidualStrainHat
PetscErrorCode calculateAtIntPtrsResidualStrainHat()
Definition: Gels.hpp:1006
GelModule::Gel::ConstitutiveEquation::strainHatDot
ublas::matrix< TYPE, ublas::row_major, ublas::bounded_array< TYPE, 9 > > strainHatDot
Internal variable, strain in dashpot beta.
Definition: Gels.hpp:129
MoFEM::Types::VectorAdaptor
VectorShallowArrayAdaptor< double > VectorAdaptor
Definition: Types.hpp:115
GelModule::Gel::OpGetDataAtGaussPts::calcVal
bool calcVal
Definition: Gels.hpp:447
GelModule::Gel::OpRhsStrainHat::OpRhsStrainHat
OpRhsStrainHat(CommonData &common_data)
Definition: Gels.hpp:1313
GelModule::Gel::BlockMaterialData::vBetaHat
double vBetaHat
Poisson ratio dashpot.
Definition: Gels.hpp:95
MoFEM::VolumeElementForcesAndSourcesCore
Volume finite element base.
Definition: VolumeElementForcesAndSourcesCore.hpp:26
GelModule::Gel::OpRhsSolventConcetrationDot::doWork
PetscErrorCode doWork(int row_side, EntityType row_type, DataForcesAndSurcesCore::EntData &row_data)
Definition: Gels.hpp:1266
GelModule::Gel::OpJacobian::calculateFunction
PetscErrorCode calculateFunction(TagEvaluate te, double *ptr)
Definition: Gels.hpp:786
GelModule::Gel::OpLhsdMudMu
Assemble matrix .
Definition: Gels.hpp:1842
GelModule::Gel::ConstitutiveEquation::calculateStressBeta
virtual PetscErrorCode calculateStressBeta()
Calculate stress in spring beta.
Definition: Gels.hpp:226
GelModule::Gel::OpLhsdxdMu::get_dStress_dx
PetscErrorCode get_dStress_dx(DataForcesAndSurcesCore::EntData &col_data, int gg)
Definition: Gels.hpp:1507
MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator
Definition: VolumeElementForcesAndSourcesCore.hpp:108
GelModule::Gel::GelFE::addToRule
int addToRule
Takes into account HO geometry.
Definition: Gels.hpp:382
GelModule::Gel::CommonData::dataAtGaussPts
map< string, vector< VectorDouble > > dataAtGaussPts
Definition: Gels.hpp:354
GelModule::Gel::commonData
CommonData commonData
Definition: Gels.hpp:376
GelModule::Gel::CommonData::solventFlux
vector< VectorDouble3 > solventFlux
Definition: Gels.hpp:358
GelModule::Gel::OpRhsStressTotal::OpRhsStressTotal
OpRhsStressTotal(CommonData &common_data)
Definition: Gels.hpp:1156
EntData
EntitiesFieldData::EntData EntData
Definition: child_and_parent.cpp:37
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
MoFEM::ForcesAndSourcesCore::UserDataOperator::getFEMethod
const FEMethod * getFEMethod() const
Return raw pointer to Finite Element Method object.
Definition: ForcesAndSourcesCore.hpp:1041
GelModule::Gel::CommonData::jacSolventFlux
vector< MatrixDouble > jacSolventFlux
Definition: Gels.hpp:364
GelModule::Gel::RESIDUALSTRAINHAT
@ RESIDUALSTRAINHAT
Definition: Gels.hpp:80
GelModule::Gel::OpJacobian::recordStressTotal
PetscErrorCode recordStressTotal()
Definition: Gels.hpp:577
GelModule::Gel::GelFE::preProcess
PetscErrorCode preProcess()
function is run at the beginning of loop
Definition: Gels.hpp:394
N
const int N
Definition: speed_test.cpp:3
GelModule::Gel::OpJacobian::recordOn
bool & recordOn
Definition: Gels.hpp:549
Range
GelModule::Gel::OpRhsSolventConcetrationDot
Calculating right hand side.
Definition: Gels.hpp:1260
MoFEM::DataOperator::doEdges
bool & doEdges
\deprectaed If false skip edges
Definition: DataOperators.hpp:91
FTensor::dd
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T * > &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: ddTensor0.hpp:33
GelModule::Gel::OpLhsdStrainHatdx::OpLhsdStrainHatdx
OpLhsdStrainHatdx(CommonData &common_data)
Definition: Gels.hpp:1755
GelModule::Gel::OpLhsdxdMu::doWork
PetscErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, DataForcesAndSurcesCore::EntData &row_data, DataForcesAndSurcesCore::EntData &col_data)
Definition: Gels.hpp:1530
GelModule::Gel::MonitorPostProc::MonitorPostProc
MonitorPostProc(MoFEM::Interface &m_field, string problem, string fe, CommonData &common_data, boost::shared_ptr< Gel::ConstitutiveEquation< adouble > > &ce, vector< int > tags)
Definition: Gels.hpp:2085
PostProcVolumeOnRefinedMesh
Post processing.
Definition: PostProcOnRefMesh.hpp:955
GelModule::Gel::CommonData::jacStressTotal
vector< MatrixDouble > jacStressTotal
Definition: Gels.hpp:363
GelModule::Gel::OpLhsdStrainHatdStrainHat::commonData
CommonData & commonData
Definition: Gels.hpp:1672
PostProcTemplateOnRefineMesh::mapGaussPts
std::vector< EntityHandle > mapGaussPts
Definition: PostProcOnRefMesh.hpp:125
GelModule::Gel::OpGetDataAtGaussPts::commonData
CommonData & commonData
Definition: Gels.hpp:446
GelModule::Gel::AssembleVector::nF
VectorDouble nF
Definition: Gels.hpp:1123
GelModule::Gel::ConstitutiveEquation::calculateTraceStrainTotalDot
virtual PetscErrorCode calculateTraceStrainTotalDot()
Definition: Gels.hpp:181
GelModule::Gel::BlockMaterialData::oMega
double oMega
Volume per solvent molecule.
Definition: Gels.hpp:99
GelModule::Gel::OpJacobian::recordSolventConcentrationDot
PetscErrorCode recordSolventConcentrationDot()
Definition: Gels.hpp:677
GelModule::Gel::OpLhsdxdStrainHat
Assemble matrix .
Definition: Gels.hpp:1580
MoFEM::Exceptions::ierr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:76
GelModule::Gel::ConstitutiveEquation::mU
TYPE mU
Solvent concentration.
Definition: Gels.hpp:130
mu
double mu
Definition: dynamic_first_order_con_law.cpp:98
MoFEM::ForcesAndSourcesCore::getOpPtrVector
boost::ptr_deque< UserDataOperator > & getOpPtrVector()
Use to push back operator for row operator.
Definition: ForcesAndSourcesCore.hpp:83
MoFEM::BasicMethod::problemPtr
const Problem * problemPtr
raw pointer to problem
Definition: LoopMethods.hpp:250
GelModule::Gel::ConstitutiveEquation::calculateSolventConcentrationDot
virtual PetscErrorCode calculateSolventConcentrationDot()
Calculate solvent concentration rate.
Definition: Gels.hpp:332
GelModule::Gel::OpJacobian::calculateAtIntPtsSolventDot
PetscErrorCode calculateAtIntPtsSolventDot()
Definition: Gels.hpp:958
GelModule::Gel::BlockMaterialData::gAlpha
double gAlpha
Shear modulus spring alpha.
Definition: Gels.hpp:92
GelModule::Gel::OpRhsStressTotal
Assemble internal force vector.
Definition: Gels.hpp:1154
GelModule::Gel::OpGetDataAtGaussPts::zeroAtType
EntityType zeroAtType
Definition: Gels.hpp:449
GelModule::Gel::OpLhsdStrainHatdStrainHat
Assemble matrix .
Definition: Gels.hpp:1671
GelModule::Gel::CommonData::residualStrainHat
vector< VectorDouble9 > residualStrainHat
Definition: Gels.hpp:360
GelModule::Gel::BlockMaterialData::vIscosity
double vIscosity
Viscosity of Gel.
Definition: Gels.hpp:98
MoFEM::Types::VectorDouble
UBlasVector< double > VectorDouble
Definition: Types.hpp:68
GelModule::Gel::MonitorPostProc::postProc
PostProcVolumeOnRefinedMesh postProc
Definition: Gels.hpp:2080
MoFEM::TSMethod::CTX_TSSETIFUNCTION
@ CTX_TSSETIFUNCTION
Definition: LoopMethods.hpp:142
GelModule::Gel::ConstitutiveEquation
Constitutive model functions.
Definition: Gels.hpp:114
GelModule::Gel::MonitorPostProc::pRT
int pRT
Definition: Gels.hpp:2083
MoFEM::Types::MatrixAdaptor
MatrixShallowArrayAdaptor< double > MatrixAdaptor
Matrix adaptor.
Definition: Types.hpp:132
GelModule::Gel::ConstitutiveEquation::strainHatFlux
ublas::matrix< TYPE, ublas::row_major, ublas::bounded_array< TYPE, 9 > > strainHatFlux
Rate of dashpot (beta) strain.
Definition: Gels.hpp:141
GelModule::Gel::OpLhsdxdx::commonData
CommonData & commonData
Definition: Gels.hpp:1403
GelModule::Gel::AssembleVector
Definition: Gels.hpp:1118
GelModule::Gel::OpLhsdStrainHatdx::doWork
PetscErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, DataForcesAndSurcesCore::EntData &row_data, DataForcesAndSurcesCore::EntData &col_data)
Definition: Gels.hpp:1792
GelModule::Gel::OpPostProcGel::postProcMesh
moab::Interface & postProcMesh
Definition: Gels.hpp:2017
GelModule::Gel::OpLhsdxdStrainHat::get_dStress_dStrainHat
PetscErrorCode get_dStress_dStrainHat(DataForcesAndSurcesCore::EntData &col_data, int gg)
Definition: Gels.hpp:1590
GelModule::Gel::OpLhsdStrainHatdx::commonData
CommonData & commonData
Definition: Gels.hpp:1754
GelModule::Gel::CommonData::nbActiveResults
map< int, int > nbActiveResults
Definition: Gels.hpp:369
GelModule::Gel::ConstitutiveEquation::stressBetaHat
ublas::matrix< TYPE, ublas::row_major, ublas::bounded_array< TYPE, 9 > > stressBetaHat
Stress as result of volume change due to solvent concentration.
Definition: Gels.hpp:142
GelModule::Gel::ConstitutiveEquation::FDot
ublas::matrix< TYPE, ublas::row_major, ublas::bounded_array< TYPE, 9 > > FDot
Rate of gradient of deformation.
Definition: Gels.hpp:127
GelModule::Gel::ConstitutiveEquation::strainHat
ublas::matrix< TYPE, ublas::row_major, ublas::bounded_array< TYPE, 9 > > strainHat
Internal variable, strain in dashpot beta.
Definition: Gels.hpp:128
GelModule::Gel::OpGetDataAtGaussPts::doWork
PetscErrorCode doWork(int side, EntityType type, DataForcesAndSurcesCore::EntData &data)
Operator field value.
Definition: Gels.hpp:470
GelModule::Gel::OpRhsSolventConcetrationDot::OpRhsSolventConcetrationDot
OpRhsSolventConcetrationDot(CommonData &common_data)
Definition: Gels.hpp:1262
MoFEM::ForcesAndSourcesCore::postProcess
virtual MoFEMErrorCode postProcess()
function is run at the end of loop
Definition: ForcesAndSourcesCore.cpp:1981
GelModule::Gel::CommonData::jacRowPtr
vector< double * > jacRowPtr
Definition: Gels.hpp:362
MoFEM::TSMethod::ts_B
Mat & ts_B
Preconditioner for ts_A.
Definition: LoopMethods.hpp:172
MoFEM::Types::VectorDouble9
VectorBoundedArray< double, 9 > VectorDouble9
Definition: Types.hpp:96
GelModule::Gel::OpJacobian::nbGaussPts
int nbGaussPts
Definition: Gels.hpp:574
GelModule::Gel::ConstitutiveEquation::stressBeta
ublas::matrix< TYPE, ublas::row_major, ublas::bounded_array< TYPE, 9 > > stressBeta
Stress generated by spring beta.
Definition: Gels.hpp:140
GelModule::Gel::AssembleMatrix::AssembleMatrix
AssembleMatrix(string row_name, string col_name)
Definition: Gels.hpp:1353
MoFEM::DataOperator::sYmm
bool sYmm
If true assume that matrix is symmetric structure.
Definition: DataOperators.hpp:82
MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator::getVolumeFE
VolumeElementForcesAndSourcesCore * getVolumeFE() const
return pointer to Generic Volume Finite Element object
Definition: VolumeElementForcesAndSourcesCore.hpp:185
MoFEM::PetscOptionsGetInt
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
Definition: DeprecatedPetsc.hpp:142
GelModule::Gel::MonitorPostProc::operator()
PetscErrorCode operator()()
function is run for every finite element
Definition: Gels.hpp:2117
GelModule::Gel::OpPostProcGel::mapGaussPts
std::vector< EntityHandle > & mapGaussPts
Definition: Gels.hpp:2018
GelModule::Gel::BlockMaterialData::vAlpha
double vAlpha
Poisson ratio spring alpha.
Definition: Gels.hpp:91
GelModule::Gel::Gel
Gel(MoFEM::Interface &m_field)
Definition: Gels.hpp:438
GelModule::Gel::OpLhsdMudx::OpLhsdMudx
OpLhsdMudx(CommonData &common_data)
Definition: Gels.hpp:1927
GelModule::Gel::ConstitutiveEquation::F
ublas::matrix< TYPE, ublas::row_major, ublas::bounded_array< TYPE, 9 > > F
Gradient of deformation.
Definition: Gels.hpp:126
GelModule::Gel::constitutiveEquationPtr
boost::shared_ptr< Gel::ConstitutiveEquation< adouble > > constitutiveEquationPtr
Definition: Gels.hpp:340
GelModule::Gel::CommonData::CommonData
CommonData()
Definition: Gels.hpp:371
GelModule::Gel::OpRhsSolventFlux
Calculate internal forces for solvent flux.
Definition: Gels.hpp:1208
GelModule::Gel::OpLhsdxdMu::OpLhsdxdMu
OpLhsdxdMu(CommonData &common_data)
Definition: Gels.hpp:1499
GelModule::Gel::OpLhsdxdx
Assemble matrix .
Definition: Gels.hpp:1402
GelModule::Gel::OpLhsdxdx::doWork
PetscErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, DataForcesAndSurcesCore::EntData &row_data, DataForcesAndSurcesCore::EntData &col_data)
Definition: Gels.hpp:1441
GelModule::Gel::ConstitutiveEquation::traceStrainTotalDot
TYPE traceStrainTotalDot
Definition: Gels.hpp:147
GelModule::Gel::GelFE
definition of volume element
Definition: Gels.hpp:379
GelModule::Gel::OpJacobian::nbActiveVariables
map< int, int > & nbActiveVariables
Definition: Gels.hpp:550
MoFEM::ForcesAndSourcesCore::mField
Interface & mField
Definition: ForcesAndSourcesCore.hpp:24
GelModule::Gel::ConstitutiveEquation::calculateResidualStrainHat
virtual PetscErrorCode calculateResidualStrainHat()
Definition: Gels.hpp:301
F
@ F
Definition: free_surface.cpp:394
GelModule::Gel::OpLhsdMudMu::doWork
PetscErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, DataForcesAndSurcesCore::EntData &row_data, DataForcesAndSurcesCore::EntData &col_data)
Definition: Gels.hpp:1876
MoFEM::ForcesAndSourcesCore::UserDataOperator::OPROW
@ OPROW
operator doWork function is executed on FE rows
Definition: ForcesAndSourcesCore.hpp:567
PostProcTemplateOnRefineMesh::addFieldValuesPostProc
MoFEMErrorCode addFieldValuesPostProc(const std::string field_name, Vec v=PETSC_NULL)
Add operator to post-process L2, H1, Hdiv, Hcurl field value.
Definition: PostProcOnRefMesh.hpp:153
GelModule::Gel::MonitorPostProc::commonData
CommonData & commonData
Definition: Gels.hpp:2076