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
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
Yuhao Liu
ogs
Commits
19508d76
Commit
19508d76
authored
9 years ago
by
Dmitri Naumov
Browse files
Options
Downloads
Patches
Plain Diff
[MeL] Rename and document searchByElementIDs.
parent
b3be7658
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/MeshEditing/RemoveMeshComponents.cpp
+1
-1
1 addition, 1 deletion
MeshLib/MeshEditing/RemoveMeshComponents.cpp
MeshLib/MeshSearch/NodeSearch.cpp
+5
-2
5 additions, 2 deletions
MeshLib/MeshSearch/NodeSearch.cpp
MeshLib/MeshSearch/NodeSearch.h
+2
-8
2 additions, 8 deletions
MeshLib/MeshSearch/NodeSearch.h
with
8 additions
and
11 deletions
MeshLib/MeshEditing/RemoveMeshComponents.cpp
+
1
−
1
View file @
19508d76
...
@@ -63,7 +63,7 @@ MeshLib::Mesh* removeElements(const MeshLib::Mesh& mesh, const std::vector<std::
...
@@ -63,7 +63,7 @@ MeshLib::Mesh* removeElements(const MeshLib::Mesh& mesh, const std::vector<std::
// delete unused nodes
// delete unused nodes
NodeSearch
ns
(
mesh
);
NodeSearch
ns
(
mesh
);
ns
.
searchBy
Element
ID
s
(
removed_element_ids
);
ns
.
markNodesConnectedTo
Elements
(
removed_element_ids
);
auto
&
removed_node_ids
(
ns
.
getSearchedNodeIDs
());
auto
&
removed_node_ids
(
ns
.
getSearchedNodeIDs
());
INFO
(
"Removing total %d nodes..."
,
removed_node_ids
.
size
());
INFO
(
"Removing total %d nodes..."
,
removed_node_ids
.
size
());
for
(
auto
nodeid
:
removed_node_ids
)
for
(
auto
nodeid
:
removed_node_ids
)
...
...
This diff is collapsed.
Click to expand it.
MeshLib/MeshSearch/NodeSearch.cpp
+
5
−
2
View file @
19508d76
...
@@ -24,7 +24,8 @@ NodeSearch::NodeSearch(const MeshLib::Mesh &mesh)
...
@@ -24,7 +24,8 @@ NodeSearch::NodeSearch(const MeshLib::Mesh &mesh)
{
{
}
}
std
::
vector
<
std
::
size_t
>
NodeSearch
::
searchByElementIDsMatchAllConnectedElements
(
const
std
::
vector
<
std
::
size_t
>
&
elements
)
std
::
size_t
NodeSearch
::
markNodesConnectedToElements
(
const
std
::
vector
<
std
::
size_t
>
&
elements
)
{
{
// Find out by how many elements a node would be removed.
// Find out by how many elements a node would be removed.
//
//
...
@@ -49,7 +50,9 @@ std::vector<std::size_t> NodeSearch::searchByElementIDsMatchAllConnectedElements
...
@@ -49,7 +50,9 @@ std::vector<std::size_t> NodeSearch::searchByElementIDsMatchAllConnectedElements
if
(
node_marked_counts
[
i
]
==
_mesh
.
getNode
(
i
)
->
getElements
().
size
())
if
(
node_marked_counts
[
i
]
==
_mesh
.
getNode
(
i
)
->
getElements
().
size
())
connected_nodes
.
push_back
(
i
);
connected_nodes
.
push_back
(
i
);
}
}
return
connected_nodes
;
this
->
updateUnion
(
connected_nodes
);
return
connected_nodes
.
size
();
}
}
std
::
size_t
NodeSearch
::
searchUnused
()
std
::
size_t
NodeSearch
::
searchUnused
()
...
...
This diff is collapsed.
Click to expand it.
MeshLib/MeshSearch/NodeSearch.h
+
2
−
8
View file @
19508d76
...
@@ -30,14 +30,8 @@ public:
...
@@ -30,14 +30,8 @@ public:
const
std
::
vector
<
std
::
size_t
>&
getSearchedNodeIDs
()
const
{
return
_marked_nodes
;
}
const
std
::
vector
<
std
::
size_t
>&
getSearchedNodeIDs
()
const
{
return
_marked_nodes
;
}
/// Marks all nodes connected to any of the given elements ids.
/// Marks all nodes connected to any of the given elements ids.
std
::
size_t
searchByElementIDs
(
const
std
::
vector
<
std
::
size_t
>
&
element_ids
)
/// \return number of connected nodes.
{
std
::
size_t
markNodesConnectedToElements
(
const
std
::
vector
<
std
::
size_t
>
&
element_ids
);
std
::
vector
<
std
::
size_t
>
connected_nodes
=
searchByElementIDsMatchAllConnectedElements
(
element_ids
);
this
->
updateUnion
(
connected_nodes
);
return
connected_nodes
.
size
();
}
/// Marks all unused nodes
/// Marks all unused nodes
std
::
size_t
searchUnused
();
std
::
size_t
searchUnused
();
...
...
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