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
Development
openfoam
Commits
0d5283a6
Commit
0d5283a6
authored
Sep 13, 2018
by
Mark OLESEN
Browse files
ENH: added edge::valid() method
- simple check for unique and non-negative point labels
parent
0e8704de
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/meshes/meshShapes/edge/edge.H
View file @
0d5283a6
...
...
@@ -134,6 +134,9 @@ public:
// No special handling of negative point labels.
inline
label
maxVertex
()
const
;
//- Return true if the vertices are unique and non-negative.
inline
bool
valid
()
const
;
//- Return true if point label is found in edge.
// Always false for a negative label.
inline
bool
found
(
const
label
pointLabel
)
const
;
...
...
@@ -146,19 +149,19 @@ public:
// Negative point labels never connect.
inline
bool
connects
(
const
edge
&
other
)
const
;
//- Return vertex common with other
E
dge or -1 on failure
//- Return vertex common with other
e
dge or -1 on failure
// Negative point labels are never considered common between edges.
inline
label
commonVertex
(
const
edge
&
other
)
const
;
//- Given one vertex
index
, return the other one.
//- Given
the point label for
one vertex, return the other one.
// No special treatment for negative point labels.
inline
label
otherVertex
(
const
label
index
)
const
;
inline
label
otherVertex
(
const
label
pointLabel
)
const
;
// Editing
//- 'Collapse' edge by marking duplicate point labels as '-1',
//
the lower vertex is retained.
//
-
the lower vertex is retained.
// Return the effective size after collapsing.
inline
label
collapse
();
...
...
src/OpenFOAM/meshes/meshShapes/edge/edgeI.H
View file @
0d5283a6
...
...
@@ -114,6 +114,12 @@ inline Foam::label Foam::edge::maxVertex() const
}
inline
bool
Foam
::
edge
::
valid
()
const
{
return
(
first
()
!=
second
()
&&
first
()
>=
0
&&
second
()
>=
0
);
}
inline
bool
Foam
::
edge
::
found
(
const
label
pointLabel
)
const
{
// -1: always false
...
...
@@ -166,13 +172,13 @@ inline Foam::label Foam::edge::commonVertex(const edge& other) const
}
inline
Foam
::
label
Foam
::
edge
::
otherVertex
(
const
label
index
)
const
inline
Foam
::
label
Foam
::
edge
::
otherVertex
(
const
label
pointLabel
)
const
{
if
(
index
==
first
())
if
(
pointLabel
==
first
())
{
return
second
();
}
if
(
index
==
second
())
if
(
pointLabel
==
second
())
{
return
first
();
}
...
...
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