-
Notifications
You must be signed in to change notification settings - Fork 38
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
Squared singular values to calculate POD variance #306
Conversation
Following the approach in Dylan's corresponding Laghos PR, there is now a possibility to retrieve the old way of calculating energy fractions by calling:
|
@axla-io Thanks for catching and fixing that! As the code style CI fails, you'll need to run @mjkim1001 Seems the number of basis vectors is quite different. It might be better if we repeat the study again... |
@siuwuncheung Good catch, the latest commit is astyled. |
Looks good to me! Also, I can re-generate the results based on this PR. |
Reopening this PR since it was closed before merging. |
@@ -328,7 +328,7 @@ void MergeBasis(const int dimFOM, const int nparam, const int max_num_snapshots, | |||
generator.endSamples(); // save the merged basis file | |||
|
|||
int cutoff = 0; | |||
generator.finalSummary(1e-7, cutoff, "mergedSV_" + name + ".txt"); | |||
generator.finalSummary(1e-7, cutoff, "mergedSV_" + name + ".txt",0,squareSV); |
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.
It is irrelevant to the functionality, but adding space after the commas make it consistent.
@@ -643,11 +646,11 @@ int main(int argc, char *argv[]) | |||
// Merge bases | |||
if (x_base_only == false) | |||
{ | |||
MergeBasis(true_size, nsets, max_num_snapshots, "V"); | |||
MergeBasis(true_size, nsets, max_num_snapshots, "V",squareSV); |
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.
Same here
MergeBasis(true_size, nsets, max_num_snapshots, "X"); | ||
MergeBasis(true_size, nsets, max_num_snapshots, "H"); | ||
MergeBasis(true_size, nsets, max_num_snapshots, "X",squareSV); | ||
MergeBasis(true_size, nsets, max_num_snapshots, "H",squareSV); |
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.
Same here in these 2 lines
Thanks @siuwuncheung this is resolved now. Interesting that astyle doesn't catch that |
@@ -448,7 +448,7 @@ void MergeBasis(const int dimFOM, const int nparam, const int max_num_snapshots, | |||
generator.endSamples(); // save the merged basis file | |||
|
|||
int cutoff = 0; | |||
generator.finalSummary(1e-4, cutoff, "mergedSV_" + name); | |||
generator.finalSummary(1e-4, cutoff, "mergedSV_" + name,0, squareSV); |
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.
Sorry for asking this again.. there is one more comma in this line
@@ -328,7 +328,7 @@ void MergeBasis(const int dimFOM, const int nparam, const int max_num_snapshots, | |||
generator.endSamples(); // save the merged basis file | |||
|
|||
int cutoff = 0; | |||
generator.finalSummary(1e-7, cutoff, "mergedSV_" + name + ".txt"); | |||
generator.finalSummary(1e-7, cutoff, "mergedSV_" + name + ".txt",0, squareSV); |
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.
Sorry for asking this again.. there is one more comma in this line.
Otherwise everything looks good to me!
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.
@siuwuncheung Cool, in the latest commit, it's fixed.
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 @axla-io. Now this gets enough approvals. Please merge this PR to the master when you get a chance.
Current libROM implementation of
BasisGenerator::finalSummary
sums the singular values to calculate the total POD energy, but this should actually be the sum of squared singular values, compare to Chatterjee (2000) chapter 6.4. This short PR adresses that in libROM.Test mixed nonlinear diffusion
To test with mixed nonlinear diffusion, run:
On the current master, the file
mergedSV_FR
readsIn this PR, the file reads
Test nonlinear elasticity
To test with nonlinear elasticity, run:
On the current master, the file
mergedSV_H.txt
readsIn this PR, the file reads