MCPcopy Create free account
hub / github.com/AMReX-Codes/amrex / flatten

Method flatten

Tools/Postprocessing/python/parseparticles.py:226–247  ·  view source on GitHub ↗

return numpy arrays with the coordinates and time for all instances of this particle

(self)

Source from the content-addressed store, hash-verified

224
225
226 def flatten(self):
227 """
228 return numpy arrays with the coordinates and time for all
229 instances of this particle
230 """
231
232 if (not self.finalized == 1):
233 print "ERROR: particle data not finalized before flatten call"
234 sys.exit(2)
235
236 coords = numpy.zeros((self.dim, self.numInstances), dtype=numpy.float64)
237 time = numpy.zeros((self.numInstances), dtype=numpy.float64)
238
239 n = 0
240 while (n < len(self.history)):
241 coords[:,n] = self.history[n].xyz[:self.dim]
242
243 time[n] = self.history[n].t
244
245 n += 1
246
247 return coords, time
248
249
250 def getVarIndex(self, varname):

Callers 2

mainFunction · 0.80
mainFunction · 0.80

Calls

no outgoing calls

Tested by 1

mainFunction · 0.64