17 shutdown_times_vec.clear();
20 PetscBool flg = PETSC_FALSE;
21 PetscReal shutdown_times[128];
25 shutdown_times_vec.assign(shutdown_times, shutdown_times +
n);
27 std::stable_sort(shutdown_times_vec.begin(), shutdown_times_vec.end());
36 std::vector<int>
getStep(
const double time) {
39 auto step_before =
static_cast<int>(std::floor(equiv_step));
40 auto step_after =
static_cast<int>(std::ceil(equiv_step));
41 std::vector<int> step_times = {step_before, step_after};
46template <
int DIM,
int MODEL_TYPE>
65 const double *endpoint_modulus)
const {
70 if (range.find(entity) != range.end()) {
75 if (properties->size() < 5)
77 "Amentum elastic properties require PROPS(5)");
86 for (
int gg = 0; gg != nb_gauss_pts; ++gg)
89 "Invalid converged Amentum modulus at point %d", gg);
95 std::find_if(state_tags.begin(), state_tags.end(),
96 [&](
const auto &entry) { return entry.name == name; });
97 if (
state == state_tags.end() ||
state->numComponents != 1)
99 "Amentum elastic modulus requires scalar UMAT_STATEV_7");
100 const void *
values =
nullptr;
104 if (
result == MB_TAG_NOT_FOUND)
109 if (
size != nb_gauss_pts)
111 "Amentum elastic modulus does not match volume quadrature");
113 for (
int gg = 0; gg != nb_gauss_pts; ++gg)
116 "Invalid Amentum elastic modulus %g at point %d",
127 char props_file[PETSC_MAX_PATH_LEN] =
"amentum_umat_props.inc";
128 PetscOptionsBegin(PETSC_COMM_WORLD,
"umat_",
"",
"none");
129 CHKERR PetscOptionsString(
"-props_file",
"Path to UMAT properties file",
"",
130 props_file, props_file,
sizeof(props_file),
132 CHKERR PetscOptionsBool(
"-subtract_thermal_strain",
133 "Subtract isotropic thermal strain before UMAT",
"",
136 CHKERR PetscOptionsScalar(
137 "-thermal_reference_temp",
"Reference temperature for thermal strain",
141 std::ifstream file(props_file);
142 if (!file.is_open()) {
144 "Could not open UMAT properties file %s", props_file);
147 std::vector<double> props;
149 while (std::getline(file, line)) {
150 const auto equal_pos = line.find(
'=');
151 if (equal_pos == std::string::npos)
154 std::istringstream value_stream(line.substr(equal_pos + 1));
156 if (!(value_stream >> value)) {
158 "Could not read UMAT property value from line: %s",
161 std::string trailing;
162 if (value_stream >> trailing) {
164 "Unexpected text after UMAT property value in line: %s",
168 props.push_back(value);
174 "UMAT properties file %s has %d values, expected %d", props_file,
193 boost::make_shared<AgingFpyTimeScale>(
"aging_fpy_history.txt");
198 <<
" subtracting thermal strain with CTE0R = "
216 createOp(boost::shared_ptr<PhysicalEquations> physical_ptr,
bool eval_stress,
217 bool eval_tangent,
bool update)
override {
218 return Base::createOp(physical_ptr, eval_stress, eval_tangent, update);
244 double &irra,
double &
temp,
double &corr);
253template <
int DIM,
int MODEL_TYPE>
257 CHKERR Base::A::matOpsDataPtr->bindStateTag(m_field, IRRA_TAG_NAME, 1);
258 CHKERR Base::A::matOpsDataPtr->bindStateTag(m_field, PREDEF_TEMP_TAG_NAME, 1);
259 CHKERR Base::A::matOpsDataPtr->bindStateTag(m_field, CORR_TAG_NAME, 1);
260 CHKERR Base::A::matOpsDataPtr->bindStateTag(m_field, TEMP_TAG_NAME, 1);
261 CHKERR Base::A::matOpsDataPtr->bindStateTag(m_field, DTEMP_TAG_NAME, 1);
262 CHKERR Base::A::matOpsDataPtr->bindStateTag(m_field, PIOLA_TAG_NAME,
267template <
int DIM,
int MODEL_TYPE>
272 auto mat_ops_data_ptr = Base::A::matOpsDataPtr;
274 boost::dynamic_pointer_cast<UMatOpData>(mat_ops_data_ptr->getUserDataPtr());
275 if (!umat_data_ptr || !umat_data_ptr->rawOpPtr) {
277 "Amentum UMAT needs the active material operator");
279 auto raw_op_ptr = umat_data_ptr->rawOpPtr;
280 const auto &gauss_pts = raw_op_ptr->getGaussPts();
281 const auto entity_type = raw_op_ptr->getFEType();
282 const int nb_gauss_pts = gauss_pts.size2();
283 if (gg < 0 || gg >= nb_gauss_pts) {
285 "Invalid Amentum UMAT integration point %d", gg);
289 switch (entity_type) {
291 v_shape.resize(4,
false);
293 &gauss_pts(1, gg), &gauss_pts(2, gg), 1);
296 v_shape.resize(8,
false);
297 const double ksi = gauss_pts(0, gg);
298 const double eta = gauss_pts(1, gg);
299 const double zeta = gauss_pts(2, gg);
312 "Amentum UMAT shape functions not implemented for entity type %d",
319template <
int DIM,
int MODEL_TYPE>
321 EntityHandle entity,
const VectorDouble &v_shape,
double time,
double &irra,
322 double &
temp,
double &corr) {
327 "Amentum UMAT needs MoFEM interface to read MOAB tags");
330 if (!stepScalingPtr) {
332 "Time scaling object is not initialized for Amentum UMAT");
335 auto &moab = Base::mField->get_moab();
336 const EntityHandle *conn =
nullptr;
338 CHKERR moab.get_connectivity(entity, conn, num_nodes,
true);
339 if (num_nodes != v_shape.size()) {
341 "Amentum UMAT connectivity does not match the shape functions");
344 auto get_nodal_tag_values = [&](
const char *tag_name,
348 const auto tag_error = moab.tag_get_handle(tag_name,
tag);
349 if (tag_error != MB_SUCCESS) {
351 "Required Amentum UMAT tag '%s' not found. Check "
352 "aging_fpy_history.txt and the projected tag mesh.",
357 CHKERR moab.tag_get_length(
tag, tag_length);
358 CHKERR moab.tag_get_data_type(
tag, tag_type);
359 if (tag_length != 1 || tag_type != MB_TYPE_DOUBLE) {
361 "Amentum UMAT tag '%s' must contain one double per node",
364 v_nodal_values.resize(num_nodes,
false);
365 CHKERR moab.tag_get_data(
tag, conn, num_nodes, v_nodal_values.data().data());
369 auto evaluate_at_gauss_point = [&](
const VectorDouble &v_nodal_values) {
370 return inner_prod(v_shape, v_nodal_values);
373 auto make_step_tag_name = [&](
const char *prefix,
int step) {
374 return (boost::format(
"%s_%d") % prefix % step).str();
377 auto load_step_tags = [&](
int step,
double &irra,
double &
temp,
381 CHKERR get_nodal_tag_values(
382 make_step_tag_name(
"MED_IRRA_ALLIRRA", step).c_str(), v_irra);
383 CHKERR get_nodal_tag_values(
384 make_step_tag_name(
"MED_TEMP_ALLNEUT", step).c_str(), v_temp);
385 CHKERR get_nodal_tag_values(
386 make_step_tag_name(
"MED_CORR_ALLNEUT", step).c_str(), v_corr);
387 irra = evaluate_at_gauss_point(v_irra);
388 temp = evaluate_at_gauss_point(v_temp);
389 corr = evaluate_at_gauss_point(v_corr);
393 auto interpolate_predef_at_equiv_step = [&](
double equiv_step,
double &irra,
394 double &
temp,
double &corr) {
395 const int step_before =
static_cast<int>(std::floor(equiv_step));
396 const int step_after =
static_cast<int>(std::ceil(equiv_step));
397 double irra_b = 0.0, temp_b = 0.0, corr_b = 0.0;
398 double irra_a = 0.0, temp_a = 0.0, corr_a = 0.0;
399 CHKERR load_step_tags(step_before, irra_b, temp_b, corr_b);
400 CHKERR load_step_tags(step_after, irra_a, temp_a, corr_a);
403 (step_after != step_before)
404 ? (equiv_step - step_before) / (step_after - step_before)
407 irra = irra_b + alpha * (irra_a - irra_b);
408 temp = temp_b + alpha * (temp_a - temp_b);
409 corr = corr_b + alpha * (corr_a - corr_b);
414 const double equiv_step = stepScalingPtr->TimeScale::getScale(time);
415 CHKERR interpolate_predef_at_equiv_step(equiv_step, irra,
temp, corr);
420template <
int DIM,
int MODEL_TYPE>
422 PetscReal time_offset)
const {
423 const PetscReal shutdown_time = Base::currentTime - time_offset;
424 const auto time_it = std::lower_bound(
425 shutdownTimes.begin(), shutdownTimes.end(),
427 return time_it != shutdownTimes.end() &&
431template <
int DIM,
int MODEL_TYPE>
437 CHKERR getFieldShapeFunctions(gg, v_shape);
439 auto &
umat = *Base::umatInterfacePtr;
440 umat.predef.assign(5, 0.0);
441 umat.dpred.assign(5, 0.0);
445 double current_irra = 0.0, current_predef_temp = 0.0, current_corr = 0.0;
446 CHKERR evaluateFieldVariables(entity, v_shape, Base::currentTime,
447 current_irra, current_predef_temp, current_corr);
449 double prev_irra = 0.0, prev_predef_temp = 0.0, prev_corr = 0.0;
450 double prev_temp = 0.0;
452 PetscReal prev_time = Base::currentTime - Base::currentTimeIncrement;
453 CHKERR evaluateFieldVariables(entity, v_shape, prev_time, prev_irra,
454 prev_predef_temp, prev_corr);
455 prev_temp = prev_predef_temp;
457 double prev_irra_test = 0.0, prev_predef_temp_test = 0.0,
458 prev_corr_test = 0.0;
459 double prev_temp_test = 0.0;
460 double debug_time_test = 0.0, debug_dt_test = 0.0, debug_step_test = 0.0;
461 auto get_previous_scalar_tag = [&](
const char *tag_name,
double &value) {
464 Base::A::matOpsDataPtr->getStateDataPtr(tag_name, entity, gg);
465 value = (*state_ptr)(0, 0);
469 if (Base::currentTime == 0) {
471 prev_predef_temp = 20.0;
474 umat.predef[2] = prev_irra;
475 umat.predef[3] = prev_predef_temp;
476 umat.predef[4] = prev_corr;
481 umat.dpred[2] = current_irra - prev_irra;
483 umat.dpred[4] = current_corr - prev_corr;
485 const bool shutdown_step =
487 const bool restore_step =
491 current_predef_temp = 20.;
494 prev_temp = current_predef_temp;
495 prev_predef_temp = current_predef_temp;
496 umat.predef[3] = prev_predef_temp;
498 }
else if (restore_step) {
499 CHKERR get_previous_scalar_tag(PREDEF_TEMP_TAG_NAME, prev_temp);
500 prev_predef_temp = prev_temp;
501 umat.predef[3] = prev_predef_temp;
504 umat.temp = prev_temp;
505 umat.dpred[3] = current_predef_temp - prev_predef_temp;
506 umat.dtemp = current_predef_temp - prev_temp;
507 debugTag = prev_temp;
509 CHKERR removeThermalStrain();
514template <
int DIM,
int MODEL_TYPE>
518 if (!subtractThermalStrain)
521 auto &
umat = *Base::umatInterfacePtr;
522 const double thermal_strain_alpha =
523 Base::currentMaterialParameters[CTE0R_PROP_INDEX];
524 const double previous_thermal_strain =
525 thermal_strain_alpha * (
umat.temp - thermalReferenceTemp);
526 const double thermal_strain_increment = thermal_strain_alpha *
umat.dtemp;
528 for (
int ii = 0; ii != Base::UmatInterfaceType::NDI; ++ii) {
529 umat.stran[ii] -= previous_thermal_strain;
530 umat.dstran[ii] -= thermal_strain_increment;
536template <
int DIM,
int MODEL_TYPE>
538 EntityHandle entity,
int gg) {
542 CHKERR getFieldShapeFunctions(gg, v_shape);
543 double current_irra = 0.0, current_predef_temp = 0.0, current_corr = 0.0;
544 CHKERR evaluateFieldVariables(entity, v_shape, Base::currentTime,
545 current_irra, current_predef_temp, current_corr);
547 current_predef_temp = 20.0;
549 auto &
umat = *Base::umatInterfacePtr;
551 auto set_scalar_tag = [&](
const char *tag_name,
double value) {
554 Base::A::matOpsDataPtr->getStateDataPtr(tag_name, entity, gg);
555 (*state_ptr)(0, 0) = value;
559 CHKERR set_scalar_tag(IRRA_TAG_NAME, current_irra);
560 CHKERR set_scalar_tag(PREDEF_TEMP_TAG_NAME, current_predef_temp);
561 CHKERR set_scalar_tag(CORR_TAG_NAME, current_corr);
562 CHKERR set_scalar_tag(TEMP_TAG_NAME,
umat.temp);
563 CHKERR set_scalar_tag(DTEMP_TAG_NAME,
umat.dtemp);
566 auto piola_ptr = Base::A::matOpsDataPtr->getStateDataPtr(
567 Base::STRESS_TAG_NAME, entity, gg);
569 auto piola_state_ptr =
570 Base::A::matOpsDataPtr->getStateDataPtr(PIOLA_TAG_NAME, entity, gg);
571 constexpr int voigt_map[3][3] = {{0, 3, 4}, {3, 1, 5}, {4, 5, 2}};
573 for (
int i = 0;
i < DIM; ++
i) {
574 for (
int j = 0;
j < DIM; ++
j) {
575 (*piola_state_ptr)(
i *DIM +
j, 0) = (*piola_ptr)(voigt_map[
i][
j], 0);
583boost::shared_ptr<PhysicalEquations>
585 boost::shared_ptr<MatOpsData> mat_ops_data_ptr,
int tag) {
586 return boost::make_shared<MatAmentumUmatImpl<3, MODEL_3D>>(mat_ops_data_ptr,
591boost::shared_ptr<PhysicalEquations>
593 boost::shared_ptr<MatOpsData> mat_ops_data_ptr,
int tag) {
594 return boost::make_shared<MatAmentumUmatImpl<2, MODEL_2D_PLANE_STRAIN>>(
595 mat_ops_data_ptr,
tag);
604 else if (
auto umat = boost::dynamic_pointer_cast<
609 "Physical time source requires an Amentum UMAT material");
614 boost::shared_ptr<PhysicalEquations> physics_ptr,
FEMethod *fe_ptr,
616 const double *endpoint_modulus) {
623 }
else if (
auto material = boost::dynamic_pointer_cast<
629 "Selected material does not supply Amentum elastic properties");
660 std::ostringstream ss;
662 for (
auto it = times.begin();
it != times.end(); ++
it) {
663 if (
it != times.begin())
675 std::ostringstream ss;
683 const char *prefix =
nullptr;
684 CHKERR PetscObjectGetOptionsPrefix(
reinterpret_cast<PetscObject
>(adapt),
686 data.regularStepLen = .5;
690 data.offApat = PETSC_FALSE;
691 data.fixedStepLen = PETSC_FALSE;
703 &data.fixedStepLen, PETSC_NULLPTR);
706 if (!(data.alpha > 0 && data.alpha < 1) ||
707 !std::isfinite(data.gamma) || data.gamma < 0 || data.desiredIt <= 0 ||
708 !std::isfinite(data.regularStepLen) || data.regularStepLen <= 0)
709 SETERRQ(PetscObjectComm(
reinterpret_cast<PetscObject
>(adapt)),
713 <<
"TS adaptivity: alpha = " << data.alpha <<
", gamma = " << data.gamma
714 <<
", desiredIt = " << data.desiredIt <<
", offAdapt = " << data.offApat
715 <<
", fixedStepLen = " << data.fixedStepLen
716 <<
", regularStepLen = " << data.regularStepLen
723 PetscOptionItems *options) {
727 CHKERR TSAdaptSetOptionsPrefix(adapt, options->prefix);
737 auto ts_adapt_amentum =
static_cast<TSAdaptAmentum *
>(adapt->data);
739 if (ts_adapt_amentum->offApat) {
740 CHKERR TSGetTimeStep(ts, next_h);
744 CHKERR TSGetSNES(ts, &snes);
746 SNESConvergedReason reason;
747 CHKERR SNESGetConvergedReason(snes, &reason);
750 CHKERR SNESGetIterationNumber(snes, &
it);
753 h *= ts_adapt_amentum->alpha;
756 "TSWORLD", Sev::warning,
757 "\tDiverged set step length: it = %d, h = %3.4g set h = %3.4g \n",
it,
759 }
else if (reason > 0) {
760 if (ts_adapt_amentum->fixedStepLen) {
761 *next_h = PetscClipInterval(ts_adapt_amentum->regularStepLen,
762 adapt->dt_min, adapt->dt_max);
764 h *= pow((
static_cast<double>(ts_adapt_amentum->desiredIt) /
765 static_cast<double>(
it + 1)),
766 static_cast<double>(ts_adapt_amentum->gamma));
767 *next_h = PetscClipInterval(
h, adapt->dt_min, adapt->dt_max);
770 "TSWORLD", Sev::inform,
771 "\tConverged set step length: it = %d, h = %3.4g set h = %3.4g \n",
782 PetscBool amentum = PETSC_FALSE;
783 CHKERR PetscObjectTypeCompare(
reinterpret_cast<PetscObject
>(adapt),
786 SETERRQ(PetscObjectComm(
reinterpret_cast<PetscObject
>(adapt)),
793 PetscInt *next_sc, PetscReal *next_h,
794 PetscBool *
accept, PetscReal *wlte,
795 PetscReal *wltea, PetscReal *wlter) {
798 auto ts_adapt_amentum =
static_cast<TSAdaptAmentum *
>(adapt->data);
799 const PetscReal accepted_step_len =
h;
812 CHKERR TSGetTime(ts, ¤t_t);
814 const PetscReal accepted_t = current_t + accepted_step_len;
816 if (ts_adapt_amentum->restoreAfterShutdown) {
818 ts_adapt_amentum->restoreAfterShutdown = PETSC_FALSE;
819 ts_adapt_amentum->rampUpAfterShutdown = PETSC_TRUE;
821 "\tShutdown step complete: t = %3.12g set restore h = %3.4g\n",
822 accepted_t, *next_h);
823 }
else if (ts_adapt_amentum->rampUpAfterShutdown) {
824 *next_h = ts_adapt_amentum->regularStepLen;
825 ts_adapt_amentum->rampUpAfterShutdown = PETSC_FALSE;
826 while (!ts_adapt_amentum->shutdownTimes.empty() &&
827 accepted_t >= ts_adapt_amentum->shutdownTimes.front() -
829 ts_adapt_amentum->shutdownTimes.erase(
830 ts_adapt_amentum->shutdownTimes.begin());
833 "\tField restore step complete: t = %3.12g set h = %3.4g\n",
834 accepted_t, *next_h);
835 }
else if (!ts_adapt_amentum->shutdownTimes.empty()) {
836 const PetscReal nextShutdownTime = ts_adapt_amentum->shutdownTimes.front();
838 if (PetscAbsReal(accepted_t - nextShutdownTime) <=
841 ts_adapt_amentum->restoreAfterShutdown = PETSC_TRUE;
843 "\tShutdown step after t = %3.12g set h = %3.4g \n",
844 accepted_t, *next_h);
846 const PetscReal next_t = accepted_t + *next_h;
847 if (accepted_t < nextShutdownTime && next_t >= nextShutdownTime) {
848 *next_h = nextShutdownTime - accepted_t;
850 "\tClip step to shutdown: t = %3.12g shutdown = "
851 "%3.12g set h = %3.4g \n",
852 accepted_t, nextShutdownTime, *next_h);
866 PetscFunctionReturn(0);
872 adapt->data =
nullptr;
883 PetscFunctionReturn(0);
int h
Corner vertex and its two front neighbours.
std::vector< int > source
#define MOFEM_LOG_C(channel, severity, format,...)
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
PetscErrorCode TSAdaptChooseAmentumRejected(TSAdapt adapt, TS ts, PetscReal h, PetscReal *next_h)
static std::string formatShutdownTimes(const std::vector< PetscReal > ×)
PetscErrorCode TSAdaptCreateAmentum(TSAdapt adapt)
PetscErrorCode TSAdaptChooseAmentum(TSAdapt adapt, TS ts, PetscReal h, PetscInt *next_sc, PetscReal *next_h, PetscBool *accept, PetscReal *wlte, PetscReal *wltea, PetscReal *wlter)
static std::string formatNextShutdownTime(const std::vector< PetscReal > ×)
PetscErrorCode TSAdaptResetAmentum(TSAdapt adapt)
static PetscErrorCode readAmentumOptions(TSAdapt adapt)
static PetscErrorCode chooseAmentumStepSize(TSAdapt adapt, TS ts, PetscReal h, PetscReal *next_h)
PetscErrorCode TSAdaptDestroyAmentum(TSAdapt adapt)
static PetscErrorCode TSAdaptSetFromOptionsAmentum(TSAdapt adapt, PetscOptionItems *options)
Amentum-specific UMAT registration surface.
Shared UMAT implementation details for built-in and user-defined UMATs.
SmartPetscObj< Vec > values
#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_OPERATION_UNSUCCESSFUL
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MOFEM_LOG(channel, severity)
Log.
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
MoFEMErrorCode setAmentumTimeSource(boost::shared_ptr< PhysicalEquations > material, AmentumTimeSource source)
MoFEMErrorCode getAmentumElasticProperties(boost::shared_ptr< PhysicalEquations > physics_ptr, FEMethod *fe_ptr, int nb_gauss_pts, const double *&young_modulus, double &poisson_ratio, const double *endpoint_modulus)
static MoFEMErrorCode getShutdownTimesFromOptions(std::vector< PetscReal > &shutdown_times_vec)
boost::shared_ptr< PhysicalEquations > createMatOpsPhysicalEquationsPtr< AMENTUM_UMAT, MODEL_2D_PLANE_STRAIN >(boost::shared_ptr< MatOpsData > mat_ops_data_ptr, int tag)
std::function< void(PetscReal &, PetscReal &, PetscInt &)> AmentumTimeSource
static constexpr PetscReal AMENTUM_SHUTDOWN_TIME_TOL
static constexpr PetscReal AMENTUM_SHUTDOWN_STEP_LEN
boost::shared_ptr< PhysicalEquations > createMatOpsPhysicalEquationsPtr< AMENTUM_UMAT, MODEL_3D >(boost::shared_ptr< MatOpsData > mat_ops_data_ptr, int tag)
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
PetscErrorCode PetscOptionsGetReal(PetscOptions *, const char pre[], const char name[], PetscReal *dval, PetscBool *set)
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)
PetscErrorCode PetscOptionsGetScalar(PetscOptions *, const char pre[], const char name[], PetscScalar *dval, PetscBool *set)
PetscErrorCode PetscOptionsGetRealArray(PetscOptions *, const char pre[], const char name[], PetscReal dval[], PetscInt *nmax, PetscBool *set)
double young_modulus
Young modulus.
double poisson_ratio
Poisson ratio.
double zeta
Viscous hardening.
void temp(int x, int y=10)
std::vector< int > getStep(const double time)
MoFEMErrorCode loadPredef(EntityHandle entity, int gg) override
AmentumTimeSource timeSource
static constexpr auto DTEMP_TAG_NAME
static constexpr auto CORR_TAG_NAME
boost::shared_ptr< AgingFpyTimeScale > stepScalingPtr
static constexpr auto IRRA_TAG_NAME
static constexpr int CTE0R_PROP_INDEX
MoFEMErrorCode setParams(FEMethod *fe_ptr, int gg) override
MoFEMErrorCode updateState(int tag, EntityHandle entity, int gg) override
PetscBool subtractThermalStrain
MoFEMErrorCode getFieldShapeFunctions(int gg, VectorDouble &v_shape)
MoFEMErrorCode storeCurrentFieldVariables(EntityHandle entity, int gg)
MoFEMErrorCode bindAuxiliaryStateTags(MoFEM::Interface &m_field) override
static constexpr auto PREDEF_TEMP_TAG_NAME
MoFEMErrorCode getOptions(MoFEM::Interface *m_field_ptr=nullptr) override
MoFEMErrorCode evaluateVariable(int tag, EntityHandle entity, int gg) override
std::vector< PetscReal > shutdownTimes
MoFEMErrorCode readElasticProperties(FEMethod *fe_ptr, int nb_gauss_pts, const double *&young_modulus, double &poisson_ratio, const double *endpoint_modulus) const
MoFEMErrorCode removeThermalStrain()
static constexpr auto TEMP_TAG_NAME
ForcesAndSourcesCore::UserDataOperator * createOp(boost::shared_ptr< PhysicalEquations > physical_ptr, bool eval_stress, bool eval_tangent, bool update) override
PetscReal thermalReferenceTemp
bool isShutdownTime(PetscReal time_offset) const
MoFEMErrorCode evaluateFieldVariables(EntityHandle entity, const VectorDouble &v_shape, double time, double &irra, double &temp, double &corr)
static constexpr auto PIOLA_TAG_NAME
static std::string getStateVariableTagName(const int index)
MoFEMErrorCode getOptions(MoFEM::Interface *m_field_ptr=nullptr) override
ForcesAndSourcesCore::UserDataOperator * createOp(boost::shared_ptr< PhysicalEquations > physical_ptr, bool eval_stress, bool eval_tangent, bool update) override
std::vector< double > defaultMaterialParameters
std::vector< double > currentMaterialParameters
std::unique_ptr< UmatInterfaceType > umatInterfacePtr
MoFEMErrorCode setParams(FEMethod *fe_ptr, int gg) override
int numberMaterialProperties
MoFEMErrorCode evaluateVariable(int, EntityHandle entity, int gg) override
MoFEMErrorCode updateState(int, EntityHandle entity, int gg) override
MoFEM::Interface * mField
PetscReal currentTimeIncrement
std::vector< std::pair< Range, std::vector< double > > > paramVecByRange
boost::shared_ptr< MatOpsData > matOpsDataPtr
virtual moab::Interface & get_moab()=0
Deprecated interface functions.
Structure for user loop methods on finite elements.
EntityHandle getFEEntityHandle() const
Get the entity handle of the current finite element.
Force scale operator for reading two columns.
double getScale(const double time)
Get scaling at a given time.
TimeScale(std::string file_name="", bool error_if_file_not_given=false, ScalingFun def_scaling_fun=[](double time) { return time;})
TimeScale constructor.
Custom TSAdaptivity in MoFEM for Amentum Umat.
PetscBool restoreAfterShutdown
PetscBool rampUpAfterShutdown
std::vector< PetscReal > shutdownTimes
subroutine umat(stress, statev, ddsdde, sse, spd, scd, rpl, ddsddt, drplde, drpldt, stran, dstran, time, dtime, temp, dtemp, predef, dpred, cmname, ndi, nshr, ntens, nstatv, props, nprops, coords, drot, pnewdt, celent, dfgrd0, dfgrd1, noel, npt, layer, kspt, kstep, kinc)