MechSys  1.0
Computing library for simulations in continuum and discrete mechanics
/home/dorival/mechsys/lib/mpm/defs.h
Go to the documentation of this file.
00001 /************************************************************************
00002  * MechSys - Open Library for Mechanical Systems                        *
00003  * Copyright (C) 2005 Dorival M. Pedroso                                *
00004  *                                                                      *
00005  * This program is free software: you can redistribute it and/or modify *
00006  * it under the terms of the GNU General Public License as published by *
00007  * the Free Software Foundation, either version 3 of the License, or    *
00008  * any later version.                                                   *
00009  *                                                                      *
00010  * This program is distributed in the hope that it will be useful,      *
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the         *
00013  * GNU General Public License for more details.                         *
00014  *                                                                      *
00015  * You should have received a copy of the GNU General Public License    *
00016  * along with this program. If not, see <http://www.gnu.org/licenses/>  *
00017  ************************************************************************/
00018 
00019 /* Definitions - Copyright (C) 2007 Dorival de Moraes Pedroso */
00020 
00021 #ifndef MPM_DEFS_H
00022 #define MPM_DEFS_H
00023 
00024 // Std Lib
00025 #include <map>
00026 
00027 // Blitz++
00028 #include <blitz/tinyvec-et.h>
00029 #include <blitz/tinymat.h>
00030 
00031 // FLTK
00032 #include <FL/Enumerations.H> // for Fl_Color
00033 
00034 // MechSys
00035 #include <mechsys/util/array.h>
00036 #include <mechsys/util/maps.h>
00037 
00038 namespace MPM {
00039 
00041 enum CurveType { CT_POINTS, CT_LINES, CT_BOTH };
00042 
00044 enum ClrMapType { CMT_BWP=0, CMT_HOT=1, CMT_JET=2 };
00045 
00047 enum FieldType { FLD_EPSXX, FLD_EPSYY, FLD_EPSZZ, FLD_EPSXY,
00048                  FLD_SIGXX, FLD_SIGYY, FLD_SIGZZ, FLD_SIGXY,
00049                  FLD_CAMP,  FLD_CAMQ,  FLD_VELN,  FLD_TAG};
00050 
00052 enum FixType { FIX_X, FIX_Y, FIX_Z, FIX_XY, FIX_YZ, FIX_ZX, FIX_XYZ };
00053 
00054 /* Curve properties. */
00055 struct CurveProps
00056 {
00057     CurveType Typ;      
00058     Fl_Color  Clr;      
00059     int       Lty;      
00060     int       Lwd;      
00061     int       Pch;      
00062     int       Psz;      
00063     char      Nam[256]; 
00064 };
00065 
00066 // Constants
00067 const double SQ2    = sqrt(2.0);
00068 const double SQ3    = sqrt(3.0);
00069 const double SQ6    = sqrt(6.0);
00070 const double SQ2BY3 = sqrt(2.0/3.0);
00071 const double PI     = 4.0*atan(1.0);
00072 
00073 // Typedefs
00074 typedef blitz::TinyVector<size_t,4>   Connec2D; 
00075 typedef blitz::TinyVector<double,3>   Vector3D; 
00076 typedef blitz::TinyVector<double,6>   STensor2; 
00077 typedef blitz::TinyVector<double,9>   ATensor2; 
00078 typedef blitz::TinyMatrix<double,6,6> STensor4; 
00079 typedef blitz::TinyMatrix<double,9,9> ATensor4; 
00080 typedef blitz::TinyVector<size_t,6>   ConnecW6; 
00081 typedef blitz::TinyVector<size_t,8>   ConnecH8; 
00082 
00083 // Structures
00084 const size_t NRVEC = 2;
00085 typedef std::map<int,int>::const_iterator n2i_it;
00086 struct ShapeAndGrads2D
00087 {
00088     double            N[16];     
00089     double            S[16];     
00090     Vector3D          G[16];     
00091     Vector3D          R0[NRVEC]; 
00092     Vector3D          R [NRVEC]; 
00093     std::map<int,int> n2i;       
00094 };
00095 
00096 // Typedefs for callback functions
00097 typedef bool      (*ptIsFixed)       (Vector3D const & N, FixType & FType);           
00098 typedef bool      (*ptIsPointInGeom) (Vector3D const & P, int & ClrIdx);              
00099 typedef double    (*ptDensity)       (Vector3D const & P);                            
00100 typedef void      (*ptModelData)     (Vector3D const & P, String & Name, int & Tag, int NDim, SDPair & Prms, SDPair & Inis, String & Scheme); 
00101 typedef void      (*ptIniVelocity)   (Vector3D const & P, Vector3D & v);              
00102 typedef bool      (*ptHasTraction)   (Vector3D const & P, Array<Vector3D> const & N, Vector3D const & L, int nPCell, Vector3D & t);   
00103 typedef bool      (*ptHasAppDisp)    (Vector3D const & P, Array<Vector3D> const & N, Vector3D const & L, int nPCell, Vector3D & fu);  
00104 typedef void      (*ptAppDisp)       (Vector3D const & P, STensor2 const & s, Vector3D const & u, Vector3D const & L, int nPCell, Vector3D & fu);
00105 typedef void      (*ptB     )        (double t,                      Vector3D & B  ); 
00106 typedef void      (*ptLdM   )        (double t                     , double   & M  ); 
00107 typedef void      (*ptVeloc )        (double t, Vector3D const & XY, Vector3D & Vel); 
00108 typedef void      (*ptStress)        (double t, Vector3D const & XY, STensor2 & Sig); 
00109 
00110 }; // namespace MPM
00111 
00112 #endif // MPM_DEFS_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines