Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-tectonic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
podlesny
dune-tectonic
Commits
98f08537
Commit
98f08537
authored
Jun 25, 2019
by
podlesny
Browse files
Options
Downloads
Patches
Plain Diff
.
parent
39b69a16
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/multi-body-problem.cc
+1
-1
1 addition, 1 deletion
src/multi-body-problem.cc
src/spatial-solving/preconditioners/supportpatchfactory.hh
+75
-25
75 additions, 25 deletions
src/spatial-solving/preconditioners/supportpatchfactory.hh
with
76 additions
and
26 deletions
src/multi-body-problem.cc
+
1
−
1
View file @
98f08537
...
@@ -185,7 +185,7 @@ int main(int argc, char *argv[]) {
...
@@ -185,7 +185,7 @@ int main(int argc, char *argv[]) {
const
auto
&
coarseContactNetwork
=
*
contactNetwork
.
level
(
0
);
const
auto
&
coarseContactNetwork
=
*
contactNetwork
.
level
(
0
);
const
auto
&
fineContactNetwork
=
*
contactNetwork
.
level
(
1
);
const
auto
&
fineContactNetwork
=
*
contactNetwork
.
level
(
1
);
SupportPatchFactory
<
typename
ContactNetwork
::
LevelContactNetwork
>
supportPatchFactory
(
coarseContactNetwork
,
fineContactNetwork
);
SupportPatchFactory
<
typename
ContactNetwork
::
LevelContactNetwork
>
supportPatchFactory
(
coarseContactNetwork
,
fineContactNetwork
);
size_t
bodyID
=
1
;
size_t
bodyID
=
2
;
size_t
patchDepth
=
0
;
size_t
patchDepth
=
0
;
std
::
cout
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
;
...
...
This diff is collapsed.
Click to expand it.
src/spatial-solving/preconditioners/supportpatchfactory.hh
+
75
−
25
View file @
98f08537
...
@@ -293,6 +293,15 @@ class SupportPatchFactory
...
@@ -293,6 +293,15 @@ class SupportPatchFactory
return
false
;
return
false
;
};
};
auto
isRPatchIntersection
=
[
this
](
std
::
vector
<
std
::
set
<
size_t
>>&
dofs
,
const
std
::
set
<
size_t
>&
patchVertices
)
{
for
(
auto
&
dof
:
dofs
[
0
])
{
if
(
patchVertices
.
count
(
dof
))
{
return
true
;
}
}
return
false
;
};
// construct coarse patch
// construct coarse patch
std
::
vector
<
BodyElement
>
patchElements
;
std
::
vector
<
BodyElement
>
patchElements
;
patchElements
.
emplace_back
(
seedElement
);
patchElements
.
emplace_back
(
seedElement
);
...
@@ -346,19 +355,28 @@ class SupportPatchFactory
...
@@ -346,19 +355,28 @@ class SupportPatchFactory
if
(
coarseIntersectionMapper_
.
count
(
faceIdx
))
{
if
(
coarseIntersectionMapper_
.
count
(
faceIdx
))
{
const
auto
&
intersections
=
coarseIntersectionMapper_
[
faceIdx
];
const
auto
&
intersections
=
coarseIntersectionMapper_
[
faceIdx
];
for
(
size_t
i
=
0
;
i
<
intersections
.
size
();
i
++
)
{
for
(
size_t
i
=
0
;
i
<
intersections
.
size
();
i
++
)
{
const
auto
&
intersection
=
intersections
[
i
];
const
auto
&
rIs
=
intersection
.
get
(
coarseContactNetwork_
);
BodyElement
neighbor
;
BodyElement
neighbor
;
neighbor
.
set
(
coarseContactNetwork_
,
intersection
s
[
i
]
);
neighbor
.
set
(
coarseContactNetwork_
,
intersection
);
size_t
neighborIdx
=
coarseIndices_
.
elementIndex
(
neighbor
.
bodyID
,
neighbor
.
element
);
size_t
neighborIdx
=
coarseIndices_
.
elementIndex
(
neighbor
.
bodyID
,
neighbor
.
element
);
if
(
visitedElements
.
count
(
neighborIdx
))
if
(
visitedElements
.
count
(
neighborIdx
))
continue
;
continue
;
std
::
cout
<<
"elementID: "
<<
coarseIndices_
.
elementIndex
(
neighbor
.
bodyID
,
neighbor
.
element
)
<<
std
::
endl
;
std
::
vector
<
std
::
set
<
size_t
>>
dofs
;
remoteIntersectionDofs
(
coarseIndices_
,
rIs
,
bodyIdx
,
neighbor
.
bodyID
,
dofs
,
intersection
.
flip
);
patchVertices
.
insert
(
neighborFaceDofs_
[
faceIdx
].
begin
(),
neighborFaceDofs_
[
faceIdx
].
end
());
if
(
isRPatchIntersection
(
dofs
,
patchVertices
))
{
patchVertices
.
insert
(
dofs
[
1
].
begin
(),
dofs
[
1
].
end
());
patchElements
.
emplace_back
(
neighbor
);
patchElements
.
emplace_back
(
neighbor
);
patchSeeds
.
push
(
neighbor
);
patchSeeds
.
push
(
neighbor
);
}
else
{
newPatchVertices
.
insert
(
dofs
[
1
].
begin
(),
dofs
[
1
].
end
());
nextSeeds
.
emplace_back
(
neighbor
);
}
print
(
patchVertices
,
"patchVertices: "
);
print
(
patchVertices
,
"patchVertices: "
);
}
}
...
@@ -418,6 +436,8 @@ class SupportPatchFactory
...
@@ -418,6 +436,8 @@ class SupportPatchFactory
if
(
visited
.
count
(
elemIdx
))
if
(
visited
.
count
(
elemIdx
))
continue
;
continue
;
std
::
cout
<<
"coarse element: "
<<
elemIdx
<<
std
::
endl
;
visited
.
insert
(
elemIdx
);
visited
.
insert
(
elemIdx
);
const
auto
&
grid
=
coarseContactNetwork_
.
body
(
coarseElem
.
bodyID
)
->
gridView
().
grid
();
const
auto
&
grid
=
coarseContactNetwork_
.
body
(
coarseElem
.
bodyID
)
->
gridView
().
grid
();
...
@@ -505,11 +525,7 @@ class SupportPatchFactory
...
@@ -505,11 +525,7 @@ class SupportPatchFactory
const
size_t
outsideID
=
intersection
.
bodyID
;
const
size_t
outsideID
=
intersection
.
bodyID
;
std
::
vector
<
std
::
set
<
size_t
>>
rIsDofs
;
std
::
vector
<
std
::
set
<
size_t
>>
rIsDofs
;
if
(
intersection
.
flip
)
{
remoteIntersectionDofs
(
fineIndices_
,
rIs
,
bodyID
,
outsideID
,
rIsDofs
,
intersection
.
flip
);
remoteIntersectionDofs
(
fineIndices_
,
rIs
,
outsideID
,
bodyID
,
rIsDofs
);
}
else
{
remoteIntersectionDofs
(
fineIndices_
,
rIs
,
bodyID
,
outsideID
,
rIsDofs
);
}
if
(
rIs
.
neighbor
())
{
if
(
rIs
.
neighbor
())
{
Element
outsideFather
;
Element
outsideFather
;
...
@@ -566,7 +582,9 @@ class SupportPatchFactory
...
@@ -566,7 +582,9 @@ class SupportPatchFactory
}
}
template
<
class
RIntersection
>
template
<
class
RIntersection
>
void
remoteIntersectionDofs
(
const
NetworkIndexMapper
&
indices
,
const
RIntersection
&
is
,
const
size_t
insideID
,
const
size_t
outsideID
,
std
::
vector
<
std
::
set
<
size_t
>>&
dofs
)
{
void
remoteIntersectionDofs
(
const
NetworkIndexMapper
&
indices
,
const
RIntersection
&
is
,
const
size_t
insideID
,
const
size_t
outsideID
,
std
::
vector
<
std
::
set
<
size_t
>>&
dofs
,
bool
flip
=
false
)
{
assert
(
!
flip
||
(
flip
&&
is
.
neighbor
()));
dofs
.
resize
(
2
);
dofs
.
resize
(
2
);
dofs
[
0
].
clear
();
dofs
[
0
].
clear
();
dofs
[
1
].
clear
();
dofs
[
1
].
clear
();
...
@@ -574,6 +592,7 @@ class SupportPatchFactory
...
@@ -574,6 +592,7 @@ class SupportPatchFactory
const
auto
&
isGeo
=
is
.
geometry
();
const
auto
&
isGeo
=
is
.
geometry
();
const
auto
&
isRefElement
=
Dune
::
ReferenceElements
<
ctype
,
dim
-
1
>::
general
(
is
.
type
());
const
auto
&
isRefElement
=
Dune
::
ReferenceElements
<
ctype
,
dim
-
1
>::
general
(
is
.
type
());
if
(
!
flip
)
{
const
auto
&
inside
=
is
.
inside
();
const
auto
&
inside
=
is
.
inside
();
const
auto
&
insideGeo
=
inside
.
geometry
();
const
auto
&
insideGeo
=
inside
.
geometry
();
const
auto
&
insideRefElement
=
Dune
::
ReferenceElements
<
ctype
,
dim
>::
general
(
inside
.
type
());
const
auto
&
insideRefElement
=
Dune
::
ReferenceElements
<
ctype
,
dim
>::
general
(
inside
.
type
());
...
@@ -604,6 +623,37 @@ class SupportPatchFactory
...
@@ -604,6 +623,37 @@ class SupportPatchFactory
}
}
}
}
}
}
}
else
{
const
auto
&
inside
=
is
.
outside
();
const
auto
&
insideGeo
=
inside
.
geometry
();
const
auto
&
insideRefElement
=
Dune
::
ReferenceElements
<
ctype
,
dim
>::
general
(
inside
.
type
());
const
int
dimElement
=
Dune
::
ReferenceElements
<
ctype
,
dim
>::
dimension
;
for
(
int
i
=
0
;
i
<
insideRefElement
.
size
(
is
.
indexInOutside
(),
1
,
dimElement
);
i
++
)
{
size_t
idxInElement
=
insideRefElement
.
subEntity
(
is
.
indexInOutside
(),
1
,
i
,
dimElement
);
const
auto
&
localCorner
=
isGeo
.
local
(
insideGeo
.
corner
(
idxInElement
));
if
(
isRefElement
.
checkInside
(
localCorner
))
{
dofs
[
0
].
insert
(
indices
.
vertexIndex
(
insideID
,
inside
,
idxInElement
));
}
}
const
auto
&
outside
=
is
.
inside
();
const
auto
&
outsideGeo
=
outside
.
geometry
();
const
auto
&
outsideRefElement
=
Dune
::
ReferenceElements
<
ctype
,
dim
>::
general
(
outside
.
type
());
for
(
int
i
=
0
;
i
<
outsideRefElement
.
size
(
is
.
indexInInside
(),
1
,
dimElement
);
i
++
)
{
size_t
idxInElement
=
outsideRefElement
.
subEntity
(
is
.
indexInInside
(),
1
,
i
,
dimElement
);
const
auto
&
localCorner
=
isGeo
.
local
(
outsideGeo
.
corner
(
idxInElement
));
if
(
isRefElement
.
checkInside
(
localCorner
))
{
dofs
[
1
].
insert
(
indices
.
vertexIndex
(
outsideID
,
outside
,
idxInElement
));
}
}
}
}
}
template
<
class
Intersection
>
template
<
class
Intersection
>
...
...
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