RFC: promote Drucker-Prager geomechanics assembler into TensorMesh public API #23
Replies: 2 comments 1 reply
-
|
Thanks for laying this out so concretely — a couple of thoughts from Q1 + Q2 — promotion shape and locationYes, the example-tested Drucker-Prager surface is mature enough to (1) General API — the constitutive primitive. Expose the (2) Syntactic sugar — the one-line assembler.
Note: applying this layering retroactively to Q3 — material containerWe'd lean toward a table-backed rather than constructor-per-soil soil = FrictionalMaterial.from_preset("DenseSand")
# or, for one-off parameter sweeps:
soil = FrictionalMaterial(E=..., nu=..., cohesion=..., friction_angle=...)The constructor stays for one-off sweeps; the preset table is the Q4 — associated vs non-associatedThe existing If you want a turnkey non-associated entrypoint for a specific Q5 — example migrationSame PR. The whole point of the promotion is removing the duplicate |
Beta Was this translation helpful? Give feedback.
-
|
Thanks to Mingyuan and Kursat. The PR is merged into the main. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
Following the merged geomechanics examples, I would like to discuss whether it is now the right time to promote the example-local Drucker-Prager implementation into a small public API.
Motivation
The geomechanics examples now establish the main ingredients:
The Drucker-Prager implementation has now been exercised in both constitutive-driver and boundary-value settings. A small public API would reduce duplication across future geomechanics examples and make it easier to add foundation, slope, excavation, and tunnel examples.
The current examples intentionally kept the implementation local. Now that the model surface has been tested in examples, I would like to ask whether it should be promoted into TensorMesh proper.
Proposed scope
I propose adding a small geomechanics assembler module inside the existing solid/assemble family:
and a lightweight material container, either in the existing material module or a small material submodule depending on maintainer preference:
I would not introduce a top-level
tensormesh.geomechanicspackage.Proposed material class
A first version could be:
I am not attached to the exact name or file location. I would prefer to match TensorMesh’s existing material conventions.
For the first public version, I suggest keeping the implementation close to the examples: associated Drucker-Prager with linear isotropic hardening. The
dilatancy_anglefield could either be omitted initially or reserved for a future non-associated extension, depending on maintainer preference.Proposed assembler
The public assembler would follow the existing J2-style lifecycle:
self.history[etype],element_data,update_state(u)called after each converged load step undertorch.no_grad(),A possible user-facing pattern:
or, if maintainers prefer to keep the constructor style closer to
J2Plasticity:Validation plan
A public API PR would include:
vmap,Migration plan
If accepted, I would update the existing geomechanics examples to use the public assembler rather than carrying duplicate local Drucker-Prager code:
The examples would remain in the gallery, but their constitutive implementation would come from the public API.
Questions
tensormesh/assemble/geomechanics.py, or beside the existing plasticity implementation?FrictionalMateriallive intensormesh/material/, or should the existing material module remain flat for now?dilatancy_angle?Beta Was this translation helpful? Give feedback.
All reactions