v0.16.3
Loading...
Searching...
No Matches
PlasticIncrementalOptimization.hpp
Go to the documentation of this file.
1/**
2 * @file PlasticIncrementalOptimization.hpp
3 * @brief Plasticity implementation of incremental optimization
4 */
5
6#ifndef MOFEM_PLASTIC_INCREMENTAL_OPTIMIZATION_HPP
7#define MOFEM_PLASTIC_INCREMENTAL_OPTIMIZATION_HPP
8
10
11namespace EshelbianPlasticity {
12
13struct EshelbianCore;
14
15/** Number of coefficients in the trace-free approximation of H^p. */
17 SPACE_DIM * (SPACE_DIM + 1) / 2 - 1;
18
19/** Plasticity adapter; no plastic data is present in the generic context. */
23 SmartPetscObj<TS> ts);
24
25 std::string getName() const override;
26 MoFEMErrorCode validate() override;
27 DM getControlDM() const override;
28 MoFEMErrorCode
29 createControlData(SmartPetscObj<Vec> &committed_control,
30 SmartPetscObj<Vec> &candidate_control) override;
31 MoFEMErrorCode configureConstraintDM(DM constraint_dm) override;
32 /** Initialise multipliers for sqrt(cell volume)-scaled inequality rows. */
33 MoFEMErrorCode initialiseInequalityMultipliers(DM constraint_dm,
34 Vec multipliers) override;
35 MoFEMErrorCode initialiseReferenceControl(Vec committed_control,
36 Vec reference_control) override;
37 MoFEMErrorCode solveState(Vec state, EquilibriumSolveReport &report) override;
38 MoFEMErrorCode restoreState(Vec state) override;
39 MoFEMErrorCode evaluateConservativeValue(double &value) override;
40 MoFEMErrorCode assembleConservativeGradient(Vec smooth_gradient) override;
41 MoFEMErrorCode evaluateDissipation(Vec control, double &value) override;
42 MoFEMErrorCode assembleObjectiveGradient(Vec control, Vec smooth_gradient,
43 Vec objective_gradient) override;
44 /** Return sqrt(cell volume) times the exact or rounded epigraph gap. */
45 MoFEMErrorCode evaluateInequalityConstraints(Vec control,
46 Vec constraints) override;
47 MoFEMErrorCode assembleInequalityJacobian(Vec control, Vec smooth_gradient,
48 Mat jacobian) override;
50 Vec control, Mat jacobian) override;
51 /** Recover physical multipliers and check unscaled plastic feasibility. */
52 MoFEMErrorCode validateSolution(
53 DM constraint_dm, Vec control, Vec smooth_gradient,
54 Vec inequality_multipliers, PetscReal gradient_tolerance,
55 PetscReal constraint_tolerance, std::string &diagnostics) override;
56 MoFEMErrorCode commit(Vec solution, Vec equilibrated_state,
57 Vec committed_control, Vec candidate_control,
58 Vec reference_control) override;
59
60 /** Plastic-flow control field; its vector values are Delta H^p. */
61 const std::string &getPlasticFlowFieldName() const;
62 /** Scalar control/constraint field; its vector values are Delta kappa. */
63 const std::string &getPlasticKappaFieldName() const;
64 double getInitialYieldStress() const { return initialYieldStress; }
71 const std::string &getVolumeElementName() const;
72 /** Add geometry operators for local constitutive integration. */
74 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline) const;
75
76private:
78 SmartPetscObj<TS> timeSolver;
79 /** Zero force selects a finite exact-cone row when no smooth force exists. */
84};
85
86boost::shared_ptr<IncrementalOptimizationContext>
88 SmartPetscObj<TS> ts,
89 SmartPetscObj<Vec> state);
90
92 const boost::shared_ptr<IncrementalOptimizationContext> &context);
93
94/** Reject combinations for which the material-energy adjoint is incomplete. */
96
97/**
98 * Evaluate only the bulk material Helmholtz free energy at equilibrium.
99 * Boundary-device and stabilization energies are excluded; their influence
100 * enters the reduced derivative through the equilibrium adjoint.
101 */
102MoFEMErrorCode evaluateEquilibratedMechanicalValue(EshelbianCore &ep, TS ts,
103 double &value);
104
105/**
106 * Fixed-control state solve corresponding to Eq. (3.5), label
107 * gen:eq:state-map, which reports failure without aborting a trial.
108 *
109 * The outer physical/load time is EshelbianCore::currentPhysicalTime. The TS
110 * time used here is reset for every control trial and is only pseudo-time for
111 * first-order dynamic relaxation. Its rate terms are excluded from both the
112 * Helmholtz value and the static sensitivity operator, and the returned
113 * equilibrium norm is recomputed with all pseudo-time rates set to zero.
114 * Reaching the TS step limit before the final pseudo-time emits a warning;
115 * the caller still checks the final state's rate-free equilibrium norm.
116 */
117MoFEMErrorCode solveEquilibriumStateTS(EshelbianCore &ep, TS ts, Vec state,
118 EquilibriumSolveReport &report);
119
120/**
121 * Evaluate five trace-free logarithmic-plastic-stretch coordinates as a full
122 * symmetric tensor at volume quadrature points. Implements Eqs.
123 * (1.50)--(1.52), labels eq:increment-expansion through
124 * eq:symmetric-basis-gram.
125 */
127 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
128 const std::string &field_name,
129 boost::shared_ptr<MatrixDouble> tensor_values,
130 const EntityType zero_type = MBTET, SmartPetscObj<DM> data_dm = {},
131 SmartPetscObj<Vec> data_vector = {});
132
133/**
134 * Evaluate the exact fixed-state discrete plastic variation
135 * -integral P : Fe Dexp(Hp)[W] for a constant symmetric direction. See Eqs.
136 * (1.29)--(1.30), labels eq:fixed-state-plastic-variation and
137 * eq:plastic-variation-conjugacy.
138 */
140 EshelbianCore &ep,
142 double &conjugate_work);
143
144/**
145 * Centred equilibrated-value/conjugate-force test for Eq. (1.87), label
146 * eq:energy-force-check.
147 */
149 Vec state);
150
151/**
152 * Control layout, reconstruction, commit, and rollback test for Eqs.
153 * (1.50)--(1.55), labels eq:history-space through eq:quadrature-weight.
154 */
156 Vec state);
157
158/**
159 * State/value/force/cache/rollback transaction test for the invariants in
160 * Eq. (3.25), label gen:eq:common-tests.
161 */
163 Vec state);
164
165/**
166 * Branch-controlled directional finite differences of the complete
167 * incremental objective and the exact TAO-facing gradient.
168 */
170 TS ts, Vec state);
171
174 Vec state);
175
176} // namespace EshelbianPlasticity
177
178#endif // MOFEM_PLASTIC_INCREMENTAL_OPTIMIZATION_HPP
boost::shared_ptr< IncrementalOptimizationContext > context
Physics-independent incremental optimization API.
constexpr int SPACE_DIM
MoFEMErrorCode validateEquilibratedMechanicalValueScope(EshelbianCore &ep)
boost::shared_ptr< IncrementalOptimizationContext > createPlasticIncrementalOptimizationContext(EshelbianCore &ep, SmartPetscObj< TS > ts, SmartPetscObj< Vec > state)
MoFEMErrorCode testIncrementalOptimizationLayout(EshelbianCore &ep, TS ts, Vec state)
MoFEMErrorCode solveEquilibriumStateTS(TopologicalTAOCtxImpl *ctx_impl_ptr)
MoFEMErrorCode testIncrementalOptimizationConstraintDerivative(EshelbianCore &ep, TS ts, Vec state)
MoFEMErrorCode testIncrementalOptimizationTransaction(EshelbianCore &ep, TS ts, Vec state)
MoFEMErrorCode evaluateEquilibratedMechanicalValue(EshelbianCore &ep, TS ts, double &value)
MoFEMErrorCode testIncrementalOptimizationObjectiveDerivative(EshelbianCore &ep, TS ts, Vec state)
MoFEMErrorCode evaluatePlasticConjugateWork(EshelbianCore &ep, const FTensor::Tensor2_symmetric< double, SPACE_DIM > &t_direction, double &conjugate_work)
MoFEMErrorCode testEquilibratedMechanicalValue(EshelbianCore &ep, TS ts, Vec state)
PlasticIncrementalOptimizationProblem & getPlasticIncrementalOptimizationProblem(const boost::shared_ptr< IncrementalOptimizationContext > &context)
MoFEMErrorCode addCalculatePlasticLogarithmicStretchFieldValues(boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pipeline, const std::string &field_name, boost::shared_ptr< MatrixDouble > tensor_values, const EntityType zero_type, SmartPetscObj< DM > data_dm, SmartPetscObj< Vec > data_vector)
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
constexpr auto field_name
MoFEMErrorCode initialiseInequalityMultipliers(DM constraint_dm, Vec multipliers) override
MoFEMErrorCode assembleConservativeGradient(Vec smooth_gradient) override
MoFEMErrorCode initialiseReferenceControl(Vec committed_control, Vec reference_control) override
MoFEMErrorCode createControlData(SmartPetscObj< Vec > &committed_control, SmartPetscObj< Vec > &candidate_control) override
MoFEMErrorCode assembleObjectiveGradient(Vec control, Vec smooth_gradient, Vec objective_gradient) override
MoFEMErrorCode solveState(Vec state, EquilibriumSolveReport &report) override
MoFEMErrorCode evaluateInequalityConstraints(Vec control, Vec constraints) override
MoFEMErrorCode commit(Vec solution, Vec equilibrated_state, Vec committed_control, Vec candidate_control, Vec reference_control) override
MoFEMErrorCode validateSolution(DM constraint_dm, Vec control, Vec smooth_gradient, Vec inequality_multipliers, PetscReal gradient_tolerance, PetscReal constraint_tolerance, std::string &diagnostics) override
MoFEMErrorCode evaluateDissipation(Vec control, double &value) override
MoFEMErrorCode assembleInequalityJacobian(Vec control, Vec smooth_gradient, Mat jacobian) override
MoFEMErrorCode assembleInequalityJacobianWithoutSmoothGradient(Vec control, Mat jacobian) override
MoFEMErrorCode addConstitutiveGeometryOperators(boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pipeline) const