damp.h

Go to the documentation of this file.
00001 /*
00002 %M This header file contains the damping class definition.
00003 %a Joao Luiz Elias Campos.
00004 %d September 16th, 2000.
00005 %r $Id: damp.h,v 1.1 2004/06/22 05:29:58 joaoluiz Exp $
00006 %w (C) COPYRIGHT 2000, Joao Luiz Elias Campos.
00007    All Rights Reserved
00008    Duplication of this program or any part thereof without the express
00009    written consent of the author is prohibited.
00010 */
00011 
00012 #ifndef _DAMP_H
00013 #define _DAMP_H
00014 
00017 typedef enum _damptype
00018 {
00019  AUTO_GLOBAL,
00020  AUTO_LOCAL,
00021  RAYLEIGH,
00022  NumDampTypes
00023 } eDampType;
00024 
00027 typedef struct _damp
00028 {
00029  eDampType  type;
00030  void      *data;
00031 } sDamp;
00032 
00035 typedef struct _dampclass
00036 {
00037  void (*init)( void );
00038  void (*new) ( sDamp ** );
00039  void (*free)( sDamp * );
00040  void (*read)( sDamp * );
00041  void (*calc)( sDamp *, int, double, double *, double *, double *, double * );
00042 } sDampClass;
00043 
00046 extern sDampClass DampClass[NumDampTypes];
00047 
00050 extern sDamp *DampObj;
00051 
00052 
00053 /*
00054 ** ------------------------------------------------------------------------
00055 ** Macro definitions:
00056 */
00057 
00058 #define DampInit(type)                          \
00059         if(DampClass[type].init != 0L)          \
00060          (*DampClass[type].init)( )
00061 
00062 #define DampNew(type,o)                 \
00063         if(DampClass[type].new != 0L)           \
00064          (*DampClass[type].new)( o )
00065 
00066 #define DampFree(o)                             \
00067         if(DampClass[o->type].free != 0L)       \
00068          (*DampClass[o->type].free)( o )
00069 
00070 #define DampRead(o)                             \
00071         if(DampClass[o->type].read != 0L)       \
00072          (*DampClass[o->type].read)( o )
00073 
00074 #define DampCalcCoeff(o,i,t,m,v,a,e)            \
00075         if(DampClass[o->type].calc != 0L)       \
00076          (*DampClass[o->type].calc)( o, i, t, m, v, a, e )
00077 
00078 /* Public functions
00079  */
00080 void DampingInit( void );
00081 void DampingFree( void );
00082 
00083 #endif
00084 

Generated on Tue Oct 23 11:23:29 2007 for Relax by  doxygen 1.5.3