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    using Epetra_CrsMatrix::SumIntoGlobalValues;
00142    using Epetra_CrsMatrix::InsertGlobalValues;
00143    using Epetra_CrsMatrix::ReplaceGlobalValues;
00144 
00146    int SumIntoGlobalValues(int GlobalRow, int NumEntries,
00147                            double* Values, int* Indices);
00148 
00150    int InsertGlobalValues(int GlobalRow, int NumEntries,
00151                            double* Values, int* Indices);
00152 
00154    int ReplaceGlobalValues(int GlobalRow, int NumEntries,
00155                            double* Values, int* Indices);
00156 
00172    int SumIntoGlobalValues(int numIndices, const int* indices,
00173                            const double* values,
00174                            int format=Epetra_FECrsMatrix::COLUMN_MAJOR);
00175 
00192    int SumIntoGlobalValues(int numRows, const int* rows,
00193                            int numCols, const int* cols,
00194                            const double* values,
00195                            int format=Epetra_FECrsMatrix::COLUMN_MAJOR);
00196 
00211    int SumIntoGlobalValues(int numIndices, const int* indices,
00212                            const double* const* values,
00213                            int format=Epetra_FECrsMatrix::ROW_MAJOR);
00214 
00230    int SumIntoGlobalValues(int numRows, const int* rows,
00231                      int numCols, const int* cols,
00232                            const double* const* values,
00233                            int format=Epetra_FECrsMatrix::ROW_MAJOR);
00234 
00249    int InsertGlobalValues(int numIndices, const int* indices,
00250                            const double* values,
00251                            int format=Epetra_FECrsMatrix::COLUMN_MAJOR);
00252 
00268    int InsertGlobalValues(int numRows, const int* rows,
00269                            int numCols, const int* cols,
00270                            const double* values,
00271                            int format=Epetra_FECrsMatrix::COLUMN_MAJOR);
00272 
00286    int InsertGlobalValues(int numIndices, const int* indices,
00287                            const double* const* values,
00288                            int format=Epetra_FECrsMatrix::ROW_MAJOR);
00289 
00304    int InsertGlobalValues(int numRows, const int* rows,
00305                      int numCols, const int* cols,
00306                            const double* const* values,
00307                            int format=Epetra_FECrsMatrix::ROW_MAJOR);
00308 
00324    int ReplaceGlobalValues(int numIndices, const int* indices,
00325                            const double* values,
00326                            int format=Epetra_FECrsMatrix::COLUMN_MAJOR);
00327 
00345    int ReplaceGlobalValues(int numRows, const int* rows,
00346                            int numCols, const int* cols,
00347                            const double* values,
00348                            int format=Epetra_FECrsMatrix::COLUMN_MAJOR);
00349 
00364    int ReplaceGlobalValues(int numIndices, const int* indices,
00365                            const double* const* values,
00366                            int format=Epetra_FECrsMatrix::ROW_MAJOR);
00367 
00383    int ReplaceGlobalValues(int numRows, const int* rows,
00384                            int numCols, const int* cols,
00385                            const double* const* values,
00386                            int format=Epetra_FECrsMatrix::ROW_MAJOR);
00387 
00398    int SumIntoGlobalValues(const Epetra_IntSerialDenseVector& indices,
00399          const Epetra_SerialDenseMatrix& values,
00400          int format=Epetra_FECrsMatrix::COLUMN_MAJOR);
00401 
00416    int SumIntoGlobalValues(const Epetra_IntSerialDenseVector& rows,
00417          const Epetra_IntSerialDenseVector& cols,
00418          const Epetra_SerialDenseMatrix& values,
00419          int format=Epetra_FECrsMatrix::COLUMN_MAJOR);
00420 
00431    int InsertGlobalValues(const Epetra_IntSerialDenseVector& indices,
00432          const Epetra_SerialDenseMatrix& values,
00433          int format=Epetra_FECrsMatrix::COLUMN_MAJOR);
00434 
00449    int InsertGlobalValues(const Epetra_IntSerialDenseVector& rows,
00450          const Epetra_IntSerialDenseVector& cols,
00451          const Epetra_SerialDenseMatrix& values,
00452          int format=Epetra_FECrsMatrix::COLUMN_MAJOR);
00453 
00465    int ReplaceGlobalValues(const Epetra_IntSerialDenseVector& indices,
00466          const Epetra_SerialDenseMatrix& values,
00467          int format=Epetra_FECrsMatrix::COLUMN_MAJOR);
00468 
00483    int ReplaceGlobalValues(const Epetra_IntSerialDenseVector& rows,
00484          const Epetra_IntSerialDenseVector& cols,
00485          const Epetra_SerialDenseMatrix& values,
00486          int format=Epetra_FECrsMatrix::COLUMN_MAJOR);
00487 
00509    int GlobalAssemble(bool callFillComplete=true);
00510 
00536    int GlobalAssemble(const Epetra_Map& domain_map,
00537                       const Epetra_Map& range_map,
00538                       bool callFillComplete=true);
00539 
00543    void setIgnoreNonLocalEntries(bool flag) {
00544      ignoreNonLocalEntries_ = flag;
00545    }
00546 
00547   private:
00548    void DeleteMemory();
00549 
00550    enum {SUMINTO = 0, REPLACE = 1, INSERT = 2};
00551 
00552    int InputGlobalValues(int numRows, const int* rows,
00553                          int numCols, const int* cols,
00554                          const double* const* values,
00555                          int format,
00556                          int mode);
00557 
00558    int InputGlobalValues(int numRows, const int* rows,
00559                          int numCols, const int* cols,
00560                          const double* values,
00561                          int format,
00562                          int mode);
00563 
00564    int InputNonlocalGlobalValues(int row,
00565          int numCols, const int* cols,
00566          const double* values,
00567          int mode);
00568 
00569    int InsertNonlocalRow(int row, int offset);
00570 
00571    int InputNonlocalValue(int rowoffset,
00572         int col, double value,
00573         int mode);
00574 
00575    int myFirstRow_;
00576    int myNumRows_;
00577 
00578    bool ignoreNonLocalEntries_;
00579 
00580    int numNonlocalRows_;
00581    int* nonlocalRows_;
00582    int* nonlocalRowLengths_;
00583    int* nonlocalRowAllocLengths_;
00584    int** nonlocalCols_;
00585    double** nonlocalCoefs_;
00586 
00587    double* workData_;
00588    int workDataLength_;
00589 };//class Epetra_FECrsMatrix
00590 
00591 #endif /* EPETRA_FECRSMATRIX_H */

Generated on Wed May 12 21:41:05 2010 for Epetra Package Browser (Single Doxygen Collection) by  doxygen 1.4.7