Epetra Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Epetra_FEVbrMatrix.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_FEVBRMATRIX_H
45 #define EPETRA_FEVBRMATRIX_H
46 
47 #if defined(Epetra_SHOW_DEPRECATED_WARNINGS)
48 #ifdef __GNUC__
49 #warning "The Epetra package is deprecated"
50 #endif
51 #endif
52 
53 
54 
55 #include <Epetra_VbrMatrix.h>
57 
65 class EPETRA_LIB_DLL_EXPORT Epetra_FEVbrMatrix: public Epetra_VbrMatrix {
66  public:
67 
69 
70 
84  const Epetra_BlockMap& RowMap,
85  int *NumBlockEntriesPerRow,
86  bool ignoreNonLocalEntries=false);
87 
89 
103  const Epetra_BlockMap& RowMap,
104  int NumBlockEntriesPerRow,
105  bool ignoreNonLocalEntries=false);
106 
108 
124  const Epetra_BlockMap& RowMap,
125  const Epetra_BlockMap& ColMap,
126  int *NumBlockEntriesPerRow,
127  bool ignoreNonLocalEntries=false);
128 
130 
147  const Epetra_BlockMap& RowMap,
148  const Epetra_BlockMap& ColMap,
149  int NumBlockEntriesPerRow,
150  bool ignoreNonLocalEntries=false);
151 
155  const Epetra_CrsGraph& Graph,
156  bool ignoreNonLocalEntries=false);
157 
160 
162  virtual ~Epetra_FEVbrMatrix();
164 
166 
167 
169 
171 
177  int PutScalar(double ScalarConstant);
178 
180 
190  int BeginInsertGlobalValues(int BlockRow, int NumBlockEntries, int * BlockIndices);
191 
193 
203  int BeginReplaceGlobalValues(int BlockRow, int NumBlockEntries, int *BlockIndices);
204 
206 
216  int BeginSumIntoGlobalValues(int BlockRow, int NumBlockEntries, int *BlockIndices);
217 
218  //Let the compiler know we intend to overload the base-class function
219  //SubmitBlockEntry rather than hide it.
221 
223  /* Submit a block entry that will recorded in the block row that was initiated by one of the
224  Begin routines listed above. Once a one of the following routines: BeginInsertGlobalValues(),
225  BeginInsertMyValues(), BeginReplaceGlobalValues(), BeginReplaceMyValues(), BeginSumIntoGlobalValues(),
226  BeginSumIntoMyValues(), you \e must call SubmitBlockEntry() NumBlockEntries times to register the values
227  corresponding to the block indices passed in to the Begin routine. If the Epetra_VbrMatrix constuctor
228  was called in Copy mode, the values will be copied. However, no copying will be done until the EndSubmitEntries()
229  function is call to complete submission of the current block row. If the constructor was called in View mode, all
230  block entries passed via SubmitBlockEntry() will not be copied, but a pointer will be set to point to the argument Values
231  that was passed in by the user.
232 
233  For performance reasons, SubmitBlockEntry() does minimal processing of data. Any processing that can be
234  delayed is performed in EndSubmitEntries().
235 
236  \param In
237  Values - The starting address of the values.
238  \param In
239  LDA - The stride between successive columns of Values.
240  \param In
241  NumRows - The number of rows passed in.
242  \param In
243  NumCols - The number of columns passed in.
244 
245  \return Integer error code, set to 0 if successful.
246  */
247  int SubmitBlockEntry(double *Values, int LDA, int NumRows, int NumCols);
248 
250 
255  int EndSubmitEntries();
256 
257  int GlobalAssemble(bool callFillComplete=true);
258 
259  private:
260  int SetupForNonlocalSubmits(int BlockRow,
261  int NumBlockEntries,
262  int * BlockIndices,
263  bool IndicesAreLocal,
264  Epetra_CombineMode SubmitMode);
265 
266  int InputNonlocalBlockEntry(double *Values, int LDA,
267  int NumRows, int NumCols);
268 
269  int InsertNonlocalRow(int row, int offset, int numCols);
270 
271  void destroyNonlocalData();
272 
274 
280 
281  //Triple-pointers are gross, but we need one here. We want a 2-D table of
282  //pointer-to-matrix objects. If we only use a double-pointer, it would be
283  //too hard to change the lengths of the rows of the table.
284 
286 
287  //Following the approach Mike uses in Epetra_VbrMatrix, we need some state
288  //variables to keep track of block-entry submits.
292  int* curCols_;
293  int curMode_;
294 };
295 
296 #endif /* EPETRA_FEVBRMATRIX_H */
Epetra_SerialDenseMatrix *** nonlocalCoefs_
int BeginReplaceGlobalValues(int BlockRow, int NumBlockEntries, int *BlockIndices)
Initiate replacement of current values with this list of entries for a given global row of the matrix...
int PutScalar(double ScalarConstant)
Initialize all values in graph of the matrix with constant value.
Epetra_VbrMatrix: A class for the construction and use of real-valued double-precision variable block...
int BeginSumIntoGlobalValues(int BlockRow, int NumBlockEntries, int *BlockIndices)
Initiate summing into current values with this list of entries for a given global row of the matrix...
Epetra_SerialDenseMatrix: A class for constructing and using real double precision general dense matr...
Epetra_BlockMap: A class for partitioning block element vectors and matrices.
int EndSubmitEntries()
Completes processing of all data passed in for the current block row.
Epetra Finite-Element VbrMatrix.
Epetra_CombineMode
int BeginInsertGlobalValues(int BlockRow, int NumBlockEntries, int *BlockIndices)
Initiate insertion of a list of elements in a given global row of the matrix, values are inserted via...
int SubmitBlockEntry(double *Values, int LDA, int NumRows, int NumCols)
Submit a block entry to the indicated block row and column specified in the Begin routine...
Epetra_VbrMatrix & operator=(const Epetra_VbrMatrix &src)
Epetra_DataAccess
Epetra_CrsGraph: A class for constructing and using sparse compressed row graphs. ...