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
55ffbb77
Commit
55ffbb77
authored
17 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
fix rec ori
parent
a869aef8
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Mesh/BDS.cpp
+123
-115
123 additions, 115 deletions
Mesh/BDS.cpp
Mesh/BDS.h
+145
-147
145 additions, 147 deletions
Mesh/BDS.h
with
268 additions
and
262 deletions
Mesh/BDS.cpp
+
123
−
115
View file @
55ffbb77
// $Id: BDS.cpp,v 1.9
8
2008-02-16 2
0:42
:4
0
geuzaine Exp $
// $Id: BDS.cpp,v 1.9
9
2008-02-16 2
1:25
:4
5
geuzaine Exp $
//
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
//
...
...
@@ -597,7 +597,6 @@ bool BDS_Mesh::split_edge(BDS_Edge * e, BDS_Point *mid)
orientation
=
1
;
else
orientation
=
-
1
;
break
;
}
}
...
...
@@ -937,7 +936,6 @@ bool BDS_Mesh::recombine_edge(BDS_Edge * e)
*/
// we test if the edge is deleted
// return false;
if
(
e
->
deleted
)
return
false
;
if
(
e
->
numfaces
()
!=
2
||
e
->
numTriangles
()
!=
2
)
...
...
@@ -945,17 +943,14 @@ bool BDS_Mesh::recombine_edge(BDS_Edge * e)
if
(
e
->
g
&&
e
->
g
->
classif_degree
==
1
)
return
false
;
BDS_Point
*
op
[
2
];
BDS_Point
*
p1
=
e
->
p1
;
BDS_Point
*
p2
=
e
->
p2
;
BDS_Point
*
op
[
2
];
e
->
oppositeof
(
op
);
BDS_Point
*
pts1
[
4
];
e
->
faces
(
0
)
->
getNodes
(
pts1
);
// FIXME !!!!!!!!!!!!!!!!!
// should ensure that orientation is unchanged
BDS_Edge
*
p1_op1
=
find_edge
(
p1
,
op
[
0
],
e
->
faces
(
0
));
BDS_Edge
*
op1_p2
=
find_edge
(
op
[
0
],
p2
,
e
->
faces
(
0
));
BDS_Edge
*
p1_op2
=
find_edge
(
p1
,
op
[
1
],
e
->
faces
(
1
));
...
...
@@ -972,7 +967,22 @@ bool BDS_Mesh::recombine_edge(BDS_Edge * e)
}
del_edge
(
e
);
BDS_Face
*
f
=
add_quadrangle
(
p1_op1
,
op1_p2
,
op2_p2
,
p1_op2
);
int
orientation
=
0
;
for
(
int
i
=
0
;
i
<
3
;
i
++
)
{
if
(
pts1
[
i
]
==
p1
)
{
if
(
pts1
[(
i
+
1
)
%
3
]
==
p2
)
orientation
=
1
;
else
orientation
=
-
1
;
break
;
}
}
BDS_Face
*
f
;
if
(
orientation
<
0
)
f
=
add_quadrangle
(
p1_op1
,
op1_p2
,
op2_p2
,
p1_op2
);
else
f
=
add_quadrangle
(
p1_op1
,
p1_op2
,
op2_p2
,
op1_p2
);
f
->
g
=
g
;
p1
->
config_modified
=
true
;
...
...
@@ -1127,11 +1137,8 @@ bool test_move_point_parametric_triangle(BDS_Point *p, double u, double v, BDS_F
return
ori_init
*
ori_final
>
0
;
}
/**
d^2_i = (x^2_i - x)^T M (x_i - x)
= M11 (x_i - x)^2 + 2 M21 (x_i-x)(y_i-y) + M22 (y_i-y)^2
~:-)
*/
// d^2_i = (x^2_i - x)^T M (x_i - x)
// = M11 (x_i - x)^2 + 2 M21 (x_i-x)(y_i-y) + M22 (y_i-y)^2
struct
smoothVertexData
{
BDS_Point
*
p
;
...
...
@@ -1305,7 +1312,8 @@ bool BDS_Mesh::smooth_point_centroid(BDS_Point *p, GFace *gf, bool test_quality)
p
->
Z
=
oldZ
;
normal_triangle
(
n
[
0
],
n
[
1
],
n
[
2
],
norm2
);
oldWorst
=
std
::
min
(
oldWorst
,
qmTriangle
(
*
it
,
QMTRI_RHO
));
double
ps
;
prosca
(
norm1
,
norm2
,
&
ps
);
double
ps
;
prosca
(
norm1
,
norm2
,
&
ps
);
if
(
ps
<
.5
)
return
false
;
}
++
it
;
...
...
This diff is collapsed.
Click to expand it.
Mesh/BDS.h
+
145
−
147
View file @
55ffbb77
...
...
@@ -173,8 +173,8 @@ class BDS_Point
// and is propagated
double
_lcBGM
,
_lcPTS
;
public:
double
X
,
Y
,
Z
;
// Real COORDINATES
double
u
,
v
;
// Parametric COORDINATES
double
X
,
Y
,
Z
;
double
u
,
v
;
bool
config_modified
;
int
iD
;
BDS_GeomEntity
*
g
;
...
...
@@ -202,7 +202,8 @@ public:
}
void
getTriangles
(
std
::
list
<
BDS_Face
*>
&
t
)
const
;
BDS_Point
(
int
id
,
double
x
=
0
,
double
y
=
0
,
double
z
=
0
)
:
_lcBGM
(
1.e22
),
_lcPTS
(
1.e22
),
X
(
x
),
Y
(
y
),
Z
(
z
),
u
(
0
),
v
(
0
),
config_modified
(
true
),
iD
(
id
),
g
(
0
)
:
_lcBGM
(
1.e22
),
_lcPTS
(
1.e22
),
X
(
x
),
Y
(
y
),
Z
(
z
),
u
(
0
),
v
(
0
),
config_modified
(
true
),
iD
(
id
),
g
(
0
)
{
}
};
...
...
@@ -260,7 +261,8 @@ public:
}
inline
void
del
(
BDS_Face
*
t
)
{
_faces
.
erase
(
std
::
remove_if
(
_faces
.
begin
(),
_faces
.
end
()
,
std
::
bind2nd
(
std
::
equal_to
<
BDS_Face
*>
(),
t
))
,
_faces
.
erase
(
std
::
remove_if
(
_faces
.
begin
(),
_faces
.
end
(),
std
::
bind2nd
(
std
::
equal_to
<
BDS_Face
*>
(),
t
)),
_faces
.
end
());
}
...
...
@@ -268,7 +270,9 @@ public:
void
update
()
{
_length
=
sqrt
((
p1
->
X
-
p2
->
X
)
*
(
p1
->
X
-
p2
->
X
)
+
(
p1
->
Y
-
p2
->
Y
)
*
(
p1
->
Y
-
p2
->
Y
)
+
(
p1
->
Z
-
p2
->
Z
)
*
(
p1
->
Z
-
p2
->
Z
));
_length
=
sqrt
((
p1
->
X
-
p2
->
X
)
*
(
p1
->
X
-
p2
->
X
)
+
(
p1
->
Y
-
p2
->
Y
)
*
(
p1
->
Y
-
p2
->
Y
)
+
(
p1
->
Z
-
p2
->
Z
)
*
(
p1
->
Z
-
p2
->
Z
));
}
BDS_Edge
(
BDS_Point
*
A
,
BDS_Point
*
B
)
...
...
@@ -288,7 +292,6 @@ public:
}
};
class
BDS_Face
{
public:
...
...
@@ -298,15 +301,13 @@ public:
inline
int
numEdges
()
const
{
return
e4
?
4
:
3
;
}
inline
void
getNodes
(
BDS_Point
*
n
[
4
])
const
{
if
(
!
e4
)
{
if
(
!
e4
){
n
[
0
]
=
e1
->
commonvertex
(
e3
);
n
[
1
]
=
e1
->
commonvertex
(
e2
);
n
[
2
]
=
e2
->
commonvertex
(
e3
);
n
[
3
]
=
0
;
}
else
{
else
{
n
[
0
]
=
e1
->
commonvertex
(
e4
);
n
[
1
]
=
e1
->
commonvertex
(
e2
);
n
[
2
]
=
e2
->
commonvertex
(
e3
);
...
...
@@ -324,7 +325,6 @@ public:
}
};
class
GeomLessThan
{
public:
...
...
@@ -367,7 +367,6 @@ public:
}
};
class
BDS_SwapEdgeTest
{
public:
...
...
@@ -400,13 +399,11 @@ struct EdgeToRecover
GEdge
*
ge
;
EdgeToRecover
(
int
_p1
,
int
_p2
,
GEdge
*
_ge
)
:
ge
(
_ge
)
{
if
(
_p1
<
_p2
)
{
if
(
_p1
<
_p2
){
p1
=
_p1
;
p2
=
_p2
;
}
else
{
else
{
p2
=
_p1
;
p1
=
_p2
;
}
...
...
@@ -460,7 +457,8 @@ public:
void
add_geom
(
int
degree
,
int
tag
);
BDS_GeomEntity
*
get_geom
(
int
p1
,
int
p2
);
// 2D operators
BDS_Edge
*
recover_edge
(
int
p1
,
int
p2
,
std
::
set
<
EdgeToRecover
>
*
e2r
=
0
,
std
::
set
<
EdgeToRecover
>
*
not_recovered
=
0
);
BDS_Edge
*
recover_edge
(
int
p1
,
int
p2
,
std
::
set
<
EdgeToRecover
>
*
e2r
=
0
,
std
::
set
<
EdgeToRecover
>
*
not_recovered
=
0
);
bool
swap_edge
(
BDS_Edge
*
,
const
BDS_SwapEdgeTest
&
theTest
);
bool
collapse_edge_parametric
(
BDS_Edge
*
,
BDS_Point
*
);
void
snap_point
(
BDS_Point
*
,
BDS_Mesh
*
geom
=
0
);
...
...
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