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
1af69331
Commit
1af69331
authored
6 years ago
by
Dennis Gläser
Browse files
Options
Downloads
Patches
Plain Diff
[mpfa][localassemblerbase] add function to compute scv-wise gradients
parent
b2ab39d0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1325
Feature/mpfa-scv-gradient-reconstruction
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dumux/discretization/cellcentered/mpfa/localassemblerbase.hh
+43
-0
43 additions, 0 deletions
dumux/discretization/cellcentered/mpfa/localassemblerbase.hh
with
43 additions
and
0 deletions
dumux/discretization/cellcentered/mpfa/localassemblerbase.hh
+
43
−
0
View file @
1af69331
...
...
@@ -161,6 +161,49 @@ class InteractionVolumeAssemblerBase
return
u
;
}
/*!
* \brief Assembles the solution gradients in the
* sub-control volumes within an interaction volume.
* \note This requires the data handle to be fully assembled already.
*
* \param handle The data handle in which the vector is stored
* \param iv The interaction volume
*/
template
<
class
DataHandle
,
class
IV
>
static
std
::
vector
<
typename
IV
::
Traits
::
LocalScvType
::
GlobalCoordinate
>
assembleScvGradients
(
const
DataHandle
&
handle
,
const
IV
&
iv
)
{
const
auto
u
=
assembleFaceUnkowns
(
handle
,
iv
);
using
LocalScv
=
typename
IV
::
Traits
::
LocalScvType
;
using
Gradient
=
typename
LocalScv
::
GlobalCoordinate
;
std
::
vector
<
Gradient
>
result
;
result
.
reserve
(
iv
.
numScvs
());
for
(
unsigned
int
scvIdx
=
0
;
scvIdx
<
iv
.
numScvs
();
++
scvIdx
)
{
const
auto
&
scv
=
iv
.
localScv
(
scvIdx
);
Gradient
gradU
(
0.0
);
for
(
unsigned
int
dir
=
0
;
dir
<
LocalScv
::
myDimension
;
++
dir
)
{
auto
nu
=
scv
.
nu
(
dir
);
// obtain face pressure
const
auto
&
scvf
=
iv
.
localScvf
(
scv
.
localScvfIndex
(
dir
)
);
const
auto
faceU
=
!
scvf
.
isDirichlet
()
?
u
[
scvf
.
localDofIndex
()]
:
handle
.
uj
()[
scvf
.
localDofIndex
()];
nu
*=
faceU
-
handle
.
uj
()[
scv
.
localDofIndex
()];
gradU
+=
nu
;
}
gradU
/=
scv
.
detX
();
result
.
emplace_back
(
std
::
move
(
gradU
)
);
}
return
result
;
}
/*!
* \brief Assembles the gravitational flux contributions on the scvfs within an
* interaction volume.
...
...
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