Loader class for vti data.
More...
|
def | __init__ (self, offset, get=1, file='data', mirrorPlane=None, silent=0, rotateX=0, rotateY=0, rotateZ=0, scaleX=1, scaleY=1, scaleZ=1) |
|
def | getNdim (self) |
|
def | getX (self) |
|
def | getY (self) |
|
def | getZ (self) |
|
def | getVars (self) |
|
def | getAll (self) |
|
def | __init__ (self, offset, get=1, file='data', type='vtu', mirrorPlane=None, rotateX=0, rotateY=0, rotateZ=0, scaleX=1, scaleY=1, scaleZ=1, silent=0) |
|
def | getTime (self) |
|
def | getVar (self, varname) |
|
def | getData (self) |
|
def | getPointData (self) |
|
def | getVars (self) |
|
def | getVarnames (self) |
|
def | getBounds (self) |
|
def | getVert (self, icell) |
|
def | getPointList (self) |
|
def | getCenterPoints (self) |
|
def | getSurface (self) |
|
def | getPieces (self, nBWidth, nBHeight, nIgnore) |
|
def | showValues (self, icell) |
|
def | getIcellByPoint (self, x, y) |
|
def | getPoints (self) |
|
def | mirror (self) |
|
def | reflectVar (self, var) |
|
def | getNdim (self) |
|
def | getAll (self) |
|
|
| tend = default_timer() |
| self.nblocks = self.data.GetMaximumNumberOfPieces() self.data.SetUpdateNumberOfPieces(self.nblocks) self.xBlockList=[] self.yBlockList=[] More...
|
|
Loader class for vti data.
Definition at line 431 of file read.py.
◆ __init__()
def read.loadvti.__init__ |
( |
|
self, |
|
|
|
offset, |
|
|
|
get = 1 , |
|
|
|
file = 'data' , |
|
|
|
mirrorPlane = None , |
|
|
|
silent = 0 , |
|
|
|
rotateX = 0 , |
|
|
|
rotateY = 0 , |
|
|
|
rotateZ = 0 , |
|
|
|
scaleX = 1 , |
|
|
|
scaleY = 1 , |
|
|
|
scaleZ = 1 |
|
) |
| |
Definition at line 434 of file read.py.
434 scaleX=1,scaleY=1,scaleZ=1):
436 self.filenameout = file
437 self.isLoaded =
False 438 self.mirrorPlane=mirrorPlane
441 self.rotateX = rotateX
442 self.rotateY = rotateY
443 self.rotateZ = rotateZ
449 self.filename=
''.join([self.filenameout,repr(offset).zfill(4),
'.vti'])
450 self.datareader = v.vtkXMLImageDataReader()
452 if (self.silent == 0): print(
'========================================')
453 if (self.silent == 0): print(
'loading file %s' % (self.filename))
◆ getAll()
def read.loadvti.getAll |
( |
|
self | ) |
|
Definition at line 499 of file read.py.
504 if (self.silent == 0): print(
'Reading data time= %f sec' % (tdata-t0))
512 if self.mirrorPlane !=
None:
513 if (self.silent == 0): print(
'========== Mirror about plane ',self.mirrorPlane,
' ... ============')
517 if (self.silent == 0): print(
'========== Initializing ... ============')
522 if (self.silent == 0): print(
'Getting vars time= %f sec' % (tvars-tdata))
527 if (self.silent == 0): print(
'========== Finished loading %d cells in %f sec, have a nice day! ===========' % (self.ncells, (tend-t0) ))
◆ getNdim()
def read.loadvti.getNdim |
( |
|
self | ) |
|
Definition at line 458 of file read.py.
460 if self.data.GetExtent()[1] - self.data.GetExtent()[0] == 0.:
461 self.ndim=self.ndim - 1
462 if self.data.GetExtent()[3] - self.data.GetExtent()[2] == 0.:
463 self.ndim=self.ndim - 1
464 if self.data.GetExtent()[5] - self.data.GetExtent()[4] == 0.:
465 self.ndim=self.ndim - 1
◆ getVars()
def read.loadvti.getVars |
( |
|
self | ) |
|
Definition at line 484 of file read.py.
485 nvars= self.data.GetCellData().GetNumberOfArrays()
486 for i
in range(nvars):
487 varname = self.data.GetCellData().GetArrayName(i)
488 if (self.silent == 0): print(
"Assigning variable:", varname)
490 vtk_values = self.data.GetCellData().GetArray(varname)
491 if self.getNdim() == 1:
492 exec(
"self.%s = ah.vtk2array(vtk_values)[0:self.ncells].reshape((self.nx),order='F')" % (varname))
493 if self.getNdim() == 2:
494 exec(
"self.%s = ah.vtk2array(vtk_values)[0:self.ncells].reshape((self.nx,self.ny),order='F')" % (varname))
495 if self.getNdim() == 3:
496 exec(
"self.%s = ah.vtk2array(vtk_values)[0:self.ncells].reshape((self.nx,self.ny,self.nz),order='F')" % (varname))
◆ getX()
def read.loadvti.getX |
( |
|
self | ) |
|
Definition at line 468 of file read.py.
469 self.dx=self.data.GetSpacing()[0]
470 self.nx=self.data.GetExtent()[1]-self.data.GetExtent()[0]
471 self.x=self.data.GetOrigin()[0] + np.arange(self.data.GetExtent()[0],self.data.GetExtent()[1])*self.dx+self.dx/2.
◆ getY()
def read.loadvti.getY |
( |
|
self | ) |
|
Definition at line 473 of file read.py.
474 self.dy=self.data.GetSpacing()[1]
475 self.ny=self.data.GetExtent()[3]-self.data.GetExtent()[2]
476 self.y=self.data.GetOrigin()[1] + np.arange(self.data.GetExtent()[2],self.data.GetExtent()[3])*self.dy+self.dy/2.
◆ getZ()
def read.loadvti.getZ |
( |
|
self | ) |
|
Definition at line 478 of file read.py.
479 self.dz=self.data.GetSpacing()[2]
480 self.nz=self.data.GetExtent()[5]-self.data.GetExtent()[4]
481 self.z=self.data.GetOrigin()[2] + np.arange(self.data.GetExtent()[4],self.data.GetExtent()[5])*self.dz+self.dz/2.
◆ datareader
◆ dx
◆ dy
◆ dz
◆ filename
◆ filenameout
◆ isLoaded
◆ mirrorPlane
◆ ndim
◆ nx
◆ ny
◆ nz
◆ offset
◆ rotateX
◆ rotateY
◆ rotateZ
◆ scaleX
◆ scaleY
◆ scaleZ
◆ silent
The documentation for this class was generated from the following file: