/[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 153 - (show annotations)
Tue Oct 25 01:51:20 2005 UTC (13 years, 10 months ago) by jgs
Original Path: trunk/esys2/escript/src/Data/AbstractSystemMatrix.h
File MIME type: text/plain
File size: 4315 byte(s)
Merge of development branch dev-02 back to main trunk on 2005-10-25

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(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(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 writes the matrix to a file using the Harwell-Boeing file format
135 */
136 virtual void saveHB(const std::string& fileName) const;
137
138 /**
139 \brief resets the matrix entries
140 */
141 virtual void resetValues() const;
142
143 protected:
144
145 private:
146
147 /**
148 \brief
149 solves the linear system this*out=in
150 */
151 virtual void setToSolution(Data& out,Data& in,const boost::python::dict& options) const;
152
153 /**
154 \brief
155 performs y+=this*x
156 */
157 virtual void ypAx(Data& y,Data& x) const;
158
159 int m_empty;
160 int m_column_blocksize;
161 int m_row_blocksize;
162 FunctionSpace m_column_functionspace;
163 FunctionSpace m_row_functionspace;
164
165 };
166
167 Data operator*(const AbstractSystemMatrix& left,const Data& right) ;
168
169
170
171 } // end of namespace
172 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26