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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 471 by jgs, Fri Jan 27 01:33:02 2006 UTC revision 1811 by ksteube, Thu Sep 25 23:11:13 2008 UTC
# Line 1  Line 1 
1  // $Id$  
2  /*  /*******************************************************
3   ******************************************************************************  *
4   *                                                                            *  * Copyright (c) 2003-2008 by University of Queensland
5   *       COPYRIGHT  ACcESS 2004 -  All Rights Reserved                        *  * Earth Systems Science Computational Center (ESSCC)
6   *                                                                            *  * http://www.uq.edu.au/esscc
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    *  * Primary Business: Queensland, Australia
9   * consent of ACcESS.  Copying, use or modification of this software          *  * Licensed under the Open Software License version 3.0
10   * by any unauthorised person is illegal unless that person has a software    *  * http://www.opensource.org/licenses/osl-3.0.php
11   * license agreement with ACcESS.                                             *  *
12   *                                                                            *  *******************************************************/
13   ******************************************************************************  
14  */  
                                                                             
15  #if !defined  finley_SystemMatrixAdapter_20040610_H  #if !defined  finley_SystemMatrixAdapter_20040610_H
16  #define finley_SystemMatrixAdapter_20040610_H  #define finley_SystemMatrixAdapter_20040610_H
17    #include "system_dep.h"
18    
 #include "SystemMatrixAdapter.h"  
 #include "escript/Data/AbstractSystemMatrix.h"  
 #include "escript/Data/Data.h"  
19  extern "C" {  extern "C" {
20  #include "SystemMatrix.h"  #include "paso/SystemMatrix.h"
21    #include "paso/Options.h"
22  }  }
23    
24    #include "FinleyAdapterException.h"
25    #include "FinleyError.h"
26    
27    #include "escript/AbstractSystemMatrix.h"
28    #include "escript/Data.h"
29    #include "escript/UtilC.h"
30    
31  #include <boost/python/dict.hpp>  #include <boost/python/dict.hpp>
32  #include <boost/shared_ptr.hpp>  #include <boost/shared_ptr.hpp>
33    #include <boost/python/extract.hpp>
34    
35  namespace finley {  namespace finley {
36    
# Line 44  class SystemMatrixAdapter:public escript Line 51  class SystemMatrixAdapter:public escript
51       Default Constructor for SystemMatrixAdapter.       Default Constructor for SystemMatrixAdapter.
52       NB: Only throws an exception.       NB: Only throws an exception.
53    */    */
54      FINLEY_DLL_API
55    SystemMatrixAdapter();    SystemMatrixAdapter();
56    
57    /**    /**
58       /brief       /brief
59       Constructor for SystemMatrixAdapter.       Constructor for SystemMatrixAdapter.
60    */    */
61      FINLEY_DLL_API
62    SystemMatrixAdapter(Paso_SystemMatrix* system_matrix,    SystemMatrixAdapter(Paso_SystemMatrix* system_matrix,
63                        const int row_blocksize,                        const int row_blocksize,
64                        const escript::FunctionSpace& row_functionspace,                        const escript::FunctionSpace& row_functionspace,
# Line 62  class SystemMatrixAdapter:public escript Line 71  class SystemMatrixAdapter:public escript
71       Destructor for SystemMatrixAdapter. As specified in the constructor       Destructor for SystemMatrixAdapter. As specified in the constructor
72       this deallocates the pointer given to the constructor.       this deallocates the pointer given to the constructor.
73    */    */
74      FINLEY_DLL_API
75    ~SystemMatrixAdapter();    ~SystemMatrixAdapter();
76    
77    /**    /**
78       \brief       \brief
79       Returns the pointer to the system matrix.       Returns the pointer to the system matrix.
80    */    */
81      FINLEY_DLL_API
82    Paso_SystemMatrix* getPaso_SystemMatrix() const;    Paso_SystemMatrix* getPaso_SystemMatrix() const;
83    
84    /**    /**
# Line 92  class SystemMatrixAdapter:public escript Line 103  class SystemMatrixAdapter:public escript
103      \brief      \brief
104      nullifyRowsAndCols - calls Paso_SystemMatrix_nullifyRowsAndCols.      nullifyRowsAndCols - calls Paso_SystemMatrix_nullifyRowsAndCols.
105    */    */
106      FINLEY_DLL_API
107    void nullifyRowsAndCols(escript::Data& row_q, escript::Data& col_q, const double mdv) const;    void nullifyRowsAndCols(escript::Data& row_q, escript::Data& col_q, const double mdv) const;
108    
109    /**    /**
110       \brief writes the matrix to a file using the Matrix Market file format       \brief writes the matrix to a file using the Matrix Market file format
111    */    */
112      FINLEY_DLL_API
113    virtual void saveMM(const std::string& fileName) const;    virtual void saveMM(const std::string& fileName) const;
114    
115    /**    /**
116       \brief writes the matrix to a file using the Harwell-Boeing file format       \brief writes the matrix to a file using the Harwell-Boeing file format
117    */    */
118      FINLEY_DLL_API
119    virtual void saveHB(const std::string& fileName) const;    virtual void saveHB(const std::string& fileName) const;
120    
121    /**    /**
122       \brief sets the matrix entries to zero       \brief sets the matrix entries to zero
123    */    */
124      FINLEY_DLL_API
125    virtual void resetValues() const;    virtual void resetValues() const;
126    
127    /**    /**
128       \brief maps escript options onto Paso options:       \brief maps escript options onto Paso options:
129    */    */
130      FINLEY_DLL_API
131    static int mapOptionToPaso(const int option);    static int mapOptionToPaso(const int option);
132    
133      /**
134         \brief extract paso options from a dictionary
135      */
136    
137      FINLEY_DLL_API
138      static void dictToPasoOptions(Paso_Options* paso_options, const boost::python::dict& options);
139    
140      /**
141         \brief prints information about a system matrix
142      */
143      FINLEY_DLL_API
144      void Print_Matrix_Info(const bool) const;
145    
146   protected:   protected:
147    
148   private:   private:
# Line 122  class SystemMatrixAdapter:public escript Line 151  class SystemMatrixAdapter:public escript
151        \brief        \brief
152        solves the linear system this*out=in        solves the linear system this*out=in
153     */     */
154       FINLEY_DLL_API
155     virtual void setToSolution(escript::Data& out, escript::Data& in, const boost::python::dict& options) const;     virtual void setToSolution(escript::Data& out, escript::Data& in, const boost::python::dict& options) const;
156    
157     /**     /**
158         \brief         \brief
159         performs y+=this*x         performs y+=this*x
160     */     */
161       FINLEY_DLL_API
162     virtual void ypAx(escript::Data& y, escript::Data& x) const;     virtual void ypAx(escript::Data& y, escript::Data& x) const;
163    
164     //     //

Legend:
Removed from v.471  
changed lines
  Added in v.1811

  ViewVC Help
Powered by ViewVC 1.1.26