00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef DISCRETIZATION_HPP
00021 #define DISCRETIZATION_HPP
00022
00023 #include <ReferenceCounting.hpp>
00024
00025 #include <BaseVector.hpp>
00026 #include <Vector.hpp>
00027 #include <BaseMatrix.hpp>
00028
00029 #include <Problem.hpp>
00030
00031 #include <DiscretizationType.hpp>
00032
00040 class Discretization
00041 {
00042 protected:
00043 const DiscretizationType __discretizationType;
00045
00046 const Problem& __problem;
00047
00049 BaseMatrix& __A;
00050
00052 BaseVector& __b;
00053
00055 const Vector<bool>* __dirichletList;
00056
00057 public:
00063 void setDirichletList(const Vector<bool>& dirichletList)
00064 {
00065 ASSERT(__dirichletList == 0);
00066 __dirichletList = &dirichletList;
00067 }
00068
00073 virtual void assembleMatrix() = 0;
00074
00079 virtual void assembleSecondMember() = 0;
00080
00086 virtual void getDiagonal(BaseVector& u) const = 0;
00087
00094 virtual void transposedTimesX(const BaseVector& x, BaseVector& v) const = 0;
00095
00102 virtual void timesX(const BaseVector& x, BaseVector& v) const = 0;
00103
00109 const Problem& problem() const
00110 {
00111 return __problem;
00112 }
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00130 BaseMatrix& A()
00131 {
00132 return __A;
00133 }
00134
00140 BaseVector& b()
00141 {
00142 return __b;
00143 }
00144
00153 Discretization(const DiscretizationType& discretizationType,
00154 const Problem& problem,
00155 BaseMatrix& A,
00156 BaseVector& b)
00157 : __discretizationType(discretizationType),
00158 __problem(problem),
00159 __A(A),
00160 __b(b),
00161 __dirichletList(0)
00162 {
00163 ;
00164 }
00165
00171 Discretization(const Discretization& d)
00172 : __discretizationType(d.__discretizationType),
00173 __problem(d.__problem),
00174 __A(d.__A),
00175 __b(d.__b),
00176 __dirichletList(0)
00177 {
00178 ;
00179 }
00180
00186 virtual ~Discretization()
00187 {
00188 ;
00189 }
00190 };
00191
00192 #endif // DISCRETIZATION_HPP