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: BoundaryConditionDiscretization.hpp,v 1.5 2007/08/29 08:37:14 yakoubix Exp $ 00019 00020 00021 #ifndef BOUNDARY_CONDITION_DISCRETIZATION_HPP 00022 #define BOUNDARY_CONDITION_DISCRETIZATION_HPP 00023 00024 #include <ReferenceCounting.hpp> 00025 00026 #include <BaseMatrix.hpp> 00027 #include <Vector.hpp> 00028 00029 #include <Problem.hpp> 00030 #include <DegreeOfFreedomSet.hpp> 00031 00041 class BoundaryConditionDiscretization 00042 { 00043 protected: 00044 const Problem& __problem; 00045 00046 const DegreeOfFreedomSet& __degreeOfFreedomSet; 00047 00049 mutable Vector<bool> __dirichletList; 00050 00051 mutable Vector<real_t> __dirichletValues; 00052 00053 public: 00054 const bool& dirichlet(const size_t i) const 00055 { 00056 return __dirichletList[i]; 00057 } 00058 00059 const real_t& dirichletValue(const size_t i) const 00060 { 00061 return __dirichletValues[i]; 00062 } 00063 00064 const Vector<bool>& getDirichletList() const 00065 { 00066 return __dirichletList; 00067 } 00068 00069 virtual void getDiagonal (BaseVector& X) const = 0; 00070 00071 virtual void setMatrix (ReferenceCounting<BaseMatrix> A, 00072 ReferenceCounting<BaseVector> b) const = 0; 00073 00074 virtual void setSecondMember (ReferenceCounting<BaseMatrix> A, 00075 ReferenceCounting<BaseVector> b) const = 0; 00076 00077 virtual void timesX(const BaseVector& X, BaseVector& Z) const = 0; 00078 00079 virtual void transposedTimesX(const BaseVector& X, BaseVector& Z) const = 0; 00080 00081 const Problem& problem() const 00082 { 00083 return __problem; 00084 } 00085 00086 BoundaryConditionDiscretization(const Problem& problem, 00087 const DegreeOfFreedomSet& dof) 00088 : __problem(problem), 00089 __degreeOfFreedomSet(dof), 00090 __dirichletList(dof.size()) 00091 { 00092 __dirichletList = false; 00093 } 00094 00095 virtual ~BoundaryConditionDiscretization() 00096 { 00097 ; 00098 } 00099 }; 00100 00101 #endif // BOUNDARY_CONDITION_DISCRETIZATION_HPP
1.5.6