Skip to content

Refactor: ldem package with a regression safety net, readable case files and documentation in four languages - #4

Merged
borisrojotanzi merged 13 commits into
devfrom
refactor/phase0-1-safety-net
Nov 9, 2026
Merged

borisrojotanzi merged 13 commits into
devfrom
refactor/phase0-1-safety-net

Conversation

@borisrojotanzi

Copy link
Copy Markdown
Contributor

What this PR does

Replaces the original MATLAB scripts with the ldem package, keeping the
results of the original code (frozen under the tag legacy-reference) as the
reference, and adds a readable input format, new examples and a documentation
site.

The history is in 13 commits, in the order they were built.

What it contains

Safety net

  • The legacy code is frozen and compared with the new code through golden-master
    fixtures (tests/regression, tests/fixtures); the bugs found in the original
    are listed with their fixes in docs/known-issues/KNOWN_ISSUES.md.

The ldem package (src/+ldem)

  • Validated ldem.Parameters; mesh, material (bilinear law, random field of the
    critical strain read from a file or generated in memory), solver with energy
    balance, ldem.runSimulation, and outputs (results.mat, ANSYS macros, VTK/ParaView).
  • Scenarios (tests) as classes: uniaxial tension, four-point bending and the new
    bi-clamped beam loaded with a force (Rodrigo's model, dev_rodrigo).

Case files (.ldem) replace DATA0.DAT

  • Named keys, units (3.87 GPa), comments, scenario and outputs in one file;
    errors name the file, line and key. ldem.run, ldem.check (dry run),
    ldem.io.convertLegacyInput (gives the same Parameters as the legacy reader).
  • Pluggable constitutive law and damping model (linear_elastic, none besides the
    legacy ones), custom tests with [[support]]/[[load]] blocks, extends
    inheritance and parameter sweeps (ldem.sweep).
  • ldem.run records what was run (hash of the case, resolved case, parents).

Documentation

  • English pages are the only source; Spanish, Portuguese and Italian are gettext
    catalogs (docs/locale), each language is its own site with a language selector.
    docs/tools/update_translations.py keeps them in step.
  • New page Examples for the three examples (bi-clamped beam, uniaxial prism,
    four-point bending beam), with figures and numbers from real runs.

Build and CI

  • buildtool tasks (check, test, testAll, docs, clean) and GitHub workflows.

How it was checked

  • buildtool: Code Analyzer with no warnings and 386 tests passing (unit and
    regression).
  • Documentation built with warnings as errors in the four languages.
  • The three examples run from start to finish with the current code; the bi-clamped
    beam through its case file gives the same results as through the script.

Not checked / to know

  • buildtool testAll (slow tests, full 167,000-node beam) has not been run since the
    pluggable laws and custom tests were added.
  • The Spanish, Portuguese and Italian translations were written without a native
    review.
  • OU2 = 14398 in the bi-clamped beam input is kept only as a comment: the original
    code does not use it and it is not confirmed that it is the tracked bar.
  • Not included: a .m script as case file, distributed loads, and laws with their own
    parameters in the case file.

For the reviewer

Start with CHANGELOG.md and the user guide pages Usage and Examples. The code to
read first is src/+ldem/runSimulation.m, src/+ldem/+io/readCase.m and
src/+ldem/+schema/caseSchema.m (the single table of keys).

@borisrojotanzi borisrojotanzi self-assigned this Nov 9, 2026
@borisrojotanzi
borisrojotanzi merged commit d293569 into dev Nov 9, 2026
3 checks passed
@borisrojotanzi
borisrojotanzi deleted the refactor/phase0-1-safety-net branch November 9, 2026 01:41
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