Typo in Garfield++ ViewField.cc?

I was looking into source code of Garfield++ and found there is some comparison in the function ViewField::PlotFieldLines(), which is:

void ViewField::PlotFieldLines(const std::vector<double>& x0,
                               const std::vector<double>& y0,
                               const std::vector<double>& z0,
                               const bool electron, const bool axis,
                               const short col) {

  if (x0.empty() || y0.empty() || z0.empty()) return;
  const size_t nLines = x0.size();
  if (y0.size() != nLines || x0.size() != nLines) {
    std::cerr << m_className << "::PlotLines:\n"
              << "    Mismatch in number of x/y/z coordinates.\n";

in the if loop there is “x0.size() != nLines”, shouldn’t it be z0 instead of x0?
Sorry if I misunderstood the algorithm…

Yes, it’s definitely a bug! Thanks a lot for spotting it! I’ll fix it asap…

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.