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
116 stars 48 forks source link

read gocad - tsurf reporting error #222

Closed millerta closed 2 years ago

millerta commented 3 years ago

While reading a TS file with many attributes, there is a report being made for every cell in the file. This creates very large lagrit out files. Here is an example where you get 4 lines of screen output for every cell in the TS file.

*               * * * * * * * * * * * * * * * * * * * * * * * *                 
*               *                                             *                 
*               *    Program:  LaGriT V3.320   Linux          *                 
*               *    date_compile: 2020/10/08 Static          *                 
*               *    Run Time: 2021/Mar 17  22:36:14          *                 
*               *    Manual:   http://lagrit.lanl.gov         *                 
*               *                                             *                 
*               * * * * * * * * * * * * * * * * * * * * * * * *         
# Fault 1                                                                       
read/gocad/Fault1.ts/fault1                                                     
Reading GOCAD file: Fault1.ts        
...
..................................................                             
READ CELL data and properties:     4    0                                       
There are no Cell Properties.                                                   
Attributes set for Cell Properties    0                                         
...................................................                             
READ CELL data and properties:     4    0                                       
There are no Cell Properties.                                                   
Attributes set for Cell Properties    0                                         
...................................................        
repeated for every cell.
millerta commented 2 years ago

Warning message for all elements for TRGL type files is fixed. While creating test file for element attributes discovered problem if there are extra spaces after PROPERTIES. Added a warning to user. Found bug for element attributes for type TRGL, it is not fatal but does not fill attribute with correct values. And sometimes did not find or write element properties (for .ts only) This was caused by allowing both tri and tet cells and so total elements will be sum of both. So carefully use n_tet, n_tri, and n_elem for TRGL and TETRA

millerta commented 2 years ago

Another bug, a triangle file is written but there are issues with keywords and large number of asterisks. The file is from cbm_mojave project and read/gocad was broken for these files. The seg fault is fixed but now need to deal with asterisks in unexpected positions. The issue now shows up in read/gocad report:

CMO_SET_INFO error:  Mesh Object does not exist: 167
Mesh Object does not exist: 167
geniee
finish
--- READ GOCAD FINISHED --------
 Mesh Type:
 ZPOSITIVE:    Elev Up
 Nodes:             1018
 Triangles:         1312
 Cells:             1312
 TFACE:                9
 Warning: Total nodes expected: **********
 Warning: Total tets expected: **********
 Warning: Total triangles expected: **********
millerta commented 2 years ago

Another bug, this was not easily repeatable, only occurred with test.lgi reading many files. The issue did not occur when reading files one at a time. At some point the buffer holding PROPERTIES list of names was corrupted with names from earlier file:

For property names list: U V, corrupted from earlier file with properties: GaussianCurvature MeanCurvature

SET VRTX properties:                                                            
cmo/addatt/motri/UaussianCurvature/VDOUBLE scalar/nnodes/linear/permanent/gxaf/0.0/                                                                                                                                                      
cmo/addatt/motri/VeanCurvature/VDOUBLE scalar/nnodes/linear/permanent/gxaf/0.0/ 

This was fixed by filling buffer with spaces after done at end of routine.

      length=len(cmsgbig)
       do i = 1, length
          cmsgbig(i) = " "
       enddo

See lagrit input file test_all_ts.lgi in /project/eesdev/tam/LaGriT/work/gocad/test_tsurf

millerta commented 2 years ago

Excessive reporting fixed, added better handling of commented long lines with * and #, fixed random corruption of cmsgbig buffer when calling multiple read/gocad in same command file. Tested with more variations for TSolid and Tsurf type files. Created test suite for LaGriT at /project/eesdev/tam/LaGriT/work/gocad/test