55 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES // FIXME
61 int *NumBlockEntriesPerRow,
62 bool ignoreNonLocalEntries)
64 ignoreNonLocalEntries_(ignoreNonLocalEntries),
65 numNonlocalBlockRows_(0),
66 nonlocalBlockRows_(NULL),
67 nonlocalBlockRowLengths_(NULL),
68 nonlocalBlockRowAllocLengths_(NULL),
69 nonlocalBlockCols_(NULL),
82 int NumBlockEntriesPerRow,
83 bool ignoreNonLocalEntries)
85 ignoreNonLocalEntries_(ignoreNonLocalEntries),
86 numNonlocalBlockRows_(0),
87 nonlocalBlockRows_(NULL),
88 nonlocalBlockRowLengths_(NULL),
89 nonlocalBlockRowAllocLengths_(NULL),
90 nonlocalBlockCols_(NULL),
104 int *NumBlockEntriesPerRow,
105 bool ignoreNonLocalEntries)
107 ignoreNonLocalEntries_(ignoreNonLocalEntries),
108 numNonlocalBlockRows_(0),
109 nonlocalBlockRows_(NULL),
110 nonlocalBlockRowLengths_(NULL),
111 nonlocalBlockRowAllocLengths_(NULL),
112 nonlocalBlockCols_(NULL),
113 nonlocalCoefs_(NULL),
126 int NumBlockEntriesPerRow,
127 bool ignoreNonLocalEntries)
129 ignoreNonLocalEntries_(ignoreNonLocalEntries),
130 numNonlocalBlockRows_(0),
131 nonlocalBlockRows_(NULL),
132 nonlocalBlockRowLengths_(NULL),
133 nonlocalBlockRowAllocLengths_(NULL),
134 nonlocalBlockCols_(NULL),
135 nonlocalCoefs_(NULL),
147 bool ignoreNonLocalEntries)
149 ignoreNonLocalEntries_(ignoreNonLocalEntries),
150 numNonlocalBlockRows_(0),
151 nonlocalBlockRows_(NULL),
152 nonlocalBlockRowLengths_(NULL),
153 nonlocalBlockRowAllocLengths_(NULL),
154 nonlocalBlockCols_(NULL),
155 nonlocalCoefs_(NULL),
167 ignoreNonLocalEntries_(src.ignoreNonLocalEntries_),
168 numNonlocalBlockRows_(0),
169 nonlocalBlockRows_(NULL),
170 nonlocalBlockRowLengths_(NULL),
171 nonlocalBlockRowAllocLengths_(NULL),
172 nonlocalBlockCols_(NULL),
173 nonlocalCoefs_(NULL),
238 numNonlocalBlockRows_ = 0;
252 double* values = A.
A();
255 for(
int k=0; k<lda*n; ++k) {
256 values[k] = ScalarConstant;
269 if(callFillComplete) {
297 pointRowsPerNonlocalBlockRow,
300 delete [] pointRowsPerNonlocalBlockRow;
305 if(callFillComplete) {
315 int numCols = 0, allocLen = 0;
317 int* pointColsPerBlockCol = NULL;
318 int ptColAllocLen = 0;
319 int insertPoint = -1;
327 numCols, allocLen) );
328 int tmpNumCols = numCols-1;
331 pointColsPerBlockCol,
332 tmpNumCols, ptColAllocLen) );
338 pointColsPerBlockCol,
342 delete [] pointColsPerBlockCol;
390 if(callFillComplete) {
401 int NumRows,
int NumCols)
413 if (coloffset < 0)
return(-1);
417 if (subblock == NULL) {
423 if (subblock == NULL) {
428 int nrows = subblock->
M();
429 int ncols = subblock->
N();
430 if (nrows != NumRows || ncols != NumCols) {
434 int Target_LDA = subblock->
LDA();
435 int Source_LDA = LDA;
436 double* tptr = subblock->
A();
437 double* sptr = values;
439 for(
int j=0; j<NumCols; ++j) {
440 for(
int i=0; i<NumRows; ++i) {
449 for(
int j=0; j<NumCols; ++j) {
450 for(
int i=0; i<NumRows; ++i) {
474 int tmp2 = alloc_len - 1;
481 int initialAllocLen = numCols*2;
490 if (newCols == NULL || newCoefs == NULL) {
494 newCols[offset] =
new int[initialAllocLen];
497 for(
int j=0; j<initialAllocLen; ++j) {
498 newCols[offset][j] = 0;
526 int myRow =
LRID(BlockRow);
535 BlockIndices,
false,
Add) );
543 int myRow =
LRID(BlockRow);
552 BlockIndices,
false,
Insert) );
560 int myRow =
LRID(BlockRow);
569 BlockIndices,
false,
Add) );
576 bool indicesAreLocal,
579 (void)indicesAreLocal;
585 int insertPoint = -1;
594 rowoffset = insertPoint;
599 for(
int i=0; i<NumBlockEntries; ++i) {
600 int col = BlockIndices[i];
623 curCols_ =
new int[NumBlockEntries];
624 for(
int j=0; j<NumBlockEntries; ++j) {
670 #endif // EPETRA_NO_32BIT_GLOBAL_INDICES
const Epetra_BlockMap & RangeMap() const
Returns the Epetra_BlockMap object associated with the range of this matrix operator.
Epetra_SerialDenseMatrix *** nonlocalCoefs_
int * nonlocalBlockRowLengths_
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 GlobalAssemble(bool callFillComplete=true)
const Epetra_CrsGraph & Graph() const
Returns a pointer to the Epetra_CrsGraph object associated with this matrix.
int PutScalar(double ScalarConstant)
Initialize all values in graph of the matrix with constant value.
long long NumGlobalElements64() const
virtual ~Epetra_FEVbrMatrix()
Epetra_VbrMatrix Destructor.
void destroyNonlocalData()
#define EPETRA_CHK_ERR(a)
int * nonlocalBlockRowAllocLengths_
Epetra_Export: This class builds an export object for efficient exporting of off-processor elements...
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_FEVbrMatrix & operator=(const Epetra_FEVbrMatrix &src)
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...
const Epetra_Comm & Comm() const
Fills a matrix with rows from a source matrix based on the specified importer.
const Epetra_BlockMap & Map() const
Map() method inherited from Epetra_DistObject.
int SetupForNonlocalSubmits(int BlockRow, int NumBlockEntries, int *BlockIndices, bool IndicesAreLocal, Epetra_CombineMode SubmitMode)
double * A() const
Returns pointer to the this matrix.
const Epetra_BlockMap & DomainMap() const
Returns the Epetra_BlockMap object associated with the domain of this matrix operator.
int Export(const Epetra_SrcDistObject &A, const Epetra_Import &Importer, Epetra_CombineMode CombineMode, const Epetra_OffsetIndex *Indexor=0)
Exports an Epetra_DistObject using the Epetra_Import object.
void SetIndicesAreGlobal(bool Flag)
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...
int LRID(int GRID_in) const
Returns the local row index for given global row index, returns -1 if no local row for this global ro...
int InsertNonlocalRow(int row, int offset, int numCols)
Epetra_BlockMap: A class for partitioning block element vectors and matrices.
const Epetra_BlockMap & RowMap() const
Returns the RowMap object as an Epetra_BlockMap (the Epetra_Map base class) needed for implementing E...
int EndSubmitEntries()
Completes processing of all data passed in for the current block row.
int EndSubmitEntries()
Completes processing of all data passed in for the current block row.
int numNonlocalBlockRows_
int Epetra_Util_binary_search(T item, const T *list, int len, int &insertPoint)
Utility function to perform a binary-search on a list of data.
int InputNonlocalBlockEntry(double *Values, int LDA, int NumRows, int NumCols)
int LDA() const
Returns the leading dimension of the this matrix.
Epetra Finite-Element VbrMatrix.
int IndexBase() const
Returns the index base for row and column indices for this graph.
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...
int FillComplete()
Signal that data entry is complete, perform transformations to local index space. ...
int ** nonlocalBlockCols_
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_FEVbrMatrix(Epetra_DataAccess CV, const Epetra_BlockMap &RowMap, int *NumBlockEntriesPerRow, bool ignoreNonLocalEntries=false)
Epetra_FEVbrMatrix constuctor with variable number of indices per row.
int N() const
Returns column dimension of system.
Epetra_VbrMatrix & operator=(const Epetra_VbrMatrix &src)
bool ignoreNonLocalEntries_
int M() const
Returns row dimension of system.
int PutScalar(double ScalarConstant)
Initialize all values in graph of the matrix with constant value.
Epetra_CrsGraph: A class for constructing and using sparse compressed row graphs. ...
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 Epetra_Util_insert(T item, int offset, T *&list, int &usedLength, int &allocatedLength, int allocChunkSize=32)
Function to insert an item in a list, at a specified offset.