2016-04-06 4 views
0

Ich versuche, ein Skript zu schreiben, um Zellen in einem Teil in ABAQUS zu entfernen, wenn das Zellvolumen kleiner als ein gegebener Wert ist. Gibt es einen einfachen Befehl, um eine Zelle zu löschen? DieseSkript zum automatischen Entfernen einer ganzen Zelle eines Teils in ABAQUS

ist, was ich habe versucht:

# Keeps cells bigger than a certain minimum value 'paramVol': paramVol=volCell/part_volume_r 
cellsVolume = [] 
pfacesInter_clean = [] 
allCells = pInterName.cells 
mask_r = pInter.cells.getMask(); 
cellobj_sequence_r = pInter.cells.getSequenceFromMask(mask=mask_r); 
part_volume_r = pInterName.getVolume(cells=cellobj_sequence_r); 
volume_sliver = 0 
# get faces 
for i in range(0, len(allCells)): 
    volCell = allCells[i].getSize() 
    cellsVolume.append(volCell) 
    paramVol = volCell/part_volume_r 
    print 'paramVol= '+str(paramVol) 
    if paramVol < 0.01: 
     print 'liver Volume' 
     #session.viewports['Viewport: 1'].setColor(initialColor='#FF0000') #-->RED 
     faces = allCells[i].getFaces() 
     highlight(allCells[i].getFaces()) 
     #pfacesInter_clean = [x for i, x in enumerate(pfacesInter) if i not in faces] 
     volume_sliver += volCell 
    else: 
     print 'Not an sliver Volume' 

Dank!

Antwort

0

Wie wäre es damit, pInter Annahme, daß ein Teil Objekt:

pInter.RemoveFaces(faceList=[pInter.faces[j] for j in pInter.cells[i].getFaces()]) 

Update: einmal die gemeinsame Fläche von zwei Zellen gelöscht wird, nicht mehr beide Zellen zu existieren. Daher müssen wir eine kleine Problemumgehung durchführen:

faces_preserved = # List of faces that belong to cells with 'big' volume. 
for cell in pInter.cells: 
    pInter.RemoveFaces(faceList=[face for face in pInter.faces if \ 
           face not in faces_preserved]) 
Verwandte Themen