mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Fixes the laplacian.
As we do not represent dofs on the boundary, we need to make sure that all diagonal values are 4.
This commit is contained in:
parent
8d9cd23722
commit
eda0be1b8c
@ -60,21 +60,18 @@ std::shared_ptr<MyMatrix> createLaplacian(int N)
|
||||
|
||||
int x=row%N;
|
||||
int y=row/N;
|
||||
double dval=0;
|
||||
if(y>0)
|
||||
{
|
||||
mm->colIndex[nnz]=row-N;
|
||||
mm->data[nnz++]=-1;
|
||||
dval+=1;
|
||||
}
|
||||
if(x>0)
|
||||
{
|
||||
mm->colIndex[nnz]=row-1;
|
||||
mm->data[nnz++]=-1;
|
||||
dval+=1;
|
||||
}
|
||||
mm->colIndex[nnz]=row;
|
||||
mm->data[nnz++]=dval+(x<N-1)+(y<N-1);
|
||||
mm->data[nnz++]=4;
|
||||
if(x<N-1)
|
||||
{
|
||||
mm->colIndex[nnz]=row+1;
|
||||
|
Loading…
Reference in New Issue
Block a user