Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
5d13ab62
Commit
5d13ab62
authored
Jan 19, 2012
by
Gaetan Bricteux
Browse files
Options
Downloads
Patches
Plain Diff
fix cut3D with physicals
parent
2f92ad59
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Geo/MElementCut.cpp
+24
-8
24 additions, 8 deletions
Geo/MElementCut.cpp
with
24 additions
and
8 deletions
Geo/MElementCut.cpp
+
24
−
8
View file @
5d13ab62
...
...
@@ -537,7 +537,8 @@ static void assignLsPhysical(GModel *GM, int reg, int dim,
if
(
!
physicals
[
dim
][
reg
].
count
(
physTag
)){
std
::
stringstream
strs
;
strs
<<
lsTag
;
physicals
[
dim
][
reg
][
physTag
]
=
"levelset_"
+
strs
.
str
();
std
::
string
sdim
=
(
dim
==
2
)
?
"S"
:
"L"
;
physicals
[
dim
][
reg
][
physTag
]
=
"levelset_"
+
sdim
+
strs
.
str
();
if
(
physTag
!=
lsTag
)
Msg
::
Info
(
"Levelset %d -> physical %d"
,
lsTag
,
physTag
);
}
...
...
@@ -1070,11 +1071,18 @@ static void elementCutMesh(MElement *e, std::vector<gLevelset *> &RPN,
}
else
tri
=
new
MTriangle
(
mv
[
0
],
mv
[
1
],
mv
[
2
],
++
numEle
,
ePart
);
int
lsTag
=
triangles
[
i
]
->
lsTag
();
int
c
=
elements
[
2
].
count
(
lsTag
)
+
elements
[
3
].
count
(
lsTag
)
+
elements
[
8
].
count
(
lsTag
);
int
cR
=
elements
[
2
].
count
(
lsTag
)
+
elements
[
3
].
count
(
lsTag
)
+
elements
[
8
].
count
(
lsTag
);
int
cP
=
0
;
for
(
std
::
map
<
int
,
std
::
map
<
int
,
std
::
string
>
>::
iterator
it
=
physicals
[
2
].
begin
();
it
!=
physicals
[
2
].
end
();
it
++
)
for
(
std
::
map
<
int
,
std
::
string
>::
iterator
it2
=
it
->
second
.
begin
();
it2
!=
it
->
second
.
end
();
it2
++
)
if
(
it2
->
first
==
lsTag
)
{
cP
=
1
;
break
;}
// the surfaces are cut before the volumes!
int
reg
=
getBorderTag
(
lsTag
,
c
,
newElemTags
[
2
][
0
],
borderElemTags
[
1
]);
int
reg
=
getBorderTag
(
lsTag
,
c
R
,
newElemTags
[
2
][
0
],
borderElemTags
[
1
]);
int
physTag
=
(
!
gePhysicals
.
size
())
?
0
:
getBorderTag
(
lsTag
,
c
,
newPhysTags
[
2
][
0
],
borderPhysTags
[
1
]);
getBorderTag
(
lsTag
,
c
P
,
newPhysTags
[
2
][
0
],
borderPhysTags
[
1
]);
elements
[
2
][
reg
].
push_back
(
tri
);
if
(
physTag
)
assignLsPhysical
(
GM
,
reg
,
2
,
physicals
,
physTag
,
lsTag
);
...
...
@@ -1285,11 +1293,18 @@ static void elementCutMesh(MElement *e, std::vector<gLevelset *> &RPN,
}
else
lin
=
new
MLine
(
mv
[
0
],
mv
[
1
],
++
numEle
,
ePart
);
int
lsTag
=
lines
[
i
]
->
lsTag
();
int
c
=
elements
[
1
].
count
(
lsTag
);
int
cR
=
elements
[
1
].
count
(
lsTag
);
int
cP
=
0
;
for
(
std
::
map
<
int
,
std
::
map
<
int
,
std
::
string
>
>::
iterator
it
=
physicals
[
1
].
begin
();
it
!=
physicals
[
2
].
end
();
it
++
)
for
(
std
::
map
<
int
,
std
::
string
>::
iterator
it2
=
it
->
second
.
begin
();
it2
!=
it
->
second
.
end
();
it2
++
)
if
(
it2
->
first
==
lsTag
)
{
cP
=
1
;
break
;}
// the lines are cut before the surfaces!
int
reg
=
getBorderTag
(
lsTag
,
c
,
newElemTags
[
1
][
0
],
borderElemTags
[
0
]);
int
reg
=
getBorderTag
(
lsTag
,
c
R
,
newElemTags
[
1
][
0
],
borderElemTags
[
0
]);
int
physTag
=
(
!
gePhysicals
.
size
())
?
0
:
getBorderTag
(
lsTag
,
c
,
newPhysTags
[
1
][
0
],
borderPhysTags
[
0
]);
getBorderTag
(
lsTag
,
c
P
,
newPhysTags
[
1
][
0
],
borderPhysTags
[
0
]);
elements
[
1
][
reg
].
push_back
(
lin
);
if
(
physTag
)
assignLsPhysical
(
GM
,
reg
,
1
,
physicals
,
physTag
,
lsTag
);
...
...
@@ -1501,7 +1516,8 @@ GModel *buildCutMesh(GModel *gm, gLevelset *ls,
}
// Create elementary and physical for non connected border lines
if
(
borders
[
0
].
size
()
>
nbBorders
&&
gmEntities
[
i
]
->
dim
()
==
2
){
if
(
borders
[
0
].
size
()
>
nbBorders
&&
gmEntities
[
i
]
->
dim
()
==
2
&&
i
==
gm
->
getNumVertices
()
+
gm
->
getNumEdges
()
+
gm
->
getNumFaces
()
-
1
){
int
k
=
0
;
for
(
std
::
map
<
int
,
std
::
vector
<
MElement
*>
>::
iterator
it
=
elements
[
1
].
begin
();
it
!=
elements
[
1
].
end
();
it
++
){
...
...
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