Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
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
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Dmitri Naumov
ogs
Commits
487d2b27
Commit
487d2b27
authored
10 years ago
by
Karsten Rink
Browse files
Options
Downloads
Patches
Plain Diff
added method to test if element is located on boundary
parent
5f40d823
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
MeshLib/Elements/Element.cpp
+5
-0
5 additions, 0 deletions
MeshLib/Elements/Element.cpp
MeshLib/Elements/Element.h
+2
-0
2 additions, 0 deletions
MeshLib/Elements/Element.h
Tests/MeshLib/TestQuadMesh.cpp
+3
-0
3 additions, 0 deletions
Tests/MeshLib/TestQuadMesh.cpp
with
10 additions
and
0 deletions
MeshLib/Elements/Element.cpp
+
5
−
0
View file @
487d2b27
...
...
@@ -163,6 +163,11 @@ bool Element::hasNeighbor(Element* elem) const
return
false
;
}
bool
Element
::
isBoundaryElement
()
const
{
return
std
::
any_of
(
_neighbors
,
_neighbors
+
this
->
getNNeighbors
(),
[](
MeshLib
::
Element
*
e
){
return
e
==
nullptr
;
});
}
}
This diff is collapsed.
Click to expand it.
MeshLib/Elements/Element.h
+
2
−
0
View file @
487d2b27
...
...
@@ -148,6 +148,8 @@ public:
*/
bool
hasZeroVolume
()
const
{
return
this
->
getContent
()
<
std
::
numeric_limits
<
double
>::
epsilon
();
}
/// Returns true if the element is located at a boundary (i.e. has at least one face without neighbour)
virtual
bool
isBoundaryElement
()
const
;
/// Returns true if these two indeces form an edge and false otherwise
virtual
bool
isEdge
(
unsigned
i
,
unsigned
j
)
const
=
0
;
...
...
This diff is collapsed.
Click to expand it.
Tests/MeshLib/TestQuadMesh.cpp
+
3
−
0
View file @
487d2b27
...
...
@@ -209,6 +209,7 @@ TEST_F(MeshLibQuadMesh, ElementNeighbors)
// Test the test
EXPECT_EQ
(
1u
,
ij_neighbors
.
first
.
size
());
EXPECT_EQ
(
1u
,
ij_neighbors
.
second
.
size
());
ASSERT_TRUE
(
e
->
isBoundaryElement
());
testNeighbors
(
e
,
i
,
j
,
ij_neighbors
);
});
...
...
@@ -222,6 +223,7 @@ TEST_F(MeshLibQuadMesh, ElementNeighbors)
std
::
pair
<
Indices
,
Indices
>
const
ij_neighbors
=
getNeighborIndices
(
i
,
j
);
// Test the test
EXPECT_EQ
(
3u
,
ij_neighbors
.
first
.
size
()
+
ij_neighbors
.
second
.
size
());
ASSERT_TRUE
(
e
->
isBoundaryElement
());
testNeighbors
(
e
,
i
,
j
,
ij_neighbors
);
});
...
...
@@ -236,6 +238,7 @@ TEST_F(MeshLibQuadMesh, ElementNeighbors)
// Test the test
EXPECT_EQ
(
2u
,
ij_neighbors
.
first
.
size
());
EXPECT_EQ
(
2u
,
ij_neighbors
.
second
.
size
());
ASSERT_FALSE
(
e
->
isBoundaryElement
());
testNeighbors
(
e
,
i
,
j
,
ij_neighbors
);
});
...
...
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