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: BoundaryConditionExpressionNeumann.cpp,v 1.4 2007/02/10 17:20:53 delpinux Exp $ 00019 00020 #include <BoundaryConditionExpressionNeumann.hpp> 00021 00022 #include <FunctionExpression.hpp> 00023 #include <BoundaryCondition.hpp> 00024 00025 #include <UnknownListExpression.hpp> 00026 00027 #include <Information.hpp> 00028 00029 #include <ScalarFunctionBase.hpp> 00030 #include <Neumann.hpp> 00031 00032 std::ostream& 00033 BoundaryConditionExpressionNeumann:: 00034 put(std::ostream& os) const 00035 { 00036 os << "\t\tdnu(" << __unknownName << ") = "<< (*__g) 00037 << " on " << (*__boundary); 00038 return os; 00039 } 00040 00041 void 00042 BoundaryConditionExpressionNeumann:: 00043 execute() 00044 { 00045 __boundary->execute(); 00046 __g->execute(); 00047 ConstReferenceCounting<ScalarFunctionBase> g = __g->function(); 00048 00049 ReferenceCounting<UnknownListExpression> L 00050 = Information::instance().getUnknownList(); 00051 00052 size_t n = L->number(__unknownName); 00053 00054 ReferenceCounting<PDECondition> N = new Neumann(g,n); 00055 00056 __boundaryCondition 00057 = new BoundaryCondition(N, __boundary->boundary()); 00058 } 00059 00060 BoundaryConditionExpressionNeumann:: 00061 BoundaryConditionExpressionNeumann(const std::string& unknownName, 00062 ReferenceCounting<FunctionExpression> g, 00063 ReferenceCounting<BoundaryExpression> boundary) 00064 : BoundaryConditionExpression(boundary, 00065 unknownName, 00066 BoundaryConditionExpression::neumann), 00067 __g(g) 00068 { 00069 ; 00070 } 00071 00072 BoundaryConditionExpressionNeumann:: 00073 BoundaryConditionExpressionNeumann(const BoundaryConditionExpressionNeumann& d) 00074 : BoundaryConditionExpression(d), 00075 __g(d.__g) 00076 { 00077 ; 00078 } 00079 00080 BoundaryConditionExpressionNeumann:: 00081 ~BoundaryConditionExpressionNeumann() 00082 { 00083 ; 00084 }
1.5.6