/[escript]/trunk/escript/src/AbstractTransportProblem.h
ViewVC logotype

Contents of /trunk/escript/src/AbstractTransportProblem.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 100 - (show annotations)
Wed Dec 15 03:48:48 2004 UTC (14 years, 6 months ago) by jgs
Original Path: trunk/esys2/escript/src/Data/AbstractSystemMatrix.h
File MIME type: text/plain
File size: 3953 byte(s)
*** empty log message ***

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26