SPModel: libSPModel/src/SplineInterpolator.h Source File
VPAC - Computational Software Development
Main | SPModel | StGermain FrameWork |
Main Page | Alphabetical List | Class List | Directories | File List | Class Members | File Members

SplineInterpolator.h

Go to the documentation of this file.
00001 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00002 **
00003 ** Copyright (C), 2004, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
00004 **
00005 ** Authors:
00006 **  Ogar R. Widjaja, Computational Scientist, VPAC.
00007 **  Raquibul Hassan, Software Engineer, VPAC. (raq@vpac.org)
00008 **  Keith Hsuan, Computational Scientist, VPAC (keith@vpac.org)
00009 **  William F. Appelbe, Director, VPAC. (bill@vpac.org)
00010 **  Stevan M. Quenette, Senior Software Engineer, VPAC. (steve@vpac.org)
00011 **  Patrick D. Sunter, Software Engineer, VPAC. (patrick@vpac.org)
00012 **
00013 ** This file may be distributed under the terms of the VPAC Public License
00014 ** as defined by VPAC of Australia and appearing in the file
00015 ** LICENSE.VPL included in the packaging of this file.
00016 **
00017 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00018 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00019 **
00020 */
00032 #ifndef __SPModel_SplineInterpolator_h__
00033 #define __SPModel_SplineInterpolator_h__
00034 
00035     #define __SplineInterpolator \
00036         __Interpolator \
00037         /* arrays used in the spline interpolation */ \
00038         double          *um; \
00039         double          *un; \
00040         float           *x1a; \
00041         float           *x2a; \
00042         float           **y2a; \
00043         float           *ytmp; \
00044         float           *yytmp; \
00045         float           *y2a_t; \
00046         float           *ya_t;
00047     struct SplineInterpolator{ __SplineInterpolator };
00048 
00049 SplineInterpolator *SplineInterpolator_DefaultNew( Name name );
00050 
00051 SplineInterpolator *SplineInterpolator_New( Name name, Dictionary *dictionary, SurfaceMesh *mesh, SurfaceRegularMesh *regularMesh );
00052 
00053 SplineInterpolator                  *_SplineInterpolator_New( SizeT                         _sizeOfSelf,
00054                                     Type                            type,
00055                                     Stg_Class_DeleteFunction*               _delete,
00056                                     Stg_Class_PrintFunction*                _print,
00057                                     Stg_Class_CopyFunction*             _copy, 
00058                                     Stg_Component_DefaultConstructorFunction*   _defaultConstructor,
00059                                     Stg_Component_ConstructFunction*            _construct,
00060                                     Stg_Component_BuildFunction*        _build,
00061                                     Stg_Component_InitialiseFunction*       _initialise,
00062                                     Stg_Component_ExecuteFunction*      _execute,
00063                                     Stg_Component_DestroyFunction*      _destroy,
00064                                     Name                            name,
00065                                     Bool                            initFlag,
00066                                     Dictionary                      *dictionary,
00067                                     SurfaceMesh                     *mesh,
00068                                     SurfaceRegularMesh              *regularMesh );
00069 
00070 void _SplineInterpolator_Init( SplineInterpolator *self );
00071 
00072 void _SplineInterpolator_Print( void *splineInterpolator, Stream *stream );
00073 
00074 void _SplineInterpolator_Delete( void *splineInterpolator );
00075 
00076 void _SplineInterpolator_Construct( void *splineInterpolator, Stg_ComponentFactory *cf );
00077 
00078 void _SplineInterpolator_Build( void *splineInterpolator, void *data );
00079 
00080 void _SplineInterpolator_Initialise( void *splineInterpolator, void *data );
00081 
00082 void _SplineInterpolator_Execute( void *splineInterpolator, void *data );
00083 
00084 void _SplineInterpolator_Destroy( void *splineInterpolator, void *data );
00085 
00086 /* public functions */
00087 
00088 void SplineInterpolator_InterpolateFromGridToMesh( _Interpolator *interpolator, float **gridDeflectionArray,
00089         float *meshDeflectionArray );
00090 
00091 /* private functions */
00092 void spline( int numElements, float *x, float *y, float yp1, float ypn, float *y2, double *u );
00093 
00094 void splint( int numElements, float *xa, float *ya, float *y2a, float x, float *y );
00095 
00096 void splie2( SplineInterpolator *splInt, float **ya );
00097 
00098 void splin2( SplineInterpolator *splInt, float **ya, float x1, float x2, float *y );
00099 
00100 #endif
00101