“30” “30”](http://www.ees.lanl.gov/staff/rao/mstkla/mstkla.md#MSTKLA_Init) “30” “30”](http://www.ees.lanl.gov/staff/rao/mstkla/prelim.md) “30” “30”](http://www.ees.lanl.gov/staff/rao/mstkla/MeshRegion.md)



MESH INITIALIZATION:  


 

void MSTKLA_Init(void);

Initialize the mesh toolkit.



MESH OPERATORS

 

These operators work on variables of type PMeshObj.


PMeshObj MESH_Create();

Creates a default mesh object and returns it - At this point all the info

in it is useless.


void MESH_InitFromFile(PMeshObj mesh, *char **filename, *char

*format, *int iotype, *char * **name);

Read a mesh in from “filename” and initialize the “mesh”.

The file is in the format “format” (“lagrit” for LaGriT dumps, “gmv” for GMV files, “avs” for AVS files).

‘iotype’ is 1 for ascii and 0 for binary.

name’ is the name of the mesh that is read and returned

If a LaGriT file is read, the geometric model info will be read as well.


void MESH_InitFromCMO(PMeshObj mesh, char *cmoname);

Initialize the mesh object from a given cmo. If ‘cmoname’ is NULL (say sent in as the character string ), the mesh object is initialized from the default mesh object. If not the given cmo is made is active and the mesh object is

initialized from that.

“31” “32”This implies that sometime in the middle of a LaGriT subroutine, one can call a C routine which initializes a mesh object and then uses the functionality of MSTKLA!! (Cool!)


int MESH_Select(PMeshObj mesh);

Make a particular mesh object active


void MESH_Delete(PMeshObj mesh);

Delete a particular mesh object.

“31” “32” *

*


void MESH_WriteToFile(PMeshObj mesh, char filename, *char

format, *int iotype);

“31” “32” *

*


PMeshObj MESH_Duplicate(PMeshObj mesh);

“31” “32” *

* *


int MESH_NumVertices(PMeshObj mesh);

Number of vertices (nodes) in the mesh.

“27” “31” * *

* * *

This count may include deleted vertices, parent vertices and other

types of vertices that should be ignored. So when looping through

vertices of a mesh, one should check if the vertex is to be ignored

by checking if MV_Type returns VIGNORE or VDELETED.


int MESH_NumRegions(PMeshObj mesh);

Number of regions (elements) in the mesh.

“27” “31” * *

* * *

This count may include deleted regions. While looping through the

regions of a mesh, one should check if the region is to be ignored

by checking if MR_Type returns RDELETED.


PMeshVert MESH_Vertex(PMeshObj mesh, int i);

Fetch the i’th vertex (node) of the mesh (This is C so remember i

starts from 0) The returned mesh vertex object can be queried for

information. The returned vertex must always be checked for its type

to see if it deleted or must otherwise be ignored.


PMeshRegn MESH_Region(PMeshObj mesh, int i);

Fetch the i’th region (element) of the mesh. The returned mesh region

can be queried for information. The returned region must be checked if

it is a deleted region.


void MESH_BldUpAdj(PMeshObj mesh);

Build the vertex to region connectivity. This will allow upward

adjacency operator MV_Regions to be called. In fact those operators

will function properly only after this is called.


void MESH_DelUpAdj(PMeshObj mesh);

Delete the vertex to region connectivity information to save

memory. It is not possible for MSTKLA to determine when this

information is not needed and call this routine automatically.


void MESH_IncrNodeLists(PMeshObj mesh);

Increment all the node lists.

“31” “32”( *

* *)


void MESH_IncrElemLists(PMeshObj mesh);

Increment all the element lists.

“31” “32”( *

* *)


void MESH_CmprNodeLists(PMeshObj mesh);

Compress all the element lists.

“31” “32” * *

“27” “31” * *

* * *

There is one side effect of compression of lists. If one is storing a

list of node numbers or PMeshVerts (which for the LaGriT interface are

just integers cast as pointers), then after compression, the node

numbers or PMeshVert “addresses” may not be referring to the nodes you

think they are.


void MESH_CmprElemLists(PMeshObj mesh);

Compress all the element lists.  * *

“27” “31” * *

* * *

There is one side effect of compression of lists. If one is storing a

list of element numbers or PMeshRegns (which for the LaGriT interface

are just integers cast as pointers), then after compression, the

element numbers or PMeshRegn “addresses” may not be referring to the

elements you think they are.

 

  “30” “30”](http://www.ees.lanl.gov/staff/rao/mstkla/mstkla.md#MSTKLA_Init) “30” “30”](http://www.ees.lanl.gov/staff/rao/mstkla/prelim.md) “30” “30”](http://www.ees.lanl.gov/staff/rao/mstkla/MeshRegion.md)