vtf-logo

shells/fem/internalStorage.h

Go to the documentation of this file.
00001 /* -*- C -*- */
00002 /*
00003  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00004  *
00005  *                                   Fehmi Cirak
00006  *                        California Institute of Technology
00007  *                           (C) 2004 All Rights Reserved
00008  *
00009  * <LicenseText>
00010  *
00011  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00012 */
00013 #ifndef INTERNALSTORAGE_H
00014 #define INTERNALSTORAGE_H
00015 
00016 #if defined(HAVE_CONFIG_H)
00017 /* autoconf */
00018 #include <config.h>
00019 #elif defined(BLD_PROCEDURE)
00020 /* build procedure */
00021 #include <portinfo.h>
00022 #endif
00023 
00024 #ifdef __cplusplus
00025 namespace shells {
00026 #define DECLARE_EXTERN extern "C"
00027 #else
00028 #define DECLARE_EXTERN extern
00029 #endif
00030 
00031 #if defined(ADLIB_MATERIAL_LIBRARY)
00032     struct material;
00033 #elif defined(SHELL_NEWMAT_LIBRARY)
00034     struct MaterialBase;   
00035 #else 
00036     struct SMaterialS;
00037 #endif
00038 
00039     typedef struct InternalStorageS {
00040         double            *stresses;    /* stresses used for constitutive update */
00041         double            *strains;     /* strains  used for constitutive update */
00042         double            *internal;    /* internal paramaters used for constitutive update */
00043         double            *thickParams; /* thickness stretch parameter */
00044 
00045 #if defined(ADLIB_MATERIAL_LIBRARY)
00046         struct material   *mat;         /* element material */
00047 #elif defined(SHELL_NEWMAT_LIBRARY)
00048         struct MaterialBase *mat;
00049 #else 
00050         struct SMaterialS *mat;
00051 #endif
00052         unsigned short   numSurf;     /* number of surface integration points */
00053         unsigned short   numThick;    /* number of thickness integration points */
00054     } InternalStorage;
00055     
00056     
00057     DECLARE_EXTERN InternalStorage *createInternalStorage(unsigned short numThick, 
00058                                                           unsigned short numSurf, 
00059                                                           unsigned short materialType);
00060     DECLARE_EXTERN void getFromStorage(InternalStorage *storage, 
00061                                        int intPointAccum,
00062                                        double stress[3][3], 
00063                                        double strain[9], 
00064                                        double *internal);
00065     DECLARE_EXTERN void putToStorage(InternalStorage *storage, 
00066                                      int intPointAccum,
00067                                      double stress[3][3], 
00068                                      double strain[3][3],
00069                                      double *internal);    
00070     DECLARE_EXTERN void  averageInternalStorage(InternalStorage *storage, 
00071                                                 double stress[9], 
00072                                                 double *internal,
00073                                                 int internalSize); 
00074 
00075     DECLARE_EXTERN double getDensity(InternalStorage *storage);
00076     DECLARE_EXTERN int getNumInternal(InternalStorage *st);
00077     DECLARE_EXTERN double getYoungsModulus(InternalStorage *st);
00078     DECLARE_EXTERN void pointerToHistoryVariables(InternalStorage *storage, 
00079                                                   double **data, 
00080                                                   int *size);
00081     DECLARE_EXTERN void resetHistoryVariables(InternalStorage *storage, 
00082                                               double *data);
00083 
00084     static unsigned short getNumSurf(InternalStorage *st) 
00085     {
00086         return st->numSurf;
00087     }
00088     
00089     static unsigned short getNumThick(InternalStorage *st) 
00090     {
00091         return st->numThick;
00092     }
00093     
00094     static void putThickParam(InternalStorage *st, int intPoint, 
00095                                      double thickParam) 
00096     {   
00097         (st->thickParams)[intPoint] = thickParam;
00098     }
00099     
00100     static double getThickParam(InternalStorage *st, int intPoint) 
00101     {
00102         return ((st->thickParams)[intPoint]);
00103     }
00104 
00105 #if defined(ADLIB_MATERIAL_LIBRARY)
00106     static struct material* getMaterial(InternalStorage *storage) 
00107     {
00108         return (storage->mat);
00109     }
00110 #elif defined(SHELL_NEWMAT_LIBRARY)
00111     static struct MaterialBase* getMaterial(InternalStorage *storage) 
00112     {
00113         return (storage->mat);
00114     }
00115 #else 
00116     static struct SMaterialS* getMaterial(InternalStorage *storage) 
00117     {
00118         return (storage->mat);
00119     }
00120 #endif
00121 
00122 
00123 #ifdef __cplusplus
00124 }
00125 #endif
00126 #undef DECLARE_EXTERN
00127 
00128 #endif 
00129 
00130 /* End of file */

Generated on Fri Aug 24 13:00:24 2007 for SFC Thin-Shell Finite Element Solver by  doxygen 1.4.7