00001 // This file is part of ff3d - http://www.freefem.org/ff3d 00002 // Copyright (C) 2001-2005 Stéphane Del Pino 00003 00004 // This program is free software; you can redistribute it and/or modify 00005 // it under the terms of the GNU General Public License as published by 00006 // the Free Software Foundation; either version 2, or (at your option) 00007 // any later version. 00008 00009 // This program is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU General Public License for more details. 00013 00014 // You should have received a copy of the GNU General Public License 00015 // along with this program; if not, write to the Free Software Foundation, 00016 // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 00018 // $Id: SolverInformationCenter.hpp,v 1.1 2007/11/02 20:33:58 delpinux Exp $ 00019 00020 #ifndef SOLVER_INFORMATION_CENTER_HPP 00021 #define SOLVER_INFORMATION_CENTER_HPP 00022 00023 #include <ThreadStaticBase.hpp> 00024 #include <Mesh.hpp> 00025 #include <DiscretizationType.hpp> 00026 00027 #include <Assert.hpp> 00028 00029 #include <stack> 00030 00041 class SolverInformationCenter 00042 : public ThreadStaticBase<SolverInformationCenter> 00043 { 00044 private: 00045 std::stack<const Mesh*> 00046 __mesh; 00047 std::stack<const DiscretizationType*> 00048 __discretizationType; 00050 public: 00056 const Mesh& 00057 mesh() const 00058 { 00059 ASSERT(__mesh.size() != 0); 00060 ASSERT(__mesh.top() != 0); 00061 return *(__mesh.top()); 00062 } 00063 00069 const DiscretizationType& 00070 discretizationType() const 00071 { 00072 ASSERT(__discretizationType.size() != 0); 00073 ASSERT(__discretizationType.top() != 0); 00074 return *__discretizationType.top(); 00075 } 00076 00082 void pushMesh(const Mesh* mesh) 00083 { 00084 __mesh.push(mesh); 00085 } 00086 00092 void pushDiscretizationType(const DiscretizationType* discretizationType) 00093 { 00094 __discretizationType.push(discretizationType); 00095 } 00096 00101 void pop() 00102 { 00103 __mesh.pop(); 00104 __discretizationType.pop(); 00105 } 00106 00111 SolverInformationCenter() 00112 { 00113 ; 00114 } 00115 00120 ~SolverInformationCenter() 00121 { 00122 ; 00123 } 00124 }; 00125 00126 #endif // SOLVER_INFORMATION_CENTER_HPP
1.5.6