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
7f2948ac
Commit
7f2948ac
authored
19 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
make the bgmesh work with quads
parent
9ab834c0
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Common/Views.h
+0
-1
0 additions, 1 deletion
Common/Views.h
Mesh/3D_BGMesh.cpp
+55
-100
55 additions, 100 deletions
Mesh/3D_BGMesh.cpp
with
55 additions
and
101 deletions
Common/Views.h
+
0
−
1
View file @
7f2948ac
...
@@ -206,7 +206,6 @@ void CopyViewOptions(Post_View *src, Post_View *dest);
...
@@ -206,7 +206,6 @@ void CopyViewOptions(Post_View *src, Post_View *dest);
void
CombineViews
(
int
time
,
int
how
,
int
remove
);
void
CombineViews
(
int
time
,
int
how
,
int
remove
);
int
BGMWithView
(
Post_View
*
ErrView
);
int
BGMWithView
(
Post_View
*
ErrView
);
double
ErrorInView
(
Post_View
*
ErrView
,
int
*
n
);
Post_View
*
Create2DGraph
(
char
*
xname
,
char
*
yname
,
int
nbdata
,
double
*
x
,
double
*
y
);
Post_View
*
Create2DGraph
(
char
*
xname
,
char
*
yname
,
int
nbdata
,
double
*
x
,
double
*
y
);
GmshColorTable
*
Get_ColorTable
(
int
num
);
GmshColorTable
*
Get_ColorTable
(
int
num
);
...
...
This diff is collapsed.
Click to expand it.
Mesh/3D_BGMesh.cpp
+
55
−
100
View file @
7f2948ac
// $Id: 3D_BGMesh.cpp,v 1.3
8
2006-01-
06 00:34
:2
5
geuzaine Exp $
// $Id: 3D_BGMesh.cpp,v 1.3
9
2006-01-
28 15:02
:2
6
geuzaine Exp $
//
//
// Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
// Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
//
//
...
@@ -161,13 +161,56 @@ static void AIG(void *a, void *b)
...
@@ -161,13 +161,56 @@ static void AIG(void *a, void *b)
AddSimplexInGrid
(
TMPM
,
s
,
BOITE
);
AddSimplexInGrid
(
TMPM
,
s
,
BOITE
);
}
}
void
BGMWithViewList
(
int
Nb
,
List_T
*
List
,
Tree_T
*
Pts
,
int
NbNod
,
Vertex
*
VertexUp
)
{
if
(
Nb
)
{
int
nb
=
List_Nbr
(
List
)
/
Nb
;
for
(
int
i
=
0
;
i
<
List_Nbr
(
List
);
i
+=
nb
)
{
double
*
X
=
(
double
*
)
List_Pointer_Fast
(
List
,
i
);
double
*
Y
=
(
double
*
)
List_Pointer_Fast
(
List
,
i
+
NbNod
);
double
*
Z
=
(
double
*
)
List_Pointer_Fast
(
List
,
i
+
2
*
NbNod
);
double
*
Val
=
(
double
*
)
List_Pointer_Fast
(
List
,
i
+
3
*
NbNod
);
Vertex
*
ver
[
4
];
for
(
int
j
=
0
;
j
<
NbNod
;
j
++
)
{
Vertex
V
;
Vertex
*
v
=
&
V
;
v
->
Pos
.
X
=
X
[
j
];
v
->
Pos
.
Y
=
Y
[
j
];
v
->
Pos
.
Z
=
Z
[
j
];
if
(
Tree_Query
(
Pts
,
&
v
))
{
ver
[
j
]
=
v
;
}
else
{
v
=
Create_Vertex
(
TMPM
->
MaxPointNum
++
,
X
[
j
],
Y
[
j
],
Z
[
j
],
Val
[
j
],
-
1.0
);
ver
[
j
]
=
v
;
Tree_Add
(
TMPM
->
Vertices
,
&
v
);
Tree_Add
(
Pts
,
&
v
);
}
}
if
(
NbNod
==
3
){
// tri
Simplex
*
s
=
Create_Simplex
(
ver
[
0
],
ver
[
1
],
ver
[
2
],
VertexUp
);
Tree_Add
(
TMPM
->
Simplexes
,
&
s
);
}
else
{
if
(
VertexUp
){
// quad
Simplex
*
s1
=
Create_Simplex
(
ver
[
0
],
ver
[
1
],
ver
[
2
],
VertexUp
);
Tree_Add
(
TMPM
->
Simplexes
,
&
s1
);
Simplex
*
s2
=
Create_Simplex
(
ver
[
0
],
ver
[
2
],
ver
[
3
],
VertexUp
);
Tree_Add
(
TMPM
->
Simplexes
,
&
s2
);
}
else
{
// tet
Simplex
*
s
=
Create_Simplex
(
ver
[
0
],
ver
[
1
],
ver
[
2
],
ver
[
3
]);
Tree_Add
(
TMPM
->
Simplexes
,
&
s
);
}
}
}
}
}
int
BGMWithView
(
Post_View
*
ErrView
)
int
BGMWithView
(
Post_View
*
ErrView
)
{
{
Vertex
*
VertexUp
,
*
v
,
V
,
*
ver
[
4
]
;
Vertex
*
VertexUp
;
Tree_T
*
Pts
;
Tree_T
*
Pts
;
int
i
,
j
,
k
,
nb
;
double
*
X
,
*
Y
,
*
Z
,
*
Val
;
Simplex
*
si
;
if
(
TMPM
){
if
(
TMPM
){
Tree_Action
(
TMPM
->
Vertices
,
Free_Vertex
);
Tree_Action
(
TMPM
->
Vertices
,
Free_Vertex
);
...
@@ -184,69 +227,17 @@ int BGMWithView(Post_View * ErrView)
...
@@ -184,69 +227,17 @@ int BGMWithView(Post_View * ErrView)
TMPM
->
BGM
.
Typ
=
ONFILE
;
TMPM
->
BGM
.
Typ
=
ONFILE
;
TMPM
->
Vertices
=
Tree_Create
(
sizeof
(
Vertex
*
),
compareVertex
);
TMPM
->
Vertices
=
Tree_Create
(
sizeof
(
Vertex
*
),
compareVertex
);
TMPM
->
Simplexes
=
Tree_Create
(
sizeof
(
Simplex
*
),
compareSimplex
);
TMPM
->
Simplexes
=
Tree_Create
(
sizeof
(
Simplex
*
),
compareSimplex
);
TMPM
->
MaxPointNum
=
0
;
Create_BgMesh
(
ONFILE
,
.2
,
THEM
);
Create_BgMesh
(
ONFILE
,
.2
,
THEM
);
k
=
1
;
BGMWithViewList
(
ErrView
->
NbST
,
ErrView
->
ST
,
Pts
,
3
,
VertexUp
);
if
(
ErrView
->
NbST
)
{
BGMWithViewList
(
ErrView
->
NbSQ
,
ErrView
->
SQ
,
Pts
,
4
,
VertexUp
);
nb
=
List_Nbr
(
ErrView
->
ST
)
/
ErrView
->
NbST
;
BGMWithViewList
(
ErrView
->
NbSS
,
ErrView
->
SS
,
Pts
,
4
,
NULL
);
for
(
i
=
0
;
i
<
List_Nbr
(
ErrView
->
ST
);
i
+=
nb
)
{
X
=
(
double
*
)
List_Pointer_Fast
(
ErrView
->
ST
,
i
);
Y
=
(
double
*
)
List_Pointer_Fast
(
ErrView
->
ST
,
i
+
3
);
Z
=
(
double
*
)
List_Pointer_Fast
(
ErrView
->
ST
,
i
+
6
);
Val
=
(
double
*
)
List_Pointer_Fast
(
ErrView
->
ST
,
i
+
9
);
for
(
j
=
0
;
j
<
3
;
j
++
)
{
v
=
&
V
;
v
->
Pos
.
X
=
X
[
j
];
v
->
Pos
.
Y
=
Y
[
j
];
v
->
Pos
.
Z
=
Z
[
j
];
if
(
Tree_Query
(
Pts
,
&
v
))
{
ver
[
j
]
=
v
;
}
else
{
v
=
Create_Vertex
(
k
++
,
X
[
j
],
Y
[
j
],
Z
[
j
],
Val
[
j
],
-
1.0
);
ver
[
j
]
=
v
;
Tree_Add
(
TMPM
->
Vertices
,
&
v
);
Tree_Add
(
Pts
,
&
v
);
}
}
si
=
Create_Simplex
(
ver
[
0
],
ver
[
1
],
ver
[
2
],
VertexUp
);
Tree_Add
(
TMPM
->
Simplexes
,
&
si
);
}
}
if
(
ErrView
->
NbSS
)
{
nb
=
List_Nbr
(
ErrView
->
SS
)
/
ErrView
->
NbSS
;
for
(
i
=
0
;
i
<
List_Nbr
(
ErrView
->
SS
);
i
+=
nb
)
{
X
=
(
double
*
)
List_Pointer_Fast
(
ErrView
->
SS
,
i
);
Y
=
(
double
*
)
List_Pointer_Fast
(
ErrView
->
SS
,
i
+
4
);
Z
=
(
double
*
)
List_Pointer_Fast
(
ErrView
->
SS
,
i
+
8
);
Val
=
(
double
*
)
List_Pointer_Fast
(
ErrView
->
SS
,
i
+
12
);
for
(
j
=
0
;
j
<
4
;
j
++
)
{
v
=
&
V
;
v
->
Pos
.
X
=
X
[
j
];
v
->
Pos
.
Y
=
Y
[
j
];
v
->
Pos
.
Z
=
Z
[
j
];
if
(
Tree_Query
(
Pts
,
&
v
))
{
ver
[
j
]
=
v
;
}
else
{
v
=
Create_Vertex
(
k
++
,
X
[
j
],
Y
[
j
],
Z
[
j
],
Val
[
j
],
-
1.0
);
ver
[
j
]
=
v
;
Tree_Add
(
TMPM
->
Vertices
,
&
v
);
Tree_Add
(
Pts
,
&
v
);
}
}
si
=
Create_Simplex
(
ver
[
0
],
ver
[
1
],
ver
[
2
],
ver
[
3
]);
Tree_Add
(
TMPM
->
Simplexes
,
&
si
);
}
}
TMPM
->
Grid
.
init
=
0
;
TMPM
->
Grid
.
init
=
0
;
TMPM
->
Grid
.
Nx
=
1
0
;
TMPM
->
Grid
.
Nx
=
2
0
;
TMPM
->
Grid
.
Ny
=
1
0
;
TMPM
->
Grid
.
Ny
=
2
0
;
TMPM
->
Grid
.
Nz
=
1
0
;
TMPM
->
Grid
.
Nz
=
2
0
;
Tree_Action
(
TMPM
->
Vertices
,
findminmax
);
Tree_Action
(
TMPM
->
Vertices
,
findminmax
);
getminmax
(
&
TMPM
->
Grid
.
min
.
X
,
&
TMPM
->
Grid
.
min
.
Y
,
&
TMPM
->
Grid
.
min
.
Z
,
getminmax
(
&
TMPM
->
Grid
.
min
.
X
,
&
TMPM
->
Grid
.
min
.
Y
,
&
TMPM
->
Grid
.
min
.
Z
,
&
TMPM
->
Grid
.
max
.
X
,
&
TMPM
->
Grid
.
max
.
Y
,
&
TMPM
->
Grid
.
max
.
Z
);
&
TMPM
->
Grid
.
max
.
X
,
&
TMPM
->
Grid
.
max
.
Y
,
&
TMPM
->
Grid
.
max
.
Z
);
...
@@ -268,39 +259,3 @@ int BGMWithView(Post_View * ErrView)
...
@@ -268,39 +259,3 @@ int BGMWithView(Post_View * ErrView)
return
1
;
return
1
;
}
}
double
ErrorInView
(
Post_View
*
ErrView
,
int
*
n
)
{
double
e
,
tot
=
0.0
,
*
Val
;
int
i
,
j
=
0
,
nb
;
if
(
ErrView
==
NULL
)
{
Msg
(
WARNING
,
"Empty error view"
);
return
0.
;
}
if
(
ErrView
->
NbST
)
{
nb
=
List_Nbr
(
ErrView
->
ST
)
/
ErrView
->
NbST
;
for
(
i
=
0
;
i
<
List_Nbr
(
ErrView
->
ST
);
i
+=
nb
)
{
Val
=
(
double
*
)
List_Pointer_Fast
(
ErrView
->
ST
,
i
+
9
);
e
=
(
Val
[
0
]
+
Val
[
1
]
+
Val
[
2
])
/
3.
;
tot
+=
e
*
e
;
j
++
;
}
}
if
(
ErrView
->
NbSS
)
{
nb
=
List_Nbr
(
ErrView
->
SS
)
/
ErrView
->
NbSS
;
for
(
i
=
0
;
i
<
List_Nbr
(
ErrView
->
SS
);
i
+=
nb
)
{
Val
=
(
double
*
)
List_Pointer_Fast
(
ErrView
->
SS
,
i
+
12
);
e
=
(
Val
[
0
]
+
Val
[
1
]
+
Val
[
2
]
+
Val
[
3
])
*
0.25
;
tot
+=
e
*
e
;
j
++
;
}
}
*
n
=
j
;
return
100
*
sqrt
(
tot
);
}
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