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
1f27a85f
Commit
1f27a85f
authored
6 years ago
by
Timo Koch
Browse files
Options
Downloads
Patches
Plain Diff
[temp] Integration point source box
parent
3b88002a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2173
WIP: Coupling concepts 1d3d (old)
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dumux/multidomain/embedded/integrationpointsource.hh
+44
-19
44 additions, 19 deletions
dumux/multidomain/embedded/integrationpointsource.hh
with
44 additions
and
19 deletions
dumux/multidomain/embedded/integrationpointsource.hh
+
44
−
19
View file @
1f27a85f
...
...
@@ -122,32 +122,57 @@ public:
// loop over all intersected elements
for
(
unsigned
int
eIdx
:
entities
)
{
if
(
FVGridGeometry
::
discMethod
==
DiscretizationMethod
::
box
)
if
constexpr
(
FVGridGeometry
::
discMethod
==
DiscretizationMethod
::
box
)
{
// check in which subcontrolvolume(s) we are
const
auto
element
=
fvGridGeometry
.
boundingBoxTree
().
entitySet
().
entity
(
eIdx
);
auto
fvGeometry
=
localView
(
fvGridGeometry
);
fvGeometry
.
bindElement
(
element
);
const
auto
globalPos
=
source
.
position
();
// loop over all sub control volumes and check if the point source is inside
constexpr
int
dim
=
FVGridGeometry
::
GridView
::
dimension
;
Dune
::
ReservedVector
<
std
::
size_t
,
1
<<
dim
>
scvIndices
;
for
(
auto
&&
scv
:
scvs
(
fvGeometry
))
if
(
intersectsPointGeometry
(
globalPos
,
scv
.
geometry
()))
scvIndices
.
push_back
(
scv
.
indexInElement
());
// for all scvs that where tested positiv add the point sources
// to the element/scv to point source map
for
(
auto
scvIdx
:
scvIndices
)
static
const
bool
boxPointSourceLumping
=
getParam
<
bool
>
(
"MixedDimension.EnableBoxPointSourceLumping"
,
true
);
if
(
boxPointSourceLumping
)
{
// loop over all sub control volumes and check if the point source is inside
constexpr
int
dim
=
FVGridGeometry
::
GridView
::
dimension
;
Dune
::
ReservedVector
<
std
::
size_t
,
1
<<
dim
>
scvIndices
;
for
(
auto
&&
scv
:
scvs
(
fvGeometry
))
if
(
intersectsPointGeometry
(
globalPos
,
scv
.
geometry
()))
scvIndices
.
push_back
(
scv
.
indexInElement
());
// for all scvs that where tested positiv add the point sources
// to the element/scv to point source map
for
(
auto
scvIdx
:
scvIndices
)
{
const
auto
key
=
std
::
make_pair
(
eIdx
,
scvIdx
);
if
(
pointSourceMap
.
count
(
key
))
pointSourceMap
.
at
(
key
).
push_back
(
source
);
else
pointSourceMap
.
insert
({
key
,
{
source
}});
// split equally on the number of matched scvs
auto
&
s
=
pointSourceMap
.
at
(
key
).
back
();
s
.
setEmbeddings
(
scvIndices
.
size
()
*
s
.
embeddings
());
}
}
// distribute the sources according to the basis function weights
else
{
const
auto
key
=
std
::
make_pair
(
eIdx
,
scvIdx
);
if
(
pointSourceMap
.
count
(
key
))
pointSourceMap
.
at
(
key
).
push_back
(
source
);
else
pointSourceMap
.
insert
({
key
,
{
source
}});
// split equally on the number of matched scvs
auto
&
s
=
pointSourceMap
.
at
(
key
).
back
();
s
.
setEmbeddings
(
scvIndices
.
size
()
*
s
.
embeddings
());
using
Scalar
=
std
::
decay_t
<
decltype
(
source
.
values
()[
0
])
>
;
using
ShapeValues
=
std
::
vector
<
typename
Dune
::
FieldVector
<
Scalar
,
1
>>
;
ShapeValues
shapeValues
;
const
auto
&
localBasis
=
fvGeometry
.
feLocalBasis
();
const
auto
ipLocal
=
element
.
geometry
().
local
(
globalPos
);
localBasis
.
evaluateFunction
(
ipLocal
,
shapeValues
);
for
(
auto
&&
scv
:
scvs
(
fvGeometry
))
{
const
auto
key
=
std
::
make_pair
(
eIdx
,
scv
.
indexInElement
());
if
(
pointSourceMap
.
count
(
key
))
pointSourceMap
.
at
(
key
).
push_back
(
source
);
else
pointSourceMap
.
insert
({
key
,
{
source
}});
auto
&
s
=
pointSourceMap
.
at
(
key
).
back
();
s
*=
shapeValues
[
scv
.
indexInElement
()];
}
}
}
else
...
...
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