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: BoundaryConditionListExpression.hpp,v 1.7 2007/12/19 00:45:45 delpinux Exp $ 00019 00020 #ifndef BOUNDARYCONDITIONLIST_EXPRESSION_HPP 00021 #define BOUNDARYCONDITIONLIST_EXPRESSION_HPP 00022 00023 #include <Expression.hpp> 00024 #include <list> 00025 #include <Variable.hpp> 00026 00027 #include <BoundaryConditionExpression.hpp> 00028 00036 class BoundaryConditionSet; 00037 class BoundaryConditionListExpression 00038 : public Expression 00039 { 00040 public: 00041 enum BoundaryConditionListType { 00042 set, 00043 variable, 00044 undefined 00045 }; 00046 00047 private: 00048 BoundaryConditionListType __boundaryConditionListType; 00049 00050 protected: 00051 ReferenceCounting<BoundaryConditionSet> __boundaryConditionSet; 00052 00053 public: 00054 virtual bool hasPOVBoundary() const = 0; 00055 virtual bool hasPredefinedBoundary() const = 0; 00056 00057 ReferenceCounting<BoundaryConditionSet> boundaryConditionSet(); 00058 00059 const BoundaryConditionListExpression::BoundaryConditionListType& 00060 boundaryConditionListType() const 00061 { 00062 return __boundaryConditionListType; 00063 } 00064 00065 virtual void add(ReferenceCounting<BoundaryConditionExpression>) = 0; 00066 00067 BoundaryConditionListExpression(const BoundaryConditionListExpression& e); 00068 00069 BoundaryConditionListExpression(const BoundaryConditionListExpression:: 00070 BoundaryConditionListType& t); 00071 00072 virtual ~BoundaryConditionListExpression(); 00073 }; 00074 00082 class PDECondition; 00083 class BoundaryConditionListExpressionSet 00084 : public BoundaryConditionListExpression 00085 { 00086 private: 00087 typedef std::list<ReferenceCounting<BoundaryConditionExpression> > BoundaryConditionExpressionList; 00088 BoundaryConditionExpressionList __boundaryConditionExpressionList; 00089 00090 std::ostream& put(std::ostream& os) const 00091 { 00092 for (BoundaryConditionExpressionList::const_iterator 00093 i = __boundaryConditionExpressionList.begin(); 00094 i != __boundaryConditionExpressionList.end(); ++i) 00095 os << (**i) << '\n'; 00096 return os; 00097 } 00098 00099 void __splitBoundaryList(BoundaryConditionSet& bcSet, 00100 ConstReferenceCounting<PDECondition> pde, 00101 ConstReferenceCounting<Boundary> b); 00102 00103 public: 00104 bool hasPOVBoundary() const; 00105 bool hasPredefinedBoundary() const; 00106 00107 void execute(); 00108 00109 void add(ReferenceCounting<BoundaryConditionExpression> b) 00110 { 00111 __boundaryConditionExpressionList.push_back(b); 00112 } 00113 00114 BoundaryConditionListExpressionSet(const BoundaryConditionListExpressionSet& e); 00115 00116 BoundaryConditionListExpressionSet(); 00117 00118 ~BoundaryConditionListExpressionSet(); 00119 }; 00120 00121 #endif // BOUNDARYCONDITIONLIST_EXPRESSION_HPP 00122
1.5.6