idaes-pse icon indicating copy to clipboard operation
idaes-pse copied to clipboard

Add function to PETSc interface to return initial condition problem

Open dallan-keylogic opened this issue 1 year ago • 5 comments
trafficstars

Fixes

  • Addresses #1343, #1347, and #1399
  • Stops Pytest warnings from controller tests not returning None

Summary/Motivation:

When using the PETSc interface, a square initial condition problem is first solved (with either PETSc-snes or IPOPT) to make sure the initial condition is consistent before sending integrations problems to PETSc-TS. However, when you end up with degree of freedom problems or a degenerate problem, it's difficult to debug. As an expedient, I would edit the PETSc problem to return the problem in the middle of the context manager.

I've added a function to get this problem directly and modified the PETSc interface to use this function to get the initial condition problem to solve to ensure consistency.

Legal Acknowledgement

By contributing to this software project, I agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the license terms described in the LICENSE.txt file at the top level of this directory.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

dallan-keylogic avatar Jun 26 '24 17:06 dallan-keylogic

This looks really useful, thanks for making the change. I'll give it a review soon.

Robbybp avatar Jun 26 '24 19:06 Robbybp

Codecov Report

Attention: Patch coverage is 80.88235% with 13 lines in your changes missing coverage. Please review.

Project coverage is 76.36%. Comparing base (10b42e4) to head (6850cb2). Report is 62 commits behind head on main.

Files with missing lines Patch % Lines
idaes/core/solvers/petsc.py 80.88% 7 Missing and 6 partials :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1443      +/-   ##
==========================================
- Coverage   76.36%   76.36%   -0.01%     
==========================================
  Files         394      394              
  Lines       64953    64993      +40     
  Branches    14404    14412       +8     
==========================================
+ Hits        49601    49630      +29     
- Misses      12793    12803      +10     
- Partials     2559     2560       +1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov-commenter avatar Jun 26 '24 21:06 codecov-commenter

@Robbybp, just a friendly nag to review when (or if) you have some time.

lbianchi-lbl avatar Jul 25 '24 18:07 lbianchi-lbl

@Robbybp , could you please review this sometime soon? I'd really like it to make the August release.

dallan-keylogic avatar Aug 13 '24 14:08 dallan-keylogic

Progress not expected until end of Sept (per @dallan-keylogic)

ksbeattie avatar Sep 05 '24 18:09 ksbeattie