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: VariationalOperatorFV.hpp,v 1.5 2007/06/10 15:03:32 delpinux Exp $ 00019 00020 #ifndef VARIATIONAL_OPERATOR_FV_HPP 00021 #define VARIATIONAL_OPERATOR_FV_HPP 00022 00023 #include <VariationalLinearOperator.hpp> 00024 #include <ScalarFunctionBuilder.hpp> 00025 #include <ScalarFunctionBase.hpp> 00026 00035 class VariationalOperatorFV 00036 : public VariationalLinearOperator 00037 { 00038 private: 00039 ConstReferenceCounting<ScalarFunctionBase> __f; 00041 public: 00047 const ScalarFunctionBase& f() const 00048 { 00049 return *__f; 00050 } 00051 00059 ReferenceCounting<VariationalLinearOperator> 00060 operator*(const ConstReferenceCounting<ScalarFunctionBase>& c) const 00061 { 00062 VariationalOperatorFV* newOperator 00063 = new VariationalOperatorFV(*this); 00064 ScalarFunctionBuilder functionBuilder; 00065 functionBuilder.setFunction(__f); 00066 functionBuilder.setBinaryOperation(BinaryOperation::product,c); 00067 00068 newOperator->__f = functionBuilder.getBuiltFunction(); 00069 return newOperator; 00070 } 00071 00079 VariationalOperatorFV(const size_t& testFunctionNumber, 00080 const VariationalOperator::Property& testFunctionProperty, 00081 ConstReferenceCounting<ScalarFunctionBase> f) 00082 : VariationalLinearOperator(VariationalLinearOperator::FV, 00083 testFunctionNumber, testFunctionProperty), 00084 __f(f) 00085 { 00086 ; 00087 } 00088 00094 VariationalOperatorFV(const VariationalOperatorFV& fv) 00095 : VariationalLinearOperator(fv), 00096 __f(fv.__f) 00097 { 00098 ; 00099 } 00100 00105 ~VariationalOperatorFV() 00106 { 00107 ; 00108 } 00109 }; 00110 00111 #endif // VARIATIONAL_OPERATOR_FV_HPP
1.5.6