00001 // ------------------------------------------------------------------------- 00002 // Fem.h - This header file contains the public data structure definitions 00003 // for the Finite Element Method class mechanism within FEMOOP. 00004 // ------------------------------------------------------------------------- 00005 // 00006 // Description: This class manages the global operations of the Finite 00007 // Element Method, like the computation of the profile of 00008 // the stiffnes matrix and the computation of the internal 00009 // force vector. 00010 // 00011 // Currently are implemented the subclasses: 00012 // FemMech - Fem for structural mechanics 00013 // 00014 // ------------------------------------------------------------------------- 00015 // Main public methods: 00016 // ------------------------------------------------------------------------- 00017 // 00018 // eFemType GetType( void ) 00019 // 00020 // Returns the Finite Element Model type. 00021 // ------------------------------------------------------------------------- 00022 // 00023 // cSmooth *GetSmooth( void ) 00024 // 00025 // Returns the pointer to smoothing class. 00026 // ------------------------------------------------------------------------- 00027 // 00028 // cDSA *GetDSA( void ) 00029 // 00030 // Returns the pointer to design sensitivity analysis class. 00031 // ------------------------------------------------------------------------- 00032 // 00033 // int GetNumEq( void ) 00034 // 00035 // Returns the total number of equations. 00036 // ------------------------------------------------------------------------- 00037 // 00038 // int *GetProfile( void ) 00039 // 00040 // Returns the profile of the stiffness matrix. 00041 // ------------------------------------------------------------------------- 00042 // 00043 // virtual void UpdateState( void ) 00044 // 00045 // Updates the system variables. For mechanical problems exemples are the 00046 // internal variables of constitutive models or the rigid rotations of 00047 // co-rotational elements. 00048 // ------------------------------------------------------------------------- 00049 // 00050 // virtual void AssignState( double *s ) 00051 // 00052 // s - vector of state variables ( out ) 00053 // 00054 // Stores the final values of the state variables (eg. nodal displacements), 00055 // this method should be called after the convergence of the global 00056 // numerical algorithm. 00057 // ------------------------------------------------------------------------- 00058 // 00059 // virtual void GetDValues( double *u ) 00060 // 00061 // u - vector of nodal displacements ( out ) 00062 // 00063 // Returns the current values of nodal displacements. 00064 // ------------------------------------------------------------------------- 00065 // 00066 // virtual void InitValues( void ) 00067 // 00068 // Initializes the system variables. For mechanical problems are the nodal 00069 // forces and constitutive models. 00070 // ------------------------------------------------------------------------- 00071 // 00072 // virtual double CalcVol( void ) 00073 // 00074 // Evaluates and returns the volume of the finite element mesh. 00075 // ------------------------------------------------------------------------- 00076 // 00077 // virtual int ExistStrainLoads( void ) 00078 // 00079 // Returns 1 if there are strain loads (e.g. thermal loads) in the FE model 00080 // and 0 otherwise. 00081 // ------------------------------------------------------------------------- 00082 // 00083 // virtual int StrainLoadVector( cVector &g, cVector &dg ); 00084 // 00085 // g - current internal force vector ( out ) 00086 // dg - strain load vector ( out ) 00087 // 00088 // Computes the strain load vector (e.g. due to thermal effects) by finite 00089 // difference: {dg} = {g(u, lf + dlf)} - {g(u, lf)})/dlf 00090 // ------------------------------------------------------------------------- 00091 // virtual void CompEqs( void ) 00092 // 00093 // Evaluates the total number of equations and generate the number of 00094 // each degree of freedom. 00095 // ------------------------------------------------------------------------- 00096 // 00097 // virtual void Profile( void ) 00098 // 00099 // Computes the profile of the global stiffness matrix. 00100 // ------------------------------------------------------------------------- 00101 // 00102 // virtual void PrscDispVector( int *prdof, double *prdsp ) 00103 // 00104 // prdof - array of prescribed dofs ( out ) 00105 // prdsp - array of prescribed displacements ( out ) 00106 // 00107 // Computes the vector of prescribed dofs and the associated prescribed 00108 // displacements. The dimension of the given vectors is the number of 00109 // prescribed displacements (obtained from cNode class). 00110 // It should be noted that the same dof may be prescribed more than one 00111 // time. In this case the resulting prescribed displacement should be the 00112 // summation of the prescribed values. 00113 // ------------------------------------------------------------------------- 00114 // 00115 // virtual void ExtLoadVector( cVector &f ) 00116 // 00117 // f - external load vector ( out ) 00118 // 00119 // Evaluates the external load vector corresponding to the total loads, 00120 // e.g. gravity + thermal loads, for small displacement analysis. 00121 // ------------------------------------------------------------------------- 00122 // 00123 // virtual void RefLoadVector( cVector &q ) 00124 // 00125 // q - reference load vector ( out ) 00126 // 00127 // Evaluates the reference load vector for proportional external loading, 00128 // e.g. gravity loads, for large displacement (geometrically nonlinear) 00129 // analysis. 00130 // ------------------------------------------------------------------------- 00131 // 00132 // virtual int IntForceVector( cVector &g ) 00133 // 00134 // g - internal load vector ( out ) 00135 // 00136 // Evaluates the internal force vector. Returns (1) for sucess and (0) for 00137 // error. 00138 // ------------------------------------------------------------------------- 00139 // 00140 // virtual void StiffnessMatrix( cSysMatrix *K ) 00141 // 00142 // K - global stiffness matrix ( out ) 00143 // 00144 // Evaluates the global stiffness matrix of the finite element model. 00145 // ------------------------------------------------------------------------- 00146 // 00147 // virtual void GeoStiffnessMatrix( cSysMatrix *Kg ) 00148 // 00149 // Kg - global geometric stiffness matrix ( out ) 00150 // 00151 // Evaluates the global geometric (initial stress) stiffness matrix of the 00152 // finite element model. 00153 // ------------------------------------------------------------------------- 00154 // 00155 // virtual void PrintResult( double lbd ) 00156 // 00157 // lbd - load factor ( in ) 00158 // 00159 // Prints the results on the output file. 00160 // ------------------------------------------------------------------------- 00161 // 00162 // virtual void CalcDSA( double lbd, double **K ) 00163 // 00164 // lbd - load factor ( in ) 00165 // K - global stiffness matrix ( in ) 00166 // 00167 // Evaluates the design sensitivities of displacements and stresses. 00168 // ------------------------------------------------------------------------- 00169 // 00170 // virtual void CalcDSA( double lbd, double **K, double *v ) 00171 // 00172 // lbd - load factor ( in ) 00173 // K - global stiffness matrix ( in ) 00174 // v - buckling mode (eigenvector) ( in ) 00175 // 00176 // Evaluates the design sensitivities of the displacements, stresses and 00177 // linear bucking load. 00178 // ------------------------------------------------------------------------- 00179 // 00180 // virtual void CalcDSA( double lbd, double **K, double *v, double *p ) 00181 // 00182 // lbd - load factor ( in ) 00183 // K - global stiffness matrix ( in ) 00184 // v - stiffness matrix zero eigenvector ( in ) 00185 // p - global load vector ( in ) 00186 // 00187 // Evaluates the design sensitivities of the nonlinear critical load. 00188 // ------------------------------------------------------------------------- 00189 // 00190 // $Author: evandro $ 00191 // $Revision: 1.5 $ 00192 // $Date: 2000/04/04 23:21:02 $ 00193 // $State: Exp $ 00194 // 00195 // ------------------------------------------------------------------------- 00196 00197 #ifndef _FEM_H 00198 #define _FEM_H 00199 00200 // ------------------------------------------------------------------------- 00201 // Forward declarations: 00202 // 00203 class cNode; 00204 class cMaterial; 00205 class cAnModel; 00206 class cElement; 00207 class cLoadElement; 00208 class cDSA; 00209 class cError; 00210 class cSmooth; 00211 class cVector; 00212 class cSysMatrix; 00213 00214 // ------------------------------------------------------------------------- 00215 // Fem types: 00216 // 00217 typedef enum _femtype 00218 { 00219 MECHANIC 00220 } eFemType; 00221 00222 // ------------------------------------------------------------------------- 00223 // Definition an Finite Element Method class: 00224 // 00225 class cFem 00226 { 00227 protected: 00228 eFemType _eType; // Fem type 00229 int _PrintVolume; // Print mesh volume 00230 int _PrintNodDsp; // Print nodal displacement 00231 int _PrintSupRct; // Print support reactions 00232 int _PrintNodScl; // Print nodal results 00233 int _PrintElmScl; // Print element results 00234 int _PrintElmNodScl; // Print elm.nodal results 00235 int _PrintElmGauScl; // Print elm.gauss results 00236 int _iNumEq; // Total number of equations 00237 int *_piProfile; // Profile vector 00238 cNode *_pcNode; // Node class 00239 cMaterial *_pcMat; // All material data 00240 cAnModel *_pcAnM; // Analysis model 00241 cElement *_pcElm; // Element class 00242 cLoadElement *_pcLec; // Load element class 00243 cDSA *_pcDSA; // Design sensitivity analysis class 00244 cError *_pcErr; // Error estimator class 00245 cSmooth *_pcSmooth; // Smooth procedure Class 00246 00247 public: 00248 cFem ( void ); 00249 virtual ~cFem ( void ); 00250 eFemType GetType ( void ) { return _eType; } 00251 int *GetProfile ( void ) { return _piProfile; } 00252 int GetNumEq ( void ) { return _iNumEq; } 00253 cSmooth *GetSmooth ( void ) { return _pcSmooth; } 00254 cDSA *GetDSA ( void ) { return _pcDSA; } 00255 virtual void UpdateState ( void ); 00256 virtual void AssignState ( double * ); 00257 virtual void AssignState ( cVector & ); 00258 virtual void GetDValues ( double * ); 00259 virtual int ExistStrainLoads ( void ); 00260 virtual int StrainLoadVector ( cVector &, cVector & ); 00261 virtual double CalcVol ( void ); 00262 virtual void InitValues ( void ) = 0; 00263 virtual void CompEqs ( void ) = 0; 00264 virtual void Profile ( void ) = 0; 00265 virtual void PrscDispVector ( int *, double * ) { } 00266 virtual void ExtLoadVector ( cVector & ) { } 00267 virtual void RefLoadVector ( cVector & ) { } 00268 virtual int IntForceVector ( cVector & ) { return 0; } 00269 virtual void StiffnessMatrix ( cSysMatrix * ) { } 00270 virtual void GeoStiffnessMatrix ( cSysMatrix * ) { } 00271 virtual void PrintResult ( double ) { } 00272 virtual void CalcDSA ( double, cSysMatrix * ) { } 00273 virtual void CalcDSA ( double, cSysMatrix *, cVector &){} 00274 virtual void CalcDSA ( double, cSysMatrix *, cVector &, 00275 cVector & ) { } 00276 virtual int GetNumStrainEq ( void ) { return 0; } 00277 virtual void AssemblyStrainVector( double *, double *, double * ) { } 00278 00279 protected: 00280 virtual void ReduceVector ( double *, double * ); 00281 void ProcessPrintOptions ( void ); 00282 }; 00283 00284 #endif 00285