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: PDEProblem.hpp,v 1.3 2006/07/20 19:08:54 delpinux Exp $ 00019 00020 #ifndef PDE_PROBLEM_HPP 00021 #define PDE_PROBLEM_HPP 00022 00023 #include <PDE.hpp> 00024 #include <BoundaryConditionSet.hpp> 00025 00026 #include <StreamCenter.hpp> 00027 00036 class PDEProblem 00037 { 00038 private: 00039 ConstReferenceCounting<PDE> __pde; 00041 ReferenceCounting<BoundaryConditionSet> 00042 __boundaryConditionSet; 00044 public: 00050 const PDE& pde() const 00051 { 00052 return *__pde; 00053 } 00054 00060 const BoundaryConditionSet& 00061 boundaryConditionSet() const 00062 { 00063 return *__boundaryConditionSet; 00064 } 00065 00073 ReferenceCounting<PDEProblem> 00074 operator*(const ConstReferenceCounting<ScalarFunctionBase>& c) const 00075 { 00076 PDEProblem* newPDEProblem = new PDEProblem(*this); 00077 newPDEProblem->__pde = (*__pde) * c; 00078 return newPDEProblem; 00079 } 00080 00089 friend std::ostream& 00090 operator << (std::ostream& os, const PDEProblem& P) 00091 { 00092 os << *P.__pde << '\n'; 00093 os << *P.__boundaryConditionSet; 00094 return os; 00095 } 00096 00103 PDEProblem(ReferenceCounting<PDE> pde, 00104 ReferenceCounting<BoundaryConditionSet> boundaryConditionSet) 00105 : __pde(pde), 00106 __boundaryConditionSet(boundaryConditionSet) 00107 { 00108 ; 00109 } 00110 00116 PDEProblem(const PDEProblem& pdeProblem) 00117 : __pde(pdeProblem.__pde), 00118 __boundaryConditionSet(pdeProblem.__boundaryConditionSet) 00119 { 00120 ; 00121 } 00122 00127 virtual ~PDEProblem() 00128 { 00129 ; 00130 } 00131 }; 00132 00133 #endif // PDE_PROBLEM_HPP
1.5.6