Epetra Package Browser (Single Doxygen Collection) Development
Loading...
Searching...
No Matches
Epetra_FECrsGraph.h
Go to the documentation of this file.
1/*
2//@HEADER
3// ************************************************************************
4//
5// Epetra: Linear Algebra Services Package
6// Copyright 2011 Sandia Corporation
7//
8// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9// the U.S. Government retains certain rights in this software.
10//
11// Redistribution and use in source and binary forms, with or without
12// modification, are permitted provided that the following conditions are
13// met:
14//
15// 1. Redistributions of source code must retain the above copyright
16// notice, this list of conditions and the following disclaimer.
17//
18// 2. Redistributions in binary form must reproduce the above copyright
19// notice, this list of conditions and the following disclaimer in the
20// documentation and/or other materials provided with the distribution.
21//
22// 3. Neither the name of the Corporation nor the names of the
23// contributors may be used to endorse or promote products derived from
24// this software without specific prior written permission.
25//
26// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37//
38// Questions? Contact Michael A. Heroux (maherou@sandia.gov)
39//
40// ************************************************************************
41//@HEADER
42*/
43
44#ifndef EPETRA_FECRSGRAPH_H
45#define EPETRA_FECRSGRAPH_H
46
47#include "Epetra_ConfigDefs.h"
48#include "Epetra_Map.h"
49#include "Epetra_CrsGraph.h"
50
51#include <map>
52
65class EPETRA_LIB_DLL_EXPORT Epetra_FECrsGraph : public Epetra_CrsGraph {
66 friend class Epetra_FECrsMatrix;
67
68 public:
69
72 const Epetra_BlockMap& RowMap,
73 int* NumIndicesPerRow,
74 bool ignoreNonLocalEntries=false,
75 bool buildNonlocalGraph=false);
76
79 const Epetra_BlockMap& RowMap,
80 int NumIndicesPerRow,
81 bool ignoreNonLocalEntries=false,
82 bool buildNonlocalGraph=false);
83
86 const Epetra_BlockMap& RowMap,
87 const Epetra_BlockMap& ColMap,
88 int* NumIndicesPerRow,
89 bool ignoreNonLocalEntries=false,
90 bool buildNonlocalGraph=false);
91
94 const Epetra_BlockMap& RowMap,
95 const Epetra_BlockMap& ColMap,
96 int NumIndicesPerRow,
97 bool ignoreNonLocalEntries=false,
98 bool buildNonlocalGraph=false);
99
101 // Using default copy constructor because there is no def in cpp file
102 // Epetra_FECrsGraph(const Epetra_FECrsGraph& Graph);
103
105 virtual ~Epetra_FECrsGraph();
106
107 //Let the compiler know we intend to overload the base-class function
108 //InsertGlobalIndices rather than hide it.
110
120#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
121 int InsertGlobalIndices(int numRows, const int* rows,
122 int numCols, const int* cols);
123#endif
124#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
125 int InsertGlobalIndices(int numRows, const long long* rows,
126 int numCols, const long long* cols);
127#endif
128
150 int GlobalAssemble(bool callFillComplete=true);
151
177 int GlobalAssemble(const Epetra_Map& domain_map,
178 const Epetra_Map& range_map,
179 bool callFillComplete=true);
180
181 bool UseNonlocalGraph () const {return buildNonlocalGraph_; };
182
183 private:
184 void DeleteMemory();
185 int InsertNonlocalRow(int row, int offset);
187 int numCols,
188 const int* cols);
189 int InputNonlocalIndex(int rowoffset,
190 int col);
191
192 long long myFirstRow_;
195
200#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
201 std::map<int,Epetra_CrsGraphData::EntriesInOneRow<int> > nonlocalRowData_int_;
202#endif
203#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
204 std::map<long long,Epetra_CrsGraphData::EntriesInOneRow<long long> > nonlocalRowData_LL_;
205#endif
206
207 template<typename int_type>
208 std::map<int_type,Epetra_CrsGraphData::EntriesInOneRow<int_type> >& nonlocalRowData();
209
216
218
219 template<typename int_type>
220 int InsertGlobalIndices(int numRows, const int_type* rows, int numCols, const int_type* cols);
221
222 template<typename int_type>
223 int GlobalAssemble(const Epetra_Map& domain_map, const Epetra_Map& range_map, bool callFillComplete);
224
225};//class Epetra_FECrsGraph
226
227#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
228template<> inline std::map<int,Epetra_CrsGraphData::EntriesInOneRow<int> >& Epetra_FECrsGraph::nonlocalRowData()
229{
231}
232#endif
233
234#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
235template<> inline std::map<long long,Epetra_CrsGraphData::EntriesInOneRow<long long> >& Epetra_FECrsGraph::nonlocalRowData()
236{
237 return nonlocalRowData_LL_;
238}
239#endif
240
241#endif
Epetra_DataAccess
Epetra_BlockMap: A class for partitioning block element vectors and matrices.
Epetra_CrsGraph: A class for constructing and using sparse compressed row graphs.
int InsertGlobalIndices(int GlobalRow, int NumIndices, int *Indices)
Enter a list of elements in a specified global row of the graph.
friend class Epetra_FECrsGraph
Epetra Finite-Element CrsGraph.
int InputNonlocalIndex(int rowoffset, int col)
std::map< int, Epetra_CrsGraphData::EntriesInOneRow< int > > nonlocalRowData_int_
This STL map holds all non-local data in format of Entries in the individual rows together with the r...
std::map< long long, Epetra_CrsGraphData::EntriesInOneRow< long long > > nonlocalRowData_LL_
int InsertNonlocalRow(int row, int offset)
Epetra_CrsGraph * nonlocalGraph_
A CrsGraph holding non-local data in case the respective flag is set in the constructor.
Epetra_FECrsGraph & operator=(const Epetra_FECrsGraph &Graph)
std::map< int_type, Epetra_CrsGraphData::EntriesInOneRow< int_type > > & nonlocalRowData()
bool UseNonlocalGraph() const
int InputNonlocalIndices(int row, int numCols, const int *cols)
Epetra Finite-Element CrsMatrix.
Epetra_Map: A class for partitioning vectors and matrices.
Definition Epetra_Map.h:119