Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dumux-repositories
dumux
Commits
238cd72e
Commit
238cd72e
authored
9 years ago
by
Dennis Gläser
Committed by
Timo Koch
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[Implicit] Further adjust the local residual to new structure
parent
d31536fe
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!617
[WIP] Next
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dumux/implicit/localresidual.hh
+5
-71
5 additions, 71 deletions
dumux/implicit/localresidual.hh
with
5 additions
and
71 deletions
dumux/implicit/localresidual.hh
+
5
−
71
View file @
238cd72e
...
...
@@ -85,8 +85,6 @@ public:
*/
void
eval
(
const
Element
&
element
)
{
fvElemGeomPtr_
=
&
model_
().
fvGeometries
(
model_
().
elementMapper
().
index
(
element
));
ElementBoundaryTypes
bcTypes
;
bcTypes
.
update
(
problem_
(),
element
,
fvGeometry_
());
...
...
@@ -105,7 +103,6 @@ public:
void
evalStorage
(
const
Element
&
element
)
{
elemPtr_
=
&
element
;
fvElemGeomPtr_
=
&
model_
().
fvGeometries
(
model_
().
elementMapper
().
index
(
element
));
ElementBoundaryTypes
bcTypes
;
bcTypes
.
update
(
problem_
(),
element
,
fvGeometry_
());
...
...
@@ -125,7 +122,6 @@ public:
void
evalFluxes
(
const
Element
&
element
)
{
elemPtr_
=
&
element
;
fvElemGeomPtr_
=
&
model_
().
fvGeometries
(
model_
().
elementMapper
().
index
(
element
));
ElementBoundaryTypes
bcTypes
;
bcTypes
.
update
(
problem_
(),
element
,
fvGeometry_
());
...
...
@@ -154,21 +150,9 @@ public:
* vertices of the element
*/
void
eval
(
const
Element
&
element
,
const
FVElementGeometry
&
fvGeometry
,
const
ElementBoundaryTypes
&
bcTypes
)
{
Valgrind
::
CheckDefined
(
prevVolVars
);
Valgrind
::
CheckDefined
(
curVolVars
);
#if !defined NDEBUG && HAVE_VALGRIND
for
(
unsigned
int
i
=
0
;
i
<
prevVolVars
.
size
();
i
++
)
{
prevVolVars
[
i
].
checkDefined
();
curVolVars
[
i
].
checkDefined
();
}
#endif // HAVE_VALGRIND
elemPtr_
=
&
element
;
fvElemGeomPtr_
=
&
fvGeometry
;
bcTypesPtr_
=
&
bcTypes
;
// resize the vectors for all terms
...
...
@@ -179,7 +163,7 @@ public:
residual_
=
0.0
;
storageTerm_
=
0.0
;
asImp_
().
evalFluxes_
();
evalFluxes_
();
#if !defined NDEBUG && HAVE_VALGRIND
for
(
int
i
=
0
;
i
<
fvGeometry_
().
numScv
;
i
++
)
...
...
@@ -193,14 +177,6 @@ public:
Valgrind
::
CheckDefined
(
residual_
[
i
]);
}
#endif // HAVE_VALGRIND
// evaluate the boundary conditions
asImp_
().
evalBoundary_
();
#if !defined NDEBUG && HAVE_VALGRIND
for
(
int
i
=
0
;
i
<
fvGeometry_
().
numScv
;
i
++
)
Valgrind
::
CheckDefined
(
residual_
[
i
]);
#endif // HAVE_VALGRIND
}
/*!
...
...
@@ -274,18 +250,14 @@ protected:
// calculate the mass flux over the scv faces and subtract
for
(
auto
&&
scvFace
:
fvGeometry_
().
scvfs
())
{
PrimaryVariables
flux
;
Valgrind
::
SetUndefined
(
flux
);
this
->
asImp_
().
computeFlux_
(
flux
,
scvFace
);
Valgrind
::
CheckDefined
(
flux
);
PrimaryVariables
flux
=
asImp_
().
computeFlux_
(
flux
,
scvFace
);
if
(
!
isBox
)
residual_
[
0
]
+=
flux
;
else
{
auto
&
insideScv
=
problem_
().
fvGeometries
().
subControlVolume
(
scvFace
.
insideScvIdx
());
auto
&
outsideScv
=
problem_
().
fvGeometries
().
subControlVolume
(
scvFace
.
outsideScvIdx
());
const
auto
&
insideScv
=
problem_
().
fvGeometries
().
subControlVolume
(
scvFace
.
insideScvIdx
());
const
auto
&
outsideScv
=
problem_
().
fvGeometries
().
subControlVolume
(
scvFace
.
outsideScvIdx
());
residual
[
insideScv
.
indexInElement
()]
+=
flux
;
residual
[
outsideScv
.
indexInElement
()]
-=
flux
;
...
...
@@ -293,38 +265,6 @@ protected:
}
}
/*!
* \brief Evaluate the boundary conditions
* of the current element.
*/
void
evalBoundary_
()
{
// Dirichlet boundary conditions are treated differently
// depending on the spatial discretization: for box,
// they are incorporated in a strong sense, whereas for
// cell-centered, they are treated by means of fluxes.
if
(
GET_PROP_VALUE
(
TypeTag
,
ImplicitIsBox
))
{
if
(
bcTypes_
().
hasNeumann
()
||
bcTypes_
().
hasOutflow
())
asImp_
().
evalBoundaryFluxes_
();
if
(
bcTypes_
().
hasDirichlet
())
asImp_
().
evalDirichlet_
();
}
else
{
asImp_
().
evalBoundaryFluxes_
();
// additionally treat mixed D/N conditions in a strong sense
if
(
bcTypes_
().
hasDirichlet
())
asImp_
().
evalDirichlet_
();
}
#if !defined NDEBUG && HAVE_VALGRIND
for
(
int
i
=
0
;
i
<
fvGeometry_
().
numScv
;
i
++
)
Valgrind
::
CheckDefined
(
residual_
[
i
]);
#endif // HAVE_VALGRIND
}
void
evalDirichlet_
()
{
...
...
@@ -440,8 +380,7 @@ protected:
*/
const
FVElementGeometry
&
fvGeometry_
()
const
{
Valgrind
::
CheckDefined
(
fvElemGeomPtr_
);
return
*
fvElemGeomPtr_
;
return
model_
().
fvGeometries
(
element_
());
}
/*!
...
...
@@ -499,11 +438,6 @@ protected:
Problem
*
problemPtr_
;
const
Element
*
elemPtr_
;
const
FVElementGeometry
*
fvElemGeomPtr_
;
// current and previous secondary variables for the element
const
ElementVolumeVariables
*
prevVolVarsPtr_
;
const
ElementVolumeVariables
*
curVolVarsPtr_
;
const
ElementBoundaryTypes
*
bcTypesPtr_
;
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment