Commit fd1ff856 authored by frey_m's avatar frey_m
Browse files

FieldWriter: only single core

parent 71e17040
......@@ -45,9 +45,6 @@
//#define FIELDSTDOUT
// Class PartBunch
// ------------------------------------------------------------------------
PartBunch::PartBunch(const PartData *ref): // Layout is set using setSolver()
PartBunchBase<double, 3>(new PartBunch::pbase_t(new Layout_t()), ref),
interpolationCacheSet_m(false)
......@@ -256,7 +253,7 @@ void PartBunch::computeSelfFields(int binNumber) {
const int dumpFreq = 100;
VField_t tmp_eg = eg_m;
if (Ippl::getNodes() == 1 && (localTrackStep_m + 1) % dumpFreq == 0) {
if ((localTrackStep_m + 1) % dumpFreq == 0) {
Vector_t rmin, rmax;
get_bounds(rmin, rmax);
......@@ -315,7 +312,7 @@ void PartBunch::computeSelfFields(int binNumber) {
#ifdef DBG_SCALARFIELD
tmp_eg += eg_m;
if (Ippl::getNodes() == 1 && (localTrackStep_m + 1) % dumpFreq == 0) {
if ((localTrackStep_m + 1) % dumpFreq == 0) {
FieldWriter fwriter;
fwriter.dumpField(tmp_eg, "e", "V/m", localTrackStep_m / dumpFreq);
}
......
//
// Class FieldWriter
// This class writes the bunch internal fields on the grid to
// file.
// file. It supports single core execution only.
//
// Copyright (c) 2020, Paul Scherrer Institut, Villigen PSI, Switzerland
// All rights reserved
......
//
// Class FieldWriter
// This class writes the bunch internal fields on the grid to
// file.
// file. It supports single core execution only.
//
// Copyright (c) 2020, Paul Scherrer Institut, Villigen PSI, Switzerland
// All rights reserved
......@@ -31,6 +31,10 @@ void FieldWriter::dumpField(FieldType& field, std::string name,
std::string unit, long long step,
FieldType* image)
{
if (Ippl::getNodes() > 1) {
return;
}
constexpr bool isVectorField = std::is_same<VField_t, FieldType>::value;
std::string type = (isVectorField) ? "field" : "scalar";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment