Commit f70335af authored by Timo Koch's avatar Timo Koch
Browse files

[implicit] resize local jacobian if necessay

The local jocabian is sized 1*2^dim x 1*2^dim for the box scheme and 1 x 2*dim for the cc scheme as default. 
Some advances approximation schemes, grids with hanging nodes, mixed dimensional grids require different sizes. 
The actual size was already calculated in implicitlocaljacobian. 
If the actual size is bigger than the default size the matrix is resized accordingly now.



git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@14441 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 5802020d
...@@ -123,15 +123,15 @@ public: ...@@ -123,15 +123,15 @@ public:
problemPtr_ = &problem; problemPtr_ = &problem;
localResidual_.init(problem); localResidual_.init(problem);
// assume quadrilinears as elements with most vertices // assume cubes as elements with most vertices
if (isBox) if (isBox)
{ {
A_.setSize(2<<dim, 2<<dim); A_.setSize(1<<dim, 1<<dim);
storageJacobian_.resize(2<<dim); storageJacobian_.resize(1<<dim);
} }
else else // assume cubes as elements with most faces
{ {
A_.setSize(1, 2<<dim); A_.setSize(1, 2*dim + 1);
storageJacobian_.resize(1); storageJacobian_.resize(1);
} }
} }
...@@ -186,11 +186,17 @@ public: ...@@ -186,11 +186,17 @@ public:
if (isBox) if (isBox)
{ {
numRows = numCols = fvElemGeom_.numScv; numRows = numCols = fvElemGeom_.numScv;
// resize for hanging nodes or lower dimensional grids
if(numRows > 1<<dim || numCols > 1<<dim)
A_.setSize(numRows, numCols);
} }
else else
{ {
numRows = 1; numRows = 1;
numCols = fvElemGeom_.numNeighbors; numCols = fvElemGeom_.numNeighbors;
// resize for hanging nodes or lower dimensional grids
if(numCols > 2*dim + 1)
A_.setSize(numRows, numCols);
} }
ElementSolutionVector partialDeriv(numRows); ElementSolutionVector partialDeriv(numRows);
PrimaryVariables storageDeriv(0.0); PrimaryVariables storageDeriv(0.0);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment