ttij.cpp

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 #include <iostream>
00023 #include <cmath>
00024 
00025 #include "tensors/tensors.h"
00026 #include "tensors/tijtensor.h"
00027 
00028 using Tensors::Tensor2;
00029 using Tensors::TijTensor;
00030 using namespace std;
00031 
00032 int main(int argc, char **argv) try
00033 {
00034     //Tensor2 Sig; Sig = 2.01, 2.0, 2.0, 0.0, 0.0, 0.0;
00035     Tensor2 Sig; Sig = 10, 20, 30, sqrt(2.0), 2.0*sqrt(2.0), 3.0*sqrt(2);
00036     //Tensor2   Sig; Sig = 2.5,1.0,1.0, 0.0,0.0,-1.5*sqrt(2.0);
00037     REAL    tn;
00038     REAL    ts;
00039     REAL    Is[3];
00040     REAL    sqrt_rz;
00041     Tensor2 Tau;
00042     Tensor2 inv_Tau;
00043     Tensor2 a;
00044     Tensor2 t;
00045     Tensor2 dtn_ds;
00046     Tensor2 dts_ds;
00047     Tensor2 dts_dt;
00048 
00049     TijTensor Tij(0.00001);
00050 
00051     Tij.Derivs(Sig,
00052                tn,
00053                ts,
00054                Is,
00055                sqrt_rz,
00056                Tau,
00057                inv_Tau,
00058                a,
00059                t,
00060                dtn_ds,
00061                dts_ds,
00062                dts_dt);
00063 
00064     cout << "Sig     = " << Sig     << endl;
00065     cout << "tn      = " << tn      << endl;
00066     cout << "ts      = " << ts      << endl;
00067     cout << "Is[0]   = " << Is[0]   << endl;
00068     cout << "Is[1]   = " << Is[1]   << endl;
00069     cout << "Is[2]   = " << Is[2]   << endl;
00070     cout << "sqrt_rz = " << sqrt_rz << endl;
00071     cout << "Tau     = " << Tau     << endl;
00072     cout << "inv_Tau = " << inv_Tau << endl;
00073     cout << "a       = " << a       << endl;
00074     cout << "t       = " << t       << endl;
00075     cout << "dtn_ds  = " << dtn_ds  << endl;
00076     cout << "dts_ds  = " << dts_ds  << endl;
00077     cout << "dts_dt  = " << dts_dt  << endl;
00078     
00079     return 0;
00080 }
00081 catch (Exception * e)
00082 {
00083     e->Cout();
00084     if (e->IsFatal()) exit(1);
00085     delete e;
00086 }

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