-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added global prom for maxwell equation #246
Conversation
There is a little red cross to the left of the commit number 34936f7, which indicates there are some failing checks. If you press it, you will see "CI / code-style (pull_request) Failing after 41s". That indicates some code styles need to be fixed, e.g. non-uniform indents, too-long lines. That's an automatic way to fix it through astyle. If you download from the source and build it, then in the parent directory of libROM just do |
ran stylization and removed line of code initializing Hypre
// FOM solution: maxwell_global_rom -fom -f 1.15 | ||
// | ||
// Online phase: maxwell_global_rom -online -f 1.15 | ||
// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it also work in parallel, like poisson_global_rom
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested in parallel and confirmed that it works, so you can copy the comment from the Poisson example:
// This example runs in parallel with MPI, by using the same number of MPI ranks
// in all phases (offline, merge, fom, online).
Changed saving mesh/sol files to calculate relative errors Saved mesh/solution files are now in folders titled "maxwell" instead of "example3"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @andersonw1!
examples/prom/maxwell_global_rom.cpp
Outdated
|
||
// libROM stores the matrix row-wise, so wrapping as a DenseMatrix in MFEM means it is transposed. | ||
DenseMatrix *reducedBasisT = new DenseMatrix(spatialbasis->getData(), | ||
numColumnRB, numRowRB); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems unnecessary. The same object is defined in the global ROM for Poisson equation, both in C++ and Python side. Can @andersonw1 @dreamer2368 take care of it? Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I deleted this line and everything runs with the same result, so it seems this part was unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I'll take care of the Poisson equation.
Looks good to me! Thanks @andersonw1 for the effort. Please run |
This PR adds a global prom example for the maxwell equation to libROM (based on MFEM ex3p).
Example runs
mpirun -np 8 maxwell_global_rom --offline -f 1.0 -id 0
mpirun -np 8 maxwell_global_rom --offline -f 1.1 -id 1
mpirun -np 8 maxwell_global_rom --offline -f 1.2 -id 2
Merge snapshots to make the basis
mpirun -np 8 maxwell_global_rom --merge -ns 3
Run full-order model
mpirun -np 8 maxwell_global_rom --fom -f 1.15
Use reduced-order model
mpirun -np 8 maxwell_global_rom --online -f 1.15
For this example:
Elapsed time for solving FOM: 4.906529e-01 second
Elapsed time for solving ROM: 1.010420e-04 second
Relative error of ROM solution = 0.00044228
Speedup: x4855.93