Skip to content
GitLab
Menu
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
951d6ab5
Commit
951d6ab5
authored
Aug 31, 2021
by
Martin Schneider
Browse files
[md][stokesdarcy][box] Introduce volVars wrapper class which mimic elemVolVars
parent
2d684fe1
Changes
2
Hide whitespace changes
Inline
Side-by-side
dumux/multidomain/boundary/stokesdarcy/box/couplingmanager.hh
View file @
951d6ab5
...
...
@@ -152,6 +152,7 @@ private:
template
<
std
::
size_t
id
>
using
GridView
=
typename
GridGeometry
<
id
>::
GridView
;
template
<
std
::
size_t
id
>
using
Element
=
typename
GridView
<
id
>::
template
Codim
<
0
>
::
Entity
;
template
<
std
::
size_t
id
>
using
PrimaryVariables
=
typename
MDTraits
::
template
SubDomain
<
id
>
::
PrimaryVariables
;
template
<
std
::
size_t
id
>
using
SubControlVolume
=
typename
FVElementGeometry
<
id
>::
SubControlVolume
;
template
<
std
::
size_t
id
>
using
SubControlVolumeFace
=
typename
FVElementGeometry
<
id
>::
SubControlVolumeFace
;
using
CellCenterSolutionVector
=
GetPropType
<
StokesTypeTag
,
Properties
::
CellCenterSolutionVector
>
;
...
...
@@ -704,9 +705,16 @@ public:
}
}
const
auto
sol
()
const
//! Return the volume variables of domain i for a given element and scv
template
<
std
::
size_t
i
>
VolumeVariables
<
i
>
volVars
(
Dune
::
index_constant
<
i
>
domainI
,
const
Element
<
i
>&
element
,
const
SubControlVolume
<
i
>&
scv
)
const
{
return
this
->
curSol
();
VolumeVariables
<
i
>
volVars
;
const
auto
elemSol
=
elementSolution
(
element
,
this
->
curSol
()[
domainI
],
this
->
problem
(
domainI
).
gridGeometry
());
volVars
.
update
(
elemSol
,
this
->
problem
(
domainI
),
element
,
scv
);
return
volVars
;
}
const
auto
&
couplingMapper
()
const
...
...
dumux/multidomain/boundary/stokesdarcy/box/projection.hh
View file @
951d6ab5
...
...
@@ -55,6 +55,27 @@ namespace Detail {
}
}
template
<
class
CouplingManager
,
class
Element
,
std
::
size_t
id
>
struct
VolVarsWrapper
{
using
Index
=
Dune
::
index_constant
<
id
>
;
VolVarsWrapper
(
const
CouplingManager
&
cm
,
const
Element
&
element
)
:
cm_
(
cm
),
element_
(
element
),
domainI_
()
{}
template
<
class
SubControlVolume
>
auto
operator
[](
const
SubControlVolume
&
scv
)
const
{
return
cm_
.
volVars
(
domainI_
,
element_
,
scv
);
}
private:
const
CouplingManager
&
cm_
;
const
Element
&
element_
;
Index
domainI_
;
};
template
<
class
MDTraits
,
class
CouplingManager
>
class
Projection
{
...
...
@@ -88,7 +109,6 @@ public:
Scalar
projection
=
0.0
;
auto
domainI
=
Dune
::
index_constant
<
freeFlowIdx
>
();
auto
fvGeometry
=
localView
(
couplingManager
.
problem
(
porousMediumIdx
).
gridGeometry
());
auto
elemVolVars
=
localView
(
darcyElemVolVars
.
gridVolVars
());
// integrate darcy pressure over each coupling facet and average
for
(
const
auto
&
couplingFacet
:
couplingFacets
(
domainI
,
couplingManager
.
couplingMapper
(),
stokesScvf
.
insideScvIdx
(),
stokesScvf
.
localFaceIdx
()))
...
...
@@ -105,7 +125,7 @@ public:
}
else
{
elem
VolVars
.
bind
(
element
,
fvGeometry
,
couplingManager
.
sol
()[
porousMediumIdx
]
);
VolVars
Wrapper
<
CouplingManager
,
Element
<
porousMediumIdx
>
,
porousMediumIdx
>
elemVolVars
(
couplingManager
,
element
);
projection
+=
calculateFacetIntegral
(
element
,
fvGeometry
,
fvGeometry
.
scvf
(
couplingFacet
.
pmScvfIdx
),
elemVolVars
,
couplingFacet
.
geometry
,
evalPriVar
);
}
...
...
@@ -143,11 +163,11 @@ public:
return
projection
;
}
template
<
class
CouplingFacetGeometry
,
class
Function
>
template
<
class
CouplingFacetGeometry
,
class
ElementVolumeVariables
,
class
Function
>
static
Scalar
calculateFacetIntegral
(
const
Element
<
porousMediumIdx
>&
element
,
const
FVElementGeometry
<
porousMediumIdx
>&
fvGeometry
,
const
SubControlVolumeFace
<
porousMediumIdx
>&
scvf
,
const
ElementVolumeVariables
<
porousMediumIdx
>
&
elemVolVars
,
const
ElementVolumeVariables
&
elemVolVars
,
const
CouplingFacetGeometry
&
facetGeometry
,
Function
evalPriVar
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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