Skip to content

Minor improvements to examples/douglas_2024#22

Merged
cmdoug merged 3 commits into
mainfrom
jolivet/improve-douglas_2024
May 11, 2026
Merged

Minor improvements to examples/douglas_2024#22
cmdoug merged 3 commits into
mainfrom
jolivet/improve-douglas_2024

Conversation

@prj-

@prj- prj- commented May 7, 2026

Copy link
Copy Markdown
Collaborator

This needs FreeFem/FreeFem-sources#393. BTW, examples/douglas_2024/modecomputeaug.md does not run, should this file be removed, or fixed?

@prj-
prj- requested a review from cmdoug May 7, 2026 18:08
@cmdoug

cmdoug commented May 7, 2026

Copy link
Copy Markdown
Owner

Thanks for the suggestion. A serial code (that did not use MPI) was specifically requested by a reviewer, so I'm going to leave this one as-is.

@cmdoug cmdoug closed this May 7, 2026
@cmdoug cmdoug reopened this May 7, 2026
@cmdoug

cmdoug commented May 7, 2026

Copy link
Copy Markdown
Owner

Though not planned, I can confirm that this works with FreeFem/FreeFem-sources#393. The fix for the bug you've reported is addressed in #23.

@cmdoug cmdoug closed this May 7, 2026
@cmdoug
cmdoug deleted the jolivet/improve-douglas_2024 branch May 7, 2026 21:07
@prj-

prj- commented May 8, 2026

Copy link
Copy Markdown
Collaborator Author

A serial code (that did not use MPI) was specifically requested by a reviewer, so I'm going to leave this one as-is.

That's plain wrong, though. The code does not run as is (with FreeFem++), because you are using load "MUMPS", which yields:

$ FreeFem++ -v 0 examples/douglas_2024/example1_suppmat.md
 -- CASE #1: Convective BC -- 
Attempting to use an MPI routine (internal_Comm_dup) before initializing or after finalizing MPICH

@prj-
prj- restored the jolivet/improve-douglas_2024 branch May 8, 2026 04:35
@cmdoug

cmdoug commented May 8, 2026

Copy link
Copy Markdown
Owner

My (seemingly incorrect) understanding was that MUMPS is an alias to MUMPS_seq when run using FreeFem++ instead of FreeFem++-mpi. I am not seeing the error you report, perhaps because I have compiled all 3rdparty libraries when building FreeFEM. When I run FreeFem++, I see:

$ FreeFem++ -v 0 examples/douglas_2024/example1_suppmat.md
init MUMPS_SEQ: MPI_Init
 -- CASE #1: Convective BC -- 
Residual norm = 0.131016, Step norm = 76.3352.
Residual norm = 1.69096e-10, Step norm = 6.73719e-06.
Residual norm = 3.17352e-16.
convective BC: err = 0.000191472, #DOF = 68032.
 -- CASE #2: Free Outflow BC -- 
Residual norm = 0.0200298, Step norm = 109.95.
Residual norm = 0.000913451, Step norm = 18.2839.
Residual norm = 4.56383e-05, Step norm = 0.312913.
Residual norm = 3.09426e-07, Step norm = 0.00100929.
Residual norm = 7.25702e-12, Step norm = 2.06395e-08.
Residual norm = 4.64197e-17.
free outflow BC: err = 0.400172, #DOF = 68031.
 -- CASE #3: Balanced Outflow BC -- 
Residual norm = 0.481056, Step norm = 148.737.
Residual norm = 3.97457, Step norm = 3.70177e-08.
Residual norm = 8.84609e-12, Step norm = 1.2913e-13.
Residual norm = 9.67158e-14.
balanced BC: err = 2.14021e-05, #DOF = 68134.
close  MUMPS_SEQ: MPI_Finalize

Then, with FreeFem++-mpi (and your recent commit on FreeFEM):

$ FreeFem++-mpi -v 0 examples/douglas_2024/example1_suppmat.md
 -- CASE #1: Convective BC -- 
Residual norm = 0.131016, Step norm = 76.3352.
Residual norm = 1.69096e-10, Step norm = 6.73721e-06.
Residual norm = 1.55966e-16.
convective BC: err = 0.000191472, #DOF = 68032.
 -- CASE #2: Free Outflow BC -- 
Residual norm = 0.0200298, Step norm = 109.95.
Residual norm = 0.000913451, Step norm = 18.2839.
Residual norm = 4.56383e-05, Step norm = 0.312913.
Residual norm = 3.09426e-07, Step norm = 0.00100929.
Residual norm = 7.25702e-12, Step norm = 2.06395e-08.
Residual norm = 4.59208e-17.
free outflow BC: err = 0.400172, #DOF = 68031.
 -- CASE #3: Balanced Outflow BC -- 
Residual norm = 0.481056, Step norm = 148.737.
Residual norm = 3.97457, Step norm = 3.70008e-08.
Residual norm = 8.88315e-12, Step norm = 1.63808e-13.
Residual norm = 1.04927e-13.
balanced BC: err = 2.14021e-05, #DOF = 68134.

@cmdoug cmdoug reopened this May 8, 2026
@prj- prj- changed the title No need for FreeFem++ anymore Minor improvements to examples/douglas_2024 May 8, 2026
@prj-

prj- commented May 8, 2026

Copy link
Copy Markdown
Collaborator Author

I am not seeing the error you report, perhaps because I have compiled all 3rdparty libraries when building FreeFEM.

Indeed, I don't have MUMPS_seq, so it picks up MUMPS_mpi instead, and it fails.

@prj-
prj- force-pushed the jolivet/improve-douglas_2024 branch from bd32dd4 to 660b9e8 Compare May 8, 2026 11:31
@prj-

prj- commented May 8, 2026

Copy link
Copy Markdown
Collaborator Author

The latest commit needs FreeFem/FreeFem-sources@e21a086.

@cmdoug

cmdoug commented May 8, 2026

Copy link
Copy Markdown
Owner

Thanks for that. Will rebase with your new commit and give this a test later today.

@cmdoug

cmdoug commented May 8, 2026

Copy link
Copy Markdown
Owner

All works on my end. Anything else in the pipeline here or should I merge this after FreeFEM #393 is merged?

@prj-

prj- commented May 8, 2026

Copy link
Copy Markdown
Collaborator Author

All good on my end. There are still a couple of MatConvert() in macros_bifbox.idp which could likely be removed, but it's orthogonal to this PR, and I'm not sure how to trigger these to make sure I'm not introducing any regression.

@cmdoug

cmdoug commented May 8, 2026

Copy link
Copy Markdown
Owner

Thanks. Yes, I was looking at those once I saw your latest commit on FF. Its delicate since we need to construct a Mat[int, int] block-by-block, and then pass everything into a pre-setup Mat. Will try some things.

cmdoug
cmdoug previously approved these changes May 8, 2026
@prj-

prj- commented May 11, 2026

Copy link
Copy Markdown
Collaborator Author

Should be good to go now.

@cmdoug
cmdoug merged commit 4d95a7f into main May 11, 2026
1 check passed
@cmdoug
cmdoug deleted the jolivet/improve-douglas_2024 branch May 11, 2026 12:03
@cmdoug cmdoug added the examples only Changes only affect examples label May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

examples only Changes only affect examples

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants