../source/moc_wall.c

\file moc_wall.c * \ingroup imoc * \brief Wall functions for Method-of-Characteristics program. * * This set of functions forms part of the computational and * data storage kernel for the MOC program. * Interaction with the user is handled by the set of * Tcl/Tk functions. * * \author PA Jacobs * * \version 04-Jan-2000 : Initial hack * \version 26-Jan-2000 : Add more functions to access wall data. *


int InitWall( void )

Purpose: Initialize the wall data structures.
Input: None
Output: Returns 0 indicating success.
(Available from the Tcl interpreter.)


int WallIsPresent( int iw )

Returns 1 if the wall is present and can be used.
(Available from the Tcl interpreter.)


int WallGetNumberOfPoints( int iw )

Returns number of points defining the wall.
(Available from the Tcl interpreter.)


double WallGetPointX( int iw, int ip )

Returns the X-coordinate of the ip-th point defining the wall.
0 <= ip < npoint[iw].
(Available from the Tcl interpreter.)


double WallGetPointY( int iw, int ip )

Returns the Y-coordinate of the ip-th point defining the wall.
0 <= ip < npoint[iw].
(Available from the Tcl interpreter.)


int WallDeletePoints( int iw )

Purpose: Set all of the data back to scratch.
Input: iw is the index of the Wall to be reset.
Output: Returns 0 indicating success or -1 on failure.
(Available from the Tcl interpreter.)


int WallAddPoint( int iw, double x, double y )

Purpose: Add an interpolation point to the specified wall.
Input:
iw : specifies the wall
x, y : coordinates of the point.
Output:
Returns the index of the point if successfully added, or -1 on failure.
(Available from the Tcl interpreter.)


double WallPosX( int iw, double t )

Purpose: Evaluate the X-value of the spline for parameter value t.
Input :
iw : specified wall
t : parametric distance 0 <= t <= 1
Output :
Returns the X-value. If anything goes wrong, a value of zero is returned.
(Available from the Tcl interpreter.)


double WallPosY( int iw, double t )

Purpose: Evaluate the Y-value of the spline for parameter value t.
Input :
iw : specified wall
t : parametric distance 0 <= t <= 1
Output :
Returns the Y-value. If anything goes wrong, a value of zero is returned.
(Available from the Tcl interpreter.)


double WallSlope( int iw, double t )

Purpose: Evaluate the slope (in the x,y-plane) of the spline for parameter value t.
Input :
iw : specified wall
t : parametric distance 0 <= t <= 1
Output :
Returns the slope. If anything goes wrong, a value of zero is returned.
(Available from the Tcl interpreter.)


double WallFindT( int iw, double xp, double yp, double cos_th, double sin_th )

Purpose: Given a line (specified by a point and a slope) find the intersection point along the spline. It is assumed that the wall is not too far from being a straight line, itself.
Input :
iw : specified wall
xp,yp : a point on the straight line.
sin_th cos_th: Slope of the line specified as sin(theta) and cos(theta).
Output :
Returns the (parametric) t-coordinatei of the intersection, 0.0 <= t <= 1.0. If anything goes wrong a value of -1.0 is returned.
(Available from the Tcl interpreter.)


int SaveWall( int iw, char *FileName )

Purpose: Write the interpolation points for the specified wall.
Input :
iw : index specifying the wall
FileName : pointer to the filename string.
Output :
Returns 0 if successful, -1 on failure.
(Available from the Tcl interpreter.)


int LoadWall( int iw, char *FileName )

Purpose: Read the interpolation points for the specified wall and set up the spline ready for evaluation.
Input :
iw : index specifying the wall
FileName : pointer to the filename string.
Output :
Returns the number of points if successful, -1 on failure.
(Available from the Tcl interpreter.)


Extracted by docgen.awk Tue Dec 9 21:31:41 AEST 2014