Skip to content

Commit a852056

Browse files
AlejandroMunozManterolaCopilot
andcommitted
Update threshold value in DGOperatorFactory and enhance AnalyticalStudyTests with BesselJ6 family tests
Co-authored-by: Copilot <copilot@github.com>
1 parent bd8dc2b commit a852056

3 files changed

Lines changed: 32 additions & 3 deletions

File tree

src/components/DGOperatorFactory.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1566,7 +1566,9 @@ namespace maxwell
15661566
// Free sub-operator blocks before applying threshold.
15671567
blocks.clear();
15681568

1569-
auto threshold = 1e-20;
1569+
// Threshold set to sqrt(eps_machine) ~ 1e-8, the standard criterion for distinguishing
1570+
// genuine matrix entries from floating-point assembly noise relative to unit-scale quantities.
1571+
auto threshold = 1e-8;
15701572
res->Threshold(threshold);
15711573

15721574
if(this->pd_.opts.export_evolution_operator){

test/cases/AnalyticalStudyTests.cpp

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ static void runBatchSweep(const std::string& case_prefix,
1515
const std::string& case_suffix,
1616
int p_min,
1717
int p_max,
18-
const std::string& description)
18+
const std::string& description,
19+
const std::string& base_export_path = "./Exports/paper/")
1920
{
20-
const std::string base_export_path = "./Exports/single-core/";
2121

2222
int processed = 0;
2323
int missing = 0;
@@ -62,6 +62,32 @@ static void runResonantFamily(const std::string& suffix, const std::string& desc
6262
}
6363
}
6464

65+
static void runBesselJ6Family(const std::string& suffix, const std::string& description)
66+
{
67+
for (int g = 1; g <= 2; ++g) {
68+
std::stringstream prefix;
69+
prefix << "2D_BesselJ6_G" << g;
70+
std::stringstream batch_desc;
71+
batch_desc << description << " G" << g;
72+
runBatchSweep(prefix.str(), suffix, 1, 5, batch_desc.str(), "./Exports/single-core/");
73+
}
74+
}
75+
76+
TEST_F(AnalyticalStudyTests, Batch_BesselJ6_Global_Closed)
77+
{
78+
runBesselJ6Family("", "BesselJ6 Global Closed Basis");
79+
}
80+
81+
TEST_F(AnalyticalStudyTests, Batch_BesselJ6_Hesthaven_Closed)
82+
{
83+
runBesselJ6Family("_hesthaven", "BesselJ6 Hesthaven Closed Basis");
84+
}
85+
86+
TEST_F(AnalyticalStudyTests, Batch_BesselJ6_Global_Open)
87+
{
88+
runBesselJ6Family("_bleg", "BesselJ6 Global Open Basis");
89+
}
90+
6591
TEST_F(AnalyticalStudyTests, Batch_TM55_Resonant_Box_Global_Closed)
6692
{
6793
runResonantFamily("", "TM55 Global Closed Basis");

testData/maxwellInputs/2D_Resonant_Box_TM55_Ha_Pb_Template/2D_Resonant_Box_TM55_Ha_Pb_Template.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"time_step": 0.0001,
66
"basis_type": 1,
77
"final_time": 2.8284,
8+
"export_operator": true,
89
"order": 1
910
},
1011
"model": {

0 commit comments

Comments
 (0)