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: FunctionExpressionLinearBasis.cpp,v 1.1 2006/07/20 17:29:18 delpinux Exp $ 00019 00020 #include <FunctionExpressionLinearBasis.hpp> 00021 #include <ScalarFunctionLinearBasis.hpp> 00022 00023 #include <ErrorHandler.hpp> 00024 00025 void FunctionExpressionLinearBasis:: 00026 execute() 00027 { 00028 switch (__basisType) { 00029 case FunctionExpressionLinearBasis::x: { 00030 __scalarFunction = new ScalarFunctionLinearBasis(ScalarFunctionLinearBasis::x); 00031 break; 00032 } 00033 case FunctionExpressionLinearBasis::y: { 00034 __scalarFunction = new ScalarFunctionLinearBasis(ScalarFunctionLinearBasis::y); 00035 break; 00036 } 00037 case FunctionExpressionLinearBasis::z: { 00038 __scalarFunction = new ScalarFunctionLinearBasis(ScalarFunctionLinearBasis::z); 00039 break; 00040 } 00041 } 00042 } 00043 00044 FunctionExpressionLinearBasis:: 00045 FunctionExpressionLinearBasis(const std::string& name) 00046 : FunctionExpression(FunctionExpression::linearBase) 00047 { 00048 if (name.size() != 1) { 00049 throw ErrorHandler(__FILE__,__LINE__, 00050 "Unknown linear expression basis: \"" 00051 +name+"\"", 00052 ErrorHandler::unexpected); 00053 } 00054 switch (name[0]) { 00055 case 'x': { 00056 __basisType = FunctionExpressionLinearBasis::x; 00057 break; 00058 } 00059 case 'y': { 00060 __basisType = FunctionExpressionLinearBasis::y; 00061 break; 00062 } 00063 case 'z': { 00064 __basisType = FunctionExpressionLinearBasis::z; 00065 break; 00066 } 00067 } 00068 } 00069 00070 FunctionExpressionLinearBasis:: 00071 FunctionExpressionLinearBasis(const FunctionExpressionLinearBasis& f) 00072 : FunctionExpression(f), 00073 __basisType(f.__basisType) 00074 { 00075 ; 00076 } 00077 00078 FunctionExpressionLinearBasis:: 00079 ~FunctionExpressionLinearBasis() 00080 { 00081 ; 00082 }
1.5.6