Skip to content
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

Prom maxwell local greedy algorithm #249

Merged
merged 13 commits into from
Jan 9, 2024
Merged

Conversation

andersonw1
Copy link
Collaborator

This PR adds a global prom example for the maxwell equation to libROM (based on MFEM ex3p).

Example run:

Build database
mpirun -np 8 maxwell_local_rom_greedy -build_database -greedy-param-min 1.0 -greedy-param-max 1.2 -greedy-param-size 5 -greedysubsize 2 -greedyconvsize 3 -greedyrelerrortol 0.01

Run full-order model
mpirun -np 8 maxwell_global_rom --fom -f 1.15

Use reduced-order model
mpirun -np 8 maxwell_local_rom_greedy -use_database -online -f 1.15

For this example:
Elapsed time for solving FOM: 8.870853e-01 second
Elapsed time for solving ROM: 9.554200e-05 second

Relative error of ROM solution = 1.88768e-05

Speedup: x9284.76

@andersonw1 andersonw1 changed the title Prom maxwell local greedy Prom maxwell local greedy algorithm Nov 15, 2023
@andersonw1 andersonw1 added the RFR Ready for review label Nov 16, 2023
Copy link
Collaborator

@ckendrick ckendrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few places to remove some unused code, but otherwise the results look good and this works as expected.

examples/prom/maxwell_local_rom_greedy.cpp Outdated Show resolved Hide resolved
examples/prom/maxwell_local_rom_greedy.cpp Outdated Show resolved Hide resolved
examples/prom/maxwell_local_rom_greedy.cpp Outdated Show resolved Hide resolved
examples/prom/maxwell_local_rom_greedy.cpp Outdated Show resolved Hide resolved
examples/prom/maxwell_local_rom_greedy.cpp Outdated Show resolved Hide resolved
examples/prom/maxwell_local_rom_greedy.cpp Outdated Show resolved Hide resolved
examples/prom/maxwell_local_rom_greedy.cpp Outdated Show resolved Hide resolved
examples/prom/maxwell_local_rom_greedy.cpp Show resolved Hide resolved
examples/prom/maxwell_local_rom_greedy.cpp Outdated Show resolved Hide resolved
@chldkdtn
Copy link
Collaborator

chldkdtn commented Jan 4, 2024

@dylan-copeland and @siuwuncheung, would you finish or continue reviewing this PR?

dylan-copeland and others added 5 commits January 8, 2024 13:14
* fix issues in Matrix::orthogonalize

* add Matrix::orthogonalize_last method

* run astyle

* add another test for Matrix::orthogonalize_last

* rerun astyle properly

* review n.1 changes

* review n.2
* Add assemble timer and timing prints

* Fix issue with -online_interp when running in parallel

* Update timing print

* Fix minor typo in examples
* Bug fix.

* Cleaning up a few things.
* initial commit

* Updated ROM operator class definition
 and input arguments

* EQP hyperreduction setup

* Added hyperreduction until line 1000

* Setting BCs

* Finished implementation in main

* Started ROM operator initialization
Need to review before finishing

* Gone through the code
and implemented what was straightforward

* Mult_hyperreduced

* small fixes
to make consistent with class definition

* removed eqp_lifting code, since it's not necessary

* Started eqp coefficient computation implementation
And made fast calculation TODO

* Updated SetupEQP to make tests run

* Some more fixes for the compiler

* Changed rrdim -> rxdim

* Started SetupEqp_snapshots
for hyperelastic nonlinear operator

* Added sketch for compute reduced eqp

* Code compiles

* Added element function to G row computation

* Testing element vector error

* Debugging.
Vshape not implemented for this class...

* fixed bug

* Explicitly adding model to eqp loop

* segfault fix

* segfault fix 2

* debug segfault

* actual debug fix

* perhaps segfault fix

* small fix

* New test.

* testing

* changed back

* testing back again

* Hopefully

* Finished writing the test.

* Fixed compilation

* Debugging elvect size

* passing by reference

* Fix for element vector

* check all errors

* Synced with hyperelasticintegrator.

* Divide error by two

* changed points to check error

* Clean up

* testing SetupEQPSnapshots

* testing errors for NNLS

* small fix

* removed testing

* Remove normalize constraints

* Fixed segfault

* Reduced EQP is building

* Running but wrong

* Runs!

* Fixed some issues

* rank-myid fix

* Syntax improvements

* fixed bug for v0

* small fix

* Implemented time windowing

* Added command line option for time windowing

* Added EQP command line examples

* Cleaned up code

* Sketch for optimized EQP

* Continued fast eqp implementation

* Improved regular EQP

* V-basis speedup

* Storing DS now

* Solved segmentation fault in non eqp hyperreduction

* Adding QDEIM option to some examples.

* updated gitignore

* Matrix multiplication optimization

* Tested precompute optimization

* Numbering works now.

* Testing .hpp fix again

* Fixed .hpp style issue

* Delete the RomOperator to remove a memory leak

* Updated RomOperator structure
to have less leaks in timestepping

* Cause of segfault error found

* Segfault fixed

* Removed EQP bug

* Add x0 to setupEQP

* add matrix row/col rescaling methods

* normalize NNLS constraints

* Added x0

* Fixed bug in NNLS constraint forming loop.

* Max iters increased

* improved eqp speed

* resetting temp variable now

* Moved temporary variable to the correct position

* Minor formatting changes

* Removed duplicate lines in examples

* build succeeds

* Updated formatting

* Astyle 3.1.

* updated .gitignore

* ++ increment

* Removed ReducedSystemOperator

* Removed unnecessary comments

* Added consts

* Added more ++ increments

* Removed unnecessary HSINV

* Comments

* LibROM native read / write

* Added pointer deletion

* librom runs

* New benchmarks

* elementmatrix first implementation

* Construct em outside loop

* Added element matrices to ROM class

* Reduced EQP fast uses em

* Em on everything

* Debugged EQP

* Formatting

* Removed unnecessary comment

* Removed more unnecessary comments

* Implemented subsampling

* measure elapsed time for EQP

* Measure elapsed time for all methods

* Update .gitignore

* Optimized lifting of FOM dimension in Nonlinear elasticity EQP (#259)

* implementation works and gives speed up

* Removed unnecessary variables

* Final benchmark

---------

Co-authored-by: Dylan Copeland <[email protected]>
Co-authored-by: Chris Vales <[email protected]>
Co-authored-by: Dylan Copeland <[email protected]>
@andersonw1 andersonw1 merged commit 8982a9e into master Jan 9, 2024
4 checks passed
@andersonw1 andersonw1 deleted the prom_maxwell_local_greedy branch January 22, 2024 23:21
andersonw1 added a commit that referenced this pull request Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants