Esempio n. 1
0
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()
Esempio n. 2
0
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()
Esempio n. 3
0
 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)
Esempio n. 4
0
 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)