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