tensors.h

00001 /*************************************************************************************
00002  * MechSys - A C++ library to simulate (Continuum) Mechanical Systems                *
00003  * Copyright (C) 2005 Dorival de Moraes Pedroso <dorival.pedroso at gmail.com>       *
00004  * Copyright (C) 2005 Raul Dario Durand Farfan  <raul.durand at gmail.com>           *
00005  *                                                                                   *
00006  * This file is part of MechSys.                                                     *
00007  *                                                                                   *
00008  * MechSys is free software; you can redistribute it and/or modify it under the      *
00009  * terms of the GNU General Public License as published by the Free Software         *
00010  * Foundation; either version 2 of the License, or (at your option) any later        *
00011  * version.                                                                          *
00012  *                                                                                   *
00013  * MechSys is distributed in the hope that it will be useful, but WITHOUT ANY        *
00014  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A   *
00015  * PARTICULAR PURPOSE. See the GNU General Public License for more details.          *
00016  *                                                                                   *
00017  * You should have received a copy of the GNU General Public License along with      *
00018  * MechSys; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, *
00019  * Fifth Floor, Boston, MA 02110-1301, USA                                           *
00020  *************************************************************************************/
00021 
00022 #ifndef MECHSYS_TENSORS_H
00023 #define MECHSYS_TENSORS_H
00024 
00025 #ifdef HAVE_CONFIG_H
00026   #include "config.h"
00027 #else
00028   #ifndef REAL
00029     #define REAL double
00030   #endif
00031 #endif
00032 
00033 #include <blitz/tinyvec-et.h>
00034 #include <blitz/tinymat.h>
00035 
00036 namespace Tensors
00037 {
00038 
00043 
00044 
00064 typedef blitz::TinyVector<REAL,6> Tensor2;
00065 
00067 
00083 typedef blitz::TinyMatrix<REAL,6,6> Tensor4;
00084 
00085 // Three-dimensional vector == Tensor1
00086 typedef blitz::TinyVector<REAL,3> Tensor1;
00087  // end of group Tensor2nd4th
00089 
00091 Tensor2 I;
00092 
00094 Tensor4 IIsym;
00095 
00097 Tensor4 IdyI;
00098 
00100 Tensor4 Psd;
00101 
00103 Tensor4 Piso;
00104 
00105 
00107 
00108 
00109 // Initialize (global) second order identity tensor
00110 int __initialize_the_I(Tensor2 & theI) // {{{
00111 {
00112     theI = 1.0, 1.0, 1.0, 0.0, 0.0, 0.0;
00113     return 0;
00114 } // }}}
00115 
00116 // Initialize (global) fourth order identity tensor
00117 int __initialize_the_IIsym(Tensor4 & theIIsym) // {{{
00118 {
00119     theIIsym = 1.0, 0.0, 0.0, 0.0, 0.0, 0.0,
00120                0.0, 1.0, 0.0, 0.0, 0.0, 0.0,
00121                0.0, 0.0, 1.0, 0.0, 0.0, 0.0,
00122                0.0, 0.0, 0.0, 1.0, 0.0, 0.0,
00123                0.0, 0.0, 0.0, 0.0, 1.0, 0.0,
00124                0.0, 0.0, 0.0, 0.0, 0.0, 1.0;
00125     return 0;
00126 } // }}}
00127 
00128 // Initialize (global) IdyI fourth order tensor
00129 int __initialize_the_IdyI(Tensor4 & theIdyI) // {{{
00130 {
00131     theIdyI = 1.0, 1.0, 1.0, 0.0, 0.0, 0.0,
00132               1.0, 1.0, 1.0, 0.0, 0.0, 0.0,
00133               1.0, 1.0, 1.0, 0.0, 0.0, 0.0,
00134               0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
00135               0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
00136               0.0, 0.0, 0.0, 0.0, 0.0, 0.0;
00137     return 0;
00138 } // }}}
00139 
00140 // Initialize (global) fourth order symmetric-deviatoric tensor
00141 int __initialize_the_Psd(Tensor4 & thePsd) // {{{
00142 {
00143     thePsd =  2.0/3.0, -1.0/3.0, -1.0/3.0, 0.0, 0.0, 0.0,
00144              -1.0/3.0,  2.0/3.0, -1.0/3.0, 0.0, 0.0, 0.0,
00145              -1.0/3.0, -1.0/3.0,  2.0/3.0, 0.0, 0.0, 0.0,
00146                   0.0,      0.0,      0.0, 1.0, 0.0, 0.0,
00147                   0.0,      0.0,      0.0, 0.0, 1.0, 0.0,
00148                   0.0,      0.0,      0.0, 0.0, 0.0, 1.0;
00149     return 0;
00150 } // }}}
00151 
00152 // Initialize (global) fourth order isotropic tensor
00153 int __initialize_the_Piso(Tensor4 & thePiso) // {{{
00154 {
00155     thePiso = 1.0/3.0, 1.0/3.0, 1.0/3.0, 0.0, 0.0, 0.0,
00156               1.0/3.0, 1.0/3.0, 1.0/3.0, 0.0, 0.0, 0.0,
00157               1.0/3.0, 1.0/3.0, 1.0/3.0, 0.0, 0.0, 0.0,
00158                   0.0,     0.0,     0.0, 0.0, 0.0, 0.0,
00159                   0.0,     0.0,     0.0, 0.0, 0.0, 0.0,
00160                   0.0,     0.0,     0.0, 0.0, 0.0, 0.0;
00161     return 0;
00162 } // }}}
00163 
00164 int __dummy1=__initialize_the_I(I);
00165 int __dummy2=__initialize_the_IIsym(IIsym);
00166 int __dummy3=__initialize_the_IdyI(IdyI);
00167 int __dummy4=__initialize_the_Psd(Psd);
00168 int __dummy5=__initialize_the_Piso(Piso);
00169 
00170 }; // namespace Tensors
00171 
00172 #endif // MECHSYS_TENSORS_H
00173 
00174 // vim:fdm=marker

Generated on Wed Jan 24 15:56:27 2007 for MechSys by  doxygen 1.4.7