46 const std::string dir =
"dirichlet_writer_dump_dir";
47 std::filesystem::remove_all(dir);
51 const std::size_t nx = 2;
52 const std::size_t ny = 3;
53 const std::vector<double> x = {0.0, 0.1};
54 const std::vector<double> y = {-0.2, 0.0, 0.2};
55 const std::vector<double> phi = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0};
60 0.25, x, y, phi, nx, ny,
"legacy");
62 const std::string expectedFile = dir +
"/phi_dirichlet_legacy_step-00000007.dat";
63 ASSERT_TRUE(std::filesystem::exists(expectedFile));
65 const std::string content = readFile(expectedFile);
66 EXPECT_NE(content.find(
"# Dirichlet-plane potential dump"), std::string::npos);
67 EXPECT_NE(content.find(
"step=7"), std::string::npos);
68 EXPECT_NE(content.find(
"zPlane=0.25"), std::string::npos);
69 EXPECT_NE(content.find(
"columns: i j x[m] y[m] phi[V]"), std::string::npos);
void writePlane(long long step, double time, double zPlane, const std::vector< double > &xCoords, const std::vector< double > &yCoords, const std::vector< double > &phiValues, std::size_t nx, std::size_t ny, const std::string &solveTag)
Write one plane snapshot.