lts_test01.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 <sstream>
00024 #include <string>
00025 
00026 #include "util/exception.h"
00027 #include "util/fileparser.h"
00028 #include "util/array.h"
00029 
00030 #include "models/subcam.h"
00031 #include "models/subtij.h"
00032 
00033 #include "labtestsim/inputdata.h"
00034 #include "labtestsim/lts.h"
00035 
00036 #ifndef REAL
00037   #define REAL double
00038 #endif
00039 
00040 int main(int argc, char **argv) try
00041 {
00042     // InputData
00043     LabTestSim::InputData ID;
00044 
00045     // Parse input arguments
00046     String MainFilename;
00047     bool   IsConsole, IsSilent, IsHelpMsg;
00048     ID.ParseInputArgs(argc, argv, MainFilename, IsConsole, IsSilent, IsHelpMsg);
00049 
00050     // Help message
00051     if (IsHelpMsg)
00052     {
00053         std::cout << std::endl << ID.HelpMessage() << std::endl;
00054         return 0;
00055     }
00056 
00057     // Initial message
00058     if (!IsSilent)
00059         std::cout << std::endl << ID.InitialMessage() << std::endl;
00060 
00061     // ReadMainFile
00062     ID.ReadMainFile(MainFilename);
00063 
00064     // WriteMainFile
00065     ID.WriteMainFile("out.t01.tmp", true); // true => overwrite file
00066 
00067     return 0;
00068 }
00069 catch (Exception * e)
00070 {
00071     e->Cout();
00072     if (e->IsFatal()) {delete e; exit(1);}
00073     delete e;
00074 }
00075 catch (...)
00076 {
00077     std::cout << "Some exception (...) ocurred\n";
00078 }
00079 
00080 // vim:fdm=marker
00081 

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