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: UnAssembledMatrix.cpp,v 1.5 2005/10/13 21:51:56 delpinux Exp $ 00019 00020 00021 #include <TinyMatrix.hpp> 00022 00023 #include <UnAssembledMatrix.hpp> 00024 #include <Discretization.hpp> 00025 #include <BoundaryConditionDiscretization.hpp> 00026 00027 void UnAssembledMatrix::getDiagonal(BaseVector& X) const 00028 { 00029 static_cast<Vector<real_t>&>(X) = 0; 00030 (*__discretization).getDiagonal(X); 00031 (*__BCDiscretization).getDiagonal(X); 00032 } 00033 00034 void UnAssembledMatrix::transposedTimesX(const BaseVector& X, 00035 BaseVector& Z) const 00036 { 00037 static_cast<Vector<real_t>&>(Z) = 0; 00038 if(__discretization != 0) { 00039 (*__discretization).transposedTimesX(X,Z); 00040 } 00041 if(__BCDiscretization != 0) { 00042 (*__BCDiscretization).transposedTimesX(X,Z); 00043 } 00044 } 00045 00046 void UnAssembledMatrix::timesX(const BaseVector& X, 00047 BaseVector& Z) const 00048 { 00049 static_cast<Vector<real_t>&>(Z) = 0; 00050 if(__discretization != 0) { 00051 (*__discretization).timesX(X,Z); 00052 } 00053 if(__BCDiscretization != 0) { 00054 (*__BCDiscretization).timesX(X,Z); 00055 } 00056 } 00057 00058 void UnAssembledMatrix:: 00059 setDiscretization(ConstReferenceCounting<Discretization> discretization) 00060 { 00061 __discretization = discretization; 00062 } 00063 00064 void UnAssembledMatrix:: 00065 setBoundaryConditions(ConstReferenceCounting<BoundaryConditionDiscretization> bcDiscretization) 00066 { 00067 __BCDiscretization = bcDiscretization; 00068 } 00069 00070 UnAssembledMatrix::UnAssembledMatrix(size_t size) 00071 : BaseMatrix(BaseMatrix::unAssembled, size), 00072 __discretization(0), 00073 __BCDiscretization(0) 00074 { 00075 ; 00076 } 00077 00078 UnAssembledMatrix::~UnAssembledMatrix() 00079 { 00080 ; 00081 } 00082
1.5.6