Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-foamgrid
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
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
extensions
dune-foamgrid
Commits
033e7a92
Commit
033e7a92
authored
5 years ago
by
Samuel Burbulla
Committed by
Timo Koch
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[gridfactory] Implement wasInserted.
parent
5ae47f09
No related branches found
No related tags found
1 merge request
!59
[gridfactory] Implement insertBoundarySegment.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/foamgrid/foamgrid/foamgridfactory.hh
+37
-0
37 additions, 0 deletions
dune/foamgrid/foamgrid/foamgridfactory.hh
with
37 additions
and
0 deletions
dune/foamgrid/foamgrid/foamgridfactory.hh
+
37
−
0
View file @
033e7a92
...
...
@@ -148,6 +148,19 @@ template <int dimworld>
insertBoundarySegment
(
vertices
);
}
/** \brief Return true if leaf intersection was inserted as boundary segment
*/
bool
wasInserted
(
const
typename
FoamGrid
<
dimgrid
,
dimworld
>::
LeafIntersection
&
intersection
)
const
override
{
if
(
!
intersection
.
boundary
()
)
return
false
;
const
auto
&
vertex
=
intersection
.
inside
().
template
subEntity
<
1
>(
intersection
.
indexInInside
());
const
auto
&
it
=
boundarySegmentIndices_
.
find
(
this
->
insertionIndex
(
vertex
)
);
return
(
it
!=
boundarySegmentIndices_
.
end
());
}
/** \brief Insert an element into the coarse grid
\param type The GeometryType of the new element
\param vertices The vertices of the new element, using the DUNE numbering
...
...
@@ -291,6 +304,30 @@ template <int dimworld>
insertBoundarySegment
(
vertices
);
}
/** \brief Return true if leaf intersection was inserted as boundary segment
*/
bool
wasInserted
(
const
typename
FoamGrid
<
dimgrid
,
dimworld
>::
LeafIntersection
&
intersection
)
const
override
{
if
(
!
intersection
.
boundary
()
)
return
false
;
// obtain the vertices of the intersection by reference element numbering
const
auto
&
vertex0
=
intersection
.
inside
().
template
subEntity
<
2
>(
(
3
-
intersection
.
indexInInside
()
)
%
3
);
const
auto
&
vertex1
=
intersection
.
inside
().
template
subEntity
<
2
>(
(
4
-
intersection
.
indexInInside
()
)
%
3
);
std
::
array
<
unsigned
int
,
2
>
vertexIndices
{{
this
->
insertionIndex
(
vertex0
),
this
->
insertionIndex
(
vertex1
)
}};
// sort the indices
if
(
vertexIndices
[
0
]
>
vertexIndices
[
1
]
)
std
::
swap
(
vertexIndices
[
0
],
vertexIndices
[
1
]
);
const
auto
&
it
=
boundarySegmentIndices_
.
find
(
vertexIndices
);
return
(
it
!=
boundarySegmentIndices_
.
end
());
}
/** \brief Insert an element into the coarse grid
\param type The GeometryType of the new element
\param vertices The vertices of the new element, using the DUNE numbering
...
...
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