gem.h File Reference

Class Gem: the geometry manager object. More...

#include <mc/mc_base.h>
#include <mc/pde.h>
#include <mc/vel.h>
#include <mc/ves.h>
#include <mc/bam.h>

Include dependency graph for gem.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  sGem
 Contains public data memebers for Gem class. More...

Defines

#define VMAXSQ   2
 Class Gem: Parameters and datatypes.

Typedefs

typedef struct sGem Gem
 Declaration of the Gem class as the Gem structure.

Functions

int Gem_dim (Gem *thee)
 Return the extrinsic spatial dimension.
int Gem_dimII (Gem *thee)
 Return the extrinsic spatial dimension.
int Gem_dimVV (Gem *thee)
 Return the number of vertices in a simplex.
int Gem_dimEE (Gem *thee)
 Return the number of edges in a simplex.
int Gem_numVirtVV (Gem *thee)
 Return the logical number of vertices in the mesh.
int Gem_numVirtEE (Gem *thee)
 Return the logical number of edges in the mesh.
int Gem_numVirtFF (Gem *thee)
 Return the logical number of faces in the mesh.
int Gem_numVirtSS (Gem *thee)
 Return the logical number of simplices in the mesh.
void Gem_setNumVirtVV (Gem *thee, int i)
 Set the logical number of vertices in the mesh.
void Gem_setNumVirtEE (Gem *thee, int i)
 Set the logical number of edges in the mesh.
void Gem_setNumVirtFF (Gem *thee, int i)
 Geometry manager constructor.
void Gem_setNumVirtSS (Gem *thee, int i)
 Set the logical number of simplices in the mesh.
int Gem_numVV (Gem *thee)
 Return the number of vertices in the mesh.
VVGem_VV (Gem *thee, int i)
 Return a given vertex.
VVGem_createVV (Gem *thee)
 Create a new vertex (becoming the new last vertex).
VVGem_firstVV (Gem *thee)
 Return the first vertex.
VVGem_lastVV (Gem *thee)
 Return the last vertex.
VVGem_nextVV (Gem *thee)
 Return the next vertex.
VVGem_prevVV (Gem *thee)
 Return the previous vertex.
VVGem_peekFirstVV (Gem *thee)
 Peek at the first vertex.
VVGem_peekLastVV (Gem *thee)
 Peek at the last vertex.
void Gem_destroyVV (Gem *thee)
 Destroy the last vertex.
void Gem_resetVV (Gem *thee)
 Destroy all of the vertices.
int Gem_numEE (Gem *thee)
 Return the number of edge.
EEGem_EE (Gem *thee, int i)
 Return a given edge.
EEGem_createEE (Gem *thee)
 Create a new edge (becoming the new last edge).
EEGem_firstEE (Gem *thee)
 Return the first edge.
EEGem_lastEE (Gem *thee)
 Return the last edge.
EEGem_nextEE (Gem *thee)
 Return the next edge.
EEGem_prevEE (Gem *thee)
 Return the previous edge.
EEGem_peekFirstEE (Gem *thee)
 Peek at the first edge.
EEGem_peekLastEE (Gem *thee)
 Peek at the last edge.
void Gem_destroyEE (Gem *thee)
 Destroy the last edge.
void Gem_resetEE (Gem *thee)
 Destroy all of the edges.
int Gem_numSS (Gem *thee)
 Return the number of simplices.
SSGem_SS (Gem *thee, int i)
 Return a given simplex.
SSGem_createSS (Gem *thee)
 Create a new simplex (becoming the new last simplex).
SSGem_firstSS (Gem *thee)
 Return the first simplex.
SSGem_lastSS (Gem *thee)
 Return the last simplex.
SSGem_nextSS (Gem *thee)
 Return the next simplex.
SSGem_prevSS (Gem *thee)
 Return the previous simplex.
SSGem_peekFirstSS (Gem *thee)
 Peek at the first simplex.
SSGem_peekLastSS (Gem *thee)
 Peek at the last simplex.
void Gem_destroySS (Gem *thee)
 Destroy the last simplex.
void Gem_resetSS (Gem *thee)
 Destroy all of the simplices.
int Gem_numSQ (Gem *thee, int currentQ)
 Return the number of simplices in a given queue.
void Gem_resetSQ (Gem *thee, int currentQ)
 Release all of the simplices in a given queue.
int Gem_numBF (Gem *thee)
 Return the number of boundary faces.
int Gem_numBV (Gem *thee)
 Return the number of boundary vertices.
void Gem_setNumBF (Gem *thee, int val)
 Set the number of boundary faces.
void Gem_setNumBV (Gem *thee, int val)
 Set the number of boundary vertices.
void Gem_addToNumBF (Gem *thee, int val)
 Increment the number of boundary faces by a given integer.
void Gem_addToNumBV (Gem *thee, int val)
 Increment the number of boundary vertices by a given integer.
void Gem_numBFpp (Gem *thee)
 Increment the number of boundary faces by 1.
void Gem_numBVpp (Gem *thee)
 Increment the number of boundary vertices by 1.
void Gem_numBFmm (Gem *thee)
 Decrement the number of boundary faces by 1.
void Gem_numBVmm (Gem *thee)
 Decrement the number of boundary vertices by 1.
GemGem_ctor (Vmem *vmem, PDE *tpde)
 Geometry manager constructor.
void Gem_dtor (Gem **thee)
 Geometry manager destructor.
void Gem_reset (Gem *thee, int dim, int dimII)
 Reset all of the geometry datastructures.
VVGem_createAndInitVV (Gem *thee)
 Create and initialize a new vertex; return a point to it.
EEGem_createAndInitEE (Gem *thee)
 Create and initialize a new edge; return a point to it.
SSGem_createAndInitSS (Gem *thee)
 Create and initialize a new simplex; return a point to it.
SSGem_SQ (Gem *thee, int currentQ, int i)
 Return the simplex at a particular location in the simplex Q.
void Gem_appendSQ (Gem *thee, int currentQ, SS *qsm)
 Append a simplex to the end of a simplex Q.
void Gem_createSimplexRings (Gem *thee)
 Create all of the simplex rings.
void Gem_destroySimplexRings (Gem *thee)
 Destroy all of the simplex rings.
EEGem_findOrCreateEdge (Gem *thee, VV *v0, VV *v1, int *iDid)
 Look for a common edges between two vertices. If it doesn't yet exist, we create it, and then note that we did so.
void Gem_createEdges (Gem *thee)
 Create all of the edges.
void Gem_destroyEdges (Gem *thee)
 Destroy all of the edges.
void Gem_countChk (Gem *thee)
 Count all vertices, edges, faces, simplices, and do it is cheaply as possible. Also do a form check.
void Gem_countFaces (Gem *thee)
 Count all of the faces without actually creating them.
void Gem_clearEdges (Gem *thee)
 Clear all of the edge numbers in each simplex.
void Gem_countEdges (Gem *thee)
 Count up all of the edges without actually creating them, and keep track of the global edge numbers in each element.
void Gem_formFix (Gem *thee, int key)
 Make some specified hacked fix to a given mesh.
void Gem_simplexInfo (Gem *thee, SS *sm, TT *t)
 Build the basic master-to-element transformation information.
void Gem_buildVolumeTrans (Gem *thee, SS *sm, TT *t)
 Build the complete master-to-element transformatio.
void Gem_buildSurfaceTrans (Gem *thee, int iface, TT *t)
 Build the complete masterFace-to-elementFace transformation.
double Gem_edgeLength (Gem *thee, VV *v0, VV *v1)
 Calculate the edge lengths of a simplex.
int Gem_newestVertex (Gem *thee, SS *sm, int face, double *len)
 Determine the edge of a simplex opposite the newest vertex.
int Gem_longestEdge (Gem *thee, SS *sm, int face, double *len)
 Determine the longest edge of a simplex or a simplex face.
int Gem_shortestEdge (Gem *thee, SS *sm, int face, double *len)
 Determine the shortest edge of a simplex or a simplex face.
double Gem_shapeMeasure (Gem *thee, SS *sm, double *f, double *g)
 Calculate the shape quality measure for this simplex.
void Gem_shapeMeasureGrad (Gem *thee, SS *sm, int vmap[], double dm[])
 Calculate gradient of the shape quality measure for this simplex, where the last vertex (vertex d) is treated as the set of independent variables.
double Gem_edgeRatio (Gem *thee, SS *sm)
 Calculate ratio of longest-to-shortest edge of a simplex.
double Gem_simplexVolume (Gem *thee, SS *sm)
 Calculate the determinant of the transformation from the master element to this element.
void Gem_shapeChk (Gem *thee)
 Traverse the simplices and check their shapes.
void Gem_markEdges (Gem *thee)
 Produce the initial edge markings in all of the simplices.
void Gem_reorderSV (Gem *thee)
 Go through simplices and enforce a vertex ordering that will produce a positive determinant.
void Gem_smoothMeshLaplace (Gem *thee)
 Smooth the mesh using simple Laplace smoothing.
void Gem_smoothMesh (Gem *thee)
 Smooth the mesh using simple Laplace smoothing.
void Gem_smoothMeshBnd (Gem *thee)
 Smooth the boundary mesh.
void Gem_smoothMeshOpt (Gem *thee)
 Smooth the mesh using a volume optimization approach.
