7.1.2 Unstructured Grid Reading and Writing



next up previous contents
Next: 7.1.3 Generic Interpolation Up: 7.1 GRS Previous: Unstructured Grid Element

7.1.2 Unstructured Grid Reading and Writing

     

Simple unstructured grid reading and writing is one of the two main purposes GRS is intended for. This functionality is both used in GRS internally for the unstructured grid interpolation, where a grid must be read into a memory-pertinent representation, as well as provided to other applications that need to read or write unstructured grids. For example, the capacitance simulator VLSICAP see Section 8 uses this functionality to write its output attributes onto triangular grids.

Full memory-pertinent structures are not necessarily during element-wise reading and writing of unstructured grids, therefore GRS does not store the point list and the list of grid elements internally. Rather it allocates just the structures describing the current grid and the current status of grid reading and writing. The actual data pointers in the face list structure and in the attribute structure are left unused, only the index of the current grid element in the face list and in the attribute is remembered.

Applications wanting to read or write an unstructured grid have to call an initialization function which allocates and fills this structures appropriately. The point list of the grid can be written with the usual PAL calls, since in this case GRS needs nothing more than just the point list handle for referencing it in the face list defining the grid elements. After initialization, the application has to call the GRS element read or write function, which read or write exactly one name list entry of the face list, and hence read or write exactly one element from or to the grid. A cleanup function has to be called finally, that frees the GRS-internal structures.



Martin Stiftinger
Tue Nov 29 19:41:50 MET 1994