00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _MATERIAL_H
00019 #define _MATERIAL_H
00020
00021
00022
00023
00024 typedef enum _mattype
00025 {
00026 MOHR_COULOMB_CUTOFF,
00027 MOHR_COULOMB,
00028 MOHR_COULOMB_NAC,
00029 MOHR_COULOMB_NAV,
00030 ISOTROPIC,
00031 ISOTROPIC_FAIL,
00032 ORTHOTROPIC,
00033 HIPERBOLIC,
00034 MISES,
00035 INTERFACE_MAT,
00036 ITF_MOHR_COULOMB,
00037 KELVIN,
00038 MAXWELL,
00039 NumMatTypes
00040 } eMatType;
00041
00042
00043
00044
00045 typedef struct _material
00046 {
00047 eMatType type;
00048 int label;
00049 double Gamma;
00050 double Rhof;
00051 void *data;
00052 double Lambda;
00053 } sMaterial;
00054
00055
00056
00057
00058 typedef struct _matclass
00059 {
00060 void (*init) ( void );
00061 void (*new) ( int, sMaterial ** );
00062 void (*free) ( sMaterial * );
00063 void (*read) ( sMaterial * );
00064 void (*epar) ( sMaterial *, double * );
00065 void (*nupar) ( sMaterial *, double * );
00066 void (*cmatrix) ( sMaterial *, double [6][6] );
00067 void (*cpsmatrix)( sMaterial *, double [6][6] );
00068 void (*updatestr)( sMaterial *, double, double *, double *, double *,
00069 double * );
00070 void (*updatepar)( sMaterial *, double );
00071 void (*timestep) ( sMaterial *, double * );
00072 void (*density) ( sMaterial *, double * );
00073 void (*vstrain) ( sMaterial *, double, sTensor *, sTensor * );
00074 void (*rf)( sMaterial *, double , double , double * );
00075
00076 } sMatClass;
00077
00078
00079
00080 extern sMatClass MatClass[NumMatTypes];
00081
00082
00083
00084 extern sMaterial **MatList;
00085
00086
00087
00088 extern int NumMaterials;
00089
00090
00091
00092
00093
00094
00095 #define MatInit(type) \
00096 if(MatClass[type].init != 0L) \
00097 (*MatClass[type].init)( )
00098
00099 #define MatNew(type,label,mat) \
00100 if(MatClass[type].new != 0L) \
00101 (*MatClass[type].new)( label, mat )
00102
00103 #define MatFree(mat) \
00104 if(MatClass[mat->type].free != 0L) \
00105 (*MatClass[mat->type].free)( mat )
00106
00107 #define MatRead(mat) \
00108 if(MatClass[mat->type].read != 0L ) \
00109 (*MatClass[mat->type].read)( mat )
00110
00111 #define MatEParameter(mat,e) \
00112 if(MatClass[mat->type].epar != 0L ) \
00113 (*MatClass[mat->type].epar)( mat, e )
00114
00115 #define MatNuParameter(mat,nu) \
00116 if(MatClass[mat->type].nupar != 0L ) \
00117 (*MatClass[mat->type].nupar)( mat, nu )
00118
00119 #define MatConstitutiveMatrix(mat,cm) \
00120 if(MatClass[mat->type].cmatrix != 0L ) \
00121 (*MatClass[mat->type].cmatrix)( mat, cm )
00122
00123 #define MatPSMatrix(mat,cm) \
00124 if(MatClass[(mat)->type].cpsmatrix != NULL ) \
00125 (*MatClass[(mat)->type].cpsmatrix)( (mat), (cm) )
00126
00127 #define MatUpdateStress(mat,dt,y,effd,str,def) \
00128 if(MatClass[mat->type].updatestr != 0L )\
00129 (*MatClass[mat->type].updatestr)( mat, dt, y, effd, str, def )
00130
00131 #define MatUpdateParameter(mat,str) \
00132 if(MatClass[mat->type].updatepar != 0L )\
00133 (*MatClass[mat->type].updatepar)( mat, str )
00134
00135 #define MatTimeStep(mat,dt) \
00136 if(MatClass[mat->type].timestep != 0L ) \
00137 (*MatClass[mat->type].timestep)( mat, dt )
00138
00139 #define MatDensity(mat,gamma) \
00140 if(MatClass[mat->type].density != 0L ) \
00141 (*MatClass[mat->type].density)( mat, gamma )
00142
00143 #define MatViscoStrain(mat,ts,str,strv) \
00144 if(MatClass[mat->type].vstrain != 0L ) \
00145 (*MatClass[mat->type].vstrain)( mat, ts, str, strv )
00146
00147 #define MatRF(mat,sig1,sig3, rfv) \
00148 if(MatClass[mat->type].rf != 0L )\
00149 (*MatClass[mat->type].rf)( mat, sig1, sig3, rfv )
00150
00151
00152
00153
00154 void MaterialInit ( void );
00155 void MaterialFree ( void );
00156 int MaterialIsVisco( sMaterial * );
00157
00158 #endif
00159