void Gem_buildCharts (Gem *thee)
 Unify the charts of vertices.
void Gem_clearCharts (Gem *thee)
 Unify the charts of vertices.
void Gem_memChk (Gem *thee)
 Print the exact current malloc usage.
void Gem_memChkVV (Gem *thee, int *num, int *size, int *vecUse, int *vecMal, int *vecOhd)
 Print the exact current malloc usage: vertices.
void Gem_memChkEE (Gem *thee, int *tnum, int *size, int *vecUse, int *vecMal, int *vecOhd)
 Print the exact current malloc usage: edges.
void Gem_memChkSS (Gem *thee, int *tnum, int *size, int *vecUse, int *vecMal, int *vecOhd)
 Print the exact current malloc usage: simplices.
void Gem_memChkSQ (Gem *thee, int currentQ, int *tnum, int *tsize, int *tVecUse, int *tVecMal, int *tVecOhd)
 Print the exact current malloc usage: simplex queues.
void Gem_memChkMore (Gem *thee)
 Estimate the current RAM usage.
void Gem_speedChk (Gem *thee)
 Calculate the cost to traverse the various structures.
void Gem_formChk (Gem *thee, int key)
 Check the self-consistency of the geometry datastructures.
void Gem_contentChk (Gem *thee)
 Print out contents of all geometry structures.
void Gem_ramClear (Gem *thee, int key)
 Check some structures.
void Gem_makeBnd (Gem *thee, int btype)
 Force naborless faces to become boundary faces.
void Gem_makeBndExt (Gem *thee, int key)
 Mark selected boundary faces in a special way.
void Gem_delaunay (Gem *thee)
 Incremental flip Delaunay generator.
void Gem_flip (Gem *thee, VV *vx)
 Edge or face flip for the incremental flip algorithm.
SSGem_findSimplex (Gem *thee, VV *vx)
 Find a simplex containing a given vertex.
void Gem_predinit (Gem *thee)
 Initialize the geometric predicates.
int Gem_orient (Gem *thee, SS *sm)
 Determine the orientation of the vertices in a simplex.
int Gem_inSphere (Gem *thee, SS *sm, int sm_facet, VV *vx, VV *vxnb)
 Determine if a vertex lies in a sphere of other vertices.
int Gem_pointInSimplex (Gem *thee, SS *sm, double x[])
 Determine whether or a not a point is in a simplex.
int Gem_pointInSimplexVal (Gem *thee, SS *sm, double x[], double phi[], double phix[][3])
 Evaluate basis functions at a point in a simplex.
int Gem_deform (Gem *thee, int dimX, double *defX[MAXV])
 Edge or face flip for the incremental flip algorithm.
int Gem_markRefine (Gem *thee, int key, int color)
 Mark simplices to be refined.
int Gem_refine (Gem *thee, int rkey, int bkey, int pkey)
 Refine the manifold and also build a prolongation operator that can interpolate functions from the original manifold to the new manifold.
void Gem_refineEdge (Gem *thee, int currentQ, SS *sm, VV *v[4], VV **vAB, int A, int B)
 We do three things in this routine:
(1) Find the midpoint of existing edge, or create it
(2) Tell simplices using edge that they are now nonconforming
(3) Determine the "type" of the new point by using the type of the edge. The edge type must itself be calculated on the fly, because we allow the use of lazy edge creation.
void Gem_octsect (Gem *thee, SS *sm, int currentQ)
 Uniform regular (quadrasection) refinement of a single simplex.
void Gem_bisectLE (Gem *thee, SS *sm, int currentQ)
 Bisection refinement of a single simplex by longest edge.
void Gem_bisectNV (Gem *thee, SS *sm, int currentQ)
 Bisection refinement of a single simplex by newest vertex.
void Gem_bisectNP (Gem *thee, SS *sm, int currentQ)
 Bisection refinement by pairs.
int Gem_unRefine (Gem *thee, int rkey, int pkey)
 Un-refine the mesh.
void Gem_delSimplex (Gem *thee, SS *sm, int currentQ)
 Delete a simplex cleanly, maintaining a consecutive list.
void Gem_unHangVertices (Gem *thee)
 Toss out any hanging vertices.
int Gem_read (Gem *thee, int key, Vio *sock)
 Read in the user-specified initial vertex-simplex mesh. provided to us in MC-Simplex-Format (MCSF), and transform into our internal datastructures.
void Gem_write (Gem *thee, int key, Vio *sock, int fkey)
 Toss out any hanging vertices.
void Gem_writeFace3d (Gem *thee, Vio *sock)
 Write out the faces of a 3-simplex mesh as a complete and legal 2-simplex mesh in "MCSF" format (described above for Gem_read).
int Gem_readEdge (Gem *thee, Vio *sock)
 Read in the user-specified initial vertex-edge mesh provided to us in MC-Edge-Format (MCEF), and transform into our internal datastructures.
void Gem_writeEdge (Gem *thee, Vio *sock)
 Write out the edges of a 2- or 3-simplex mesh in "MCEF" (MC-Edge-Format).
void Gem_buildSfromE (Gem *thee)
 Build a vertex-simplex mesh from a vertex-edge mesh.
void Gem_writeBrep (Gem *thee, Vio *sock)
 Write out the boundary edges or boundary faces of a 2-simplex or 3-simplex mesh in a "BREP" format for input into Barry Joe's 2D/3D Geompak.
void Gem_writeBrep2 (Gem *thee, Vio *sock)
 Write out boundary edges of a 2-simplex mesh in a "BREP" format for input into Barry Joe's 2D Geompak.
void Gem_writeBrep3 (Gem *thee, Vio *sock)
 Write out boundary faces of a 3-simplex mesh in a "BREP" format for input into Barry Joe's 3D Geompak.
void Gem_writeBrep2to3 (Gem *thee, Vio *sock)
 Write out triangles of a 2-manifold as a 3-simplex boundary mesh in a "BREP" format for input into Barry Joe's 3D Geompak.
void Gem_writeGEOM (Gem *thee, Vio *sock, int defKey, int colKey, int chartKey, double gluVal, int fkey, double *defX[MAXV], char *format)
 Write a finite element mesh or mesh function in some format.
void Gem_writeSOL (Gem *thee, Vio *sock, int fldKey, double *defX[MAXV], char *format)
 Write a finite element mesh or mesh function in some format.
void Gem_writeVolHeaderOFF (Gem *thee, Vio *sock)
 Produce an OFF file header for a volume mesh.
void Gem_writeBndHeaderOFF (Gem *thee, Vio *sock)
 Produce an OFF file header for a boundary mesh.
void Gem_writeTrailerOFF (Gem *thee, Vio *sock)
 Produce an OFF file trailer.
void Gem_writeGV (Gem *thee, Vio *sock, int defKey, int colKey, int chartKey, double gluVal, int fkey, double *defX[MAXV])
 Write out a mesh in "Geomview OFF" format to a file or socket.
void Gem_writeFace2dGV (Gem *thee, Vio *sock, int defKey, int colKey, int chartKey, double gluVal, double *defX[MAXV])
 Write out the faces of a 2-simplex mesh as a complete and legal 1-simplex mesh in "Geomview SKEL" format.
void Gem_writeFace3dGV (Gem *thee, Vio *sock, int defKey, int colKey, int chartKey, double gluVal, double *defX[MAXV])
 Write out the faces of a 3-simplex mesh as a complete and legal 2-simplex mesh in "Geomview OFF" format.
void Gem_writeHeaderMATH (Gem *thee, Vio *sock)
 Produce an MATH file header for a volume mesh.
void Gem_writeTrailerMATH (Gem *thee, Vio *sock)
 Produce an MATH file trailer.
void Gem_writeMATH (Gem *thee, Vio *sock, int defKey, int colKey, int chartKey, double gluVal, int fkey, double *defX[MAXV])
 Write out a mesh in "Mathematica" format to a file or socket.
void Gem_writeGMV (Gem *thee, Vio *sock, int fldKey, double *defX[MAXV])
 Write out a scalar or vector function over a simplex mesh in "GMV" (General Mesh Viewer) format.
void Gem_writeUCD (Gem *thee, Vio *sock, int fldKey, double *defX[MAXV])
 Write out a scalar or vector function over a simplex mesh in "UCD" (Unstructured Cell Data) format for AVS 5.0.
void Gem_writeDX (Gem *thee, Vio *sock, int fldKey, double *defX[MAXV])
 Write out a scalar or vector function over a simplex mesh in "DX" (www.opendx.org) format.
void Gem_writeTEC (Gem *thee, Vio *sock, int fldKey, double *defX[MAXV])
 Write out a scalar or vector function over a simplex mesh in "TEC" (www.opendx.org) format.
void Gem_makeCube (Gem *thee)
 Generate a unit cube domain.
void Gem_makeOctahedron (Gem *thee)
 Generate a unit octahedron domain.
void Gem_makeIcosahedron (Gem *thee)
 Generate a unit icosahedron domain.


Detailed Description

Class Gem: the geometry manager object.

Author:
Michael Holst
Note:
None
Version:
Id
gem.h,v 1.42 2010/07/13 13:22:29 fetk Exp

Attention:
 *
 * MC = < Manifold Code >
 * Copyright (C) 1994--2008 Michael Holst
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 *  

Generated on Mon Aug 9 11:13:40 2010 for MC by  doxygen 1.5.6