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
Özgür Ozan Sen
ogs
Commits
e649c352
Commit
e649c352
authored
1 year ago
by
Dmitri Naumov
Browse files
Options
Downloads
Patches
Plain Diff
[MTL] Use ids view_closure simplifying code
parent
fe04c976
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
MeshToolsLib/MeshSurfaceExtraction.cpp
+7
-9
7 additions, 9 deletions
MeshToolsLib/MeshSurfaceExtraction.cpp
with
7 additions
and
9 deletions
MeshToolsLib/MeshSurfaceExtraction.cpp
+
7
−
9
View file @
e649c352
...
@@ -277,10 +277,9 @@ MeshLib::Mesh* MeshSurfaceExtraction::getMeshSurface(
...
@@ -277,10 +277,9 @@ MeshLib::Mesh* MeshSurfaceExtraction::getMeshSurface(
std
::
for_each
(
sfc_elements
.
begin
(),
sfc_elements
.
end
(),
std
::
for_each
(
sfc_elements
.
begin
(),
sfc_elements
.
end
(),
[](
MeshLib
::
Element
*
e
)
{
delete
e
;
});
[](
MeshLib
::
Element
*
e
)
{
delete
e
;
});
std
::
vector
<
std
::
size_t
>
id_map
;
auto
sfc_node_ids
=
sfc_nodes
|
MeshLib
::
views
::
ids
;
id_map
.
reserve
(
sfc_nodes
.
size
());
std
::
vector
<
std
::
size_t
>
const
id_map
(
sfc_node_ids
.
begin
(),
std
::
transform
(
begin
(
sfc_nodes
),
end
(
sfc_nodes
),
std
::
back_inserter
(
id_map
),
sfc_node_ids
.
end
());
[](
MeshLib
::
Node
*
const
n
)
{
return
n
->
getID
();
});
MeshLib
::
Mesh
*
result
(
new
MeshLib
::
Mesh
(
subsfc_mesh
.
getName
()
+
"-Surface"
,
MeshLib
::
Mesh
*
result
(
new
MeshLib
::
Mesh
(
subsfc_mesh
.
getName
()
+
"-Surface"
,
sfc_nodes
,
new_elements
));
sfc_nodes
,
new_elements
));
...
@@ -500,11 +499,10 @@ std::unique_ptr<MeshLib::Mesh> getBoundaryElementsAsMesh(
...
@@ -500,11 +499,10 @@ std::unique_ptr<MeshLib::Mesh> getBoundaryElementsAsMesh(
delete
e
;
delete
e
;
}
}
std
::
vector
<
std
::
size_t
>
nodes_to_bulk_nodes_id_map
;
auto
boundary_node_ids
=
boundary_nodes
|
MeshLib
::
views
::
ids
;
nodes_to_bulk_nodes_id_map
.
reserve
(
boundary_nodes
.
size
());
std
::
transform
(
begin
(
boundary_nodes
),
end
(
boundary_nodes
),
std
::
vector
<
std
::
size_t
>
const
nodes_to_bulk_nodes_id_map
(
std
::
back_inserter
(
nodes_to_bulk_nodes_id_map
),
boundary_node_ids
.
begin
(),
boundary_node_ids
.
end
());
[](
MeshLib
::
Node
*
const
n
)
{
return
n
->
getID
();
});
std
::
unique_ptr
<
MeshLib
::
Mesh
>
boundary_mesh
(
new
MeshLib
::
Mesh
(
std
::
unique_ptr
<
MeshLib
::
Mesh
>
boundary_mesh
(
new
MeshLib
::
Mesh
(
bulk_mesh
.
getName
()
+
"-boundary"
,
boundary_nodes
,
new_elements
));
bulk_mesh
.
getName
()
+
"-boundary"
,
boundary_nodes
,
new_elements
));
...
...
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