/[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

trunk/finley/src/finley/CPPAdapter/SystemMatrixAdapter.h revision 467 by jgs, Wed Jan 25 05:43:46 2006 UTC trunk/finley/src/CPPAdapter/SystemMatrixAdapter.h revision 2898 by caltinay, Mon Feb 1 01:23:46 2010 UTC
# Line 1  Line 1 
1  // $Id$  
2  /*  /*******************************************************
3   ******************************************************************************  *
4   *                                                                            *  * Copyright (c) 2003-2010 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  #include <boost/python/dict.hpp>  
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/object.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 SolutionOptions class
135      */
136    
137      FINLEY_DLL_API
138      static void escriptToPasoOptions(Paso_Options* paso_options, const boost::python::object& options);
139    
140      /**
141         \brief copied diagonistic data back to the solver option.
142      */
143    
144      FINLEY_DLL_API
145      static void pasoToEscriptOptions(const Paso_Options* paso_options,boost::python::object& options);
146    
147      /**
148         \brief prints information about a system matrix
149      */
150      FINLEY_DLL_API
151      void Print_Matrix_Info(const bool) const;
152    
153   protected:   protected:
154    
155   private:   private:
# Line 122  class SystemMatrixAdapter:public escript Line 158  class SystemMatrixAdapter:public escript
158        \brief        \brief
159        solves the linear system this*out=in        solves the linear system this*out=in
160     */     */
161     virtual void setToSolution(escript::Data& out, escript::Data& in, const boost::python::dict& options) const;     FINLEY_DLL_API
162       virtual void setToSolution(escript::Data& out, escript::Data& in, boost::python::object& options) const;
163    
164     /**     /**
165         \brief         \brief
166         performs y+=this*x         performs y+=this*x
167     */     */
168       FINLEY_DLL_API
169     virtual void ypAx(escript::Data& y, escript::Data& x) const;     virtual void ypAx(escript::Data& y, escript::Data& x) const;
170    
171     //     //

Legend:
Removed from v.467  
changed lines
  Added in v.2898

  ViewVC Help
Powered by ViewVC 1.1.26