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: FieldOfScalarFunction.cpp,v 1.2 2007/05/20 23:02:47 delpinux Exp $ 00019 00020 #include <FieldOfScalarFunction.hpp> 00021 00022 std::ostream& operator << (std::ostream& os, 00023 const FieldOfScalarFunction& field) 00024 { 00025 ASSERT(field.numberOfComponents()>0); 00026 if (field.numberOfComponents()>1) os << '['; 00027 00028 os << *field.function(0); 00029 for (size_t i=1; i<field.numberOfComponents(); ++i) { 00030 os << ',' << *field.function(i); 00031 } 00032 if (field.numberOfComponents()>1) os << ']'; 00033 00034 return os; 00035 } 00036 00037 00038 ConstReferenceCounting<ScalarFunctionBase> 00039 FieldOfScalarFunction:: 00040 function(const size_t& i) const 00041 { 00042 ASSERT(i<__field.size()); 00043 return __field[i]; 00044 } 00045 00046 void 00047 FieldOfScalarFunction:: 00048 add(ConstReferenceCounting<ScalarFunctionBase> function) 00049 { 00050 __field.push_back(function); 00051 } 00052 00053 FieldOfScalarFunction:: 00054 FieldOfScalarFunction() 00055 { 00056 ; 00057 } 00058 00059 FieldOfScalarFunction:: 00060 ~FieldOfScalarFunction() 00061 { 00062 ; 00063 }
1.5.6