Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dumux-repositories
dumux
Commits
e321d3f5
Commit
e321d3f5
authored
Jan 10, 2019
by
Melanie Lipp
Browse files
Weigh the Dirichlet boundary condition 1 in the Jacobian matrix by a mean diagonal value.
parent
d9fae490
Changes
2
Hide whitespace changes
Inline
Side-by-side
dumux/discretization/staggered/fvgridgeometry.hh
View file @
e321d3f5
...
...
@@ -431,6 +431,8 @@ public:
// bool dofOnBoundary(unsigned int dofIdx) const
// { return boundaryScvfDofIndices_[dofIdx]; }
//! Returns a pointer the cell center specific auxiliary class. Required for the multi-domain FVAssembler's ctor.
std
::
unique_ptr
<
CellCenterFVGridGeometry
<
ThisType
>>
cellCenterFVGridGeometryPtr
()
const
{
...
...
dumux/multidomain/fvassembler.hh
View file @
e321d3f5
...
...
@@ -175,6 +175,38 @@ public:
auto
&
subRes
=
(
*
residual_
)[
domainId
];
this
->
assembleJacobianAndResidual_
(
domainId
,
jacRow
,
subRes
,
curSol
);
});
static
constexpr
auto
cellCenterIdx
=
Dune
::
index_constant
<
0
>
();
static
constexpr
auto
faceIdx
=
Dune
::
index_constant
<
1
>
();
Scalar
diagSum
=
0
;
auto
&
zeroBlock
=
(
*
jacobian_
)[
cellCenterIdx
][
cellCenterIdx
];
// for (unsigned int i = 0; i < zeroBlock.M(); ++i)
// {
// diagSum += zeroBlock[i][i];
// }
auto
&
oneBlock
=
(
*
jacobian_
)[
faceIdx
][
faceIdx
];
for
(
unsigned
int
i
=
0
;
i
<
oneBlock
.
M
();
++
i
)
{
diagSum
+=
oneBlock
[
i
][
i
];
}
Scalar
averageDiagElement
=
diagSum
/
(
zeroBlock
.
M
()
+
oneBlock
.
M
());
std
::
cout
<<
std
::
endl
<<
"averageDiagElement = "
<<
averageDiagElement
<<
std
::
endl
;
for
(
unsigned
int
i
=
0
;
i
<
oneBlock
.
M
();
++
i
)
{
const
auto
prob
=
problem
(
faceIdx
);
const
auto
boundaryScvfsIndexSet
=
prob
.
fvGridGeometry
().
dirichletBoundaryScvfsIndexSet
(
prob
);
if
(
std
::
find
(
boundaryScvfsIndexSet
.
begin
(),
boundaryScvfsIndexSet
.
end
(),
i
)
!=
boundaryScvfsIndexSet
.
end
()){
oneBlock
[
i
][
i
]
=
averageDiagElement
;
(
*
residual_
)[
faceIdx
][
i
]
*=
averageDiagElement
;
}
}
}
//! compute the residuals using the internal residual
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment