![]() |
v0.16.3 |
#include "users_modules/eshelbian_plasticity/src/IncrementalMechanics.hpp"
Public Types | |
| using | FieldSnapshot = std::map< EntityHandle, std::vector< double > > |
Public Member Functions | |
| IncrementalMechanics (EshelbianCore &ep, SmartPetscObj< TS > ts) | |
| TS | getTS () const |
| void | addStateControlField (const std::string &field) |
| void | addHistoryField (const std::string &field) |
| MoFEMErrorCode | solveState (Vec state, EquilibriumSolveReport &report) |
| MoFEMErrorCode | fixedDataAreCurrent (bool ¤t) |
| MoFEMErrorCode | restoreState (Vec state) |
| MoFEMErrorCode | evaluateBaseline (Vec state, double &value) |
| MoFEMErrorCode | evaluateConservativeValue (double &value) |
| MoFEMErrorCode | assembleConservativeGradient (DM control_dm, Vec gradient) |
| bool | supportsHessianAction () const |
| MoFEMErrorCode | prepareHessian (DM control_dm, Vec control) |
| MoFEMErrorCode | applyHessian (Vec direction, Vec action) |
| MoFEMErrorCode | assembleHessianPreconditioner (Mat metric) |
| PetscInt | getMechanicalSolveCount () const |
| PetscInt | getDirectionalSolveCount () const |
Private Member Functions | |
| MoFEMErrorCode | publishTrialControl () |
| MoFEMErrorCode | stateControlBlocksEqual (Vec first, Vec second, PetscBool &equal) |
| MoFEMErrorCode | zeroStateControlBlocks (Vec control) |
| MoFEMErrorCode | snapshotHistory (std::vector< FieldSnapshot > &snapshot) |
| MoFEMErrorCode | refreshConservativeGradient (DM control_dm) |
Private Attributes | |
| EshelbianCore & | ep |
| SmartPetscObj< TS > | timeSolver |
| std::vector< std::string > | stateControlFields |
| std::vector< std::string > | historyFields |
| SmartPetscObj< Vec > | cachedControl |
| SmartPetscObj< Vec > | cachedState |
| EquilibriumSolveReport | cachedReport |
| std::vector< FieldSnapshot > | cachedHistory |
| double | cachedPhysicalTime = 0 |
| bool | cacheValid = false |
| PetscInt | mechanicalSolves = 0 |
| SmartPetscObj< Vec > | cachedGradient |
| bool | gradientValid = false |
| boost::shared_ptr< PlasticIncrementalOptimizationInternal::ReducedBulkMaterialEnergyHessianWorkspace > | gradientWorkspace |
| boost::shared_ptr< PlasticIncrementalOptimizationInternal::ReducedBulkMaterialEnergyHessianWorkspace > | hessianWorkspace |
Mechanical state of the incremental optimisation.
One object serves every physics. It owns the fixed-control TS equilibrium solve with its cache, the zero-increment baseline, the bulk Helmholtz value, the base adjoint of the reduced conservative gradient and the frozen tangents of the reduced Hessian action. A physics registers the control fields that enter equilibrium, so only their blocks of the trial control key the state cache, and the mesh history fields whose change invalidates that cache. The mechanical pipelines read the registered control fields from EshelbianCore::incrementalTrialControl.
Definition at line 34 of file IncrementalMechanics.hpp.
| using EshelbianPlasticity::IncrementalMechanics::FieldSnapshot = std::map<EntityHandle, std::vector<double> > |
Definition at line 35 of file IncrementalMechanics.hpp.
| EshelbianPlasticity::IncrementalMechanics::IncrementalMechanics | ( | EshelbianCore & | ep, |
| SmartPetscObj< TS > | ts | ||
| ) |
Definition at line 20 of file IncrementalMechanics.cpp.
|
inline |
Definition at line 43 of file IncrementalMechanics.hpp.
|
inline |
Definition at line 40 of file IncrementalMechanics.hpp.
| MoFEMErrorCode EshelbianPlasticity::IncrementalMechanics::applyHessian | ( | Vec | direction, |
| Vec | action | ||
| ) |
Write the reduced mechanical Hessian action in direction to action through one tangent-state and one incremental-adjoint solve.
Definition at line 260 of file IncrementalMechanics.cpp.
| MoFEMErrorCode EshelbianPlasticity::IncrementalMechanics::assembleConservativeGradient | ( | DM | control_dm, |
| Vec | gradient | ||
| ) |
Reduced conservative gradient on control_dm through the base adjoint; cached until the next equilibrium solve.
Definition at line 230 of file IncrementalMechanics.cpp.
| MoFEMErrorCode EshelbianPlasticity::IncrementalMechanics::assembleHessianPreconditioner | ( | Mat | metric | ) |
Add the frozen material curvature block to the SPD metric.
Definition at line 270 of file IncrementalMechanics.cpp.
| MoFEMErrorCode EshelbianPlasticity::IncrementalMechanics::evaluateBaseline | ( | Vec | state, |
| double & | value | ||
| ) |
Equilibrium with the registered control blocks zeroed and its Helmholtz value; the trial control is restored afterwards.
Definition at line 168 of file IncrementalMechanics.cpp.
| MoFEMErrorCode EshelbianPlasticity::IncrementalMechanics::evaluateConservativeValue | ( | double & | value | ) |
Bulk Helmholtz free energy of the state on the mesh.
Definition at line 197 of file IncrementalMechanics.cpp.
| MoFEMErrorCode EshelbianPlasticity::IncrementalMechanics::fixedDataAreCurrent | ( | bool & | current | ) |
Whether the histories and the physical time still match the cache.
Definition at line 145 of file IncrementalMechanics.cpp.
| PetscInt EshelbianPlasticity::IncrementalMechanics::getDirectionalSolveCount | ( | ) | const |
Definition at line 280 of file IncrementalMechanics.cpp.
|
inline |
Definition at line 73 of file IncrementalMechanics.hpp.
|
inline |
Definition at line 39 of file IncrementalMechanics.hpp.
| MoFEMErrorCode EshelbianPlasticity::IncrementalMechanics::prepareHessian | ( | DM | control_dm, |
| Vec | control | ||
| ) |
Freeze the base adjoint and the tangent matrices at control.
Definition at line 244 of file IncrementalMechanics.cpp.
|
private |
Definition at line 24 of file IncrementalMechanics.cpp.
|
private |
Definition at line 202 of file IncrementalMechanics.cpp.
| MoFEMErrorCode EshelbianPlasticity::IncrementalMechanics::restoreState | ( | Vec | state | ) |
Put the trial control and state back on the mesh.
Definition at line 161 of file IncrementalMechanics.cpp.
|
private |
Definition at line 82 of file IncrementalMechanics.cpp.
| MoFEMErrorCode EshelbianPlasticity::IncrementalMechanics::solveState | ( | Vec | state, |
| EquilibriumSolveReport & | report | ||
| ) |
Publish the trial control and equilibrate; a cached state is reused when the registered control blocks, histories and time are unchanged.
Definition at line 102 of file IncrementalMechanics.cpp.
|
private |
Definition at line 39 of file IncrementalMechanics.cpp.
| bool EshelbianPlasticity::IncrementalMechanics::supportsHessianAction | ( | ) | const |
Whether the material provides the curvature used by applyHessian().
Definition at line 239 of file IncrementalMechanics.cpp.
|
private |
Definition at line 64 of file IncrementalMechanics.cpp.
|
private |
Definition at line 89 of file IncrementalMechanics.hpp.
|
private |
Definition at line 97 of file IncrementalMechanics.hpp.
|
private |
Definition at line 92 of file IncrementalMechanics.hpp.
|
private |
Definition at line 93 of file IncrementalMechanics.hpp.
|
private |
Definition at line 91 of file IncrementalMechanics.hpp.
|
private |
Definition at line 90 of file IncrementalMechanics.hpp.
|
private |
Definition at line 94 of file IncrementalMechanics.hpp.
|
private |
Definition at line 84 of file IncrementalMechanics.hpp.
|
private |
Definition at line 98 of file IncrementalMechanics.hpp.
|
private |
Definition at line 101 of file IncrementalMechanics.hpp.
|
private |
Definition at line 101 of file IncrementalMechanics.hpp.
|
private |
Definition at line 87 of file IncrementalMechanics.hpp.
|
private |
Definition at line 95 of file IncrementalMechanics.hpp.
|
private |
Definition at line 86 of file IncrementalMechanics.hpp.
|
private |
Definition at line 85 of file IncrementalMechanics.hpp.