def section5Disp(odbName): keysToWrite = ['resForce', 'rightInitCoord', 'rightU1', 'rightU2', 'time'] valuesToWrite = dict.fromkeys(keysToWrite, None) run = False for data in range(len(valuesToWrite)): file = valuesToWrite.keys()[data] + '.ascii' if (not os.path.isfile(file))\ or (os.path.getmtime(file) < os.path.getmtime('exeCalls.txt'))\ or (os.path.getmtime(file) < os.path.getmtime(__file__)): run = True break if run: setName = 'INPLANE5_INSTANCE.SF_INPLANE5_WITH_SECTIONNED6' if '02' in odbName: setName = 'SECTIONED2_INSTANCE.SF_SECTIONED2_WITH_INPLANE1' print "running postPro on %s" % (odbName) myOdb = odbTools.openOdb(odbName) time = ext.getTime(myOdb) resForce = ext.getResF2D(myOdb, setName) rightInitCoord = ext.getNCoord(myOdb, setName) rightU1 = ext.getU_1(myOdb, setName) rightU2 = ext.getU_2(myOdb, setName) valuesToWrite = dict(rightInitCoord=rightInitCoord, rightU1=rightU1, rightU2=rightU2, resForce=resForce, time=time) odbTools.writeValues(valuesToWrite) myOdb.close()
def containedDisplExtractors(odbName): keysToWrite = [ 'radialDisp_intFace', 'resForce_intFace', 'radialDisp_outFace', 'resForce_outFace', 'time' ] valuesToWrite = dict.fromkeys(keysToWrite, None) run = False for data in range(len(valuesToWrite)): file = valuesToWrite.keys()[data] + '.ascii' if (not os.path.isfile(file))\ or (os.path.getmtime(file) < os.path.getmtime('exeCalls.txt'))\ or (os.path.getmtime(file) < os.path.getmtime(__file__)): run = True break if run: print "running postPro on %s" % (odbName) myOdb = odbTools.openOdb(odbName) time = ext.getTime(myOdb) intRadialDispl = ext.getU_3(myOdb, 'innerFace') extRadialDispl = ext.getU_3(myOdb, 'outerFace') inResForce = ext.getResF(myOdb, 'innerFace') outResForce = ext.getResF(myOdb, 'outerFace') valuesToWrite = dict(radialDisp_intFace=intRadialDispl, radialDisp_outFace=extRadialDispl, resForce_intFace=inResForce, resForce_outFace=outResForce, time=time) odbTools.writeValues(valuesToWrite) myOdb.close()
def appliedDisplExtractors(odbName): keysToWrite = ['time', 'topResForce', 'bottomResForce'] keysToWrite.append('initCoord') keysToWrite.append('radialDisp') keysToWrite.append('axialDisp') keysToWrite.append('tgtDisp') valuesToWrite = dict.fromkeys(keysToWrite, None) run = False for data in valuesToWrite.keys(): file = data + '.ascii' if (not os.path.isfile(file))\ or (os.path.getmtime(file) < os.path.getmtime('exeCalls.txt'))\ or (os.path.getmtime(file) < os.path.getmtime(__file__)): run = True break if run: print "running postPro on %s" % (odbName) myOdb = odbTools.openOdb(odbName) myAssembly = myOdb.rootAssembly #create node set from surface mainPart = myAssembly.instances['PART-1-1'] extSetName = 'EXTERNALANNULUS' if extSetName not in myAssembly.nodeSets.keys(): mySurface = mainPart.surfaces[extSetName] nodeList = list() for e in mySurface.elements: nodeList.extend([ nodeLbl for nodeLbl in e.connectivity if nodeLbl not in nodeList ]) myNodes = tuple(nodeList) extSet = myAssembly.NodeSetFromNodeLabels(name=extSetName, nodeLabels=(('PART-1-1', myNodes), )) else: try: extSet = myAssembly.nodeSets[extSetName] except: raise Exception('FIND SURFACE') cylSystem = getCylDatum(myOdb) valuesToWrite['time'] = ext.getTime(myOdb) valuesToWrite['topResForce'] = ext.getResF( myOdb, 'NS_TOPPLATE_WITH_BACKGROUND', sysC=cylSystem) valuesToWrite['bottomResForce'] = ext.getResF( myOdb, 'NS_BOTTOMPLATE_WITH_BACKGROUND', sysC=cylSystem) valuesToWrite['initCoord'] = ext.getNCoord(myOdb, extSet, sysC=cylSystem) valuesToWrite['radialDisp'] = ext.getU_1(myOdb, extSet, sysC=cylSystem) valuesToWrite['tgtDisp'] = ext.getU_2(myOdb, extSet, sysC=cylSystem) valuesToWrite['axialDisp'] = ext.getU_3(myOdb, extSet, sysC=cylSystem) odbTools.writeValues(valuesToWrite) myOdb.close()
def lamellarDispOpti(odbName): print "running postPro on %s" % (odbName) myOdb = odbTools.openOdb(odbName) resForce = ext.getResF_1(myOdb, 'left') time = ext.getTime(myOdb) odbTools.writeValuesOpti(zip(time, resForce)) myOdb.close()
def lamellarRectangleDisp(odbName): keysToWrite = [ 'resForce', 'topInitCoord', 'topU1', 'topU2', 'botInitCoord', 'botU1', 'botU2', 'time' ] valuesToWrite = dict.fromkeys(keysToWrite, None) run = False for data in range(len(valuesToWrite)): file = valuesToWrite.keys()[data] + '.ascii' if (not os.path.isfile(file))\ or (os.path.getmtime(file) < os.path.getmtime('exeCalls.txt'))\ or (os.path.getmtime(file) < os.path.getmtime(__file__)): run = True break if run: print "running postPro on %s" % (odbName) myOdb = odbTools.openOdb(odbName) time = ext.getTime(myOdb) resForce = ext.getResF2D(myOdb, 'left') resTopForce = ext.getResF2D(myOdb, 'top') rightInitCoord = ext.getNCoord(myOdb, 'right') rightU1 = ext.getU_1(myOdb, 'right') rightU2 = ext.getU_2(myOdb, 'right') leftInitCoord = ext.getNCoord(myOdb, 'left') leftU1 = ext.getU_1(myOdb, 'left') leftU2 = ext.getU_2(myOdb, 'left') topInitCoord = ext.getNCoord(myOdb, 'top') topU1 = ext.getU_1(myOdb, 'top') topU2 = ext.getU_2(myOdb, 'top') botInitCoord = ext.getNCoord(myOdb, 'bottom') botU1 = ext.getU_1(myOdb, 'bottom') botU2 = ext.getU_2(myOdb, 'bottom') valuesToWrite = dict(rightInitCoord=rightInitCoord, rightU1=rightU1, rightU2=rightU2, leftInitCoord=leftInitCoord, leftU1=leftU1, leftU2=leftU2, resForce=resForce, resTopForce=resTopForce, topInitCoord=topInitCoord, topU1=topU1, topU2=topU2, botInitCoord=botInitCoord, botU1=botU1, botU2=botU2, time=time) odbTools.writeValues(valuesToWrite) myOdb.close()
def optiStiffnessExtractors(odbName): myOdb = odbTools.openOdb(odbName) time = ext.getTime(myOdb) extDispl = ext.getFinalU_3(myOdb, 'outerFace') outForce = ext.getFinalResF_3(myOdb, 'outerFace') stiffness = 0. if abs(outForce) > 1e-8 and abs(outForce) < 1e8: stiffness = outForce / extDispl[0] odbTools.writeValuesOpti(stiffness) myOdb.close()
def appliedDisplExtractors(odbName): sets = [ 'edgeXMax', 'edgeXMaxInt', 'edgeXMin', 'edgeXMinInt', 'edgeYMax', 'edgeYMaxInt', 'edgeYMin', 'edgeYMinInt' ] keysToWrite = ['time', 'topResForce', 'bottomResForce'] for set in sets: keysToWrite.append('initCoord_%s' % set) keysToWrite.append('radialDisp_%s' % set) keysToWrite.append('axialDisp_%s' % set) keysToWrite.append('tgtDisp_%s' % set) valuesToWrite = dict.fromkeys(keysToWrite, None) run = False for data in valuesToWrite.keys(): file = data + '.ascii' if (not os.path.isfile(file))\ or (os.path.getmtime(file) < os.path.getmtime('exeCalls.txt'))\ or (os.path.getmtime(file) < os.path.getmtime(__file__)): run = True break if run: print "running postPro on %s" % (odbName) myOdb = odbTools.openOdb(odbName) sysCyl = geometricTools.cylXYCoordSystem(myOdb.rootAssembly) valuesToWrite['time'] = ext.getTime(myOdb) valuesToWrite['topResForce'] = ext.getResF(myOdb, 'zMax', sysC=sysCyl) valuesToWrite['bottomResForce'] = ext.getResF(myOdb, 'zMin', sysC=sysCyl) for set in sets: valuesToWrite['initCoord_%s' % set] = ext.getNCoord(myOdb, set, sysC=sysCyl) valuesToWrite['radialDisp_%s' % set] = ext.getU_1(myOdb, set, sysC=sysCyl) valuesToWrite['tgtDisp_%s' % set] = ext.getU_2(myOdb, set, sysC=sysCyl) valuesToWrite['axialDisp_%s' % set] = ext.getU_3(myOdb, set, sysC=sysCyl) odbTools.writeValues(valuesToWrite) myOdb.close()
def appliedDisplacementForceExtractor(odbName): keysToWrite = ['totalForce_pinnedFace', 'totalForce_movingFace', 'time'] valuesToWrite = dict.fromkeys(keysToWrite, None) run = False for data in range(len(valuesToWrite)): file = valuesToWrite.keys()[data] + '.ascii' if (not os.path.isfile(file))\ or (os.path.getmtime(file) < os.path.getmtime('exeCalls.txt'))\ or (os.path.getmtime(file) < os.path.getmtime(__file__)): run = True break if run: print "running postPro on %s" % (odbName) myOdb = odbTools.openOdb(odbName) mySets = myOdb.rootAssembly.nodeSets pinnedNodeSetName = list() movingNodeSetName = list() for nodeSet in mySets.keys(): zMin = '_WITH_ZMIN' if nodeSet.endswith(zMin): pinnedNodeSetName.append(nodeSet) zMax = '_WITH_ZMAX' if nodeSet.endswith(zMax): movingNodeSetName.append(nodeSet) time = ext.getTime(myOdb) resultantForce_pin = [0] * len(time) for setName in pinnedNodeSetName: resForce = ext.getResF_3(myOdb, setName) for t in range(len(resultantForce_pin)): resultantForce_pin[t] += resForce[t] resultantForce_mov = [0] * len(time) for setName in movingNodeSetName: resForce = ext.getResF_3(myOdb, setName) for t in range(len(resultantForce_mov)): resultantForce_mov[t] += resForce[t] valuesToWrite = dict(totalForce_pinnedFace=resultantForce_pin, totalForce_movingFace=resultantForce_mov, time=time) odbTools.writeValues(valuesToWrite) myOdb.close()