-
Notifications
You must be signed in to change notification settings - Fork 43
Squared singular values to calculate POD variance #306
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
Changes from 6 commits
d03d6c9
9d2bf98
10958cf
f0f146a
1fbbf99
89caae4
b5020b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -308,7 +308,7 @@ CAROM::Matrix *GetFirstColumns(const int N, const CAROM::Matrix *A) | |
|
|
||
| // TODO: move this to the library? | ||
| void MergeBasis(const int dimFOM, const int nparam, const int max_num_snapshots, | ||
| std::string name) | ||
| std::string name, bool squareSV) | ||
| { | ||
| MFEM_VERIFY(nparam > 0, "Must specify a positive number of parameter sets"); | ||
|
|
||
|
|
@@ -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); | ||
|
||
| } | ||
|
|
||
| const CAROM::Matrix *GetSnapshotMatrix(const int dimFOM, const int nparam, | ||
|
|
@@ -416,6 +416,7 @@ int main(int argc, char *argv[]) | |
| bool x_base_only = false; | ||
| int num_samples_req = -1; | ||
| const char *samplingType = "gnat"; | ||
| bool squareSV = true; | ||
|
|
||
| int nsets = 0; | ||
| int id_param = 0; | ||
|
|
@@ -478,6 +479,8 @@ int main(int argc, char *argv[]) | |
| "Enable or disable the online phase."); | ||
| args.AddOption(&merge, "-merge", "--merge", "-no-merge", "--no-merge", | ||
| "Enable or disable the merge phase."); | ||
| args.AddOption(&squareSV, "-sqsv", "--square-sv", "-no-sqsv", "--no-square-sv", | ||
| "Use singular values squared in energy fraction."); | ||
| args.AddOption(&samplingType, "-hrtype", "--hrsamplingtype", | ||
| "Sampling type for hyperreduction."); | ||
| args.AddOption(&num_samples_req, "-nsr", "--nsr", | ||
|
|
@@ -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); | ||
| } | ||
|
|
||
| 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); | ||
|
|
||
| totalTimer.Stop(); | ||
| if (myid == 0) | ||
|
|
||
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