45 std::fstream fin(fname, std::fstream::in);
55 int xcount{-1}, ycount{-1}, zcount{-1};
56 double xcurr{0}, ycurr{0}, zcurr{0};
59 while(std::getline(fin >>
std::ws, line))
61 std::stringstream ss(line);
63 if(ss.str().front() ==
'#')
71 while(std::getline(fin >>
std::ws, line))
73 double x{0},
y{0},
z{0}, fx{0}, fy{0}, fz{0},
f{0};
74 std::stringstream ss(line);
76 if(ss.str().front() ==
'#')
79 ss >>
x >>
y >>
z >> fx >> fy >> fz >>
f;
81 if(
std::abs(
x - xcurr) > 0.0 || xcount < 0)
91 if(
std::abs(
y - ycurr) > 0.0 || ycount < 0)
96 m_field_x[xcount].emplace_back(std::vector<double>{});
97 m_field_y[xcount].emplace_back(std::vector<double>{});
98 m_field_z[xcount].emplace_back(std::vector<double>{});
105 if(
std::abs(
z - zcurr) > 0.0 || zcount < 0)
118 const double x = pos[0];
119 const double y = pos[1];
120 const double z = pos[2];
130 EDepSimLog(
"Printing values for electric field.");
static constexpr double cm
#define EDepSimLog(outStream)
std::array< double, 3 > m_delta
std::vector< std::vector< std::vector< double > > > m_field_z
std::vector< std::vector< std::vector< double > > > m_field_y
volt_as<> volt
Type of potential stored in volts, in double precision.
virtual void GetFieldValue(const G4double pos[4], G4double *field) const
#define EDepSimError(outStream)
void line(double t, double *p, double &x, double &y, double &z)
double interpolate(const double *point, const std::vector< std::vector< std::vector< double >>> &g, const double *delta, const double *offset) const
std::array< double, 3 > m_offset
bool ReadFile(const std::string &fname)
QTextStream & endl(QTextStream &s)
std::vector< std::vector< std::vector< double > > > m_field_x