splinepy icon indicating copy to clipboard operation
splinepy copied to clipboard

Field integrator

Open markriegler opened this issue 1 year ago • 6 comments

Overview

FieldIntegrator is a class to discretize PDEs into a system of equations. This should be ideal for rapid prototyping. It creates the corresponding matrices and vectors based on the user's input which consists of:

  • Geometry
  • A function on how to assemble the left hand side matrix
  • A function on how to assemble the right hand side vector
  • Boundary conditions

New features

  • Transformation class: computes supports, Jacobians and quadrature points for elements in a patch
  • FieldIntegrator class: assemble system matrix and right hand side vector
    • Assembly takes function on how to assemble matrix/vector as input

Showcase

Examples will be added in the examples folder

Checklists

  • [ ] Documentations are up-to-date.
  • [x] Added example(s)
  • [ ] Added test(s)

Summary by CodeRabbit

  • New Features

    • Introduced an example implementation for solving the Galerkin Laplace problem using the FieldIntegrator class.
    • Added new utility functions for improved integration functionality and a new FieldIntegrator class to manage integration processes.
    • Enhanced the volume function for better performance and accuracy in integration tasks.
  • Bug Fixes

    • Improved error handling and assertions in the volume integration test suite.
  • Documentation

    • Enhanced parameter descriptions in the parametric_function method for better clarity.

markriegler avatar Aug 05 '24 13:08 markriegler

[!IMPORTANT]

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The recent updates to the splinepy library introduce several enhancements, including the new FieldIntegrator class and improved integration functions. These changes streamline spline parameter handling and boost accuracy while ensuring robust testing and documentation that validate the integration logic and transformations.

Changes

Files Change Summary
examples/iga/.../galerkin_laplace_problem_field_integrator.py New script demonstrating the FieldIntegrator class for solving the Galerkin Laplace problem, detailing geometry preparation and computational functions for matrix assembly and visualization.
splinepy/helpme/.../integrate.py Added _get_integral_measure and _default_quadrature_orders for improved integration handling; refactored volume for clarity; and introduced the FieldIntegrator class to encapsulate integration logic.
tests/.../test_volume_integration.py Renamed VolumeIntegrationTest to IntegratorTest, introducing new methods for enhanced test coverage across spline types and user-defined functions, improving error handling and integration validation.
.github/workflows/... Enhanced CI workflows for documentation generation and testing, transitioning from unittest to pytest, and refining dependency handling for better performance.
README.md Expanded installation instructions and enhanced the introduction for clarity and usability.
docs/... Various documentation updates, including the addition of a C++ API section and improved Doxygen configurations for better output structure.
include/splinepy/... Added licensing information to key header files and improved several spline classes for enhanced clarity and functionality of method signatures.

Poem

🐇 In the meadow where splines play,
New changes hop in, brightening the day.
Integrations dance, tests take flight,
FieldIntegrator shines, oh what a sight!
With each curve and twist, we refine and improve,
In the world of math, we joyfully move! 🌼✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Aug 05 '24 13:08 coderabbitai[bot]

I think there was an issue with rebase. Do you need some help with that?

j042 avatar Aug 14 '24 15:08 j042

There are still some commits which do some unnecessary things (e.g. removing a function in one commit and later commit adds the same function again), but I tried to reduce the total number of commits.

markriegler avatar Aug 16 '24 15:08 markriegler

I think this should be rebased at 6e13284

j042 avatar Sep 03 '24 12:09 j042

What's up with this branch? Anybody still working on it? why is it still draft? help required?

jzwar avatar Apr 29 '25 16:04 jzwar

The reason why I declared it as draft is because I wanted to extend it to work with multiple fields (e.g. pressure and velocity field for Stokes) and I was working on that. This extension is still a work in progress, but I guess this can get into a different branch + new PR. In the current state, everything for a single field PDE (e.g. Poisson, maybe even linear elasticity) should work. I'll try resolving the conflicts and then the code should be reviewable / mergeable.

markriegler avatar May 07 '25 14:05 markriegler