v0.15.0
Loading...
Searching...
No Matches
ClosestPointProjection.cpp
Go to the documentation of this file.
1/**
2 * \file ClosestPointProjection.cpp
3 * \ingroup adoc_plasticity
4 *
5 * \brief Implementation of nested integration algorithm for plasticity
6 *
7 */
8
9#include <MoFEM.hpp>
10using namespace MoFEM;
11
12#include <ADOLCPlasticity.hpp>
13namespace ADOLCPlasticity {
14
16
17 if (!LogManager::checkIfChannelExist("ADOLCPlasticityWold")) {
18 auto core_log = logging::core::get();
19
21 "ADOLCPlasticityWold"));
23 "ADOLCPlasticitySync"));
25 "ADOLCPlasticitySelf"));
26
27 LogManager::setLog("ADOLCPlasticityWold");
28 LogManager::setLog("ADOLCPlasticitySync");
29 LogManager::setLog("ADOLCPlasticitySelf");
30
31 MOFEM_LOG_TAG("ADOLCPlasticityWold", "ADOL-C Plasticity");
32 MOFEM_LOG_TAG("ADOLCPlasticitySync", "ADOL-C Plasticity");
33 MOFEM_LOG_TAG("ADOLCPlasticitySelf", "ADOL-C Plasticity");
34 }
35
36 tapesTags = {0, 1, 2}; //< set tapes default tags
37
38 implHessianW = PETSC_FALSE;
39 CHKERR PetscOptionsGetBool(PETSC_NULLPTR, "-impl_hessianW", &implHessianW, 0);
40
41}
42
45
46 auto plastic_strain = getPlasticStrain();
47 auto total_strain = getTotalStrain();
48 auto internal_variables = getInternalVariables();
49
51 {
52 // active variables
53 a_plasticStrain.resize(6, false);
54 for (int ii = 0; ii < 6; ii++) {
55 a_plasticStrain[ii] <<= plastic_strain[ii];
56 }
57 a_sTrain.resize(6, false);
58 for (int ii = 0; ii < 6; ii++) {
59 a_sTrain[ii] <<= total_strain[ii];
60 }
62 for (unsigned int ii = 0; ii < nbInternalVariables; ii++) {
63 a_internalVariables[ii] <<= internal_variables[ii];
64 }
65 // evaluete functions
67 a_w >>= w;
68 }
69 trace_off();
71}
72
75
76 auto stress = getStress();
77 auto internal_fluxes = getInternalFluxes();
78
80 {
81 // active variables
82 a_sTress.resize(6, false);
83 for (int ii = 0; ii < 6; ii++) {
84 a_sTress[ii] <<= stress[ii];
85 }
87 for (unsigned int ii = 0; ii < nbInternalVariables; ii++) {
88 a_internalFluxes[ii] <<= internal_fluxes[ii];
89 }
90 // evaluete functions
92 // return variables
93 a_y >>= y;
94 }
95 trace_off();
97}
98
101
102 auto stress = getStress();
103 auto internal_fluxes = getInternalFluxes();
104
106 {
107 // active variables
108 a_sTress.resize(6, false);
109 for (int ii = 0; ii < 6; ii++) {
110 a_sTress[ii] <<= stress[ii];
111 }
113 for (unsigned int ii = 0; ii < nbInternalVariables; ii++) {
114 a_internalFluxes[ii] <<= internal_fluxes[ii];
115 }
116 // evaluete functions
118 // return variables
119 a_h >>= h;
120 }
121 trace_off();
123}
124
127 int r;
128 int adloc_return_value = 0;
129 r = ::function(tapesTags[ClosestPointProjection::W], 1,
130 activeVariablesW.size(), &activeVariablesW[0], &w);
131 if (r < adloc_return_value) {
132 SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
133 "ADOL-C function evaluation with error");
134 }
136 &activeVariablesW[0], &gradientW[0]);
137 if (r < adloc_return_value) {
138 SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
139 "ADOL-C function evaluation with error");
140 }
141
142 hessianW.resize(activeVariablesW.size(), activeVariablesW.size(), false);
143 hessianW.clear();
144 vector<double *> hessian_w(activeVariablesW.size());
145 for (unsigned int dd = 0; dd < activeVariablesW.size(); dd++) {
146 hessian_w[dd] = &hessianW(dd, 0);
147 }
148 if (!implHessianW) {
149 // call adolc hessian (energy, active variables)
151 &activeVariablesW[0], &hessian_w[0]);
152 if (r < adloc_return_value) {
153 SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
154 "ADOL-C function evaluation with error");
155 }
156 } else {
157 // call hard coded hessian depending on material model
158 CHKERR codedHessianW(hessian_w);
159 }
160
161 partialWStrainPlasticStrain.resize(6, 6, false);
162 for (int ii = 0; ii < 6; ii++) {
163 for (int jj = 0; jj < 6; jj++) {
164 partialWStrainPlasticStrain(ii, jj) = hessianW(6 + ii, jj);
165 }
166 }
167 C.resize(6, 6, false);
168 for (int ii = 0; ii < 6; ii++) {
169 for (int jj = 0; jj <= ii; jj++) {
170 C(ii, jj) = hessianW(6 + ii, 6 + jj);
171 }
172 }
174 for (unsigned int ii = 0; ii < nbInternalVariables; ii++) {
175 for (unsigned int jj = 0; jj <= ii; jj++) {
176 D(ii, jj) = hessianW(12 + ii, 12 + jj);
177 }
178 }
180}
181
185 int r;
186 int adloc_return_value = 0;
187 r = ::function(tapesTags[ClosestPointProjection::W], 1,
188 activeVariablesW.size(), &activeVariablesW[0], &w);
189 if (r < adloc_return_value) {
190 SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
191 "ADOL-C function evaluation with error");
192 }
194 &activeVariablesW[0], &gradientW[0]);
195 if (r < adloc_return_value) {
196 SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
197 "ADOL-C function evaluation with error");
198 }
200}
201
204 auto active_variables_yh = getActiveVariablesYH();
205 int r;
206 int adloc_return_value = 0;
207 r = ::function(tapesTags[ClosestPointProjection::Y], 1,
208 active_variables_yh.size(), &active_variables_yh[0], &y);
209 if (r < adloc_return_value) {
210 SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
211 "ADOL-C function evaluation with error");
212 }
213 gradientY.resize(active_variables_yh.size());
214 r = gradient(tapesTags[ClosestPointProjection::Y], active_variables_yh.size(),
215 &active_variables_yh[0], &gradientY[0]);
216 if (r < adloc_return_value) {
217 SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
218 "ADOL-C function evaluation with error");
219 }
221 VectorAdaptor(6, ublas::shallow_array_adaptor<double>(6, &gradientY[0]));
224 ublas::shallow_array_adaptor<double>(nbInternalVariables, &gradientY[6]));
226}
230 auto active_variables_yh = getActiveVariablesYH();
231 int r;
232 int adloc_return_value = 0;
233 r = ::function(tapesTags[ClosestPointProjection::Y], 1,
234 active_variables_yh.size(), &active_variables_yh[0], &y);
235 if (r < adloc_return_value) {
236 SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
237 "ADOL-C function evaluation with error");
238 }
240}
243 auto active_variables_yh = getActiveVariablesYH();
244 int r;
245 int adloc_return_value = 0;
246 r = ::function(tapesTags[ClosestPointProjection::H], 1,
247 active_variables_yh.size(), &active_variables_yh[0], &h);
248 if (r < adloc_return_value) {
249 SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
250 "ADOL-C function evaluation with error");
251 }
252 gradientH.resize(active_variables_yh.size());
253 r = gradient(tapesTags[ClosestPointProjection::H], active_variables_yh.size(),
254 &active_variables_yh[0], &gradientH[0]);
255 if (r < adloc_return_value) {
256 SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
257 "ADOL-C function evaluation with error");
258 }
259 hessianH.resize(6 + nbInternalVariables, 6 + nbInternalVariables, false);
260 hessianH.clear();
261 vector<double *> hessian_h(active_variables_yh.size());
262 for (int dd = 0; dd < active_variables_yh.size(); dd++) {
263 hessian_h[dd] = &hessianH(dd, 0);
264 }
265 r = hessian(tapesTags[ClosestPointProjection::H], active_variables_yh.size(),
266 &active_variables_yh[0], &hessian_h[0]);
267 if (r < adloc_return_value) {
268 SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
269 "ADOL-C function evaluation with error");
270 }
272 VectorAdaptor(6, ublas::shallow_array_adaptor<double>(6, &gradientH[0]));
275 ublas::shallow_array_adaptor<double>(nbInternalVariables, &gradientH[6]));
276 partialHFlux *= -1;
277 partial2HSigma.resize(6, 6, false);
278 for (int ii = 0; ii < 6; ii++) {
279 for (int jj = 0; jj <= ii; jj++) {
280 partial2HSigma(ii, jj) = hessianH(ii, jj);
281 }
282 }
284 for (unsigned int ii = 0; ii < nbInternalVariables; ii++) {
285 for (unsigned int jj = 0; jj <= ii; jj++) {
286 partial2HFlux(ii, jj) = -hessianH(6 + ii, 6 + jj);
287 }
288 }
289 partial2HSigmaFlux.resize(6, nbInternalVariables, false);
290 partial2HSigmaFlux.clear();
291 for (int ii = 0; ii < 6; ii++) {
292 for (unsigned int jj = 0; jj < nbInternalVariables; jj++) {
293 partial2HSigmaFlux(ii, jj) = -hessianH(6 + jj, ii);
294 }
295 }
297}
300 auto active_variables_yh = getActiveVariablesYH();
301 int r;
302 int adloc_return_value = 0;
303 r = ::function(tapesTags[ClosestPointProjection::H], 1,
304 active_variables_yh.size(), &active_variables_yh[0], &h);
305 if (r < adloc_return_value) {
306 SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
307 "ADOL-C function evaluation with error");
308 }
309 gradientH.resize(active_variables_yh.size());
310 r = gradient(tapesTags[ClosestPointProjection::H], active_variables_yh.size(),
311 &active_variables_yh[0], &gradientH[0]);
312 if (r < adloc_return_value) {
313 SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
314 "ADOL-C function evaluation with error");
315 }
317 VectorAdaptor(6, ublas::shallow_array_adaptor<double>(6, &gradientH[0]));
320 ublas::shallow_array_adaptor<double>(nbInternalVariables, &gradientH[6]));
321 partialHFlux *= -1;
323}
324
327 PetscInt n;
328 n = 1 + 6 + nbInternalVariables;
329 dataA.resize(n, n, false);
330 Mat A_tmp;
331 Vec R_tmp, Chi_tmp, dChi_tmp;
332 CHKERR MatCreateSeqDense(PETSC_COMM_SELF, n, n, &dataA(0, 0), &A_tmp);
333 CHKERR VecCreateSeq(PETSC_COMM_SELF, n, &R_tmp);
334 CHKERR VecCreateSeq(PETSC_COMM_SELF, n, &Chi_tmp);
335 CHKERR VecCreateSeq(PETSC_COMM_SELF, n, &dChi_tmp);
336
337 A = SmartPetscObj<Mat>(A_tmp);
338 R = SmartPetscObj<Vec>(R_tmp);
339 Chi = SmartPetscObj<Vec>(Chi_tmp);
340 dChi = SmartPetscObj<Vec>(dChi_tmp);
341
343}
344
353
361
369
373
374 auto plastic_strain = getPlasticStrain();
375 auto internal_variables = getInternalVariables();
376
377 // Residual
378 double *array;
379 CHKERR VecGetArray(R, &array);
380 for (int ii = 0; ii < 6; ii++) {
381 array[ii] = -plastic_strain[ii] + plasticStrain0[ii] +
383 }
384 for (unsigned int ii = 0; ii < nbInternalVariables; ii++) {
385 array[6 + ii] = -internal_variables[ii] + internalVariables0[ii] +
387 }
388 array[6 + nbInternalVariables] = y;
389 CHKERR VecRestoreArray(R, &array);
391}
392
395 // matrix A
396 CHKERR MatZeroEntries(A);
397 // row 0 (Strain)
398 MatrixDouble a00 = prod(partial2HSigma, partialWStrainPlasticStrain);
399 MatrixDouble a01 = prod(partial2HSigmaFlux, D);
400 for (int ii = 0; ii < 6; ii++) {
401 for (int jj = 0; jj < 6; jj++) {
402 dataA(ii, jj) = deltaGamma * a00(ii, jj);
403 }
404 for (unsigned int jj = 0; jj < nbInternalVariables; jj++) {
405 dataA(ii, 6 + jj) = deltaGamma * a01(ii, jj);
406 }
407 dataA(ii, ii) -= 1;
408 }
409 for (int ii = 0; ii < 6; ii++) {
411 }
412 // row 1 (Fluxes)
413 MatrixDouble a11 = prod(partial2HFlux, D);
414 MatrixDouble a10 =
416 for (unsigned int ii = 0; ii < nbInternalVariables; ii++) {
417 for (int jj = 0; jj < 6; jj++) {
418 dataA(6 + ii, jj) += deltaGamma * a10(ii, jj);
419 }
420 for (unsigned int jj = 0; jj < nbInternalVariables; jj++) {
421 dataA(6 + ii, 6 + jj) += deltaGamma * a11(ii, jj);
422 }
423 dataA(6 + ii, 6 + ii) -= 1;
424 }
425 for (unsigned int ii = 0; ii < nbInternalVariables; ii++) {
426 dataA(6 + ii, 6 + nbInternalVariables) = partialHFlux[ii];
427 }
428 // row 3 (Plastic multiplier)
429 VectorDouble partial_y_sigma_c =
431 VectorDouble partial_y_flux_d = prod(trans(D), partialYFlux);
432 for (unsigned int dd = 0; dd < partial_y_sigma_c.size(); dd++) {
433 dataA(6 + nbInternalVariables, dd) = partial_y_sigma_c[dd];
434 }
435 for (unsigned int dd = 0; dd < partial_y_flux_d.size(); dd++) {
436 dataA(6 + nbInternalVariables, 6 + dd) = partial_y_flux_d[dd];
437 }
439 CHKERR MatAssemblyBegin(A, MAT_FINAL_ASSEMBLY);
440 CHKERR MatAssemblyEnd(A, MAT_FINAL_ASSEMBLY);
442}
443
446 sNes = createSNES(PETSC_COMM_SELF);
447 CHKERR SNESSetFunction(sNes, R, ADOLCPlasticityRes, (void *)this);
448 CHKERR SNESSetJacobian(sNes, A, A, ADOLCPlasticityJac, (void *)this);
449
450 KSP ksp;
451 PC pc;
452 SNESLineSearch line_search;
453 CHKERR SNESGetKSP(sNes, &ksp);
454 CHKERR KSPGetPC(ksp, &pc);
455 CHKERR KSPSetType(ksp, KSPPREONLY);
456 CHKERR PCSetType(pc, PCLU);
457 CHKERR SNESSetTolerances(sNes, 1e-8, 1e-6, 1e-12, 20, 1000);
458 CHKERR SNESGetLineSearch(sNes, &line_search);
459 // CHKERR SNESLineSearchSetType(line_search, SNESLINESEARCHBASIC);
460 CHKERR SNESLineSearchSetType(line_search, SNESLINESEARCHBT);
461 // CHKERR SNESLineSearchSetType(line_search, SNESLINESEARCHL2);
462
463 CHKERR SNESAppendOptionsPrefix(sNes, "cp_");
464 CHKERR SNESSetFromOptions(sNes);
465
467}
468
472
473 auto plastic_strain = getPlasticStrain();
474 auto internal_variables = getInternalVariables();
475
476 {
477 double *array;
478 CHKERR VecGetArray(Chi, &array);
479 for (int ii = 0; ii < 6; ii++) {
480 array[ii] = plastic_strain[ii];
481 }
482 int nb_internal_variables = nbInternalVariables;
483 for (unsigned int ii = 0; ii < nb_internal_variables; ii++) {
484 array[6 + ii] = internal_variables[ii];
485 }
486 deltaGamma = 0;
487 CHKERR VecRestoreArray(Chi, &array);
488 }
489
490 CHKERR SNESSolve(sNes, PETSC_NULLPTR, Chi);
491 SNESConvergedReason reason;
492 CHKERR SNESGetConvergedReason(sNes, &reason);
493 if (reason < 0) {
494 int its;
495 CHKERR SNESGetIterationNumber(sNes, &its);
497 "ADOLCPlasticitySelf", Sev::warning,
498 "Plasticity Closest Point Projection - number of Newton iterations = %d",
499 its);
500 plastic_strain = plasticStrain0;
501 internal_variables = internalVariables0;
502 deltaGamma = 0;
503 } else {
504 double *array;
505 CHKERR VecGetArray(Chi, &array);
506 for (int ii = 0; ii < 6; ii++) {
507 plastic_strain[ii] = array[ii];
508 }
509 int nb_internal_variables = nbInternalVariables;
510 for (unsigned int ii = 0; ii < nb_internal_variables; ii++) {
511 internal_variables[ii] = array[6 + ii];
512 }
513 deltaGamma = array[6 + nb_internal_variables];
514 CHKERR VecRestoreArray(Chi, &array);
515 }
517}
518
524 Ep.resize(6, 6, false);
525 MatrixDouble ep_row; // inrement internal varaibles as result of incremen of
526 // total strain
527 ep_row = deltaGamma * prod(partial2HSigma, C);
528 MatrixDouble alpha_row;
529 alpha_row = deltaGamma * prod(trans(partial2HSigmaFlux), C);
530 VectorDouble y_row;
531 y_row = prod(C, partialYSigma);
532 const int n = 6 + nbInternalVariables;
533 // Iterate strains
534 for (int dd = 0; dd < 6; dd++) {
535 CHKERR VecZeroEntries(R);
536 double *array;
537 CHKERR VecGetArray(R, &array);
538 {
539 for (auto ii = 0; ii < 6; ii++) {
540 array[ii] = ep_row(ii, dd);
541 }
542 for (auto ii = 0; ii < nbInternalVariables; ii++) {
543 array[6 + ii] = alpha_row(ii, dd);
544 }
545 array[n] = y_row[dd];
546 }
547 CHKERR VecRestoreArray(R, &array);
548 CHKERR VecAssemblyBegin(R);
549 CHKERR VecAssemblyEnd(R);
550
551 KSP ksp;
552 CHKERR SNESGetKSP(sNes, &ksp);
553 CHKERR KSPSolve(ksp, R, dChi);
554 CHKERR VecGetArray(dChi, &array);
555 {
556 for (auto ii = 0; ii < 6; ii++) {
557 Ep(ii, dd) = array[ii];
558 }
559 }
560 CHKERR VecRestoreArray(dChi, &array);
561 }
562 Cp.resize(6, 6, false);
563 noalias(Cp) = prod(C, Ep);
564 Cep.resize(6, 6, false);
565 noalias(Cep) = C + Cp;
567}
568
569MoFEMErrorCode ADOLCPlasticityRes(SNES snes, Vec chi, Vec r, void *ctx) {
572 cp = (ClosestPointProjection *)ctx;
573
574 auto plastic_strain = cp->getPlasticStrain();
575 auto internal_variables = cp->getInternalVariables();
576
577 {
578 const double *array;
579 CHKERR VecGetArrayRead(chi, &array);
580 for (auto ii = 0; ii < 6; ii++) {
581 plastic_strain[ii] = array[ii];
582 }
583 for (auto ii = 0; ii < cp->nbInternalVariables; ii++) {
584 internal_variables[ii] = array[6 + ii];
585 }
586 cp->deltaGamma = array[6 + cp->nbInternalVariables];
587 CHKERR VecRestoreArrayRead(chi, &array);
588 }
590 CHKERR cp->calculateR(r);
591
593}
594
595MoFEMErrorCode ADOLCPlasticityJac(SNES snes, Vec chi, Mat A, Mat,
596 void *ctx) {
599 cp = (ClosestPointProjection *)ctx;
600
601 auto plastic_strain = cp->getPlasticStrain();
602 auto internal_variables = cp->getInternalVariables();
603
604 {
605 const double *array;
606 CHKERR VecGetArrayRead(chi, &array);
607 for (auto ii = 0; ii < 6; ii++) {
608 plastic_strain[ii] = array[ii];
609 }
610 for (auto ii = 0; ii < cp->nbInternalVariables; ii++) {
611 internal_variables[ii] = array[6 + ii];
612 }
613 cp->deltaGamma = array[6 + cp->nbInternalVariables];
614 CHKERR VecRestoreArrayRead(chi, &array);
615 }
617 CHKERR cp->calculateA();
619}
620
623 VectorDouble active(12 + nbInternalVariables);
624 VectorDouble gradient(12 + nbInternalVariables);
625 auto tmp_active = getVectorAdaptor(&(active[0]), 12 + nbInternalVariables);
626 auto tmp_gradient =
627 getVectorAdaptor(&(gradient[0]), 12 + nbInternalVariables);
628 activeVariablesW.swap(tmp_active);
629 gradientW.swap(tmp_gradient);
632}
633
634} // namespace ADOLCPlasticity
#define MOFEM_LOG_C(channel, severity, format,...)
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_OPERATION_UNSUCCESSFUL
Definition definitions.h:34
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
@ R
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
const double n
refractive index of diffusive medium
MoFEMErrorCode ADOLCPlasticityJac(SNES, Vec, Mat, Mat, void *ctx)
Internal SNES function used at integration points to calulate tangent matrix.
MoFEMErrorCode ADOLCPlasticityRes(SNES snes, Vec chi, Vec r, void *ctx)
Internal SNES function used at integration points to calulate stress.
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
VectorShallowArrayAdaptor< double > VectorAdaptor
Definition Types.hpp:115
implementation of Data Operators for Forces and Sources
Definition Common.hpp:10
auto getVectorAdaptor(T1 ptr, const size_t n)
Get Vector adaptor.
Definition Templates.hpp:31
auto createSNES(MPI_Comm comm)
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)
Closest point projection algorithm.
std::array< int, LAST_TAPE > tapesTags
MoFEMErrorCode solveClosestProjection()
Solve nonlinear system of equations to find stress, internal fluxes, and Lagrange plastic multiplier.
MoFEMErrorCode recordH()
Record flow potential.
friend MoFEMErrorCode ADOLCPlasticityRes(SNES, Vec, Vec, void *ctx)
Function executed by nested SENES at evaluationg residual.
MoFEMErrorCode recordY()
Record yield function.
virtual MoFEMErrorCode flowPotential()=0
Set flow potential.
ublas::symmetric_matrix< double, ublas::lower > partial2HFlux
MoFEMErrorCode recordW()
Record strain energy.
ublas::symmetric_matrix< double, ublas::lower > D
ublas::symmetric_matrix< double, ublas::lower > C
virtual MoFEMErrorCode codedHessianW(vector< double * >)
virtual MoFEMErrorCode yieldFunction()=0
Set yield function.
MoFEMErrorCode consistentTangent()
Calculate consistent tangent matrix.
ublas::symmetric_matrix< double, ublas::lower > partial2HSigma
friend MoFEMErrorCode ADOLCPlasticityJac(SNES, Vec, Mat, Mat, void *ctx)
Function executed by nested SENES at evaluationg tangent matrix.
ublas::matrix< double, ublas::column_major > dataA
virtual MoFEMErrorCode freeHemholtzEnergy()=0
Set Hemholtz energy.
MoFEMErrorCode snesCreate()
Create nested snes.
static boost::shared_ptr< SinkType > createSink(boost::shared_ptr< std::ostream > stream_ptr, std::string comm_filter)
Create a sink object.
static boost::shared_ptr< std::ostream > getStrmWorld()
Get the strm world object.
static boost::shared_ptr< std::ostream > getStrmSync()
Get the strm sync object.
static bool checkIfChannelExist(const std::string channel)
Check if channel exist.
static boost::shared_ptr< std::ostream > getStrmSelf()
Get the strm self object.
intrusive_ptr for managing petsc objects