/[escript]/trunk/finley/src/CPPAdapter/SystemMatrixAdapter.h
ViewVC logotype

Contents of /trunk/finley/src/CPPAdapter/SystemMatrixAdapter.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 682 - (show annotations)
Mon Mar 27 02:43:09 2006 UTC (13 years, 7 months ago) by robwdcock
File MIME type: text/plain
File size: 3704 byte(s)
+ NEW BUILD SYSTEM

This commit contains the new build system with cross-platform support.
Most things work are before though you can have more control.

ENVIRONMENT settings have changed:
+ You no longer require LD_LIBRARY_PATH or PYTHONPATH to point to the
esysroot for building and testing performed via scons
+ ACcESS altix users: It is recommended you change your modules to load
the latest intel compiler and other libraries required by boost to match
the setup in svn (you can override). The correct modules are as follows

module load intel_cc.9.0.026
export
MODULEPATH=${MODULEPATH}:/data/raid2/toolspp4/modulefiles/gcc-3.3.6
module load boost/1.33.0/python-2.4.1
module load python/2.4.1
module load numarray/1.3.3


1 // $Id$
2 /*
3 ************************************************************
4 * Copyright 2006 by ACcESS MNRF *
5 * *
6 * http://www.access.edu.au *
7 * Primary Business: Queensland, Australia *
8 * Licensed under the Open Software License version 3.0 *
9 * http://www.opensource.org/licenses/osl-3.0.php *
10 * *
11 ************************************************************
12 */
13
14 #if !defined finley_SystemMatrixAdapter_20040610_H
15 #define finley_SystemMatrixAdapter_20040610_H
16
17 extern "C" {
18 #include "paso/SystemMatrix.h"
19 #include "paso/Options.h"
20 }
21
22 #include "FinleyAdapterException.h"
23 #include "FinleyError.h"
24
25 #include "escript/AbstractSystemMatrix.h"
26 #include "escript/Data.h"
27 #include "escript/UtilC.h"
28
29 #include <boost/python/dict.hpp>
30 #include <boost/shared_ptr.hpp>
31 #include <boost/python/extract.hpp>
32
33 namespace finley {
34
35 class SystemMatrixAdapter:public escript::AbstractSystemMatrix {
36
37 /**
38 \brief
39 Wrapper for Paso_SystemMatrix.
40
41 Description:
42 Wrapper for Paso_SystemMatrix.
43 */
44
45 public:
46
47 /**
48 /brief
49 Default Constructor for SystemMatrixAdapter.
50 NB: Only throws an exception.
51 */
52 SystemMatrixAdapter();
53
54 /**
55 /brief
56 Constructor for SystemMatrixAdapter.
57 */
58 SystemMatrixAdapter(Paso_SystemMatrix* system_matrix,
59 const int row_blocksize,
60 const escript::FunctionSpace& row_functionspace,
61 const int column_blocksize,
62 const escript::FunctionSpace& colum_functionspace);
63
64
65 /**
66 \brief
67 Destructor for SystemMatrixAdapter. As specified in the constructor
68 this deallocates the pointer given to the constructor.
69 */
70 ~SystemMatrixAdapter();
71
72 /**
73 \brief
74 Returns the pointer to the system matrix.
75 */
76 Paso_SystemMatrix* getPaso_SystemMatrix() const;
77
78 /**
79 \brief
80 Returns the system matrix as a const AbstractSystemMatrix&.
81 */
82 inline const escript::AbstractSystemMatrix& asAbstractSystemMatrix() const
83 {
84 return dynamic_cast<const escript::AbstractSystemMatrix&>(*this);
85 }
86
87 /**
88 \brief
89 Returns a system matrix as a const SystemMatrixAdapter&.
90 */
91 inline static const SystemMatrixAdapter& asSystemMatrixAdapter(const AbstractSystemMatrix& systemmatrix)
92 {
93 return dynamic_cast<const SystemMatrixAdapter&>(systemmatrix);
94 }
95
96 /**
97 \brief
98 nullifyRowsAndCols - calls Paso_SystemMatrix_nullifyRowsAndCols.
99 */
100 void nullifyRowsAndCols(escript::Data& row_q, escript::Data& col_q, const double mdv) const;
101
102 /**
103 \brief writes the matrix to a file using the Matrix Market file format
104 */
105 virtual void saveMM(const std::string& fileName) const;
106
107 /**
108 \brief writes the matrix to a file using the Harwell-Boeing file format
109 */
110 virtual void saveHB(const std::string& fileName) const;
111
112 /**
113 \brief sets the matrix entries to zero
114 */
115 virtual void resetValues() const;
116
117 /**
118 \brief maps escript options onto Paso options:
119 */
120 static int mapOptionToPaso(const int option);
121
122 protected:
123
124 private:
125
126 /**
127 \brief
128 solves the linear system this*out=in
129 */
130 virtual void setToSolution(escript::Data& out, escript::Data& in, const boost::python::dict& options) const;
131
132 /**
133 \brief
134 performs y+=this*x
135 */
136 virtual void ypAx(escript::Data& y, escript::Data& x) const;
137
138 //
139 // pointer to the externally created finley mesh - system_matrix.
140 //
141 boost::shared_ptr<Paso_SystemMatrix> m_system_matrix;
142
143 };
144
145 } // end of namespace
146 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26