00001 // This file is part of ff3d - http://www.freefem.org/ff3d 00002 // Copyright (C) 2001, 2002, 2003 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: PDEProblemExpression.hpp,v 1.5 2007/12/19 00:45:45 delpinux Exp $ 00019 00020 #ifndef PDEPROBLEM_EXPRESSION_HPP 00021 #define PDEPROBLEM_EXPRESSION_HPP 00022 00023 #include <Expression.hpp> 00024 #include <Variable.hpp> 00025 00026 #include <PDEEquationExpression.hpp> 00027 #include <BoundaryConditionListExpression.hpp> 00035 class PDEProblem; 00036 class PDEProblemExpression 00037 : public Expression 00038 { 00039 public: 00040 enum PDEProblemType { 00041 description, 00042 undefined, 00043 variable 00044 }; 00045 00046 private: 00047 PDEProblemExpression::PDEProblemType __pdeProblemType; 00048 00049 protected: 00050 ReferenceCounting<PDEProblem> __pdeProblem; 00051 00052 public: 00059 virtual bool hasPOVBoundary() const = 0; 00060 00068 virtual bool hasPredefinedBoundary() const = 0; 00069 00070 00071 ReferenceCounting<PDEProblem> pdeProblem(); 00072 00073 const PDEProblemExpression::PDEProblemType& pdeProblemType() const 00074 { 00075 return __pdeProblemType; 00076 } 00077 00078 PDEProblemExpression(const PDEProblemExpression& e); 00079 00080 PDEProblemExpression(const PDEProblemExpression::PDEProblemType& t); 00081 00082 virtual ~PDEProblemExpression(); 00083 }; 00084 00085 class PDEProblemExpressionDescription 00086 : public PDEProblemExpression 00087 { 00088 private: 00089 std::ostream& put(std::ostream& os) const; 00090 00091 const std::string __unknownName; 00092 ReferenceCounting<PDEEquationExpression> __pdeEquation; 00093 ReferenceCounting<BoundaryConditionListExpression> __bcList; 00094 00095 public: 00103 bool hasPOVBoundary() const; 00104 00113 bool hasPredefinedBoundary() const; 00114 00115 void execute(); 00116 00117 ReferenceCounting<PDEEquationExpression> pdeEquation(); 00118 00119 ReferenceCounting<BoundaryConditionListExpression> bcList(); 00120 00121 PDEProblemExpressionDescription(const std::string& unknownName, 00122 ReferenceCounting<PDEEquationExpression> pdeEquation, 00123 ReferenceCounting<BoundaryConditionListExpression> bcList); 00124 00125 PDEProblemExpressionDescription(const PDEProblemExpressionDescription& e); 00126 00127 ~PDEProblemExpressionDescription(); 00128 }; 00129 00130 #endif // PDEPROBLEM_EXPRESSION_HPP
1.5.6