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
86f9a7ab
Commit
86f9a7ab
authored
Aug 30, 2019
by
Dennis Gläser
Browse files
Merge branch 'bugfix/assembly-numdiff-explicit' into 'master'
Bugfix/assembly numdiff explicit See merge request
!1707
parents
b0149d6f
fc506a40
Changes
5
Hide whitespace changes
Inline
Side-by-side
dumux/assembly/boxlocalassembler.hh
View file @
86f9a7ab
...
...
@@ -419,6 +419,7 @@ public:
// get the vecor of the acutal element residuals
const
auto
origResiduals
=
this
->
evalLocalResidual
();
const
auto
origStorageResiduals
=
this
->
evalLocalStorageResidual
();
//////////////////////////////////////////////////////////////////////////////////////////////////
// //
...
...
@@ -458,7 +459,7 @@ public:
// derive the residuals numerically
static
const
NumericEpsilon
<
Scalar
,
numEq
>
eps_
{
this
->
problem
().
paramGroup
()};
static
const
int
numDiffMethod
=
getParamFromGroup
<
int
>
(
this
->
problem
().
paramGroup
(),
"Assembly.NumericDifferenceMethod"
);
NumericDifferentiation
::
partialDerivative
(
evalStorage
,
elemSol
[
scv
.
localDofIndex
()][
pvIdx
],
partialDerivs
,
origResiduals
,
NumericDifferentiation
::
partialDerivative
(
evalStorage
,
elemSol
[
scv
.
localDofIndex
()][
pvIdx
],
partialDerivs
,
orig
Storage
Residuals
,
eps_
(
elemSol
[
scv
.
localDofIndex
()][
pvIdx
],
pvIdx
),
numDiffMethod
);
// update the global stiffness matrix with the current partial derivatives
...
...
dumux/assembly/cclocalassembler.hh
View file @
86f9a7ab
...
...
@@ -382,6 +382,7 @@ public:
// assemble the undeflected residual
const
auto
residual
=
this
->
evalLocalResidual
()[
0
];
const
auto
storageResidual
=
this
->
evalLocalStorageResidual
();
//////////////////////////////////////////////////////////////////////////////////////////////////
// Calculate derivatives of all dofs in stencil with respect to the dofs in the element. In the //
...
...
@@ -423,7 +424,7 @@ public:
// the residual with the deflected primary variables
elemSol
[
0
][
pvIdx
]
=
priVar
;
curVolVars
.
update
(
elemSol
,
this
->
problem
(),
element
,
scv
);
return
this
->
evalLocalStorageResidual
()
[
0
]
;
return
this
->
evalLocalStorageResidual
();
};
// for non-ghosts compute the derivative numerically
...
...
@@ -431,7 +432,7 @@ public:
{
static
const
NumericEpsilon
<
Scalar
,
numEq
>
eps_
{
this
->
problem
().
paramGroup
()};
static
const
int
numDiffMethod
=
getParamFromGroup
<
int
>
(
this
->
problem
().
paramGroup
(),
"Assembly.NumericDifferenceMethod"
);
NumericDifferentiation
::
partialDerivative
(
evalStorage
,
elemSol
[
0
][
pvIdx
],
partialDeriv
,
r
esidual
,
NumericDifferentiation
::
partialDerivative
(
evalStorage
,
elemSol
[
0
][
pvIdx
],
partialDeriv
,
storageR
esidual
,
eps_
(
elemSol
[
0
][
pvIdx
],
pvIdx
),
numDiffMethod
);
}
...
...
dumux/multidomain/subdomainboxlocalassembler.hh
View file @
86f9a7ab
...
...
@@ -617,6 +617,7 @@ public:
// get the vector of the actual (undeflected) element residuals
const
auto
origResiduals
=
this
->
evalLocalResidual
();
const
auto
origStorageResiduals
=
this
->
evalLocalStorageResidual
();
//////////////////////////////////////////////////////////////////////////////////////////////////
// Calculate derivatives of all dofs in stencil with respect to the dofs in the element. In the //
...
...
@@ -654,7 +655,7 @@ public:
// derive the residuals numerically
static
const
NumericEpsilon
<
Scalar
,
numEq
>
eps_
{
this
->
problem
().
paramGroup
()};
static
const
int
numDiffMethod
=
getParamFromGroup
<
int
>
(
this
->
problem
().
paramGroup
(),
"Assembly.NumericDifferenceMethod"
);
NumericDifferentiation
::
partialDerivative
(
evalStorage
,
elemSol
[
scv
.
localDofIndex
()][
pvIdx
],
partialDerivs
,
origResiduals
,
NumericDifferentiation
::
partialDerivative
(
evalStorage
,
elemSol
[
scv
.
localDofIndex
()][
pvIdx
],
partialDerivs
,
orig
Storage
Residuals
,
eps_
(
elemSol
[
scv
.
localDofIndex
()][
pvIdx
],
pvIdx
),
numDiffMethod
);
// update the global stiffness matrix with the current partial derivatives
...
...
dumux/multidomain/subdomaincclocalassembler.hh
View file @
86f9a7ab
...
...
@@ -614,6 +614,7 @@ public:
// assemble the undeflected residual
const
auto
residual
=
this
->
evalLocalResidual
()[
0
];
const
auto
storageResidual
=
this
->
evalLocalStorageResidual
();
//////////////////////////////////////////////////////////////////////////////////////////////////
// Calculate derivatives of all dofs in stencil with respect to the dofs in the element. In the //
...
...
@@ -654,7 +655,7 @@ public:
// the residual with the deflected primary variables
elemSol
[
0
][
pvIdx
]
=
priVar
;
curVolVars
.
update
(
elemSol
,
this
->
problem
(),
element
,
scv
);
return
this
->
evalLocalStorageResidual
()
[
0
]
;
return
this
->
evalLocalStorageResidual
();
};
// for non-ghosts compute the derivative numerically
...
...
@@ -662,7 +663,7 @@ public:
{
static
const
NumericEpsilon
<
Scalar
,
numEq
>
eps_
{
this
->
problem
().
paramGroup
()};
static
const
int
numDiffMethod
=
getParamFromGroup
<
int
>
(
this
->
problem
().
paramGroup
(),
"Assembly.NumericDifferenceMethod"
);
NumericDifferentiation
::
partialDerivative
(
evalStorage
,
elemSol
[
0
][
pvIdx
],
partialDeriv
,
r
esidual
,
NumericDifferentiation
::
partialDerivative
(
evalStorage
,
elemSol
[
0
][
pvIdx
],
partialDeriv
,
storageR
esidual
,
eps_
(
elemSol
[
0
][
pvIdx
],
pvIdx
),
numDiffMethod
);
}
...
...
test/multidomain/facet/tracer_tracer/params.input
View file @
86f9a7ab
...
...
@@ -27,4 +27,4 @@ SpatialParams.Porosity = 0.9
OutputName = test_md_facet_tracertracer
[Assembly]
NumericDifference.BaseEpsilon = 1e10
NumericDifference.BaseEpsilon = 1e
-
10
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