added --float option to translate real-valued grid data
This commit is contained in:
parent
814b05e2f6
commit
40de6910b8
|
@ -1,13 +1,20 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if [[ "$1" == "-f" || "$1" == "--float" ]]; then
|
||||||
|
shift
|
||||||
|
arg='--float'
|
||||||
|
else
|
||||||
|
arg=''
|
||||||
|
fi
|
||||||
|
|
||||||
for geom in "$@"
|
for geom in "$@"
|
||||||
do
|
do
|
||||||
geom_toTable \
|
geom_toTable $arg \
|
||||||
< $geom \
|
< $geom \
|
||||||
| \
|
| \
|
||||||
vtk_rectilinearGrid > ${geom%.*}.vtk
|
vtk_rectilinearGrid > ${geom%.*}.vtk
|
||||||
|
|
||||||
geom_toTable \
|
geom_toTable $arg \
|
||||||
< $geom \
|
< $geom \
|
||||||
| \
|
| \
|
||||||
vtk_addRectilinearGridData \
|
vtk_addRectilinearGridData \
|
||||||
|
|
|
@ -19,8 +19,17 @@ Translate geom description into ASCIItable containing position and microstructur
|
||||||
|
|
||||||
""", version = scriptID)
|
""", version = scriptID)
|
||||||
|
|
||||||
|
parser.add_option('--float',
|
||||||
|
dest = 'real',
|
||||||
|
action = 'store_true',
|
||||||
|
help = 'use float input')
|
||||||
|
|
||||||
|
parser.set_defaults(real = False,
|
||||||
|
)
|
||||||
(options, filenames) = parser.parse_args()
|
(options, filenames) = parser.parse_args()
|
||||||
|
|
||||||
|
datatype = 'f' if options.real else 'i'
|
||||||
|
|
||||||
# --- loop over input files -------------------------------------------------------------------------
|
# --- loop over input files -------------------------------------------------------------------------
|
||||||
|
|
||||||
if filenames == []: filenames = [None]
|
if filenames == []: filenames = [None]
|
||||||
|
@ -56,7 +65,7 @@ for name in filenames:
|
||||||
|
|
||||||
# --- read data ------------------------------------------------------------------------------------
|
# --- read data ------------------------------------------------------------------------------------
|
||||||
|
|
||||||
microstructure = table.microstructure_read(info['grid'])
|
microstructure = table.microstructure_read(info['grid'],datatype)
|
||||||
|
|
||||||
# ------------------------------------------ assemble header ---------------------------------------
|
# ------------------------------------------ assemble header ---------------------------------------
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue