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
d1c5bbce
Commit
d1c5bbce
authored
17 years ago
by
Jean-François Remacle
Browse files
Options
Downloads
Patches
Plain Diff
*** empty log message ***
parent
49fd68f7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Geo/gmshVertex.cpp
+9
-0
9 additions, 0 deletions
Geo/gmshVertex.cpp
Mesh/meshGFace.cpp
+94
-2
94 additions, 2 deletions
Mesh/meshGFace.cpp
with
103 additions
and
2 deletions
Geo/gmshVertex.cpp
+
9
−
0
View file @
d1c5bbce
#include
"GFace.h"
#include
"GEdge.h"
#include
"gmshVertex.h"
#include
"Geo.h"
#include
"GeoInterpolation.h"
...
...
@@ -10,6 +11,14 @@ SPoint2 gmshVertex::reparamOnFace(GFace *face, int dir) const
Surface
*
s
=
(
Surface
*
)
face
->
getNativePtr
();
if
(
s
->
geometry
)
{
// It is not always right if it is periodic.
if
(
l_edges
.
size
()
==
1
&&
(
*
l_edges
.
begin
())
->
getBeginVertex
()
==
(
*
l_edges
.
begin
())
->
getEndVertex
()
)
{
Range
<
double
>
bb
=
(
*
l_edges
.
begin
())
->
parBounds
(
0
);
return
(
*
l_edges
.
begin
())
->
reparamOnFace
(
face
,
bb
.
low
(),
dir
);
}
return
v
->
pntOnGeometry
;
}
if
(
s
->
Typ
==
MSH_SURF_REGL
){
...
...
This diff is collapsed.
Click to expand it.
Mesh/meshGFace.cpp
+
94
−
2
View file @
d1c5bbce
// $Id: meshGFace.cpp,v 1.9
2
2007-10-11
08:59:2
2 remacle Exp $
// $Id: meshGFace.cpp,v 1.9
3
2007-10-11
13:42:1
2 remacle Exp $
//
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
//
...
...
@@ -39,6 +39,91 @@ extern Context_T CTX;
static
double
SCALINGU
=
1
,
SCALINGV
=
1
;
void
remeshUnrecoveredEdges
(
std
::
set
<
EdgeToRecover
>
&
edgesNotRecovered
,
std
::
list
<
GFace
*>
&
facesToRemesh
)
{
facesToRemesh
.
clear
();
deMeshGFace
dem
;
std
::
set
<
EdgeToRecover
>::
iterator
itr
=
edgesNotRecovered
.
begin
();
for
(
;
itr
!=
edgesNotRecovered
.
end
()
;
++
itr
)
{
std
::
list
<
GFace
*>
l_faces
=
itr
->
ge
->
faces
();
// Un-mesh model faces adjacent to the model edge
for
(
std
::
list
<
GFace
*>::
iterator
it
=
l_faces
.
begin
()
;
it
!=
l_faces
.
end
();
++
it
)
{
if
((
*
it
)
->
triangles
.
size
()
||
(
*
it
)
->
quadrangles
.
size
())
{
facesToRemesh
.
push_back
(
*
it
);
dem
(
*
it
);
}
}
//-----------------------------------------------------
// add a new point in the middle of the intersecting segment
int
p1
=
itr
->
p1
;
int
p2
=
itr
->
p2
;
int
index
=
0
;
int
N
=
itr
->
ge
->
lines
.
size
();
GVertex
*
g1
=
itr
->
ge
->
getBeginVertex
();
GVertex
*
g2
=
itr
->
ge
->
getEndVertex
();
Range
<
double
>
bb
=
itr
->
ge
->
parBounds
(
0
);
std
::
vector
<
MLine
*>
newLines
;
for
(
int
i
=
0
;
i
<
N
;
i
++
){
MVertex
*
v1
=
itr
->
ge
->
lines
[
i
]
->
getVertex
(
0
);
MVertex
*
v2
=
itr
->
ge
->
lines
[
i
]
->
getVertex
(
1
);
if
(
v1
->
getNum
()
==
p1
&&
v2
->
getNum
()
==
p2
||
v1
->
getNum
()
==
p2
&&
v2
->
getNum
()
==
p1
)
{
double
t1
;
double
lc1
=
-
1
;
if
(
v1
->
onWhat
()
==
g1
)
t1
=
bb
.
low
();
else
if
(
v1
->
onWhat
()
==
g2
)
t1
=
bb
.
high
();
else
{
MEdgeVertex
*
ev1
=
(
MEdgeVertex
*
)
v1
;
lc1
=
ev1
->
getLc
();
v1
->
getParameter
(
0
,
t1
);
}
double
t2
;
double
lc2
=
-
1
;
if
(
v2
->
onWhat
()
==
g1
)
t2
=
bb
.
low
();
else
if
(
v2
->
onWhat
()
==
g2
)
t2
=
bb
.
high
();
else
{
MEdgeVertex
*
ev2
=
(
MEdgeVertex
*
)
v2
;
lc2
=
ev2
->
getLc
();
v2
->
getParameter
(
0
,
t2
);
}
if
(
lc1
==
-
1
)
lc1
=
BGM_MeshSize
(
v1
->
onWhat
(),
0
,
0
,
v1
->
x
(),
v1
->
y
(),
v1
->
z
());
if
(
lc2
==
-
1
)
lc2
=
BGM_MeshSize
(
v2
->
onWhat
(),
0
,
0
,
v2
->
x
(),
v2
->
y
(),
v2
->
z
());
// should be better, i.e. equidistant
double
t
=
0.5
*
(
t2
+
t1
);
double
lc
=
0.5
*
(
lc1
+
lc2
);
GPoint
V
=
itr
->
ge
->
point
(
t
);
MEdgeVertex
*
newv
=
new
MEdgeVertex
(
V
.
x
(),
V
.
y
(),
V
.
z
(),
itr
->
ge
,
t
,
lc
);
newLines
.
push_back
(
new
MLine
(
v1
,
newv
));
newLines
.
push_back
(
new
MLine
(
newv
,
v2
));
delete
itr
->
ge
->
lines
[
i
];
}
else
{
newLines
.
push_back
(
itr
->
ge
->
lines
[
i
]);
}
}
itr
->
ge
->
lines
=
newLines
;
itr
->
ge
->
mesh_vertices
.
clear
();
N
=
itr
->
ge
->
lines
.
size
();
for
(
int
i
=
1
;
i
<
N
;
i
++
){
itr
->
ge
->
mesh_vertices
.
push_back
(
itr
->
ge
->
lines
[
i
]
->
getVertex
(
0
));
}
}
}
bool
AlgoDelaunay2D
(
GFace
*
gf
)
{
if
(
gf
->
getNativeType
()
==
GEntity
::
GmshModel
&&
CTX
.
mesh
.
algo2d
==
ALGO_2D_DELAUNAY
&&
gf
->
geomType
()
==
GEntity
::
Plane
)
...
...
@@ -834,7 +919,7 @@ bool gmsh2DMeshGenerator ( GFace *gf , bool debug = true)
it
=
emb_edges
.
begin
();
while
(
it
!=
emb_edges
.
end
())
{
recover_medge
(
m
,
*
it
,
&
edgesToRecover
,
&
edgesNotRecovered
,
1
);
recover_medge
(
m
,
*
it
,
&
edgesToRecover
,
&
edgesNotRecovered
,
1
);
++
it
;
}
...
...
@@ -854,6 +939,13 @@ bool gmsh2DMeshGenerator ( GFace *gf , bool debug = true)
if
(
edgesNotRecovered
.
size
())
{
Msg
(
GERROR
,
"%d edges were not recovered on model face %d, gmsh goes back and refines the 1d mesh"
,
edgesNotRecovered
.
size
(),
gf
->
tag
());
// std::list<GFace *> facesToRemesh;
// remeshUnrecoveredEdges ( edgesNotRecovered, facesToRemesh);
delete
m
;
delete
[]
U_
;
delete
[]
V_
;
// if (facesToRemesh.size() == 0)
// return gmsh2DMeshGenerator (gf,debug);
return
false
;
}
...
...
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