LLNL / libROM

Model reduction library with an emphasis on large scale parallelism and linear subspace methods
https://www.librom.net
Other
197 stars 36 forks source link

Add elliptic eigenvalue global prom example #266

Closed ckendrick closed 3 months ago

ckendrick commented 5 months ago

Adds a simple elliptic eigenvalue global pROM example based on MFEM example 11p.

Note: MFEM needs to be compiled with MFEM_USE_LAPACK enabled to run the online phase. This adds a -l option to the compile.sh script to build MFEM with lapack enabled.

Sample runs:

./elliptic_eigenproblem_global_rom -offline -p 2 -id 0 -a 0.40
./elliptic_eigenproblem_global_rom -offline -p 2 -id 1 -a 0.45
./elliptic_eigenproblem_global_rom -offline -p 2 -id 2 -a 0.55
./elliptic_eigenproblem_global_rom -offline -p 2 -id 3 -a 0.60

./elliptic_eigenproblem_global_rom -merge -p 2 -ns 4

./elliptic_eigenproblem_global_rom -fom -p 2 -a 0.50 -visit

./elliptic_eigenproblem_global_rom -online -p 2 -a 0.50

Example FOM output:

Number of unknowns: 289
 Eigenvalue 0: 0.04533314
 Eigenvalue 1: 0.11332411
 Eigenvalue 2: 0.11486387
 Eigenvalue 3: 0.18192
 Eigenvalue 4: 0.22964377
Elapsed time for assembling FOM: 1.475750e-03 second
Elapsed time for solving FOM: 3.390041e-01 second

Example online output:

spatial basis dimension is 289 x 20
Eigenvalue 0: = 0.048430949
Eigenvalue 1: = 0.12021157
Eigenvalue 2: = 0.12147847
Eigenvalue 3: = 0.19456504
Eigenvalue 4: = 0.24285855
Relative error of ROM solution for eigenvalue 0 = 0.068334316
Relative error of ROM solution for eigenvalue 1 = 0.060776586
Relative error of ROM solution for eigenvalue 2 = 0.057586388
Relative error of ROM solution for eigenvalue 3 = 0.069508795
Relative error of ROM solution for eigenvalue 4 = 0.057544708
Relative l2 error of ROM eigenvector 0 = 0.070430601
Relative l2 error of ROM eigenvector 1 = 1.996413
Relative l2 error of ROM eigenvector 2 = 0.077548522
Relative l2 error of ROM eigenvector 3 = 0.10685373
Relative l2 error of ROM eigenvector 4 = 0.1494834
Elapsed time for assembling ROM: 5.230334e-03 second
Elapsed time for solving ROM: 7.794170e-04 second
siuwuncheung commented 3 months ago

Inviting @dreamer2368 as a reviewer to evaluate the changes in the build process in this PR.

siuwuncheung commented 3 months ago

I had approved this PR after reviewing the changes and reproducing the results. We need one more approval to get this PR merged.