Skip to content

Commit

Permalink
Merge Pull Request #3568 from trilinos/Trilinos/jhu-00b5da7
Browse files Browse the repository at this point in the history
Automatically Merged using Trilinos Pull Request AutoTester
PR Title: TrilinosCouplings: fix issue #3551
PR Author: jhux2
  • Loading branch information
trilinos-autotester authored Oct 6, 2018
2 parents 35ad387 + 00b5da7 commit b5118b1
Showing 1 changed file with 42 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ FiniteElementProblem::FiniteElementProblem(int numGlobalElements, Epetra_Comm& c
OverlapMyGlobalElements[i] = OverlapMinMyGID + i;

OverlapMap = new Epetra_Map(-1, OverlapNumMyElements,
OverlapMyGlobalElements, 0, *Comm);
OverlapMyGlobalElements, 0, *Comm);

delete [] OverlapMyGlobalElements;

Expand Down Expand Up @@ -119,9 +119,9 @@ FiniteElementProblem::~FiniteElementProblem()

// Matrix and Residual Fills
bool FiniteElementProblem::evaluate(FillType f,
const Epetra_Vector* soln,
Epetra_Vector* tmp_rhs,
Epetra_RowMatrix* tmp_matrix)
const Epetra_Vector* soln,
Epetra_Vector* tmp_rhs,
Epetra_RowMatrix* tmp_matrix)
{
flag = f;

Expand Down Expand Up @@ -149,9 +149,9 @@ bool FiniteElementProblem::evaluate(FillType f,

// Declare required variables
int i,j;
#ifndef NDEBUG
int ierr;
#endif
#ifndef NDEBUG
int ierr;
#endif
int OverlapNumMyElements = OverlapMap->NumMyElements();

int OverlapMinMyGID;
Expand Down Expand Up @@ -188,37 +188,37 @@ bool FiniteElementProblem::evaluate(FillType f,
uu[1]=u[ne+1];
// Calculate the basis function at the gauss point
basis.getBasis(gp, xx, uu);
// Loop over Nodes in Element
for (i=0; i< 2; i++) {
row=OverlapMap->GID(ne+i);
//printf("Proc=%d GlobalRow=%d LocalRow=%d Owned=%d\n",
// MyPID, row, ne+i,StandardMap.MyGID(row));
if (StandardMap->MyGID(row)) {
if ((flag == F_ONLY) || (flag == ALL)) {
(*rhs)[StandardMap->LID(OverlapMap->GID(ne+i))]+=
+basis.wt*basis.dx
*((1.0/(basis.dx*basis.dx))*basis.duu*
basis.dphide[i]+factor*basis.uu*basis.uu*basis.phi[i]);
}
}
// Loop over Trial Functions
if ((flag == MATRIX_ONLY) || (flag == ALL)) {
for(j=0;j < 2; j++) {
if (StandardMap->MyGID(row)) {
column=OverlapMap->GID(ne+j);
jac=basis.wt*basis.dx*((1.0/(basis.dx*basis.dx))*
basis.dphide[j]*basis.dphide[i]
+2.0*factor*basis.uu*basis.phi[j]*
basis.phi[i]);
#ifndef NDEBUG
ierr=
#endif
row=OverlapMap->GID(ne+i);
//printf("Proc=%d GlobalRow=%d LocalRow=%d Owned=%d\n",
// MyPID, row, ne+i,StandardMap.MyGID(row));
if (StandardMap->MyGID(row)) {
if ((flag == F_ONLY) || (flag == ALL)) {
(*rhs)[StandardMap->LID(OverlapMap->GID(ne+i))]+=
+basis.wt*basis.dx
*((1.0/(basis.dx*basis.dx))*basis.duu*
basis.dphide[i]+factor*basis.uu*basis.uu*basis.phi[i]);
}
}
// Loop over Trial Functions
if ((flag == MATRIX_ONLY) || (flag == ALL)) {
for(j=0;j < 2; j++) {
if (StandardMap->MyGID(row)) {
column=OverlapMap->GID(ne+j);
jac=basis.wt*basis.dx*((1.0/(basis.dx*basis.dx))*
basis.dphide[j]*basis.dphide[i]
+2.0*factor*basis.uu*basis.phi[j]*
basis.phi[i]);
# ifndef NDEBUG
ierr=
# endif
A->SumIntoGlobalValues(row, 1, &jac, &column);
assert(ierr);
}
}
}
assert(ierr==0);
}
}
}
}
}
}
Expand Down Expand Up @@ -280,13 +280,13 @@ Epetra_CrsGraph& FiniteElementProblem::generateGraph(Epetra_CrsGraph& AA)

// Loop over Trial Functions
for(j=0;j < 2; j++) {
// If this row is owned by current processor, add the index
if (StandardMap->MyGID(row)) {
column=OverlapMap->GID(ne+j);
AA.InsertGlobalIndices(row, 1, &column);
}
}
// If this row is owned by current processor, add the index
if (StandardMap->MyGID(row)) {
column=OverlapMap->GID(ne+j);
AA.InsertGlobalIndices(row, 1, &column);
}
}
}
}
AA.FillComplete();
Expand Down

0 comments on commit b5118b1

Please sign in to comment.