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

Method addInstance

Tools/Postprocessing/python/parseparticles.py:185–204  ·  view source on GitHub ↗

add a particleInstance object to the particle history to store a single instance (in time) of this particle

(self, xyz=[-1.0,-1.0,-1.0],t=0.0,
                    dataValues=[])

Source from the content-addressed store, hash-verified

183
184
185 def addInstance(self, xyz=[-1.0,-1.0,-1.0],t=0.0,
186 dataValues=[]):
187 """
188 add a particleInstance object to the particle history to
189 store a single instance (in time) of this particle
190 """
191
192 if (self.finalized == 1):
193 print "ERROR: particle data finalized before addInstance call"
194 sys.exit(2)
195
196
197 xyz = numpy.array(xyz)
198 dataValues = numpy.array(dataValues)
199
200
201 # add this particle instance to the particle history
202 self.history.append(particleInstance(xyz,t,dataValues))
203
204 self.numInstances += 1
205
206
207

Callers 1

parseParticleFileFunction · 0.80

Calls 3

particleInstanceClass · 0.85
arrayMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected