Epetra Package Browser (Single Doxygen Collection) Development
Epetra_FECrsGraph.h
Go to the documentation of this file.
00001 /*
00002 //@HEADER
00003 // ************************************************************************
00004 // 
00005 //               Epetra: Linear Algebra Services Package 
00006 //                 Copyright 2011 Sandia Corporation
00007 // 
00008 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00009 // the U.S. Government retains certain rights in this software.
00010 //
00011 // Redistribution and use in source and binary forms, with or without
00012 // modification, are permitted provided that the following conditions are
00013 // met:
00014 //
00015 // 1. Redistributions of source code must retain the above copyright
00016 // notice, this list of conditions and the following disclaimer.
00017 //
00018 // 2. Redistributions in binary form must reproduce the above copyright
00019 // notice, this list of conditions and the following disclaimer in the
00020 // documentation and/or other materials provided with the distribution.
00021 //
00022 // 3. Neither the name of the Corporation nor the names of the
00023 // contributors may be used to endorse or promote products derived from
00024 // this software without specific prior written permission.
00025 //
00026 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00027 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00028 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00029 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00030 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00031 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00032 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00033 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00034 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00035 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00036 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00037 //
00038 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00039 // 
00040 // ************************************************************************
00041 //@HEADER
00042 */
00043 
00044 #ifndef EPETRA_FECRSGRAPH_H
00045 #define EPETRA_FECRSGRAPH_H
00046 
00047 #include "Epetra_Map.h"
00048 #include "Epetra_CrsGraph.h"
00049 
00050 #include <map>
00051 
00064 class EPETRA_LIB_DLL_EXPORT Epetra_FECrsGraph : public Epetra_CrsGraph {
00065   friend class Epetra_FECrsMatrix;
00066 
00067   public:
00068 
00070   Epetra_FECrsGraph(Epetra_DataAccess CV,
00071         const Epetra_BlockMap& RowMap,
00072         int* NumIndicesPerRow,
00073         bool ignoreNonLocalEntries=false,
00074         bool buildNonlocalGraph=false);
00075 
00077   Epetra_FECrsGraph(Epetra_DataAccess CV,
00078         const Epetra_BlockMap& RowMap,
00079         int NumIndicesPerRow,
00080         bool ignoreNonLocalEntries=false,
00081         bool buildNonlocalGraph=false);
00082 
00084   Epetra_FECrsGraph(Epetra_DataAccess CV,
00085         const Epetra_BlockMap& RowMap, 
00086         const Epetra_BlockMap& ColMap,
00087         int* NumIndicesPerRow,
00088         bool ignoreNonLocalEntries=false,
00089         bool buildNonlocalGraph=false);
00090 
00092   Epetra_FECrsGraph(Epetra_DataAccess CV,
00093         const Epetra_BlockMap& RowMap, 
00094         const Epetra_BlockMap& ColMap,
00095         int NumIndicesPerRow,
00096         bool ignoreNonLocalEntries=false,
00097         bool buildNonlocalGraph=false);
00098 
00100   Epetra_FECrsGraph(const Epetra_FECrsGraph& Graph);
00101 
00103   virtual ~Epetra_FECrsGraph();
00104 
00105   //Let the compiler know we intend to overload the base-class function
00106   //InsertGlobalIndices rather than hide it.
00107   using Epetra_CrsGraph::InsertGlobalIndices;
00108 
00118   int InsertGlobalIndices(int numRows, const int* rows,
00119         int numCols, const int* cols);
00120 
00142   int GlobalAssemble(bool callFillComplete=true);
00143 
00169   int GlobalAssemble(const Epetra_Map& domain_map,
00170                      const Epetra_Map& range_map,
00171                      bool callFillComplete=true);
00172 
00173   bool UseNonlocalGraph () const {return buildNonlocalGraph_; };
00174 
00175  private:     
00176   void DeleteMemory();
00177   int InsertNonlocalRow(int row, int offset);
00178   int InputNonlocalIndices(int row,
00179          int numCols,
00180          const int* cols);
00181   int InputNonlocalIndex(int rowoffset,
00182        int col);
00183 
00184   int myFirstRow_;
00185   int myNumRows_;
00186   bool ignoreNonLocalEntries_;
00187 
00192   std::map<int,Epetra_CrsGraphData::EntriesInOneRow> nonlocalRowData_;
00193 
00198   Epetra_CrsGraph* nonlocalGraph_;
00199   bool buildNonlocalGraph_;
00200 
00201   Epetra_FECrsGraph & operator=(const Epetra_FECrsGraph& Graph);
00202      
00203 
00204 };//class Epetra_FECrsGraph
00205 
00206 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines