../source/moc_kernel.c

\file moc_kernel.c * \ingroup imoc * \brief Method-of-Characteristics program, 1998, 1999 * * This set of functions forms the computational and * data storage kernel for the MOC program. * Interaction with the user is handled by the set of * Tcl/Tk wrapper functions generated by SWIG. * The wrapper functions are set up such that they have the * same Tcl command name as the C function name. * The Tcl commands also accept the same number and type of * formal arguments and return the same type of result * as the corresponding C function. * * \author PA Jacobs * * \version 26-Sep-1998 : Initial hack * \version 01-Jan-1999 : resumed work * \version 07-Jan-2000 : Added Mach-number<--> Prandtl-Meyer conversion * when storing node data * \version 09-Jan-2000 : Added CZeroUp and CZeroDown fields. * \version 17-Jan-2000 : Split ListNodesNear into two parts (the new one * is FindNodesNear(). * \version 17-Sep-2000 : Rename SetGamma, SetDebugLevel, SetAxiFlag (add _C) *


int SetDebugLevel_C( int value )

A value of 0 turns off debug code.
(Available from the Tcl interpreter.)


int GetDebugLevel( void )

Used primarily in the C functions.
(Available from the Tcl interpreter.)


int SetGamma_C( double value )

Sets the ratio of specific heats. For air, use a value of 1.4.
(Available from the Tcl interpreter.)


double GetGamma( void )

Returns the currently set ratio of specific heats.
(Available from the Tcl interpreter.)


int SetAxiFlag_C( int value )

A value of 0 indicates 2D planar flow, and a value of 1 indicates axisymmetric flow. The axis of symmetry is along the x-axis.
(Available from the Tcl interpreter.)


int GetAxiFlag( void )

Returns 0 for 2D planar flow, 1 for axisymmetric flow.
(Available from the Tcl interpreter.)


int GetNumberOfNodes( void )

Returns the number of nodes with valid data.
(Available from the Tcl interpreter.)


int ValidNode( int id )

Returns a value of 1 if the node id is within range and the pointer is valid, 0 otherwise.
(Available from the Tcl interpreter.)


int InitMOC( void )

Called by the Tcl initialization procedure to set up the data storage and the initial value of some of the kernel variables.
(Available from the Tcl interpreter.)


int CreateNode( int id )

Input:
id < 0 : Select the next available location.
id >= 0 : Use a specific location.
Output:
Returns the index of the created node. A value of -1 is returned on failure.
(Available from the Tcl interpreter.)


int DeleteNode( int id )

Destroys the memory allocated to a node. If the node is connected to other nodes in the mesh, the linkages are retained between the remaining nodes.
(Available from the Tcl interpreter.)


struct NodeData * GetNodePtr( int id )

Returns the address of the memory allocated to the node. A NULL value returned indicates that the node doesn't exist or the index was out of range.
For use within the C functions.


int SetNodeData_C( int id, char *parameter, char *valueString )

Set the value for a particular node parameter.
Input:
id : index to the node
parameter : pointer to a string specifying the parameter
valueString : pointer to a string specifying the value
Output:
Returns 0 if successful, -1 on error.
(Available from the Tcl interpreter.)


char *GetNodeData_C( int id, char *parameter )

Get the value for a particular node parameter.
Input:
id : index to the node
parameter : pointer to a string specifying the parameter
Output:
Returns a pointer to the string specifying the value.
(Available from the Tcl interpreter.)


int GetNextNodeId( int idStart )

Search for the next node that exists.
Input:
idStart : the index for the start of the search To find the first node, send -1 as input.
Output:
Returns id if a valid node was found, else returns -1.
(Available from the Tcl interpreter.)


char * ListNodesNear( double x, double y, double tol )

Find all nodes a specified location or find the node nearest a given location.
Input:
x, y : location coordinates
tol : radius of interest.
Output:
For tol > 0.0, returns a string listing all nodes within radius tol.
If tol <= 0.0, the nearest node will be returned.
(Available from the Tcl interpreter.)


int FindNodesNear( double x, double y, double tol, int id_near_array[], int maxCount )

Find all nodes a specified location or find the node nearest a given location.
Input:
x, y : location coordinates
tol : radius of interest:
for tol > 0.0 all nodes within radius tol will be included
for tol <= 0.0, only the closest node will be included.
id_near_array[] : pointer to an array which will be used to store node ids
maxCount : maximum number of nodes that will be collected in the id_near_array
Output:
For tol > 0.0, returns a string listing all nodes within radius tol.
If tol <= 0.0, the nearest node will be returned.


int SaveNodes( char *FileName )

Save all valid nodes to the specified file.
(Available from the Tcl interpreter.)


int LoadNodes( char *FileName )

Load the node data from the specified file.
To keep the characteristic network connections intact, we have to read the node data back into their original positions in the array.
(Available from the Tcl interpreter.)


Extracted by docgen.awk Mon Aug 09 23:28:59 EST 2004