tbar.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 
00024 #include "util/array.h"
00025 #include "util/exception.h"
00026 #include "models/barcelona.h"
00027 
00028 using Tensors::Tensor2;
00029 using std::cout;
00030 using std::endl;
00031 
00032 int main(int argc, char **argv) try
00033 {
00034     // Parameters
00035     Array<REAL> prms; prms.resize(13);
00036     prms[0]  = 0.25  ; // lam0
00037     prms[1]  = 0.05  ; // kap
00038     prms[2]  = 10000 ; // G (kPa)
00039     prms[3]  = 20.0  ; // phics (deg)
00040     prms[4]  = 0.9   ; // r
00041     prms[5]  = 0.1   ; // bet
00042     prms[6]  = 0.5   ; // k
00043     prms[7]  = 0.002 ; // lams
00044     prms[8]  = 0.001 ; // kaps
00045     prms[9]  = 101.3 ; // patm (kPa)
00046     prms[10] = 1     ; // pref
00047     prms[11] = 10    ; // A
00048     prms[12] = 10    ; // B
00049 
00050     // Initial Data
00051     Array<REAL> inidata; inidata.resize(7); //{ SigX SigY SigZ vini OCR z1 Pp }
00052     inidata[0] = 24;  // =z0 (kPa)
00053     inidata[1] = 24;  // =z0 (kPa)
00054     inidata[2] = 24;  // =z0 (kPa)
00055     inidata[3] = 1.8; // v_ini
00056     inidata[4] = 1;   // OCR
00057     inidata[5] = 20;  // z1 (kPa)
00058     inidata[6] = -10; // Pp (kPa);  ==> Suc = 0-(-10) = +10 (kPa)
00059 
00060     // Barcelona Model
00061     Barcelona bar(prms, inidata);
00062 
00063     // Actualize
00064     Tensor2 DSig; DSig=10,10,5, 0,0,0;
00065     REAL    DPp;  DPp=-2;
00066     Tensor2 DEps;
00067     REAL    DnSr;
00068     bar.Actualize(DSig,DPp, DEps, DnSr);
00069 
00070     // Output
00071     cout << "DEps (%) = " << DEps*100.0 << endl;
00072 
00073     return 0;
00074 }
00075 catch (Exception * e) // {{{
00076 {
00077     e->Cout();
00078     if (e->IsFatal()) exit(1);
00079     delete e;
00080 }
00081 catch (char const * s)
00082 {
00083     cout << " Fatal:" << s << "\n";
00084     exit(1);
00085 } // }}}
00086 
00087 // vim:fdm=marker

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