/[escript]/branches/arrexp_2137_win_merge/escript/src/AbstractTransportProblem.h
ViewVC logotype

Contents of /branches/arrexp_2137_win_merge/escript/src/AbstractTransportProblem.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 97 - (show annotations)
Tue Dec 14 05:39:33 2004 UTC (14 years, 9 months ago) by jgs
Original Path: trunk/esys2/escript/src/Data/AbstractSystemMatrix.h
File MIME type: text/plain
File size: 4365 byte(s)
*** empty log message ***

1 // $Id$
2 /*
3 ******************************************************************************
4 * *
5 * COPYRIGHT ACcESS 2004 - All Rights Reserved *
6 * *
7 * This software is the property of ACcESS. No part of this code *
8 * may be copied in any form or by any means without the expressed written *
9 * consent of ACcESS. Copying, use or modification of this software *
10 * by any unauthorised person is illegal unless that person has a software *
11 * license agreement with ACcESS. *
12 * *
13 ******************************************************************************
14 */
15
16 #if !defined escript_AbstractSystemMatrix_20040628_H
17 #define escript_AbstractSystemMatrix_20040628_H
18
19 #include "escript/Data/FunctionSpace.h"
20 #include "escript/Data/SystemMatrixException.h"
21 #include "escript/Data/Data.h"
22 #include <boost/python/dict.hpp>
23
24 namespace escript {
25
26 /**
27 \brief
28 Give a short description of what AbstractSystemMatrix does.
29
30 Description:
31 Give a detailed description of AbstractSystemMatrix
32
33 Template Parameters:
34 For templates describe any conditions that the parameters used in the
35 template must satisfy
36 */
37 class AbstractSystemMatrix {
38
39 public:
40
41 /**
42 \brief
43 Default constructor for AbstractSystemMatrix
44
45 Description:
46 Default constructor for AbstractSystemMatrix
47
48 Preconditions:
49 Describe any preconditions
50
51 Throws:
52 Describe any exceptions thrown
53 */
54 AbstractSystemMatrix();
55
56 AbstractSystemMatrix(const int row_blocksize,
57 const FunctionSpace& row_functionspace,
58 const int column_blocksize,
59 const FunctionSpace& column_functionspace);
60 /**
61 \brief
62 Destructor.
63 */
64 virtual ~AbstractSystemMatrix();
65
66 /**
67 \brief
68 matrix*vector multiplication
69 */
70 Data vectorMultiply(const Data& right) const;
71
72 /**
73 \brief
74 returns true if the matrix is empty
75 */
76 int isEmpty() const;
77
78 /**
79 \brief
80 returns the column function space
81 */
82 inline FunctionSpace getColumnFunctionSpace() const
83 {
84 if (isEmpty())
85 throw SystemMatrixException("Error - Matrix is empty.");
86 return m_column_functionspace;
87 }
88
89 /**
90 \brief
91 returns the row function space
92 */
93 inline FunctionSpace getRowFunctionSpace() const
94 {
95 if (isEmpty())
96 throw SystemMatrixException("Error - Matrix is empty.");
97 return m_row_functionspace;
98 }
99
100 /**
101 \brief
102 returns the row block size
103 */
104 inline int getRowBlockSize() const
105 {
106 if (isEmpty())
107 throw SystemMatrixException("Error - Matrix is empty.");
108 return m_row_blocksize;
109 }
110
111 /**
112 \brief
113 returns the column block size
114 */
115 inline int getColumnBlockSize() const
116 {
117 if (isEmpty())
118 throw SystemMatrixException("Error - Matrix is empty.");
119 return m_column_blocksize;
120 }
121
122 /**
123 \brief
124 returns the solution u of the linear system this*u=in
125 */
126 Data solve(const Data& in,const boost::python::dict& options) const;
127
128 /**
129 \brief writes the matrix to a file using the Matrix Market file format
130 */
131 virtual void saveMM(const std::string& fileName) const;
132
133 /**
134 \brief sets the matrix entries to value
135 */
136 virtual void setValue(const double value) const;
137
138
139 protected:
140
141 private:
142
143 /**
144 \brief
145 solves the linear system this*out=in
146 */
147 virtual void setToSolution(Data& out,const Data& in,const boost::python::dict& options) const;
148
149 /**
150 \brief
151 performs y+=this*x
152 */
153 virtual void ypAx(Data& y,const Data& x) const;
154
155 int m_empty;
156 int m_column_blocksize;
157 int m_row_blocksize;
158 FunctionSpace m_column_functionspace;
159 FunctionSpace m_row_functionspace;
160
161 };
162
163 Data operator*(const AbstractSystemMatrix& left, const Data& right) ;
164
165
166
167 } // end of namespace
168 #endif

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26