/[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 474 - (show annotations)
Mon Jan 30 04:23:44 2006 UTC (13 years, 8 months ago) by jgs
Original Path: trunk/escript/src/AbstractSystemMatrix.h
File MIME type: text/plain
File size: 4277 byte(s)
restructure escript source tree
move src/Data/* -> src
remove inc
modify #includes and cpppath settings accordingly

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 "FunctionSpace.h"
20 #include "SystemMatrixException.h"
21 #include "Data.h"
22
23 #include <boost/python/dict.hpp>
24
25 namespace escript {
26
27 /**
28 \brief
29 Give a short description of what AbstractSystemMatrix does.
30
31 Description:
32 Give a detailed description of AbstractSystemMatrix
33
34 Template Parameters:
35 For templates describe any conditions that the parameters used in the
36 template must satisfy
37 */
38 class AbstractSystemMatrix {
39
40 public:
41
42 /**
43 \brief
44 Default constructor for AbstractSystemMatrix
45
46 Description:
47 Default constructor for AbstractSystemMatrix
48
49 Preconditions:
50 Describe any preconditions
51
52 Throws:
53 Describe any exceptions thrown
54 */
55 AbstractSystemMatrix();
56
57 AbstractSystemMatrix(const int row_blocksize,
58 const FunctionSpace& row_functionspace,
59 const int column_blocksize,
60 const FunctionSpace& column_functionspace);
61 /**
62 \brief
63 Destructor.
64 */
65 virtual ~AbstractSystemMatrix();
66
67 /**
68 \brief
69 matrix*vector multiplication
70 */
71 Data vectorMultiply(Data& right) const;
72
73 /**
74 \brief
75 returns true if the matrix is empty
76 */
77 int isEmpty() const;
78
79 /**
80 \brief
81 returns the column function space
82 */
83 inline FunctionSpace getColumnFunctionSpace() const
84 {
85 if (isEmpty())
86 throw SystemMatrixException("Error - Matrix is empty.");
87 return m_column_functionspace;
88 }
89
90 /**
91 \brief
92 returns the row function space
93 */
94 inline FunctionSpace getRowFunctionSpace() const
95 {
96 if (isEmpty())
97 throw SystemMatrixException("Error - Matrix is empty.");
98 return m_row_functionspace;
99 }
100
101 /**
102 \brief
103 returns the row block size
104 */
105 inline int getRowBlockSize() const
106 {
107 if (isEmpty())
108 throw SystemMatrixException("Error - Matrix is empty.");
109 return m_row_blocksize;
110 }
111
112 /**
113 \brief
114 returns the column block size
115 */
116 inline int getColumnBlockSize() const
117 {
118 if (isEmpty())
119 throw SystemMatrixException("Error - Matrix is empty.");
120 return m_column_blocksize;
121 }
122
123 /**
124 \brief
125 returns the solution u of the linear system this*u=in
126 */
127 Data solve(Data& in,const boost::python::dict& options) const;
128
129 /**
130 \brief writes the matrix to a file using the Matrix Market file format
131 */
132 virtual void saveMM(const std::string& fileName) const;
133
134 /**
135 \brief writes the matrix to a file using the Harwell-Boeing file format
136 */
137 virtual void saveHB(const std::string& fileName) const;
138
139 /**
140 \brief resets the matrix entries
141 */
142 virtual void resetValues() const;
143
144 protected:
145
146 private:
147
148 /**
149 \brief
150 solves the linear system this*out=in
151 */
152 virtual void setToSolution(Data& out,Data& in,const boost::python::dict& options) const;
153
154 /**
155 \brief
156 performs y+=this*x
157 */
158 virtual void ypAx(Data& y,Data& x) const;
159
160 int m_empty;
161 int m_column_blocksize;
162 int m_row_blocksize;
163 FunctionSpace m_column_functionspace;
164 FunctionSpace m_row_functionspace;
165
166 };
167
168 Data operator*(const AbstractSystemMatrix& left,const Data& right) ;
169
170
171
172 } // end of namespace
173 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26