fei_MatrixTraits_LinProbMgr.hpp

00001 /*--------------------------------------------------------------------*/
00002 /*    Copyright 2005 Sandia Corporation.                              */
00003 /*    Under the terms of Contract DE-AC04-94AL85000, there is a       */
00004 /*    non-exclusive license for use of this work by or on behalf      */
00005 /*    of the U.S. Government.  Export of this program may require     */
00006 /*    a license from the United States Government.                    */
00007 /*--------------------------------------------------------------------*/
00008 
00009 #ifndef _fei_MatrixTraits_LinProbMgr_hpp_
00010 #define _fei_MatrixTraits_LinProbMgr_hpp_
00011 
00012 //This file defines matrix traits for LinearProblemManager matrix
00013 //representations.
00014 //
00015 
00016 #include <fei_LinearProblemManager.hpp>
00017 
00018 namespace fei {
00019 
00021   template<>
00022   struct MatrixTraits<fei::LinearProblemManager> {
00023 
00025     static const char* typeName()
00026       { return("fei::LinearProblemManager"); }
00027 
00030     static int setValues(fei::LinearProblemManager* mat, double scalar)
00031       {
00032   mat->setMatrixValues(scalar);
00033         return(0);
00034       }
00035 
00039     static int getNumLocalRows(fei::LinearProblemManager* mat, int& numRows)
00040     {
00041       numRows = mat->getLocalNumRows();
00042       return(0);
00043     }
00044 
00047     static int getRowLength(fei::LinearProblemManager* mat, int row, int& length)
00048       {
00049   length = mat->getRowLength(row);
00050         if (length < 0) return(length);
00051         return(0);
00052       }
00053 
00066     static int copyOutRow(fei::LinearProblemManager* mat,
00067           int row, int len, double* coefs, int* indices)
00068       {
00069   return( mat->copyOutMatrixRow(row, len, coefs, indices) );
00070       }
00071 
00074     static int putValuesIn(fei::LinearProblemManager* mat,
00075                            int numRows, const int* rows,
00076                            int numCols, const int* cols,
00077                            const double* const* values,
00078                            bool sum_into)
00079       {
00080         return( mat->insertMatrixValues(numRows, rows,
00081                                         numCols, cols,
00082                                         values, sum_into) );
00083       }
00084 
00088     static int globalAssemble(fei::LinearProblemManager* mat)
00089     {
00090       return( mat->globalAssemble() );
00091     }
00092 
00094     static int matvec(fei::LinearProblemManager* mat,
00095           fei::Vector* x,
00096           fei::Vector* y)
00097     {
00098       return( -1 );
00099     }
00100   };//struct MatrixTraits
00101 }//namespace fei
00102 
00103 #endif // _fei_MatrixTraits_LinProbMgr_hpp_
00104 

Generated on Tue Jul 13 09:27:45 2010 for FEI by  doxygen 1.4.7