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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
d3c83604
Commit
d3c83604
authored
15 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
extractVolume could miss some full (sub)elements for non-simplices
parent
71295301
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
Plugin/Levelset.cpp
+26
-24
26 additions, 24 deletions
Plugin/Levelset.cpp
with
26 additions
and
24 deletions
Plugin/Levelset.cpp
+
26
−
24
View file @
d3c83604
...
...
@@ -291,6 +291,32 @@ void GMSH_LevelsetPlugin::_cutAndAddElements(PViewData *vdata, PViewData *wdata,
// Remove identical nodes (this can happen if an edge actually
// belongs to the zero levelset, i.e., if levels[] * levels[] == 0)
if
(
np
>
1
)
removeIdenticalNodes
(
&
np
,
numComp
,
xp
,
yp
,
zp
,
valp
,
ep
);
// if there are no cuts and we extract the volume, save the full
// element if it is on the correct side of the levelset
if
(
np
<=
1
&&
_extractVolume
){
bool
add
=
true
;
for
(
int
nod
=
0
;
nod
<
nsn
;
nod
++
){
if
((
_extractVolume
<
0.
&&
levels
[
n
[
nod
]]
>
0.
)
||
(
_extractVolume
>
0.
&&
levels
[
n
[
nod
]]
<
0.
)){
add
=
false
;
break
;
}
}
if
(
add
){
double
xp
[
12
],
yp
[
12
],
zp
[
12
],
valp
[
12
][
9
];
for
(
int
nod
=
0
;
nod
<
nsn
;
nod
++
){
xp
[
nod
]
=
x
[
n
[
nod
]];
yp
[
nod
]
=
y
[
n
[
nod
]];
zp
[
nod
]
=
z
[
n
[
nod
]];
for
(
int
comp
=
0
;
comp
<
numComp
;
comp
++
)
wdata
->
getValue
(
wstep
,
ent
,
ele
,
nod
,
comp
,
valp
[
n
[
nod
]][
comp
]);
}
_addElement
(
step
,
nsn
,
nse
,
numComp
,
xp
,
yp
,
zp
,
valp
,
out
);
}
continue
;
}
if
(
numEdges
>
4
&&
np
<
3
)
// 3D input should only lead to 2D output
continue
;
else
if
(
numEdges
>
1
&&
np
<
2
)
// 2D input should only lead to 1D output
...
...
@@ -365,30 +391,6 @@ void GMSH_LevelsetPlugin::_cutAndAddElements(PViewData *vdata, PViewData *wdata,
_addElement
(
step
,
np
,
numEdges
,
numComp
,
xp
,
yp
,
zp
,
valp
,
out
);
}
if
(
_extractVolume
){
// if we compute isovolumes, add full elements that are completely
// on one side
bool
add
=
true
;
for
(
int
nod
=
0
;
nod
<
numNodes
;
nod
++
){
if
((
_extractVolume
<
0.
&&
levels
[
nod
]
>
0.
)
||
(
_extractVolume
>
0.
&&
levels
[
nod
]
<
0.
)){
add
=
false
;
break
;
}
}
if
(
add
){
double
xp
[
12
],
yp
[
12
],
zp
[
12
],
valp
[
12
][
9
];
for
(
int
nod
=
0
;
nod
<
numNodes
;
nod
++
){
xp
[
nod
]
=
x
[
nod
];
yp
[
nod
]
=
y
[
nod
];
zp
[
nod
]
=
z
[
nod
];
for
(
int
comp
=
0
;
comp
<
numComp
;
comp
++
)
wdata
->
getValue
(
wstep
,
ent
,
ele
,
nod
,
comp
,
valp
[
nod
][
comp
]);
}
_addElement
(
step
,
numNodes
,
numEdges
,
numComp
,
xp
,
yp
,
zp
,
valp
,
out
);
}
}
}
PView
*
GMSH_LevelsetPlugin
::
execute
(
PView
*
v
)
...
...
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