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: PDEOperator.hpp,v 1.5 2007/11/20 22:00:05 delpinux Exp $ 00019 00020 00021 #ifndef PDE_OPERATOR_HPP 00022 #define PDE_OPERATOR_HPP 00023 00024 #include <ReferenceCounting.hpp> 00025 #include <ScalarFunctionBase.hpp> 00026 00027 #include <string> 00037 class UserFunction; 00038 class PDEOperator 00039 { 00040 public: 00041 enum Type { 00042 firstorderop, 00043 firstorderopTransposed, 00044 divmugrad, 00045 secondorderop, 00046 massop 00047 }; 00048 00049 protected: 00050 const PDEOperator::Type __type; 00052 size_t __numberOfSubOperators; 00057 public: 00063 const size_t& numberOfSubOperators() const 00064 { 00065 return __numberOfSubOperators; 00066 } 00067 00073 virtual std::string 00074 typeName() const = 0; 00075 00081 const PDEOperator::Type& 00082 type() const 00083 { 00084 return __type; 00085 } 00086 00094 virtual ConstReferenceCounting<PDEOperator> 00095 operator*(const ConstReferenceCounting<ScalarFunctionBase>& c) const=0; 00096 00102 virtual ConstReferenceCounting<PDEOperator> 00103 operator-() const=0; 00104 00113 friend std::ostream& 00114 operator << (std::ostream& os, const PDEOperator& pdeOperator) 00115 { 00116 os << pdeOperator.typeName(); 00117 return os; 00118 } 00119 00126 PDEOperator(const PDEOperator::Type& type, 00127 const size_t& numberOfSubOperators) 00128 : __type(type), 00129 __numberOfSubOperators(numberOfSubOperators) 00130 { 00131 ; 00132 } 00133 00139 PDEOperator(const PDEOperator& P) 00140 : __type(P.__type), 00141 __numberOfSubOperators(P.__numberOfSubOperators) 00142 { 00143 ; 00144 } 00145 00150 virtual ~PDEOperator() 00151 { 00152 ; 00153 } 00154 }; 00155 00156 #endif // PDE_OPERATOR_HPP
1.5.6