21 "Get test field indices");
32 const std::array<double, 5>
deviator{{.12, -.08, .06, -.04, .09}};
33 const std::array<double, 5> stress{{-.21, .12, .31, .19, -.11}};
34 const std::array<double, 3> rotation{{.14, -.11, .07}};
35 for (
const auto &dof : *problem->getNumeredRowDofsPtr()) {
36 const auto index = dof->getPetscGlobalDofIdx();
37 if (index < first || index >= last)
39 const auto &name = dof->getName();
40 const auto component = dof->getDofCoeffIdx();
41 double value = .01 * std::sin(.37 * (index + 1));
44 if (dof->getDofOrder() == 0) {
50 value = stress.at(component);
52 value = rotation.at(component);
54 value *= .2 / (1 + dof->getDofOrder());
57 CHKERR VecSetValue(
state, index, value, INSERT_VALUES);
61 CHKERR VecGhostUpdateBegin(
state, INSERT_VALUES, SCATTER_FORWARD);
62 CHKERR VecGhostUpdateEnd(
state, INSERT_VALUES, SCATTER_FORWARD);
70 double history_norm = .2;
72 "-auxiliary_plastic_history_norm", &history_norm,
74 if (!std::isfinite(history_norm) || history_norm <= 0)
76 "Plastic Jacobian fixture requires positive history norm");
79 const double scale = history_norm / std::sqrt(t_history(A) * t_history(A));
80 auto set_history = [&](boost::shared_ptr<FieldEntity> field_entity) {
82 auto values = field_entity->getEntFieldData();
83 if (values.size() != 5)
85 "Plastic Jacobian fixture requires five P0 history coordinates");
86 auto t_values = getFTensor1FromPtr<5>(&values[0]);
87 t_values(A) =
scale * t_history(A);
96 PetscInt elements = 0;
97 double noncoaxial = 0;
99 double plasticHistory = 0;
100 double plasticStretch = 0;
101 double plasticNoncoaxial = 0;
104struct OpAuditGaussState :
public VolumeElement::UserDataOperator {
105 OpAuditGaussState(boost::shared_ptr<DataAtIntegrationPts> data,
106 boost::shared_ptr<GaussAudit> audit,
109 auditPtr(audit), parameters(parameters),
alphaU(alpha_u) {}
113 if (getFEMethod()->snes) {
114 PetscBool domain_error;
115 CHKERR SNESGetFunctionDomainError(getFEMethod()->snes, &domain_error);
119 const int points = getGaussPts().size2();
122 "Coupled Jacobian test requires multiple Gauss points");
124 CHKERR checkMaterialRate(points);
126 *dataPtr->auxiliaryData->logDeviator, points)();
129 *dataPtr->auxiliaryData->stress, points)();
130 auto t_h_p = dataPtr->getFTensorPlasticH(points);
131 auto t_f_p = dataPtr->getFTensorPlasticF(points);
136 for (
int gg = 0; gg != points; ++gg) {
137 const auto t_d_tensor = Tensor2SymmetricDeviatorBasis::getTensor(t_d);
138 const auto t_stress_tensor =
139 Tensor2SymmetricDeviatorBasis::getTensor(t_stress);
141 t_commutator(
i,
j) = t_d_tensor(
i,
k) * t_stress_tensor(
k,
j) -
142 t_stress_tensor(
i,
k) * t_d_tensor(
k,
j);
143 auditPtr->noncoaxial =
144 std::max(auditPtr->noncoaxial,
145 std::sqrt(t_commutator(
i,
j) * t_commutator(
i,
j)));
146 t_difference(A) = t_d(A) - t_first(A);
147 auditPtr->variation = std::max(
148 auditPtr->variation, std::sqrt(t_difference(A) * t_difference(A)));
149 if (std::abs(t_h_p(
i,
i)) > 1.e-12 ||
152 "Plastic history must remain trace-free and isochoric");
153 auditPtr->plasticHistory = std::max(auditPtr->plasticHistory,
154 std::sqrt(t_h_p(
i,
j) * t_h_p(
i,
j)));
157 t_plastic_difference(
i,
j) = t_f_p(
i,
j) - t_identity(
i,
j);
158 auditPtr->plasticStretch = std::max(
159 auditPtr->plasticStretch,
160 std::sqrt(t_plastic_difference(
i,
j) * t_plastic_difference(
i,
j)));
162 t_h_p(
i,
k) * t_d_tensor(
k,
j) - t_d_tensor(
i,
k) * t_h_p(
k,
j);
163 const double history_deviator_commutator =
164 std::sqrt(t_commutator(
i,
j) * t_commutator(
i,
j));
165 t_commutator(
i,
j) = t_h_p(
i,
k) * t_stress_tensor(
k,
j) -
166 t_stress_tensor(
i,
k) * t_h_p(
k,
j);
167 auditPtr->plasticNoncoaxial = std::max(
168 auditPtr->plasticNoncoaxial,
169 std::min(history_deviator_commutator,
170 std::sqrt(t_commutator(
i,
j) * t_commutator(
i,
j))));
176 ++auditPtr->elements;
182 const auto &fields = *dataPtr->auxiliaryData;
183 const auto &material = *dataPtr->auxiliaryMaterialData;
185 auto get_coordinates = [&](
const auto &values) {
188 auto t_d = get_coordinates(fields.logDeviator);
189 auto t_rate = get_coordinates(fields.logDeviatorDot);
190 auto t_stress = get_coordinates(fields.stress);
191 auto t_elastic_stress = get_coordinates(material.elasticStress);
192 auto t_dm = get_coordinates(material.materialDeviator);
195 *material.energy, points)();
200 for (
int gg = 0; gg != points; ++gg) {
202 t_material_deviator(A) = t_dm(A);
203 double material_energy;
205 material_energy, &t_forward_stress);
206 t_error(A) = t_stress(A) -
alphaU * t_rate(A) - t_forward_stress(A);
207 const double constitutive_error = std::sqrt(t_error(A) * t_error(A));
208 t_error(A) = t_elastic_stress(A) - t_forward_stress(A);
209 const double elastic_error = std::sqrt(t_error(A) * t_error(A));
210 const double expected_energy =
211 material_energy + t_forward_stress(A) * (t_d(A) - t_dm(A)) +
213 const double energy_error = std::abs(t_mixed - expected_energy);
214 if (!std::isfinite(constitutive_error) || constitutive_error > 1.e-10 ||
215 !std::isfinite(elastic_error) || elastic_error > 1.e-10 ||
216 !std::isfinite(energy_error) || energy_error > 1.e-10)
218 "Auxiliary rate material check: constitutive error %g, "
219 "elastic stress error %g, stored energy error %g",
220 constitutive_error, elastic_error, energy_error);
232 boost::shared_ptr<DataAtIntegrationPts> dataPtr;
233 boost::shared_ptr<GaussAudit> auditPtr;
238MoFEMErrorCode getFieldNorm(Vec vector, IS field, PetscReal &norm) {
241 CHKERR VecGetSubVector(vector, field, &subvector);
242 CHKERR VecNorm(subvector, NORM_INFINITY, &norm);
243 CHKERR VecRestoreSubVector(vector, field, &subvector);
250 CHKERR VecGetSubVector(vector, field, &subvector);
251 CHKERR VecZeroEntries(subvector);
252 CHKERR VecRestoreSubVector(vector, field, &subvector);
253 CHKERR VecGhostUpdateBegin(vector, INSERT_VALUES, SCATTER_FORWARD);
254 CHKERR VecGhostUpdateEnd(vector, INSERT_VALUES, SCATTER_FORWARD);
259 const std::string &row,
260 const std::string &column,
261 const bool symmetric =
true) {
263 auto row_is = getFieldIS(ep, row);
264 auto column_is = getFieldIS(ep, column);
265 Mat raw_forward, raw_reverse, raw_transpose;
266 CHKERR MatCreateSubMatrix(jacobian, row_is, column_is, MAT_INITIAL_MATRIX,
269 CHKERR MatCreateSubMatrix(jacobian, column_is, row_is, MAT_INITIAL_MATRIX,
272 CHKERR MatTranspose(reverse, MAT_INITIAL_MATRIX, &raw_transpose);
274 PetscReal norm, error;
275 CHKERR MatNorm(forward, NORM_INFINITY, &norm);
276 CHKERR MatAXPY(forward, -1., transpose, DIFFERENT_NONZERO_PATTERN);
277 CHKERR MatNorm(forward, NORM_INFINITY, &error);
278 if (!std::isfinite(norm) || norm <= 1.e-13 || !std::isfinite(error) ||
279 (symmetric ? error > 1.e-12 * std::max(1., norm)
280 : error <= 1.e-12 *
std::max(1., norm)))
282 "Cross block %s/%s: norm %g, transpose difference %g, symmetric %d",
283 row.c_str(), column.c_str(), norm, error,
284 static_cast<
int>(symmetric));
289 boost::shared_ptr<VolumeElement> rhs,
290 Vec
state, Vec rates, Vec accelerations,
301 CHKERR TSGetSNES(ts, &snes);
302 struct ResidualContext {
304 Vec rates, accelerations;
305 } residual_context{ts, rates, accelerations};
313 [](SNES, Vec x, Vec f,
void *ctx) -> PetscErrorCode {
314 auto &data = *
static_cast<ResidualContext *
>(ctx);
315 return TSComputeI2Function(data.ts, 1., x, data.rates,
316 data.accelerations, f);
320 CHKERR SNESComputeFunction(snes, input, reference);
321 PetscReal reference_norm;
322 CHKERR VecNorm(reference, NORM_2, &reference_norm);
323 if (!std::isfinite(reference_norm))
325 "Domain-recovery reference residual is not finite");
327 PetscInt first, last;
328 CHKERR VecGetOwnershipRange(input, &first, &last);
329 PetscInt injected = 0;
331 for (
const auto &dof : *problem->getNumeredRowDofsPtr()) {
332 const auto index = dof->getPetscGlobalDofIdx();
333 if (index >= first && index < last && dof->getName() == ep.
logJacobian &&
334 dof->getDofOrder() == 0) {
337 CHKERR VecSetValue(input, index, 400., INSERT_VALUES);
343 PetscInt total_injected;
344 CHKERR MPI_Allreduce(&injected, &total_injected, 1, MPIU_INT, MPI_SUM,
346 if (total_injected != 1)
348 "Domain-recovery fixture requires one owned logarithmic volume");
349 CHKERR VecAssemblyBegin(input);
350 CHKERR VecAssemblyEnd(input);
351 CHKERR SNESComputeFunction(snes, input, residual);
352 PetscBool domain_error;
353 CHKERR SNESGetFunctionDomainError(snes, &domain_error);
354 PetscInt local_domain = domain_error ? 1 : 0, domains;
355 CHKERR MPI_Allreduce(&local_domain, &domains, 1, MPIU_INT, MPI_SUM,
357 PetscReal rejected_norm;
358 CHKERR VecNorm(residual, NORM_2, &rejected_norm);
359 if (!domains || std::isfinite(rejected_norm))
361 "Nonrepresentable volume must flag the SNES residual domain");
362 for (Vec vector : {input.get(), residual.get()}) {
364 CHKERR VecLockGet(vector, &lock);
367 "Rejected SNES residual left a vector locked");
371 CHKERR SNESComputeFunction(snes, input, residual);
372 CHKERR SNESGetFunctionDomainError(snes, &domain_error);
373 local_domain = domain_error ? 1 : 0;
374 CHKERR MPI_Allreduce(&local_domain, &domains, 1, MPIU_INT, MPI_SUM,
376 CHKERR VecAXPY(residual, -1., reference);
378 CHKERR VecNorm(residual, NORM_2, &error);
379 if (domains || !std::isfinite(error) ||
380 error > 1.e-12 * std::max(1., reference_norm))
382 "SNES residual did not recover after domain rejection: error %g",
385 "Auxiliary residual domain recovery passed: error %.3e\n",
399 constexpr double dt = .4;
401 CHKERR VecScale(rates, .3);
403 CHKERR VecScale(accelerations, -.2);
405 CHKERR VecGhostUpdateBegin(ep.
solTSStep, INSERT_VALUES, SCATTER_FORWARD);
406 CHKERR VecGhostUpdateEnd(ep.
solTSStep, INSERT_VALUES, SCATTER_FORWARD);
407 boost::shared_ptr<VolumeElement> rhs, lhs;
410 auto audit = boost::make_shared<GaussAudit>();
413 ¶meters.c10,
nullptr);
415 ¶meters.bulkModulus,
nullptr);
417 rhs->getOpPtrVector().push_back(
421 state, rates, accelerations, 1.,
dt, {});
423 state, rates, accelerations, 1.,
dt, {});
429 std::map<std::string, SmartPetscObj<IS>> field_indices;
430 for (
const auto &name : fields) {
431 auto indices = getFieldIS(ep, name);
433 CHKERR ISGetSize(indices, &size);
436 "Missing coupled test field %s", name.c_str());
437 field_indices.emplace(name, indices);
441 CHKERR VecZeroEntries(zero_rates);
444 zero_rates, zero_rates, 1.,
dt, {});
445 CHKERR VecAYPX(rate_residual, -1., residual);
446 for (
const auto &[field,
active] :
453 CHKERR getFieldNorm(rate_residual, field_indices.at(field), norm);
454 if (!std::isfinite(norm) || (
active ? norm <= 1.e-12 : norm > 1.e-12))
456 "Rate residual %s: norm %g, active %d", field.c_str(), norm,
457 static_cast<int>(
active));
462 CHKERR VecCopy(rates, zero_deviator_rates);
464 auto zero_deviator_residual =
466 zero_deviator_rates, accelerations, 1.,
dt, {});
468 CHKERR VecWAXPY(deviator_rate_effect, -1., zero_deviator_residual,
470 for (
const auto &field : fields) {
472 CHKERR getFieldNorm(deviator_rate_effect, field_indices.at(field), norm);
474 if (!std::isfinite(norm) || (
active ? norm <= 1.e-12 : norm > 1.e-12))
476 "Deviator rate must affect only Td: row %s, norm %g",
477 field.c_str(), norm);
482 const auto alpha_u = ep.
alphaU;
484 boost::shared_ptr<VolumeElement> elastic_rhs, elastic_lhs;
487 auto elastic_residual =
489 state, rates, accelerations, 1.,
dt, {});
490 CHKERR VecAXPY(elastic_residual, -1., zero_deviator_residual);
492 CHKERR VecNorm(elastic_residual, NORM_INFINITY, &error);
493 if (!std::isfinite(error) || error > 1.e-12)
495 "Zero D rate must recover alpha_u=0 residual: error %g", error);
497 "Auxiliary deviator rate isolation and zero-rate "
498 "recovery passed: error %.3e\n",
505 const OperatorsTester::VectorFunction evaluate = [&](
Vec input,
Vec output) {
507 CHKERR VecCopy(input, trial);
508 CHKERR VecGhostUpdateBegin(trial, INSERT_VALUES, SCATTER_FORWARD);
509 CHKERR VecGhostUpdateEnd(trial, INSERT_VALUES, SCATTER_FORWARD);
512 CHKERR VecCopy(trial_rates, trial_accelerations);
513 CHKERR VecAXPY(trial_rates, 1., rates);
514 CHKERR VecAXPY(trial_accelerations, 1., accelerations);
517 trial_rates, trial_accelerations, 1.,
dt, {});
518 CHKERR VecCopy(value, output);
525 CHKERR VecZeroEntries(mixed);
526 auto check_direction = [&](
const std::string &name) {
528 CHKERR tester->checkVectorCentralFiniteDifference(
529 state, direction, residual, jacobian, 2.e-6, evaluate, error);
530 CHKERR MatMult(jacobian, direction, action);
531 PetscReal max_error = 0;
532 for (
const auto &row : fields) {
533 PetscReal row_error, row_action;
534 CHKERR getFieldNorm(error, field_indices.at(row), row_error);
535 CHKERR getFieldNorm(action, field_indices.at(row), row_action);
536 const double tolerance = 2.e-8 + 2.e-6 * row_action;
537 if (!std::isfinite(row_error) || row_error > tolerance)
539 "Jacobian row %s, direction %s: FD error %g exceeds %g "
540 "(Jacobian action %g)",
541 row.c_str(), name.c_str(), row_error, tolerance, row_action);
542 max_error = std::max(max_error, row_error);
545 "Auxiliary coupled Jacobian direction %s: error %.3e\n",
546 name.c_str(), max_error);
549 for (
const auto &name : fields) {
550 CHKERR VecZeroEntries(direction);
552 auto indices = field_indices.at(name);
553 CHKERR VecGetSubVector(direction, indices, &subvector);
554 PetscInt first, last;
555 CHKERR VecGetOwnershipRange(subvector, &first, &last);
557 CHKERR VecGetArray(subvector, &values);
558 for (PetscInt index = first; index != last; ++index)
559 values[index - first] = std::sin(.71 * (index + 1)) + .3;
560 CHKERR VecRestoreArray(subvector, &values);
561 CHKERR VecRestoreSubVector(direction, indices, &subvector);
563 CHKERR VecNormalize(direction, &norm);
566 "Zero test direction for %s", name.c_str());
567 CHKERR VecGhostUpdateBegin(direction, INSERT_VALUES, SCATTER_FORWARD);
568 CHKERR VecGhostUpdateEnd(direction, INSERT_VALUES, SCATTER_FORWARD);
569 CHKERR VecAXPY(mixed, 1., direction);
570 CHKERR check_direction(name);
572 CHKERR VecCopy(mixed, direction);
573 CHKERR VecNormalize(direction,
nullptr);
574 CHKERR VecGhostUpdateBegin(direction, INSERT_VALUES, SCATTER_FORWARD);
575 CHKERR VecGhostUpdateEnd(direction, INSERT_VALUES, SCATTER_FORWARD);
576 CHKERR check_direction(
"mixed");
580 CHKERR checkCrossBlock(ep, jacobian, material, mechanical);
590 auto zero_stress_jacobian =
592 accelerations, 1.,
dt, {});
594 CHKERR MatCreateSubMatrix(
595 zero_stress_jacobian, field_indices.at(ep.
logDeviator),
596 field_indices.at(ep.
logDeviator), MAT_INITIAL_MATRIX, &raw_dd);
599 CHKERR MatNorm(dd, NORM_INFINITY, &dd_norm);
600 if (!std::isfinite(dd_norm) || dd_norm > 1.e-13)
602 "Zero-stress DD block must vanish; norm %g", dd_norm);
605 double noncoaxial, variation;
606 CHKERR MPI_Allreduce(&audit->elements, &elements, 1, MPIU_INT, MPI_SUM,
608 CHKERR MPI_Allreduce(&audit->noncoaxial, &noncoaxial, 1, MPI_DOUBLE, MPI_MAX,
610 CHKERR MPI_Allreduce(&audit->variation, &variation, 1, MPI_DOUBLE, MPI_MAX,
612 if (!elements || !(noncoaxial > 1.e-4) || !(variation > 1.e-7))
614 "Insufficient Gauss-state coverage: elements %d, commutator %g, "
616 static_cast<int>(elements), noncoaxial, variation);
618 const std::array<double, 3> local{
619 audit->plasticHistory, audit->plasticStretch, audit->plasticNoncoaxial};
620 std::array<double, 3> global;
621 CHKERR MPI_Allreduce(local.data(), global.data(), 3, MPI_DOUBLE, MPI_MAX,
623 if (global[0] < 1.e-3 || global[1] < 1.e-3 || global[2] < 1.e-4)
625 "Insufficient plastic state coverage: Hp norm %g, Fp-I norm %g, "
626 "minimum Hp/D and Hp/Td commutator %g",
627 global[0], global[1], global[2]);
629 "Auxiliary plastic Jacobian: Hp norm %.3e, "
630 "Fp-I norm %.3e, commutator %.3e\n",
631 global[0], global[1], global[2]);
633 CHKERR checkDomainRecovery(ep, rhs,
state, rates, accelerations,
dt);
635 "Auxiliary coupled Jacobian atom passed: "
636 "commutator %.3e, Gauss variation %.3e\n",
637 noncoaxial, variation);
643static char help[] =
"Verify the full auxiliary logarithmic stress Jacobian.\n";
645int main(
int argc,
char *argv[]) {
647 auto core_log = logging::core::get();
Material and stress-work blocks for the independent D/theta/Td fields.
Shared mesh and problem setup for auxiliary formulation atoms.
#define FTENSOR_INDEXES(DIM,...)
#define CATCH_ERRORS
Catch errors.
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_ATOM_TEST_INVALID
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
PetscErrorCode DMMoFEMGetProblemPtr(DM dm, const MoFEM::Problem **problem_ptr)
Get pointer to problem data structure.
PetscErrorCode DMMoFEMGetFieldIS(DM dm, RowColData rc, const char field_name[], IS *is)
get field is in the problem
auto createDMVector(DM dm, RowColData rc=RowColData::COL)
Get smart vector from DM.
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
const FTensor::Tensor2< T, Dim, Dim > Vec
MoFEMErrorCode setPlasticHistory(EshelbianCore &ep, const PlasticHistory &history, const FTensor::Tensor2_symmetric< double, SPACE_DIM > &t_direction, const double scale)
MoFEMErrorCode runAuxiliaryLogarithmicStressTest(const std::function< MoFEMErrorCode(EshelbianCore &)> &test)
MoFEMErrorCode evaluateAuxiliaryMixedStoredEnergy(const AuxiliaryLogarithmicStressData &fields, const AuxiliaryLogarithmicStressMaterialData &material, VectorDouble &mixed_energy)
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)
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
PetscErrorCode PetscOptionsGetReal(PetscOptions *, const char pre[], const char name[], PetscReal *dval, PetscBool *set)
PetscErrorCode TsSetI2Function(TS ts, PetscReal t, Vec u, Vec u_t, Vec u_tt, Vec F, void *ctx)
Calculation the right hand side for second order PDE in time.
SmartPetscObj< Vec > vectorDuplicate(Vec vec)
Create duplicate vector of smart vector.
auto createTS(MPI_Comm comm)
decltype(GetFTensor1FromMatImpl< Tensor_Dim, S, DL, M >::get(std::declval< M & >(), 0, 0)) GetFTensor1FromMatType
static auto getFTensor0FromVec(V &data)
Get tensor rank 0 (scalar) form data vector.
static auto determinantTensor3by3(T &t)
Calculate the determinant of a 3x3 matrix or a tensor of rank 2.
auto deviator(FTensor::Tensor2_symmetric< T, DIM > &t_stress, double trace, FTensor::Tensor2_symmetric< double, DIM > &t_alpha, FTensor::Number< DIM >)
MoFEM::Interface & mField
const std::string spatialL2Disp
boost::shared_ptr< Range > plasticVolumes
const std::string elementVolumeName
const std::string logDeviator
const std::string plasticHField
const std::string piolaStress
const std::string logJacobian
MoFEMErrorCode setVolumeElementOps(const int tag, const bool add_elastic, const bool add_material, boost::shared_ptr< VolumeElementForcesAndSourcesCore > &fe_rhs, boost::shared_ptr< VolumeElementForcesAndSourcesCore > &fe_lhs)
const std::string bubbleField
const std::string auxiliaryLogStress
const std::string rotAxis
boost::shared_ptr< ForcesAndSourcesCore > contactTreeRhs
Make a contact tree.
static PetscBool plasticVolume
MoFEMErrorCode setContactElementRhsOps(boost::shared_ptr< ForcesAndSourcesCore > &fe_contact_tree)
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
const std::string hybridSpatialDisp
SmartPetscObj< Vec > solTSStep
SmartPetscObj< DM > dmElastic
Elastic problem.
static MoFEMErrorCode validateParameters(const Parameters ¶meters)
Check finite, strictly positive C10, K and representable mu = 2*C10.
static MoFEMErrorCode evaluateDeviator(const Parameters ¶meters, const Coordinates &t_deviator, double &energy, Coordinates *stress_ptr=nullptr, Tangent *hessian_ptr=nullptr)
Evaluate f(D), optionally its five-component gradient and Hessian.
virtual MPI_Comm & get_comm() const =0
virtual int get_comm_rank() const =0
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Data on single entity (This is passed as argument to DataOperator::doWork)
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 boost::shared_ptr< std::ostream > getStrmSelf()
Get the strm self object.
Calculate directional derivative of the right hand side and compare it with tangent matrix derivative...
SmartPetscObj< Mat > assembleMat(SmartPetscObj< DM > dm, std::string fe_name, boost::shared_ptr< FEMethod > pipeline, SmartPetscObj< Vec > x, SmartPetscObj< Vec > delta_x, SmartPetscObj< Vec > delta2_x, double time, double delta_t, CacheTupleWeakPtr cache_ptr)
Assemble the left hand side vector.
keeps basic data about problem
intrusive_ptr for managing petsc objects
Interface for Time Stepping (TS) solver.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
Volume finite element base.