def AbaqusCAE_ADAMS(instRef, includeAnchoredPart, anchoredPart, myModel, myAsm, edgeSeedDensity, unitShort, jointsMBDXML, feaXML, metricComponentsXML, metricAssemblyXML, parallelCores, ramAllocated, args, instAssemblyRef, asmParts): logger = logging.getLogger() skipped = [] merging_asms = [] parts_to_be_merged = [] for asm in instAssemblyRef.keys(): if instAssemblyRef[asm]['MergeChildren']: merge = [] merging_asms.append(asm) for comp in asmParts[asm]: parts_to_be_merged.append(comp) myAsm.Instance(comp,dependent=OFF,part=mdb.models['Model-1'].parts[comp]) merge.append(myAsm.instances[comp]) myAsm.PartFromBooleanMerge(name=asm,instances=tuple(merge)) for comp in asmParts[asm]: del myAsm.instances[comp] for (key,entry) in instRef.iteritems(): # Iterate through all parts if key in parts_to_be_merged: skipped.append([key,entry]) continue else: if not includeAnchoredPart and key == anchoredPart: continue else: pass assignSections_ADAMS(key, entry, myModel, myAsm) meshInstances(edgeSeedDensity, unitShort, instRef, instAssemblyRef, myAsm, feaXML, metricComponentsXML, metricAssemblyXML, args, runAdams=True) ADAMS_setup_INP(myAsm,key,jointsMBDXML,instRef,myModel,parallelCores,ramAllocated) for j in merging_asms: a = asmParts[j] material = None for s in skipped: if s[0] in a: material = s[1]['MaterialID'] a.remove(s[0]) if len(a) > 0: raise Exception if material is not None: instAssemblyRef[j].update([['MaterialID',material]]) instRef[j].update([['MaterialID',material]]) cleanModel(myModel, myAsm) assignSections_ADAMS(j,instAssemblyRef[j],myModel,myAsm) meshInstances(edgeSeedDensity, unitShort, instRef, instAssemblyRef, myAsm, feaXML, metricComponentsXML, metricAssemblyXML, args, runAdams=True) ADAMS_setup_INP(myAsm,j,jointsMBDXML,instRef,myModel,parallelCores,ramAllocated)
def AbaqusCAE_ADAMS(asminfo, instRef, includeAnchoredPart, anchoredPart, myModel, myAsm, edgeSeedDensity, unitShort, feaXML, parallelCores, ramAllocated, args, instAssemblyRef, asmParts): """ Entry point for Adams-to-Abaqus simulations. All CyPhy/CAD information has been parsed at this point. """ skipped = [] merging_asms = [] parts_to_be_merged = [] for asm in instAssemblyRef.keys(): if instAssemblyRef[asm]['MergeChildren']: merge = [] merging_asms.append(asm) for comp in asmParts[asm]: parts_to_be_merged.append(comp) myAsm.Instance(comp, dependent=OFF, part=myModel.parts[comp]) merge.append(myAsm.instances[comp]) myAsm.PartFromBooleanMerge(name=asm, instances=tuple(merge)) for comp in asmParts[asm]: del myAsm.instances[comp] for (key, entry) in instRef.iteritems(): # Iterate through all parts if key in parts_to_be_merged: skipped.append([key, entry]) continue else: if not includeAnchoredPart and key == anchoredPart: continue else: pass assignSections_ADAMS(key, entry, myModel, myAsm) meshInstances(asminfo, edgeSeedDensity, unitShort, instRef, instAssemblyRef, myAsm, feaXML, args, runAdams=True) ADAMS_setup_INP(myAsm, key, asminfo, instRef, instAssemblyRef, myModel, parallelCores, ramAllocated) for j in merging_asms: a = asmParts[j] material = None for s in skipped: if s[0] in a: material = s[1]['MaterialID'] a.remove(s[0]) if len(a) > 0: raise Exception if material is not None: instAssemblyRef[j].update([['MaterialID', material]]) instRef[j].update([['MaterialID', material]]) cleanModel(myModel, myAsm) assignSections_ADAMS(j, instAssemblyRef[j], myModel, myAsm) meshInstances(asminfo, edgeSeedDensity, unitShort, instRef, instAssemblyRef, myAsm, feaXML, args, runAdams=True) ADAMS_setup_INP(myAsm, j, asminfo, instRef, instAssemblyRef, myModel, parallelCores, ramAllocated)