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
9ecee01b
Commit
9ecee01b
authored
1 year ago
by
Dmitri Naumov
Browse files
Options
Downloads
Patches
Plain Diff
[MTL] Extract createPyramid()
parent
fe61f626
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/MeshEditing/MeshRevision.cpp
+25
-7
25 additions, 7 deletions
MeshToolsLib/MeshEditing/MeshRevision.cpp
with
25 additions
and
7 deletions
MeshToolsLib/MeshEditing/MeshRevision.cpp
+
25
−
7
View file @
9ecee01b
...
...
@@ -156,6 +156,25 @@ std::unique_ptr<MeshLib::Element> createPrism(
return
std
::
make_unique
<
MeshLib
::
Prism
>
(
prism_nodes
);
}
std
::
unique_ptr
<
MeshLib
::
Element
>
createPyramid
(
std
::
span
<
MeshLib
::
Node
*
const
>
const
element_nodes
,
std
::
vector
<
MeshLib
::
Node
*>
const
&
nodes
,
std
::
array
<
std
::
size_t
,
5
>
const
local_ids
)
{
using
namespace
MeshLib
::
views
;
auto
lookup_in
=
[](
auto
const
&
values
)
{
return
ranges
::
views
::
transform
([
&
values
](
std
::
size_t
const
n
)
{
return
values
[
n
];
});
};
std
::
array
<
MeshLib
::
Node
*
,
std
::
size
(
local_ids
)
>
prism_nodes
;
ranges
::
copy
(
local_ids
|
lookup_in
(
element_nodes
)
|
ids
|
lookup_in
(
nodes
),
begin
(
prism_nodes
));
return
std
::
make_unique
<
MeshLib
::
Pyramid
>
(
prism_nodes
);
}
/// Subdivides a prism with nonplanar quad faces into two tets.
unsigned
subdividePrism
(
MeshLib
::
Element
const
*
const
prism
,
std
::
vector
<
MeshLib
::
Node
*>
const
&
nodes
,
...
...
@@ -650,13 +669,12 @@ unsigned reduceHex(MeshLib::Element const* const org_elem,
{
const
std
::
array
<
unsigned
,
4
>
base_nodes
(
lutHexCuttingQuadNodes
(
i
,
j
));
std
::
array
const
pyr_nodes
{
nodes
[
org_elem
->
getNode
(
base_nodes
[
0
])
->
getID
()],
nodes
[
org_elem
->
getNode
(
base_nodes
[
1
])
->
getID
()],
nodes
[
org_elem
->
getNode
(
base_nodes
[
2
])
->
getID
()],
nodes
[
org_elem
->
getNode
(
base_nodes
[
3
])
->
getID
()],
nodes
[
org_elem
->
getNode
(
i
)
->
getID
()]};
new_elements
.
push_back
(
new
MeshLib
::
Pyramid
(
pyr_nodes
));
std
::
array
<
std
::
size_t
,
5
>
const
pyr_nodes
=
{
base_nodes
[
0
],
base_nodes
[
1
],
base_nodes
[
2
],
base_nodes
[
3
],
i
};
new_elements
.
push_back
(
createPyramid
(
org_elem
->
nodes
(),
nodes
,
pyr_nodes
)
.
release
());
if
(
i
<
4
&&
j
>=
4
)
{
...
...
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