Epetra_FECrsMatrix.h

Go to the documentation of this file.
00001 
00002 //@HEADER
00003 /*
00004 ************************************************************************
00005 
00006               Epetra: Linear Algebra Services Package 
00007                 Copyright (2001) Sandia Corporation
00008 
00009 Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00010 license for use of this work by or on behalf of the U.S. Government.
00011 
00012 This library is free software; you can redistribute it and/or modify
00013 it under the terms of the GNU Lesser General Public License as
00014 published by the Free Software Foundation; either version 2.1 of the
00015 License, or (at your option) any later version.
00016  
00017 This library is distributed in the hope that it will be useful, but
00018 WITHOUT ANY WARRANTY; without even the implied warranty of
00019 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020 Lesser General Public License for more details.
00021  
00022 You should have received a copy of the GNU Lesser General Public
00023 License along with this library; if not, write to the Free Software
00024 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00025 USA
00026 Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00027 
00028 ************************************************************************
00029 */
00030 //@HEADER
00031 
00032 #ifndef EPETRA_FECRSMATRIX_H
00033 #define EPETRA_FECRSMATRIX_H
00034 
00035 #include <Epetra_CrsMatrix.h>
00036 class Epetra_Map;
00037 class Epetra_IntSerialDenseVector;
00038 class Epetra_SerialDenseMatrix;
00039 
00097 class Epetra_FECrsMatrix : public Epetra_CrsMatrix {
00098   public:
00100    Epetra_FECrsMatrix(Epetra_DataAccess CV,
00101           const Epetra_Map& RowMap,
00102           int* NumEntriesPerRow,
00103           bool ignoreNonLocalEntries=false);
00104 
00106    Epetra_FECrsMatrix(Epetra_DataAccess CV,
00107           const Epetra_Map& RowMap,
00108           int NumEntriesPerRow,
00109           bool ignoreNonLocalEntries=false);
00110 
00112    Epetra_FECrsMatrix(Epetra_DataAccess CV,
00113           const Epetra_Map& RowMap,
00114           const Epetra_Map& ColMap,
00115           int* NumEntriesPerRow,
00116           bool ignoreNonLocalEntries=false);
00117 
00119    Epetra_FECrsMatrix(Epetra_DataAccess CV,
00120           const Epetra_Map& RowMap,
00121           const Epetra_Map& ColMap,
00122           int NumEntriesPerRow,
00123           bool ignoreNonLocalEntries=false);
00124 
00126    Epetra_FECrsMatrix(Epetra_DataAccess CV,
00127           const Epetra_CrsGraph& Graph,
00128           bool ignoreNonLocalEntries=false);
00129 
00131    Epetra_FECrsMatrix(const Epetra_FECrsMatrix& src);
00132 
00134    virtual ~Epetra_FECrsMatrix();
00135 
00137    Epetra_FECrsMatrix& operator=(const Epetra_FECrsMatrix& src);
00138 
00139    enum { ROW_MAJOR = 0, COLUMN_MAJOR = 3 };
00140 
00141    //Let the compiler know we intend to overload the following base-class
00142    //functions, rather than hide them.
00143    using Epetra_CrsMatrix::SumIntoGlobalValues;
00144    using Epetra_CrsMatrix::InsertGlobalValues;
00145    using Epetra_CrsMatrix::ReplaceGlobalValues;
00146 
00162    int SumIntoGlobalValues(int numIndices, const int* indices,
00163                            const double* values,
00164                            int format=Epetra_FECrsMatrix::COLUMN_MAJOR);
00165 
00182    int SumIntoGlobalValues(int numRows, const int* rows,
00183                            int numCols, const int* cols,
00184                            const double* values,
00185                            int format=Epetra_FECrsMatrix::COLUMN_MAJOR);
00186 
00201    int SumIntoGlobalValues(int numIndices, const int* indices,
00202                            const double* const* values,
00203                            int format=Epetra_FECrsMatrix::ROW_MAJOR);
00204 
00220    int SumIntoGlobalValues(int numRows, const int* rows,
00221                      int numCols, const int* cols,
00222                            const double* const* values,
00223                            int format=Epetra_FECrsMatrix::ROW_MAJOR);
00224 
00239    int InsertGlobalValues(int numIndices, const int* indices,
00240                            const double* values,
00241                            int format=Epetra_FECrsMatrix::COLUMN_MAJOR);
00242 
00258    int InsertGlobalValues(int numRows, const int* rows,
00259                            int numCols, const int* cols,
00260                            const double* values,
00261                            int format=Epetra_FECrsMatrix::COLUMN_MAJOR);
00262 
00276    int InsertGlobalValues(int numIndices, const int* indices,
00277                            const double* const* values,
00278                            int format=Epetra_FECrsMatrix::ROW_MAJOR);
00279 
00294    int InsertGlobalValues(int numRows, const int* rows,
00295                      int numCols, const int* cols,
00296                            const double* const* values,
00297                            int format=Epetra_FECrsMatrix::ROW_MAJOR);
00298 
00314    int ReplaceGlobalValues(int numIndices, const int* indices,
00315                            const double* values,
00316                            int format=Epetra_FECrsMatrix::COLUMN_MAJOR);
00317 
00335    int ReplaceGlobalValues(int numRows, const int* rows,
00336                            int numCols, const int* cols,
00337                            const double* values,
00338                            int format=Epetra_FECrsMatrix::COLUMN_MAJOR);
00339 
00354    int ReplaceGlobalValues(int numIndices, const int* indices,
00355                            const double* const* values,
00356                            int format=Epetra_FECrsMatrix::ROW_MAJOR);
00357 
00373    int ReplaceGlobalValues(int numRows, const int* rows,
00374                            int numCols, const int* cols,
00375                            const double* const* values,
00376                            int format=Epetra_FECrsMatrix::ROW_MAJOR);
00377 
00388    int SumIntoGlobalValues(const Epetra_IntSerialDenseVector& indices,
00389          const Epetra_SerialDenseMatrix& values,
00390          int format=Epetra_FECrsMatrix::COLUMN_MAJOR);
00391 
00406    int SumIntoGlobalValues(const Epetra_IntSerialDenseVector& rows,
00407          const Epetra_IntSerialDenseVector& cols,
00408          const Epetra_SerialDenseMatrix& values,
00409          int format=Epetra_FECrsMatrix::COLUMN_MAJOR);
00410 
00421    int InsertGlobalValues(const Epetra_IntSerialDenseVector& indices,
00422          const Epetra_SerialDenseMatrix& values,
00423          int format=Epetra_FECrsMatrix::COLUMN_MAJOR);
00424 
00439    int InsertGlobalValues(const Epetra_IntSerialDenseVector& rows,
00440          const Epetra_IntSerialDenseVector& cols,
00441          const Epetra_SerialDenseMatrix& values,
00442          int format=Epetra_FECrsMatrix::COLUMN_MAJOR);
00443 
00455    int ReplaceGlobalValues(const Epetra_IntSerialDenseVector& indices,
00456          const Epetra_SerialDenseMatrix& values,
00457          int format=Epetra_FECrsMatrix::COLUMN_MAJOR);
00458 
00473    int ReplaceGlobalValues(const Epetra_IntSerialDenseVector& rows,
00474          const Epetra_IntSerialDenseVector& cols,
00475          const Epetra_SerialDenseMatrix& values,
00476          int format=Epetra_FECrsMatrix::COLUMN_MAJOR);
00477 
00499    int GlobalAssemble(bool callFillComplete=true);
00500 
00526    int GlobalAssemble(const Epetra_Map& domain_map,
00527                       const Epetra_Map& range_map,
00528                       bool callFillComplete=true);
00529 
00533    void setIgnoreNonLocalEntries(bool flag) {
00534      ignoreNonLocalEntries_ = flag;
00535    }
00536 
00537   private:
00538    void DeleteMemory();
00539 
00540    enum {SUMINTO = 0, REPLACE = 1, INSERT = 2};
00541 
00542    int InputGlobalValues(int numRows, const int* rows,
00543                          int numCols, const int* cols,
00544                          const double* const* values,
00545                          int format,
00546                          int mode);
00547 
00548    int InputGlobalValues(int numRows, const int* rows,
00549                          int numCols, const int* cols,
00550                          const double* values,
00551                          int format,
00552                          int mode);
00553 
00554    int InputNonlocalGlobalValues(int row,
00555          int numCols, const int* cols,
00556          const double* values,
00557          int mode);
00558 
00559    int InsertNonlocalRow(int row, int offset);
00560 
00561    int InputNonlocalValue(int rowoffset,
00562         int col, double value,
00563         int mode);
00564 
00565    int myFirstRow_;
00566    int myNumRows_;
00567 
00568    bool ignoreNonLocalEntries_;
00569 
00570    int numNonlocalRows_;
00571    int* nonlocalRows_;
00572    int* nonlocalRowLengths_;
00573    int* nonlocalRowAllocLengths_;
00574    int** nonlocalCols_;
00575    double** nonlocalCoefs_;
00576 
00577    double* workData_;
00578    int workDataLength_;
00579 };//class Epetra_FECrsMatrix
00580 
00581 #endif /* EPETRA_FECRSMATRIX_H */

Generated on Thu Sep 18 12:37:57 2008 for Epetra Package Browser (Single Doxygen Collection) by doxygen 1.3.9.1