Added possibility of setting the VTU color mapper. Color palete is not yet implemented.
| | |
| | | from trisurf import trisurf |
| | | from trisurf import tsmgr |
| | | |
| | | |
| | | from trisurf import analyses |
| | | |
| | | |
| | | #Ok... Configure your keys: |
| | |
| | | |
| | | hosts=({'name':'natalie','address':'kabinet.penic.eu', 'runs':Runs, 'username':'samo', 'remotebasepath':'simulations-test/subdir/subdir'}, |
| | | {'name':'Hestia','address':'127.0.0.1', 'runs':Runs, 'username':'samo'}) |
| | | analyses={'analysis1':analyze,'webReport':testWebAnalysis} |
| | | analyses={'analysis1':analyze,'webReport':testWebAnalysis,'runningavg':analyses.plotrunningavginteractive} |
| | | |
| | | tsmgr.start(hosts, analyses=analyses) |
| | |
| | | from trisurf import analyses |
| | | analyses.plotColumnFromPostProcess(run,column='VertexMoveSucessRate',filename='statistics.csv',**kwargs) |
| | | |
| | | def runningavgc0(run, **kwargs): |
| | | from trisurf import analyses |
| | | analyses.plotrunningavginteractive(run, scalar_field='spontaneous_curvature', **kwargs) |
| | | |
| | | #start manager with configured runs |
| | | tsmgr.start(Runs, analyses={'demo':analyses.demo,'runningavg':analyses.plotrunningavginteractive, 'plothbar':analyses.plotColumnFromPostProcess, 'plotvol':plotvolume, 'plotbondrate':plotbondrate}) |
| | | tsmgr.start(Runs, analyses={'demo':analyses.demo,'runningavg':analyses.plotrunningavginteractive, 'plothbar':analyses.plotColumnFromPostProcess, 'plotvol':plotvolume, 'plotbondrate':plotbondrate, 'runningavgC0':runningavgc0}) |
| | | |
| | | #here is how we combine statistics of multiple runs |
| | | #statistics.combine([Runs[1],Runs[2]]) |
| | |
| | | |
| | | |
| | | class Renderer: |
| | | def __init__(self,args,host,run, timestep=-1): |
| | | def __init__(self,args,host,run, timestep=-1, scalar_field='vertices_idx'): |
| | | self.host=host |
| | | self.args=args |
| | | self.run=run |
| | | self.timestep=timestep |
| | | self.scalar_field=scalar_field |
| | | self.renderer = vtkRenderer() |
| | | self.actor=self.lastActor() |
| | | self.textactor=self.textActor() |
| | |
| | | reader.SetFileName(self.filename) |
| | | reader.Update() # Needed because of GetScalarRange |
| | | output = reader.GetOutput() |
| | | output.GetPointData().SetActiveScalars(self.scalar_field) |
| | | scalar_range = output.GetScalarRange() |
| | | mapper = vtkDataSetMapper() |
| | | mapper.SetInputData(output) |
| | | mapper.SetScalarRange(scalar_range) |
| | | |
| | | #color lookuptables |
| | | #lut = vtk.vtkLookupTable() |
| | | #lut.SetHueRange(0.5, 0.6) |
| | | #lut.SetSaturationRange(0, 1) |
| | | #lut.SetValueRange(0, 1) |
| | | |
| | | #mapper.SetLookupTable(lut) |
| | | |
| | | # Create the Actor |
| | | actor = vtkActor() |
| | |
| | | print(kwargs.get('args',None)) |
| | | |
| | | |
| | | def plotrunningavginteractive(run, **kwargs): |
| | | # can be wrapped to specify scalar_field) |
| | | def plotrunningavginteractive(run, scalar_field='vertices_idx', **kwargs): |
| | | import matplotlib.pyplot as plt |
| | | from trisurf import VTKRendering as vtk |
| | | import math |
| | |
| | | avg.append(np.average(col[:-i])) |
| | | return avg |
| | | def spawned_viewer(n): |
| | | vtk.Renderer(kwargs.get('args', None),kwargs.get('host',None),run, n) |
| | | vtk.Renderer(kwargs.get('args', None),kwargs.get('host',None),run, timestep=n,scalar_field=scalar_field) |
| | | |
| | | fig=plt.figure(1) |
| | | ra=running_avg(table['hbar']) |