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
f76e2f79
Commit
f76e2f79
authored
10 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
surface extrusions now handle embedded points/edges
parent
1c77588c
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
Geo/GFace.cpp
+20
-0
20 additions, 0 deletions
Geo/GFace.cpp
Geo/GFace.h
+3
-1
3 additions, 1 deletion
Geo/GFace.h
Mesh/meshGFaceExtruded.cpp
+12
-4
12 additions, 4 deletions
Mesh/meshGFaceExtruded.cpp
Mesh/meshGRegionExtruded.cpp
+12
-3
12 additions, 3 deletions
Mesh/meshGRegionExtruded.cpp
with
47 additions
and
8 deletions
Geo/GFace.cpp
+
20
−
0
View file @
f76e2f79
...
@@ -276,6 +276,26 @@ surface_params GFace::getSurfaceParams() const
...
@@ -276,6 +276,26 @@ surface_params GFace::getSurfaceParams() const
return
p
;
return
p
;
}
}
std
::
vector
<
MVertex
*>
GFace
::
getEmbeddedMeshVertices
()
const
{
std
::
set
<
MVertex
*>
tmp
;
for
(
std
::
list
<
GEdge
*>::
const_iterator
it
=
embedded_edges
.
begin
();
it
!=
embedded_edges
.
end
();
it
++
){
tmp
.
insert
((
*
it
)
->
mesh_vertices
.
begin
(),
(
*
it
)
->
mesh_vertices
.
end
());
tmp
.
insert
((
*
it
)
->
getBeginVertex
()
->
mesh_vertices
.
begin
(),
(
*
it
)
->
getBeginVertex
()
->
mesh_vertices
.
end
());
tmp
.
insert
((
*
it
)
->
getEndVertex
()
->
mesh_vertices
.
begin
(),
(
*
it
)
->
getEndVertex
()
->
mesh_vertices
.
end
());
}
for
(
std
::
list
<
GVertex
*>::
const_iterator
it
=
embedded_vertices
.
begin
();
it
!=
embedded_vertices
.
end
();
it
++
){
tmp
.
insert
((
*
it
)
->
mesh_vertices
.
begin
(),
(
*
it
)
->
mesh_vertices
.
end
());
}
std
::
vector
<
MVertex
*>
res
;
res
.
insert
(
res
.
end
(),
tmp
.
begin
(),
tmp
.
end
());
return
res
;
}
std
::
list
<
GVertex
*>
GFace
::
vertices
()
const
std
::
list
<
GVertex
*>
GFace
::
vertices
()
const
{
{
std
::
set
<
GVertex
*>
v
;
std
::
set
<
GVertex
*>
v
;
...
...
This diff is collapsed.
Click to expand it.
Geo/GFace.h
+
3
−
1
View file @
f76e2f79
...
@@ -121,6 +121,8 @@ class GFace : public GEntity
...
@@ -121,6 +121,8 @@ class GFace : public GEntity
// edges that are embedded in the face
// edges that are embedded in the face
virtual
std
::
list
<
GVertex
*>
embeddedVertices
()
const
{
return
embedded_vertices
;
}
virtual
std
::
list
<
GVertex
*>
embeddedVertices
()
const
{
return
embedded_vertices
;
}
std
::
vector
<
MVertex
*>
getEmbeddedMeshVertices
()
const
;
// vertices that bound the face
// vertices that bound the face
virtual
std
::
list
<
GVertex
*>
vertices
()
const
;
virtual
std
::
list
<
GVertex
*>
vertices
()
const
;
...
...
This diff is collapsed.
Click to expand it.
Mesh/meshGFaceExtruded.cpp
+
12
−
4
View file @
f76e2f79
...
@@ -152,9 +152,16 @@ static void copyMesh(GFace *from, GFace *to, MVertexRTree &pos)
...
@@ -152,9 +152,16 @@ static void copyMesh(GFace *from, GFace *to, MVertexRTree &pos)
{
{
ExtrudeParams
*
ep
=
to
->
meshAttributes
.
extrude
;
ExtrudeParams
*
ep
=
to
->
meshAttributes
.
extrude
;
// create vertices
// interior vertices
for
(
unsigned
int
i
=
0
;
i
<
from
->
mesh_vertices
.
size
();
i
++
){
std
::
vector
<
MVertex
*>
mesh_vertices
=
from
->
mesh_vertices
;
MVertex
*
v
=
from
->
mesh_vertices
[
i
];
// add all embedded vertices
std
::
vector
<
MVertex
*>
embedded
=
from
->
getEmbeddedMeshVertices
();
mesh_vertices
.
insert
(
mesh_vertices
.
end
(),
embedded
.
begin
(),
embedded
.
end
());
// create extruded vertices
for
(
unsigned
int
i
=
0
;
i
<
mesh_vertices
.
size
();
i
++
){
MVertex
*
v
=
mesh_vertices
[
i
];
double
x
=
v
->
x
(),
y
=
v
->
y
(),
z
=
v
->
z
();
double
x
=
v
->
x
(),
y
=
v
->
y
(),
z
=
v
->
z
();
ep
->
Extrude
(
ep
->
mesh
.
NbLayer
-
1
,
ep
->
mesh
.
NbElmLayer
[
ep
->
mesh
.
NbLayer
-
1
],
ep
->
Extrude
(
ep
->
mesh
.
NbLayer
-
1
,
ep
->
mesh
.
NbElmLayer
[
ep
->
mesh
.
NbLayer
-
1
],
x
,
y
,
z
);
x
,
y
,
z
);
...
@@ -261,8 +268,9 @@ int MeshExtrudedSurface(GFace *gf,
...
@@ -261,8 +268,9 @@ int MeshExtrudedSurface(GFace *gf,
// if the edges of the mesh are constrained, the vertices already
// if the edges of the mesh are constrained, the vertices already
// exist on the face--so we add them to the set
// exist on the face--so we add them to the set
if
(
constrainedEdges
)
if
(
constrainedEdges
)
{
pos
.
insert
(
gf
->
mesh_vertices
);
pos
.
insert
(
gf
->
mesh_vertices
);
}
if
(
ep
->
geo
.
Mode
==
EXTRUDED_ENTITY
)
{
if
(
ep
->
geo
.
Mode
==
EXTRUDED_ENTITY
)
{
// surface is extruded from a curve
// surface is extruded from a curve
...
...
This diff is collapsed.
Click to expand it.
Mesh/meshGRegionExtruded.cpp
+
12
−
3
View file @
f76e2f79
...
@@ -136,9 +136,16 @@ static void extrudeMesh(GFace *from, GRegion *to, MVertexRTree &pos)
...
@@ -136,9 +136,16 @@ static void extrudeMesh(GFace *from, GRegion *to, MVertexRTree &pos)
{
{
ExtrudeParams
*
ep
=
to
->
meshAttributes
.
extrude
;
ExtrudeParams
*
ep
=
to
->
meshAttributes
.
extrude
;
// create vertices
// interior vertices
for
(
unsigned
int
i
=
0
;
i
<
from
->
mesh_vertices
.
size
();
i
++
){
std
::
vector
<
MVertex
*>
mesh_vertices
=
from
->
mesh_vertices
;
MVertex
*
v
=
from
->
mesh_vertices
[
i
];
// add all embedded vertices
std
::
vector
<
MVertex
*>
embedded
=
from
->
getEmbeddedMeshVertices
();
mesh_vertices
.
insert
(
mesh_vertices
.
end
(),
embedded
.
begin
(),
embedded
.
end
());
// create extruded vertices
for
(
unsigned
int
i
=
0
;
i
<
mesh_vertices
.
size
();
i
++
){
MVertex
*
v
=
mesh_vertices
[
i
];
for
(
int
j
=
0
;
j
<
ep
->
mesh
.
NbLayer
;
j
++
)
{
for
(
int
j
=
0
;
j
<
ep
->
mesh
.
NbLayer
;
j
++
)
{
for
(
int
k
=
0
;
k
<
ep
->
mesh
.
NbElmLayer
[
j
];
k
++
)
{
for
(
int
k
=
0
;
k
<
ep
->
mesh
.
NbElmLayer
[
j
];
k
++
)
{
double
x
=
v
->
x
(),
y
=
v
->
y
(),
z
=
v
->
z
();
double
x
=
v
->
x
(),
y
=
v
->
y
(),
z
=
v
->
z
();
...
@@ -194,6 +201,8 @@ static void insertAllVertices(GRegion *gr, MVertexRTree &pos)
...
@@ -194,6 +201,8 @@ static void insertAllVertices(GRegion *gr, MVertexRTree &pos)
std
::
list
<
GFace
*>::
iterator
itf
=
faces
.
begin
();
std
::
list
<
GFace
*>::
iterator
itf
=
faces
.
begin
();
while
(
itf
!=
faces
.
end
()){
while
(
itf
!=
faces
.
end
()){
pos
.
insert
((
*
itf
)
->
mesh_vertices
);
pos
.
insert
((
*
itf
)
->
mesh_vertices
);
std
::
vector
<
MVertex
*>
embedded
=
(
*
itf
)
->
getEmbeddedMeshVertices
();
pos
.
insert
(
embedded
);
std
::
list
<
GEdge
*>
edges
=
(
*
itf
)
->
edges
();
std
::
list
<
GEdge
*>
edges
=
(
*
itf
)
->
edges
();
std
::
list
<
GEdge
*>::
iterator
ite
=
edges
.
begin
();
std
::
list
<
GEdge
*>::
iterator
ite
=
edges
.
begin
();
while
(
ite
!=
edges
.
end
()){
while
(
ite
!=
edges
.
end
()){
...
...
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