Skip to content

Coupling instructions: say what the exported flux columns hold (the outward traction is -q) - #71

Merged
alhermann merged 1 commit into
mainfrom
fix/served-traction-sign
Oct 15, 2026
Merged

alhermann merged 1 commit into
mainfrom
fix/served-traction-sign

Conversation

@alhermann

Copy link
Copy Markdown
Collaborator

Problem

The served Dirichlet–Neumann participant templates export normal_fluxes, and dump them into interface_level<k>.csv, as minus the conormal derivative on their own outward normal:

  • heat: -(k grad u) · n_own, which is the outward normal flux;
  • elasticity: -(σ · n_own), which is minus the outward traction.

That convention is right for the exchange. But the instructions that send the agent from these columns to the files its task asks for, after a converged coupling, said nothing about the sign. So a file that asked for the outward traction σ · n received its negative. The coupled solution itself was not affected; only the reported interface traction was.

What this changes

What the coupling exchanges is unchanged. Every place that points the agent from the exported columns to its own output files now states the sign:

  • coupling_knowledge:
    • adds FLUX_COLUMNS_SIGN (the rule, per contract kind) and FLUX_COLUMNS_SIGN_SHORT (one sentence for text repeated per level);
    • the vector contract (section 6a, rule 2) and the elastic variant's intro say that the outward traction is -q.
  • consolidated:
    • the rule is in couple_levels' all-converged next_step and in couple()'s reporting;
    • the interface tables' _how_to_use carries the short rule;
    • the converged-level leads, the SAVE-VERBATIM verdict and the couple docstring qualify the q columns;
    • interface tables name one column per entry (x, y, u1, u2, q1, q2) where six columns were headed x, y, u, qn;
    • the thermo-elastic exchange is written [q_n, q_x, q_y] (also in the 4C deck grammar note).
  • result_audit:
    • the rule appears in the deliverables brief (ladder step 4) and in the missing-fields finding;
    • the deliverable-flux finding says what the q columns hold.
  • Elastic participant contracts (FEniCSx, DUNE-fem, FEBio):
    • the console line names the exported traction qx, qy with its definition, instead of tx, ty;
    • FEBio's dump block states what its qx, qy columns hold, as the others do.

Tests

New: tests/test_exchanged_traction_is_not_the_outward_traction.py. It runs:

  • the scikit-fem elastic contract, for both interface orientations and both roles;
  • the scikit-fem heat contract;
  • a real converged couple_levels and couple of two elastic sides.

The contracts run on fields with closed-form stress and flux, and the test checks the replies against the measured columns.

Local run on this branch, which is on top of main (da6f80a):

  • pytest tests/, without the LangGraph test: 99 passed, 13 skipped;
  • tests/test_web_search_reports_a_block.py in the LangGraph environment: 11 passed.

🤖 Generated with Claude Code

…sk's files

The served Dirichlet-Neumann participants export normal_fluxes, and dump
them into interface_level<k>.csv, as minus the conormal derivative on
their own outward normal: -(k grad u) . n_own for heat, which is the
outward normal flux, and -(sigma . n_own) for elasticity, which is MINUS
the outward traction. The instructions that send the agent from these
columns to the task's interface files after a converged coupling said
nothing about the sign, so a file that asked for the outward traction
sigma . n received its negative. What the coupling exchanges is unchanged.

- coupling_knowledge: FLUX_COLUMNS_SIGN (the rule, per contract kind) and
  FLUX_COLUMNS_SIGN_SHORT (one sentence for text repeated per level); the
  vector contract (section 6a, rule 2) and the elastic variant's intro say
  that the outward traction is -q.
- consolidated: the rule in couple_levels' all-converged next_step and in
  couple()'s `reporting`; the interface tables' _how_to_use carries the
  short rule; the converged-level leads, the SAVE-VERBATIM verdict and the
  couple docstring qualify the q columns; interface tables name one column
  per entry (x, y, u1, u2, q1, q2) where six columns were headed
  "x, y, u, qn"; the thermo-elastic exchange is written [q_n, q_x, q_y]
  (also in the 4C deck grammar note).
- result_audit: the rule in the deliverables brief (ladder step 4) and in
  the missing-fields finding; the deliverable-flux finding says what the
  q columns hold.
- elastic contracts (FEniCSx, DUNE-fem, FEBio): the console line names the
  exported traction qx, qy with its definition instead of tx, ty; FEBio's
  dump block states what its qx, qy columns hold, as the others do.
- tests/test_exchanged_traction_is_not_the_outward_traction.py runs the
  scikit-fem elastic contract (both interface orientations, both roles)
  and the scikit-fem heat contract on fields with closed-form stress and
  flux, and a real converged couple_levels and couple of two elastic
  sides, and checks the replies against the measured columns.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The reporting and header changes preserve numerical exchange behavior, with regression coverage and no identified blocking issues.

0 open findings

What changed in this PR

Clarifies how openPASO converts exported interface fluxes into reported quantities, without changing the numerical exchange.

Changes:

  • States that elastic outward traction is -q throughout reporting guidance.
  • Gives vector CSV columns individual names and clarifies participant log labels.
  • Adds regression tests for flux signs and converged coupling replies.
File Description
tests/​test_exchanged_traction_is_not_the_outward_traction.py Tests sign conventions and reporting guidance.
src/​tools/​result_audit.py Adds sign guidance to deliverable instructions.
src/​tools/​coupling_knowledge.py Defines shared flux-sign explanations.
src/​tools/​consolidated.py Updates reporting guidance and vector CSV headers.
src/​backends/​fourc/​deck_grammar.py Clarifies exchange notation in documentation.
data/​coupling_participants/​participant_fenics_elastic.py Clarifies exported traction log labels.
data/​coupling_participants/​participant_febio_elastic.py Clarifies log labels and dump comments.
data/​coupling_participants/​participant_dune_elastic.py Clarifies exported traction log labels.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@alhermann
alhermann merged commit ee94e3f into main Oct 15, 2026
3 checks passed
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.

2 participants