Skip to content

add computational of integral values#5

Merged
dodu94 merged 1 commit into
mainfrom
extract-volumes-and-areas
Jun 10, 2026
Merged

add computational of integral values#5
dodu94 merged 1 commit into
mainfrom
extract-volumes-and-areas

Conversation

@dodu94

@dodu94 dodu94 commented Jun 10, 2026

Copy link
Copy Markdown
Member

Add functions to compute the integral values of the interpolation

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

Walkthrough

This PR adds post-processing and validation analysis capabilities to the interpolation framework. It introduces two new Interpolator methods to compute weighted scalar field integrals and EM force/moment resultants with error metrics, supported by exception handling, parser updates to carry mesh volume/area data, comprehensive tests, APDL export enhancements, and working documentation examples.

Changes

Post-Processing and Analysis Capabilities

Layer / File(s) Summary
Exception and Parser Foundations
src/interpcore/errors.py, src/interpcore/parsers.py
New IncompatibleResultsError exception and updated parse_mech_mesh signature to optionally accept volume and area column indices, returning a dictionary with conditionally included numpy arrays alongside coordinates and ID numbers.
Interpolator Analysis Methods
src/interpcore/interpolator.py
Imports updated to include the new exception; __init__ modified to parse and store destination mesh volumes and areas; two public methods added: compute_scalar_integrals() for weighted integration by volume/area, and compute_EM_resultants() for source vs. interpolated force/moment resultant comparison with per-component relative error metrics.
Test Coverage for Analysis Methods
tests/test_interpolator.py
New test cases for compute_scalar_integrals() and compute_EM_resultants(), validating required interpolation state, return value structure and dimensionality, optional pole behavior, and error handling when invoked before interpolation.
Data and Export Tool Updates
apdl-scripts/export_centroids.apdl, doc/heat_flux/destination_mesh.txt, doc/heat_gen/destination_mesh.txt
APDL script updated to retrieve and export per-element area and volume via *GET queries; destination mesh text files extended with Area column (heat flux domain) and Volume column (heat generation domain) to support weighted integral computations.
Documentation and Working Examples
README.md, doc/em_force/em_force.ipynb, doc/heat_flux/heat_flux.ipynb, doc/heat_gen/heat_gen.ipynb
README updated with "Analysis tools" feature description and "Analysis Methods" section documenting scalar integrals and EM force/moment resultants; three example notebooks extended with new cells demonstrating the analysis method calls, showing returned force/moment resultants, integral values, and error metrics.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Interpolator
  participant Parser
  participant Analysis
  User->>Interpolator: initialize with destination mesh file
  Interpolator->>Parser: parse_mech_mesh with vol/area column indices
  Parser-->>Interpolator: return dict with coordinates, volumes, areas
  Interpolator->>Interpolator: store volumes/areas on instance
  User->>Interpolator: interpolate_all()
  User->>Interpolator: compute_scalar_integrals()
  Interpolator->>Analysis: validate interpolation, sum weighted integrals
  Analysis-->>Interpolator: dict of integral results by load
  User->>Interpolator: compute_EM_resultants(pole)
  Interpolator->>Analysis: compute source/destination force/moment resultants
  Analysis-->>Interpolator: dict with resultants, errors, unmapped norm
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 With volumes measured and forces aligned,
Integrals flow through the fields we've designed,
Conservation checked from pole to pole,
The interpolator now plays a complete role!
📊✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'add computational of integral values' is partially related to the changeset. While the PR does add integral computation capabilities (compute_scalar_integrals), it also substantially adds EM force/moment resultant computation (compute_EM_resultants), updates mesh parsing to support volume/area data, and includes comprehensive documentation and tests. The title focuses on only one aspect of the changes.
Docstring Coverage ✅ Passed Docstring coverage is 85.71% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch extract-volumes-and-areas

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dodu94 dodu94 merged commit 3893075 into main Jun 10, 2026
8 of 9 checks passed
@dodu94 dodu94 deleted the extract-volumes-and-areas branch June 10, 2026 15:11
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