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_FEM_STAGESITERATOR_H 00023 #define MECHSYS_FEM_STAGESITERATOR_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 "fem/stagesmanager.h" 00034 #include "fem/solver/solver.h" 00035 #include "fem/solver/csolver.h" 00036 00037 namespace FEM 00038 { 00039 00041 00044 class StagesIterator 00045 { 00046 public: 00047 void Start(FEM::StagesManager * stagesm, FEM::Solver * solver) const 00048 { 00049 for (int i=0; i<stagesm->nStages(); ++i) 00050 { 00051 stagesm -> ActivateStage(i); // prepare data 00052 solver -> Solve(i); 00053 } 00054 } 00055 void Start(FEM::StagesManager * stagesm, FEM::CSolver * csolver) const 00056 { 00057 for (int i=0; i<stagesm->nStages(); ++i) 00058 { 00059 stagesm -> ActivateStage(i); // prepare data 00060 csolver -> Solve(i); 00061 } 00062 } 00063 }; // class StagesIterator 00064 00065 }; // namespace FEM 00066 00067 #endif // MECHSYS_FEM_STAGESITERATOR_H 00068 00069 // vim:fdm=marker