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: PDEEquationExpression.cpp,v 1.4 2007/02/08 23:19:38 delpinux Exp $ 00019 00020 #include <PDEEquationExpression.hpp> 00021 #include <PDE.hpp> 00022 00023 PDEEquationExpression::PDEEquationExpression(const PDEEquationExpression& e) 00024 : Expression(e), 00025 __pdeOperatorSum(e.__pdeOperatorSum), 00026 __secondMember(e.__secondMember) 00027 { 00028 ; 00029 } 00030 00031 PDEEquationExpression:: 00032 PDEEquationExpression(ReferenceCounting<PDEOperatorSumExpression> pdeOperatorSum, 00033 ReferenceCounting<FunctionExpression> secondMember) 00034 : Expression(Expression::pdeEquation), 00035 __pdeOperatorSum(pdeOperatorSum), 00036 __secondMember(secondMember) 00037 { 00038 ; 00039 } 00040 00041 PDEEquationExpression::~PDEEquationExpression() 00042 { 00043 ; 00044 } 00045 00046 ReferenceCounting<PDE> 00047 PDEEquationExpression::pde() 00048 { 00049 return __pde; 00050 } 00051 00052 void PDEEquationExpression::execute() 00053 { 00054 (*__pdeOperatorSum).execute(); 00055 (*__secondMember).execute(); 00056 00057 if (__secondMember->hasBoundaryExpression()) { 00058 throw ErrorHandler(__FILE__,__LINE__, 00059 "cannot evaluate the expression \"" 00060 +stringify((*__secondMember)) 00061 +"\" in the volume", 00062 ErrorHandler::normal); 00063 } 00064 00065 __pde = new PDE(__pdeOperatorSum->vectorPDEOperator(), __secondMember->function()); 00066 } 00067
1.5.6