Skip to content

Commit f546b34

Browse files
authored
Merge pull request #22 from OpenSEMBA/unshielded-wires
Unshielded wires test on fdtd cell centering
2 parents 282620f + ed265ac commit f546b34

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,4 @@ __pycache__/
6464
/mfem-build
6565
/testData/lansink2024_single_wire/lansink2024_single_wire.areas.json
6666
/testData/lansink2024_fdtd_cell/calculations.py
67+
/testData/lansink2024/inCellPotentials.out.json

test/DriverTest.cpp

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,56 @@ TEST_F(DriverTest, lansink2024_two_wires_using_multipolar_expansion)
636636
EXPECT_NEAR(0.0, relError(expectedL11, computedL11), rTol);
637637
}
638638

639+
640+
TEST_F(DriverTest, lansink2024_two_wires_shifted_and_centered)
641+
{
642+
// From:
643+
// Rotgerink, J.L. et al. (2024, September).
644+
// Numerical Computation of In - cell Parameters for Multiwire Formalism in FDTD.
645+
// In 2024 International Symposium on Electromagnetic Compatibility
646+
// EMC Europe(pp. 334 - 339). IEEE.
647+
648+
const std::string CASE{ "lansink2024" };
649+
650+
auto inCell{
651+
Driver::loadFromFile(
652+
casesFolder() + CASE + "/" + CASE + ".pulmtln.in.json"
653+
).getInCellPotentials()
654+
};
655+
656+
Box fdtdCellCentered{ {-0.100, -0.100}, {0.100, 0.100} };
657+
658+
{
659+
Box fdtdCellShifted{ {-0.110, -0.100}, {0.090, 0.100} };
660+
auto computedC_shifted = inCell.getCapacitanceOnBox(0, 0, fdtdCellShifted);
661+
auto computedC_centered = inCell.getCapacitanceOnBox(0, 0, fdtdCellCentered);
662+
auto err = relError(computedC_shifted, computedC_centered);
663+
EXPECT_TRUE(err < 1e-4);
664+
}
665+
{
666+
Box fdtdCellShifted{ {-0.110, -0.100}, {0.090, 0.100} };
667+
auto computedC_shifted = inCell.getCapacitanceOnBox(0, 1, fdtdCellShifted);
668+
auto computedC_centered = inCell.getCapacitanceOnBox(0, 1, fdtdCellCentered);
669+
auto err = relError(computedC_shifted, computedC_centered);
670+
EXPECT_TRUE(err < 1e-2);
671+
}
672+
{
673+
Box fdtdCellShifted{ { -0.090, -0.100 }, { 0.110, 0.100 } };
674+
auto computedC_shifted = inCell.getCapacitanceOnBox(1, 0, fdtdCellShifted);
675+
auto computedC_centered = inCell.getCapacitanceOnBox(1, 0, fdtdCellCentered);
676+
auto err = relError(computedC_shifted, computedC_centered);
677+
EXPECT_TRUE(err < 1e-2);
678+
}
679+
{
680+
Box fdtdCellShifted{ { -0.090, -0.100 }, { 0.110, 0.100 } };
681+
auto computedC_shifted = inCell.getCapacitanceOnBox(1, 1, fdtdCellShifted);
682+
auto computedC_centered = inCell.getCapacitanceOnBox(1, 1, fdtdCellCentered);
683+
auto err = relError(computedC_shifted, computedC_centered);
684+
EXPECT_TRUE(err < 1e-2);
685+
}
686+
}
687+
688+
639689
TEST_F(DriverTest, lansink2024_single_wire_in_cell_parameters)
640690
{
641691
// From:

0 commit comments

Comments
 (0)