def saveSkeleton(menuitem, filename, mode, format, skeleton): skelcontext = skeletoncontext.skeletonContexts[skeleton] if format == datafile.ABAQUS: skeletonIO.writeABAQUSfromSkeleton(filename, mode.string(), skelcontext) else: dfile = datafile.writeDataFile(filename, mode.string(), format) microstructureIO.writeMicrostructure(dfile, skelcontext.getParent()) skeletonIO.writeSkeleton(dfile, skelcontext) dfile.close()
def saveSkeleton(menuitem, filename, mode, format, skeleton): skelcontext = skeletoncontext.skeletonContexts[skeleton] if format==datafile.ABAQUS: skeletonIO.writeABAQUSfromSkeleton(filename, mode.string(), skelcontext) else: dfile = datafile.writeDataFile(filename, mode.string(), format) microstructureIO.writeMicrostructure(dfile, skelcontext.getParent()) skeletonIO.writeSkeleton(dfile, skelcontext) dfile.close()
def start(self, meshcontext, time, continuing): # ScheduledOutput.start() opens the file and resets 'rewound'. writeskel = self.destination.rewound or not continuing scheduledoutput.ScheduledOutput.start(self, meshcontext, time, continuing) if writeskel: skelcontext = meshcontext.getParent() mscontext = skelcontext.getParent() microstructureIO.writeMicrostructure(self.destination.dfile(), mscontext) skeletonIO.writeSkeleton(self.destination.dfile(), skelcontext) writeMesh(self.destination.dfile(), meshcontext, includeFields=False)
def saveMicrostructure(menuitem, filename, mode, format, microstructure): ms = ooflib.common.microstructure.microStructures[microstructure] dfile = datafile.writeDataFile(filename, mode.string(), format) microstructureIO.writeMicrostructure(dfile, ms) dfile.close()