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: Dirichlet.hpp,v 1.3 2007/11/20 22:00:06 delpinux Exp $ 00019 00020 // this class allows to define Dirichlet Boundary Conditions 00021 00022 #ifndef DIRICHLET_HPP 00023 #define DIRICHLET_HPP 00024 00025 #include <PDECondition.hpp> 00026 #include <ScalarFunctionBase.hpp> 00027 00036 class Dirichlet 00037 : public PDECondition 00038 { 00039 private: 00041 ConstReferenceCounting<ScalarFunctionBase> __g; 00042 00043 public: 00051 real_t g(const TinyVector<3,real_t>& x) const 00052 { 00053 return (*__g)(x); 00054 } 00055 00061 std::string typeName() const 00062 { 00063 return "Dirichlet"; 00064 } 00065 00072 Dirichlet(ConstReferenceCounting<ScalarFunctionBase> g, 00073 const size_t& unknownNumber) 00074 : PDECondition(PDECondition::dirichlet, 00075 unknownNumber), 00076 __g(g) 00077 { 00078 ; 00079 } 00080 00088 Dirichlet(const Dirichlet& d) 00089 : PDECondition(d), 00090 __g(d.__g) 00091 { 00092 ; 00093 } 00094 00099 ~Dirichlet() 00100 { 00101 ; 00102 } 00103 }; 00104 00105 #endif // DIRICHLET_HPP
1.5.6