changed coordinate option to be consistent with rectilinearGrid.
This commit is contained in:
parent
feae2164fc
commit
0b09ce31db
|
@ -18,12 +18,12 @@ Produce a VTK point cloud dataset based on coordinates given in an ASCIItable.
|
|||
|
||||
""", version = scriptID)
|
||||
|
||||
parser.add_option('-d', '--deformed',
|
||||
dest = 'deformed',
|
||||
parser.add_option('-c', '--coordinates',
|
||||
dest = 'pos',
|
||||
type = 'string', metavar = 'string',
|
||||
help = 'deformed coordinate label [%default]')
|
||||
help = 'coordinate label [%default]')
|
||||
|
||||
parser.set_defaults(deformed = 'ipdeformedcoord'
|
||||
parser.set_defaults(pos = 'pos'
|
||||
)
|
||||
|
||||
(options, filenames) = parser.parse_args()
|
||||
|
@ -46,9 +46,9 @@ for name in filenames:
|
|||
|
||||
errors = []
|
||||
remarks = []
|
||||
coordDim = table.label_dimension(options.deformed)
|
||||
if not 3 >= coordDim >= 1: errors.append('coordinates "{}" need to have one, two, or three dimensions.'.format(options.deformed))
|
||||
elif coordDim < 3: remarks.append('appending {} dimensions to coordinates "{}"...'.format(3-coordDim,options.deformed))
|
||||
coordDim = table.label_dimension(options.pos)
|
||||
if not 3 >= coordDim >= 1: errors.append('coordinates "{}" need to have one, two, or three dimensions.'.format(options.pos))
|
||||
elif coordDim < 3: remarks.append('appending {} dimensions to coordinates "{}"...'.format(3-coordDim,options.pos))
|
||||
|
||||
if remarks != []: damask.util.croak(remarks)
|
||||
if errors != []:
|
||||
|
@ -58,7 +58,7 @@ for name in filenames:
|
|||
|
||||
# ------------------------------------------ process data ---------------------------------------
|
||||
|
||||
table.data_readArray(options.deformed)
|
||||
table.data_readArray(options.pos)
|
||||
if len(table.data.shape) < 2: table.data.shape += (1,) # expand to 2D shape
|
||||
if table.data.shape[1] < 3:
|
||||
table.data = np.hstack((table.data,
|
||||
|
|
Loading…
Reference in New Issue