lanl / LaGriT

Los Alamos Grid Toolbox (LaGriT) is a library of user callable tools that provide mesh generation, mesh optimization and dynamic mesh maintenance in two and three dimensions.
https://lanl.github.io/LaGriT/
Other
122 stars 49 forks source link

dump/avs is not working for writing a vector type attribute #188

Open millerta opened 4 years ago

millerta commented 4 years ago

Something is wrong in usage of crank where vector rank = 3 and the loop through attributes.

For now there is an error message and exit: ERROR dumpavs: vector output not supported!!!
convert vector to scalars with cmo/addatt
ERROR dumpavs: No Action

NOTE: Writing a vector for AVS attributes, there is only 1 attribute not 3 (irank) Internally lagrit has an array 3x nnodes (or elements) Write AVS format for vector should look something like: Header: nnodes nelements 3 0 0 Data: 1 3 vector_name, real 1 varray(1,1) varray(2,1) varray(3,1) 2 varray(1,2) varray(2,2) varray(3,2)

millerta commented 4 years ago
# test vector attribute for dump/avs
# bug where vector output not handled correctly
# and the array values get corrupted
# dump gmv does not corrupt but writes scalar, not vector
# create vector and printatt vector are correct

cmo/create/motet
createpts/xyz/ 2,2,2 /0. 0. 0./1. 1. 1./1,1,1/
cmo/setatt/ motet/ imt/ 1
cmo/setatt/ motet/ itetclr/ 1
filter/1,0,0; rmpoint/compress;
connect
resetpts itp

cmo/addatt/motet/n1/vdouble/scalar/nnodes
cmo/addatt/motet/n2/vdouble/scalar/nnodes
cmo/addatt/motet/n3/vdouble/scalar/nnodes
cmo/addatt/motet/Vxyz/vdouble/vector/nnodes
cmo/printatt/motet/Vxyz 

# use avs1 to write integers as real to see values
# avs2 will try to write small space integers and
# will result in astericks in some of the data
dump/avs1/ test.inp / motet

finish
millerta commented 4 years ago

dump/avs has been removed in the test directory where this bug was discovered level01/cmo_addatt_normals The file being written had incorrect values for attribute irank=3 output_box_normals.inp