00001 // ------------------------------------------------------------------------- 00002 // dsa.h - This header file contains the public data structure definitions 00003 // for the Design Sensitivity Analysis class within FEMOOP. 00004 // ------------------------------------------------------------------------- 00005 // Public methods: 00006 // ------------------------------------------------------------------------- 00007 // 00008 // static cDSA *Read(cFem *pcFem) 00009 // 00010 // pcFem - pointer to parent Fem object ( in) 00011 // 00012 // This method reads the DSA data from the input file and returns a pointer 00013 // to the created DSA object. 00014 // ------------------------------------------------------------------------- 00015 // 00016 // void Evaluate(double lbd, cSysMatrix *K) 00017 // 00018 // lbd - current load factor ( in) 00019 // K - current stiffnes matrix ( in) 00020 // 00021 // This method evaluates the derivatives of mesh vol., nodal displacements 00022 // and element stresses w.r.t. the nodal coordinates and prints these 00023 // values in the "pos" file. 00024 // ------------------------------------------------------------------------- 00025 // 00026 // void Evaluate(double lbd, cSysMatrix *K, cVector &v) 00027 // 00028 // lbd - buckling load factor ( in) 00029 // K - global stiffnes matrix ( in) 00030 // v - buckling mode ( in) 00031 // 00032 // This method evaluates the derivatives of mesh vol., nodal displacements, 00033 // element stresses and linear bukling load factor w.r.t. the nodal 00034 // coordinates and prints these values in the "pos" file. 00035 // ------------------------------------------------------------------------- 00036 // 00037 // void Evaluate(double lbd, cSysMatrix *K, cVector &v, cVector &f) 00038 // 00039 // lbd - critical load factor ( in) 00040 // K - current stiffnes matrix ( in) 00041 // v - buckling mode (zero eigenvector) ( in) 00042 // f - reference load vector ( in) 00043 // 00044 // This method evaluates the derivatives of nonlinear critical load factor 00045 // and prints these values in the "pos" file. 00046 // ------------------------------------------------------------------------- 00047 // Pure virtual methods: 00048 // ------------------------------------------------------------------------- 00049 // 00050 // double DsaVolume(cElement *Elm, int nnode, cNode **node, 00051 // sNodeCoord *dcoord) 00052 // 00053 // elm - given element ( in) 00054 // nnode - number of element nodes ( in) 00055 // node - element nodes ( in) 00056 // dcoord - design velocities (dcoord/dx) ( in) 00057 // 00058 // Returns the shape sensitivity of the element volume. 00059 // ------------------------------------------------------------------------- 00060 // 00061 // void DsaEqvForce(cLoadElement *lec, int nnode, cNode **node, 00062 // sNodeCoord *dcoord, double lf, double *p) 00063 // 00064 // lec - given load element ( in) 00065 // nnode - number of element nodes ( in) 00066 // node - element nodes ( in) 00067 // dcoord - design velocities (dcoord/dx) ( in) 00068 // lbd - load factor ( in) 00069 // p - d{f}/dx (out) 00070 // 00071 // Evaluates the shape sensitivity of the equivalent load vector. 00072 // ------------------------------------------------------------------------- 00073 // 00074 // void DsaIntForce(cElement *elm, int nnode, cNode **node, 00075 // sNodeCoord *dcoord, double *p) 00076 // 00077 // elm - given element ( in) 00078 // nnode - number of element nodes ( in) 00079 // node - element nodes ( in) 00080 // dcoord - design velocities (dcoord/dx) ( in) 00081 // p - d{g}/dx (out) 00082 // 00083 // Evaluates the shape sensitivity of the internal force vector. 00084 // ------------------------------------------------------------------------- 00085 // 00086 // void DsaStiffMat(cElement *elm, int nnode, cNode **node, 00087 // sNodeCoord *dcoord, double *v, double *w) 00088 // 00089 // elm - given element ( in) 00090 // nnode - number of element nodes ( in) 00091 // node - element nodes ( in) 00092 // dcoord - design velocities (dcoord/dx) ( in) 00093 // v - buckling mode ( in) 00094 // w - (d[K]/dx)*{v} (out) 00095 // 00096 // Evaluates the shape sensitivity of the stiffness matrix (d[K]/dx) and 00097 // returns (d[K]/dx)*{v}. Used for critical load sensitivity. 00098 // ------------------------------------------------------------------------- 00099 // 00100 // void DsaGeoStiff(cElement *elm, int active, int nnode, cNode **node, 00101 // sNodeCoord *dcoord, double *du, double *v, double *w) 00102 // 00103 // elm - given element ( in) 00104 // active - flag indicating if dcoord != {0} ( in) 00105 // nnode - number of element nodes ( in) 00106 // node - element nodes ( in) 00107 // dcoord - design velocities (dcoord/dx) ( in) 00108 // du - nodal displacements ( in) 00109 // v - buckling mode ( in) 00110 // w - (d[K]/dx)*{v} (out) 00111 // 00112 // Evaluates the shape sensitivity of the element geometric stiffness 00113 // matrix (d[K]/dx) and returns (d[K]/dx)*{v}. Used for critical load 00114 // sensitivity. 00115 // ------------------------------------------------------------------------- 00116 // 00117 // void DsaStress(cElement *elm, int active, int nnode, cNode **node, 00118 // sNodeCoord *dcoord, double *du, double **ds) 00119 // 00120 // elm - given element ( in) 00121 // active - flag indicating if dcoord != {0} ( in) 00122 // nnode - number of element nodes ( in) 00123 // node - element nodes ( in) 00124 // dcoord - design velocities (dcoord/dx) ( in) 00125 // du - nodal displacements ( in) 00126 // ds - sensitivity of element stresses (out) 00127 // 00128 // Evaluates the shape sensitivity of the element stresses. 00129 // ------------------------------------------------------------------------- 00130 // 00131 // $Author: evandro $ 00132 // $Revision: 1.7 $ 00133 // $Date: 2000/08/21 19:20:55 $ 00134 // $State: Exp $ 00135 // 00136 // ------------------------------------------------------------------------- 00137 00138 #ifndef _DSA_H 00139 #define _DSA_H 00140 00141 #include "gbldefs.h" 00142 00143 // ------------------------------------------------------------------------- 00144 // Forward declarations: 00145 // 00146 class cFem; 00147 class cNode; 00148 class cElement; 00149 class cLoadElement; 00150 class cVector; 00151 class cSysMatrix; 00152 00153 // ------------------------------------------------------------------------- 00154 // Sensitivity types: 00155 // 00156 typedef enum _dsatype 00157 { 00158 AM, // Analytical method 00159 SAM, // Semi-Analytical method 00160 RSAM // Refined Semi-Analytical method 00161 } eDSAType; 00162 00163 typedef struct _dsanodedir 00164 { 00165 cNode *node; 00166 int dirx; 00167 int diry; 00168 int dirz; 00169 int theta; 00170 int phi; 00171 } DSANodeDir; 00172 00173 typedef struct _dsanodedrv 00174 { 00175 double dx; // coord x derivative w.r.t. design var 00176 double dy; // coord y derivative w.r.t. design var 00177 double dz; // coord z derivative w.r.t. design var 00178 double dtheta; // vector theta angle derivative w.r.t. design var 00179 double dphi; // vector phi angle derivative w.r.t. design var 00180 } DSANodeDrv; 00181 00182 typedef struct _dsatempdrv 00183 { 00184 double tinf; // sensitivity of inferior face temperature 00185 double tsup; // sensitivity of superior face temperature 00186 } DSATempDrv; 00187 00188 // ------------------------------------------------------------------------- 00189 // DSA class: 00190 // 00191 class cDSA 00192 { 00193 protected: 00194 static eDSAType _eType; // Method of DSA 00195 static int _iNumVar; // Number of design variables 00196 static int _iNumKeyNode; // Number of FE mesh 'key' nodes 00197 static int _iNumSnsNode; // Number of nodes for stress sensit. 00198 static int _iNumSnsElem; // Number of elems (stress sensit.) 00199 static int _iNumTempNode; // Number of nodes with temp. derivs. 00200 static int _iDirDerDiff; // Dir. deriv. diff. (foward/central) 00201 static double _dRelPert; // Relative perturbation 00202 static double _dDirDerPert; // Dir. deriv. perturbation 00203 static DSANodeDir *_psKeyNode; // 'Key' nodes and directions 00204 static DSANodeDrv **_psDrvNodeVar; // Nodal coord. deriv. w.r.t des. var. 00205 static cNode **_pcSnsNode; // Nodes for stress sensitivities 00206 static cElement **_pcSnsElm; // Elements for stress sensitivities 00207 static cNode **_pcTempNode; // Nodes with temperature sensit. 00208 static DSATempDrv **_psTempDrv; // Nodal coord. deriv. w.r.t des. var. 00209 static cFem *_pcFem; // pointer to f.e.model 00210 00211 public: 00212 static cDSA *Read (cFem *); 00213 cDSA (void); 00214 virtual ~cDSA (void); 00215 void Evaluate(double, cSysMatrix *); 00216 void Evaluate(double, cSysMatrix *, cVector &); 00217 void Evaluate(double, cSysMatrix *, cVector &, cVector &); 00218 00219 protected: 00220 static void AssemblyElmList(void); 00221 static void StoreDerDispl (double *, sNodeDispl *); 00222 static void PrintDerVol (double *); 00223 static void PrintDerStress (sTensor ***); 00224 static void PrintDerMaxLoad(double *); 00225 static void PrintDerDispl (cVector *); 00226 static void GetCoordDeriv (int, int, cNode **, int *, sNodeCoord *); 00227 static void GetTempDeriv (int, int, cNode **, int *, DSATempDrv *); 00228 00229 void EvalDerDispl (double, cSysMatrix *, cVector *); 00230 void EvalPseudoLoad (int, double, cVector &, double *); 00231 void EvalDerivStiff (int, cVector &, cVector &); 00232 double EvalDerBuckLoad(int, double, cVector &, cVector &); 00233 void EvalDerStress (int, cVector &); 00234 void EvalDerivStiff (double *, double **); 00235 void EvalDirDerVec (cVector &, cVector &, cVector &, 00236 cVector *, cVector &, cVector *, 00237 cVector &, cVector * ); 00238 void EvalDirDerVec (cVector &, cVector &, cVector &, 00239 cVector &); 00240 00241 virtual double DsaVolume (cElement *, int, cNode **, sNodeCoord *)=0; 00242 virtual void DsaEqvForce (cLoadElement *, int, cNode **, 00243 sNodeCoord *, double, double *)=0; 00244 virtual void DsaIntForce (cElement *, int, cNode **, sNodeCoord *, 00245 double *)=0; 00246 virtual void DsaStiffMat (cElement *, int, cNode **, sNodeCoord *, 00247 double *, double *)=0; 00248 virtual void DsaGeoStiff (cElement *, int, int, cNode **, sNodeCoord *, 00249 double *, double *, double *)=0; 00250 virtual void DsaStress (cElement *, int, int, cNode **, sNodeCoord *, 00251 double *, double **)=0; 00252 virtual void DsaTempIntForce(cElement *, int, cNode **, DSATempDrv *, 00253 double *)=0; 00254 virtual void DsaTempStiffMat(cElement *, int, cNode **, DSATempDrv *, 00255 double *, double *)=0; 00256 virtual void DsaTempGeoStiff(cElement *, int, cNode **, DSATempDrv *, 00257 double *, double *)=0; 00258 virtual void DsaTempStress (cElement *, int, cNode **, DSATempDrv *, 00259 double **)=0; 00260 }; 00261 00262 #endif