Skip to content

refactor(assemble): split built-in assemblers by physics - #37

Open
kilickursat wants to merge 1 commit into
camlab-ethz:mainfrom
kilickursat:refactor/assemble-builtin-physics-hierarchy
Open

refactor(assemble): split built-in assemblers by physics#37
kilickursat wants to merge 1 commit into
camlab-ethz:mainfrom
kilickursat:refactor/assemble-builtin-physics-hierarchy

Conversation

@kilickursat

Copy link
Copy Markdown
Contributor

Summary

This PR refactors the built-in assembler layout from the monolithic
tensormesh/assemble/builtin.py module into a builtin/ package organized by
physics category.

The new hierarchy is:

tensormesh/assemble/builtin/
├── common.py
├── fluid/
├── solid/
└── electromagnetic/

Geomechanics lives under the solid family:

tensormesh/assemble/builtin/solid/geomechanics.py

Scope

  • Splits built-in assemblers by physics category
  • Moves Laplace and mass assemblers under builtin/fluid/
  • Moves linear elasticity, Neo-Hookean, J2 plasticity, Drucker-Prager plasticity, and contact under builtin/solid/
  • Adds a reserved builtin/electromagnetic/ namespace
  • Preserves existing public imports from tensormesh.assemble
  • Preserves imports from tensormesh.assemble.builtin
  • Adds category-level imports such as tensormesh.assemble.builtin.solid
  • Adds import-compatibility tests

Out of scope

  • No numerical behavior changes
  • No Drucker-Prager formula changes
  • No J2Plasticity behavior changes
  • No public API behavior changes
  • No tunnel-specific API
  • No .po translation updates

Validation

Ran locally:

  • pytest tests/assemble/test_builtin_imports.py -v
  • pytest tests/assemble -v
  • pytest tests/functional/test_drucker_prager.py -v
  • pytest tests/material/test_frictional_material.py -v
  • pytest tests/assemble/test_drucker_prager_plasticity.py -v
  • pytest tests/assemble/test_drucker_prager_triaxial_example.py -v
  • pytest tests/assemble/test_drucker_prager_footing_example.py -v
  • python examples/solid/geomechanics/drucker_prager_triaxial/drucker_prager_triaxial.py --no-plot --steps 16
  • python examples/solid/geomechanics/drucker_prager_footing/drucker_prager_footing.py --no-plot --steps 6 --chara-length 0.60
  • cd docs && make html
  • cd docs && make zh

Also verified import compatibility for:

from tensormesh.assemble import J2Plasticity
from tensormesh.assemble import DruckerPragerPlasticity
from tensormesh.assemble.builtin import J2Plasticity
from tensormesh.assemble.builtin.solid import DruckerPragerPlasticity

Notes

This is a structure-only refactor. The previous public import paths are preserved
through builtin/__init__.py and tensormesh/assemble/__init__.py.

Signed-off-by: Kursat Kilic <kilic_kursat@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant