PBC meshing can work on 2D models

This commit is contained in:
Nan Jia 2012-03-14 13:40:22 +00:00
parent 2b5ed4ab93
commit d2051e54a5
1 changed files with 11 additions and 9 deletions

View File

@ -66,6 +66,7 @@ def servoLink():
for coord in base: # calc the dimension of the bounding box for coord in base: # calc the dimension of the bounding box
box['delta'][coord] = box['max'][coord] - box['min'][coord] box['delta'][coord] = box['max'][coord] - box['min'][coord]
if box['delta'][coord] != 0.0:
for extremum in ['min','max']: for extremum in ['min','max']:
rounded = round(box[extremum][coord]*1e+15/box['delta'][coord]) * \ rounded = round(box[extremum][coord]*1e+15/box['delta'][coord]) * \
1e-15*box['delta'][coord] # rounding to 1e-15 of dimension 1e-15*box['delta'][coord] # rounding to 1e-15 of dimension
@ -81,6 +82,7 @@ def servoLink():
Nmax = 0 Nmax = 0
Nmin = 0 Nmin = 0
for coord in base: # for each direction for coord in base: # for each direction
if box['delta'][coord] != 0.0:
rounded = round(NodeCoords[node][coord]*1e+15/box['delta'][coord]) * \ rounded = round(NodeCoords[node][coord]*1e+15/box['delta'][coord]) * \
1e-15*box['delta'][coord] # rounding to 1e-15 of dimension 1e-15*box['delta'][coord] # rounding to 1e-15 of dimension
NodeCoords[node][coord] = {False: rounded, NodeCoords[node][coord] = {False: rounded,