/[escript]/trunk/escript/src/AbstractSystemMatrix.cpp
ViewVC logotype

Diff of /trunk/escript/src/AbstractSystemMatrix.cpp

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

trunk/esys2/escript/src/Data/AbstractSystemMatrix.cpp revision 97 by jgs, Tue Dec 14 05:39:33 2004 UTC trunk/escript/src/AbstractSystemMatrix.cpp revision 969 by ksteube, Tue Feb 13 23:02:23 2007 UTC
# Line 1  Line 1 
1  // $Id$  // $Id$
2  /*  /*
3   ******************************************************************************   ************************************************************
4   *                                                                            *   *          Copyright 2006 by ACcESS MNRF                   *
5   *       COPYRIGHT  ACcESS 2004 -  All Rights Reserved                        *   *                                                          *
6   *                                                                            *   *              http://www.access.edu.au                    *
7   * This software is the property of ACcESS. No part of this code              *   *       Primary Business: Queensland, Australia            *
8   * may be copied in any form or by any means without the expressed written    *   *  Licensed under the Open Software License version 3.0    *
9   * consent of ACcESS.  Copying, use or modification of this software          *   *     http://www.opensource.org/licenses/osl-3.0.php       *
10   * by any unauthorised person is illegal unless that person has a software    *   *                                                          *
11   * license agreement with ACcESS.                                             *   ************************************************************
  *                                                                            *  
  ******************************************************************************  
12  */  */
13    
14  #include "escript/Data/AbstractSystemMatrix.h"  #include "AbstractSystemMatrix.h"
15  #include "escript/Data/FunctionSpace.h"  #include "DataException.h"
16  #include "escript/Data/DataException.h"  #include "DataArrayView.h"
17  #include "escript/Data/DataArrayView.h"  #include "Data.h"
18    
19  namespace escript {  namespace escript {
20    
# Line 49  int AbstractSystemMatrix::isEmpty() cons Line 47  int AbstractSystemMatrix::isEmpty() cons
47     return m_empty;     return m_empty;
48  }  }
49    
50  Data operator*(const AbstractSystemMatrix& left, const Data& right)  Data operator*(const AbstractSystemMatrix& left,const Data& right)
51  {  {
52        return left.vectorMultiply(right);        Data tmp=(Data) right;
53          return left.vectorMultiply(tmp);
54  }  }
55    
56  Data AbstractSystemMatrix::vectorMultiply(const Data& right) const  Data AbstractSystemMatrix::vectorMultiply(Data& right) const
57  {  {
58       if (isEmpty())       if (isEmpty())
59            throw SystemMatrixException("Error - Matrix is empty.");            throw SystemMatrixException("Error - Matrix is empty.");
      if (right.getFunctionSpace()!=getColumnFunctionSpace())  
           throw SystemMatrixException("Error - column function space and function space of input data do not match.");  
60       if (right.getDataPointSize()!=getColumnBlockSize())       if (right.getDataPointSize()!=getColumnBlockSize())
61            throw SystemMatrixException("Error - column block size and input data size do not match.");            throw SystemMatrixException("Error - column block size and input data size do not match.");
62       DataArrayView::ShapeType shape;       DataArrayView::ShapeType shape;
63       if (getRowBlockSize()>1) shape.push_back(getRowBlockSize());       if (getRowBlockSize()>1) shape.push_back(getRowBlockSize());
64    
65       Data out=Data(0.,shape,getRowFunctionSpace(),true);       Data out=Data(0.,shape,getRowFunctionSpace(),true);
66       ypAx(out,right);       Data in=Data(right,getColumnFunctionSpace());
67         ypAx(out,in);
68       return out;       return out;
69  }  }
70    
71  void AbstractSystemMatrix::ypAx(Data& y,const Data& x) const  void AbstractSystemMatrix::ypAx(Data& y,Data& x) const
72  {  {
73      throw SystemMatrixException("Error - ypAx not available");      throw SystemMatrixException("Error - ypAx not available");
74  }  }
75    
76  Data AbstractSystemMatrix::solve(const Data& in,const boost::python::dict& options) const  Data AbstractSystemMatrix::solve(Data& in,const boost::python::dict& options) const
77  {  {
78         printf("ksteube in escript/src/AbstractSystemMatrix.cpp : solve()\n");
79       if (isEmpty())       if (isEmpty())
80            throw SystemMatrixException("Error - Matrix is empty.");            throw SystemMatrixException("Error - Matrix is empty.");
81       if (in.getFunctionSpace()!=getRowFunctionSpace())       if (in.getFunctionSpace()!=getRowFunctionSpace())
# Line 89  Data AbstractSystemMatrix::solve(const D Line 88  Data AbstractSystemMatrix::solve(const D
88       setToSolution(out,in,options);       setToSolution(out,in,options);
89       return out;       return out;
90  }  }
91  void AbstractSystemMatrix::setToSolution(Data& out,const Data& in,const boost::python::dict& options) const  void AbstractSystemMatrix::setToSolution(Data& out,Data& in,const boost::python::dict& options) const
92  {  {
93      throw SystemMatrixException("Error - setToSolution not available");      throw SystemMatrixException("Error - setToSolution not available");
94  }  }
# Line 97  void AbstractSystemMatrix::saveMM(const Line 96  void AbstractSystemMatrix::saveMM(const
96  {  {
97      throw SystemMatrixException("Error - Matrix Market interface not available.");      throw SystemMatrixException("Error - Matrix Market interface not available.");
98  }  }
99  void AbstractSystemMatrix:: setValue(const double value) const  void AbstractSystemMatrix::saveHB(const std::string& fileName) const
100  {  {
101        throw SystemMatrixException("Error - Harwell-Boeing interface not available.");
102    }
103    void AbstractSystemMatrix::resetValues() const
104    {
105        throw SystemMatrixException("Error - setValue is not implemented.");
106  }  }
107    
108  }  // end of namespace  }  // end of namespace

Legend:
Removed from v.97  
changed lines
  Added in v.969

  ViewVC Help
Powered by ViewVC 1.1.26