00001 // ------------------------------------------------------------------------- 00002 // ShpLine.h - This header file contains the definitions of : 00003 // Line2D and Line3D shape class. 00004 // ------------------------------------------------------------------------- 00005 // Public methods: 00006 // ------------------------------------------------------------------------- 00007 // 00008 // void DerivXYZ ( double **invjac, 00009 // sDerivNat *derivshp_rst, 00010 // sDerivCart *deriv_xyz ) 00011 // 00012 // invjac - inverse of the jacobian matrix ( in ) 00013 // derivshp_rst - local shape functions derivatives ( in ) 00014 // deriv_xyz - global shape functions derivatives ( out ) 00015 // 00016 // 00017 // - - - - 00018 // | dN/dx | | dN/dr | 00019 // | | | | 00020 // | dN/dy | = [jac_inv] * | 0 | , where dN/ds = 0 00021 // | | | | 00022 // | dN/dz | | 0 | dN/dt = 0. 00023 // - - - - 00024 // 00025 // This method evaluates the global shape functions derivatives 00026 // at a given integration point, for line elements. 00027 // 00028 // ------------------------------------------------------------------------- 00029 // 00030 // void Jacobian ( sDerivNat *derivmap_rst, 00031 // sNodeCoord *coord, 00032 // double *detjac, 00033 // double **invjac ) 00034 // 00035 // derivmap_rst - local map functions derivatives ( in ) 00036 // mapfunc - map functions ( in ) 00037 // coord - element coordinates ( in ) 00038 // detjac - determinant of jacobian matrix ( out ) 00039 // jac - jacobian matrix ( out ) 00040 // invjac - inverse of the jacobian matrix ( out ) 00041 // 00042 // 00043 // Line2D 00044 // 00045 // This method evaluates the jacobian matrix, its inverse and its 00046 // determinant for line element shape. The jacobian matrix is 00047 // defined as follows: 00048 // The first row is formed by the derivatives of the position 00049 // vector with respect to the line parametric coordinate, i.e., 00050 // the line tangent direction. 00051 // The second row is a direction in the plane which is 00052 // normal to the line tangent direction, i.e., a 00053 // direction perpendicular to the first Jacobian matrix row. 00054 // The third row is the unity vector in the z-direction. 00055 // The size of the vector (dx/dr,dy/dr) is returned as the 00056 // determinant of the jacobian matrix. 00057 // 00058 // - - 00059 // | dx/dr dy/dr 0 | 00060 // | | 00061 // [jac] = | -dy/dr dx/dr 0 | 00062 // | | 00063 // | 0 0 1 | 00064 // - - 00065 // 00066 // 2 2 00067 // det_jac = sqrt( (dx/dr) + (dy/dr) ) 00068 // 00069 // 00070 // Line3D 00071 // 00072 // This method evaluates the jacobian matrix, its inverse and its 00073 // determinant for line element shape. The jacobian matrix is 00074 // defined as follows: 00075 // The first row is formed by the derivatives of the position 00076 // vector with respect to the line parametric coordinate, i.e., 00077 // the line tangent direction. 00078 // The second row is any direction which is found perdendicular 00079 // to the first row. The first choice is a direction which 00080 // also perpendicular to the z-axis, the second is a direction 00081 // perpendicular to the y-axis, and the third choice is a 00082 // direction perpendicular to the x-axis. 00083 // The third row is obtained by the cross product of the 00084 // first two rows. 00085 // The size of the vector (dx/dr,dy/dr,dz/dr) is returned as the 00086 // determinant of the jacobian matrix. 00087 // 00088 // 2 2 2 00089 // det_jac = sqrt( (dx/dr) + (dy/dr) + (dz/dr) ) 00090 // 00091 // ------------------------------------------------------------------------- 00092 // 00093 // void LocalSys ( sDerivNat *derivmap_rst, 00094 // sNodeCoord *coord, 00095 // double **rot ) 00096 // 00097 // derivmap_rst - local map functions derivatives ( in ) 00098 // coord - element coordinates ( in ) 00099 // rot[3][3] - rotation matrix ( out ) 00100 // 00101 // This method computes the rotation matrix of a local system of 00102 // coordinates evaluated at a point on the line. The rotation 00103 // matrix is formed as follows: 00104 // Each column of the rotation matrix is formed by the coordinates 00105 // of each local system unity vector in the global system. 00106 // The non-normalized coordinates of the local system directions 00107 // are considered as: 00108 // The first column is formed by the derivatives of the position 00109 // vector with respect to the line parametric coordinate, i.e., 00110 // the line tangent direction. 00111 // The second column is any direction which is found perdendicular 00112 // to the first row. The first choice is a direction which 00113 // also perpendicular to the z-axis, the second is a direction 00114 // perpendicular to the y-axis, and the third choice is a 00115 // direction perpendicular to the x-axis. 00116 // The third column is obtained by the cross product of the 00117 // first two rows. 00118 // 00119 // ------------------------------------------------------------------------- 00120 // 00121 // $Author: joaquim $ 00122 // $Revision: 1.2 $ 00123 // $Date: 1998/02/16 20:21:11 $ 00124 // $State: Exp $ 00125 // 00126 // ------------------------------------------------------------------------- 00127 00128 #ifndef _SHPLINE_H 00129 #define _SHPLINE_H 00130 00131 #include "gbldefs.h" 00132 #include "shape.h" 00133 00134 // ------------------------------------------------------------------------- 00135 // Line2D Shape class: 00136 // 00137 class cLine2D : public cShape 00138 { 00139 public: 00140 cLine2D ( void ); 00141 virtual ~cLine2D ( void ); 00142 int GetDimShape ( void ) { return 1; } 00143 virtual void Jacobian ( sDerivNat *, double *, sNodeCoord *, 00144 double *, double **, double ** ); 00145 virtual void DerivXYZ ( double **, sDerivNat *,sDerivCart * ); 00146 virtual void LocalSys ( sDerivNat *, sNodeCoord *, double ** ); 00147 virtual void GetTangent ( sNodeCoord *, sDerivNat *, sVector *, 00148 double *); 00149 virtual void DsaDerivXYZ ( sNodeCoord *, sDerivNat *, sDerivNat *, 00150 double *, sDerivCart *, sNodeCoord *, 00151 double *, sDerivCart *); 00152 }; 00153 00154 00155 // ------------------------------------------------------------------------- 00156 // Line3D Shape class: 00157 // 00158 class cLine3D : public virtual cLine2D 00159 { 00160 public: 00161 cLine3D ( void ); 00162 virtual ~cLine3D ( void ); 00163 virtual void Jacobian ( sDerivNat *, double *, sNodeCoord *, 00164 double *, double **, double ** ); 00165 virtual void DerivXYZ ( double **, sDerivNat *,sDerivCart * ); 00166 virtual void LocalSys ( sDerivNat *, sNodeCoord *, double ** ); 00167 virtual void GetTangent ( sNodeCoord *, sDerivNat *, sVector *, 00168 double *); 00169 virtual void DsaDerivXYZ ( sNodeCoord *, sDerivNat *, sDerivNat *, 00170 double *, sDerivCart *, sNodeCoord *, 00171 double *, sDerivCart *); 00172 }; 00173 00174 #endif