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
107f0acc
Commit
107f0acc
authored
19 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
add line elements in octree + little nicer Probe drawing
parent
4fddfb0f
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Plugin/OctreePost.cpp
+34
-1
34 additions, 1 deletion
Plugin/OctreePost.cpp
Plugin/OctreePost.h
+6
-5
6 additions, 5 deletions
Plugin/OctreePost.h
Plugin/Probe.cpp
+2
-1
2 additions, 1 deletion
Plugin/Probe.cpp
with
42 additions
and
7 deletions
Plugin/OctreePost.cpp
+
34
−
1
View file @
107f0acc
// $Id: OctreePost.cpp,v 1.1
5
2005-
03-04 19:08:38
geuzaine Exp $
// $Id: OctreePost.cpp,v 1.1
6
2005-
12-17 22:26:44
geuzaine Exp $
//
// Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle
//
...
...
@@ -63,6 +63,12 @@ static void centroid(int n, double *X, double *Y, double *Z, double *c)
c
[
2
]
*=
oc
;
}
void
linBB
(
void
*
a
,
double
*
min
,
double
*
max
)
{
double
*
X
=
(
double
*
)
a
,
*
Y
=
&
X
[
2
],
*
Z
=
&
X
[
4
];
minmax
(
2
,
X
,
Y
,
Z
,
min
,
max
);
}
void
triBB
(
void
*
a
,
double
*
min
,
double
*
max
)
{
double
*
X
=
(
double
*
)
a
,
*
Y
=
&
X
[
3
],
*
Z
=
&
X
[
6
];
...
...
@@ -99,6 +105,14 @@ void pyrBB(void *a, double *min, double *max)
minmax
(
5
,
X
,
Y
,
Z
,
min
,
max
);
}
int
linInEle
(
void
*
a
,
double
*
x
)
{
double
*
X
=
(
double
*
)
a
,
*
Y
=
&
X
[
2
],
*
Z
=
&
X
[
4
],
uvw
[
3
];
line
lin
(
X
,
Y
,
Z
);
lin
.
xyz2uvw
(
x
,
uvw
);
return
lin
.
isInside
(
uvw
[
0
],
uvw
[
1
],
uvw
[
2
]);
}
int
triInEle
(
void
*
a
,
double
*
x
)
{
double
*
X
=
(
double
*
)
a
,
*
Y
=
&
X
[
3
],
*
Z
=
&
X
[
6
],
uvw
[
3
];
...
...
@@ -147,6 +161,12 @@ int pyrInEle(void *a, double *x)
return
pyr
.
isInside
(
uvw
[
0
],
uvw
[
1
],
uvw
[
2
]);
}
void
linCentroid
(
void
*
a
,
double
*
x
)
{
double
*
X
=
(
double
*
)
a
,
*
Y
=
&
X
[
2
],
*
Z
=
&
X
[
4
];
centroid
(
2
,
X
,
Y
,
Z
,
x
);
}
void
triCentroid
(
void
*
a
,
double
*
x
)
{
double
*
X
=
(
double
*
)
a
,
*
Y
=
&
X
[
3
],
*
Z
=
&
X
[
6
];
...
...
@@ -214,6 +234,16 @@ OctreePost::OctreePost(Post_View *v)
const
int
maxElePerBucket
=
100
;
// memory vs. speed trade-off
SL
=
Octree_Create
(
maxElePerBucket
,
min
,
size
,
linBB
,
linCentroid
,
linInEle
);
addListOfStuff
(
SL
,
v
->
SL
,
6
+
2
*
v
->
NbTimeStep
);
Octree_Arrange
(
SL
);
VL
=
Octree_Create
(
maxElePerBucket
,
min
,
size
,
linBB
,
linCentroid
,
linInEle
);
addListOfStuff
(
VL
,
v
->
VL
,
6
+
6
*
v
->
NbTimeStep
);
Octree_Arrange
(
VL
);
TL
=
Octree_Create
(
maxElePerBucket
,
min
,
size
,
linBB
,
linCentroid
,
linInEle
);
addListOfStuff
(
TL
,
v
->
TL
,
6
+
18
*
v
->
NbTimeStep
);
Octree_Arrange
(
TL
);
ST
=
Octree_Create
(
maxElePerBucket
,
min
,
size
,
triBB
,
triCentroid
,
triInEle
);
addListOfStuff
(
ST
,
v
->
ST
,
9
+
3
*
v
->
NbTimeStep
);
Octree_Arrange
(
ST
);
...
...
@@ -323,6 +353,7 @@ bool OctreePost::searchScalar(double x, double y, double z, double *values,
if
(
getValue
(
Octree_Search
(
P
,
SY
),
3
,
5
,
1
,
P
,
timestep
,
values
,
size_elem
))
return
true
;
if
(
getValue
(
Octree_Search
(
P
,
ST
),
2
,
3
,
1
,
P
,
timestep
,
values
,
size_elem
))
return
true
;
if
(
getValue
(
Octree_Search
(
P
,
SQ
),
2
,
4
,
1
,
P
,
timestep
,
values
,
size_elem
))
return
true
;
if
(
getValue
(
Octree_Search
(
P
,
SL
),
1
,
2
,
1
,
P
,
timestep
,
values
,
size_elem
))
return
true
;
return
false
;
}
...
...
@@ -345,6 +376,7 @@ bool OctreePost::searchVector(double x, double y, double z, double *values,
if
(
getValue
(
Octree_Search
(
P
,
VY
),
3
,
5
,
3
,
P
,
timestep
,
values
,
size_elem
))
return
true
;
if
(
getValue
(
Octree_Search
(
P
,
VT
),
2
,
3
,
3
,
P
,
timestep
,
values
,
size_elem
))
return
true
;
if
(
getValue
(
Octree_Search
(
P
,
VQ
),
2
,
4
,
3
,
P
,
timestep
,
values
,
size_elem
))
return
true
;
if
(
getValue
(
Octree_Search
(
P
,
VL
),
1
,
2
,
3
,
P
,
timestep
,
values
,
size_elem
))
return
true
;
return
false
;
}
...
...
@@ -367,6 +399,7 @@ bool OctreePost::searchTensor(double x, double y, double z, double *values,
if
(
getValue
(
Octree_Search
(
P
,
TY
),
3
,
5
,
9
,
P
,
timestep
,
values
,
size_elem
))
return
true
;
if
(
getValue
(
Octree_Search
(
P
,
TT
),
2
,
3
,
9
,
P
,
timestep
,
values
,
size_elem
))
return
true
;
if
(
getValue
(
Octree_Search
(
P
,
TQ
),
2
,
4
,
9
,
P
,
timestep
,
values
,
size_elem
))
return
true
;
if
(
getValue
(
Octree_Search
(
P
,
TL
),
1
,
2
,
9
,
P
,
timestep
,
values
,
size_elem
))
return
true
;
return
false
;
}
This diff is collapsed.
Click to expand it.
Plugin/OctreePost.h
+
6
−
5
View file @
107f0acc
...
...
@@ -26,6 +26,7 @@ class Post_View;
class
OctreePost
{
Octree
*
SL
,
*
VL
,
*
TL
;
Octree
*
ST
,
*
VT
,
*
TT
;
Octree
*
SQ
,
*
VQ
,
*
TQ
;
Octree
*
SS
,
*
VS
,
*
TS
;
...
...
@@ -38,11 +39,11 @@ class OctreePost
public
:
OctreePost
(
Post_View
*
);
~
OctreePost
();
// search for the value of the View at point
//
x, y, z. Values is interpolated linearly in
//
the
post element. If several time steps
//
are present, they are all interpolated unless
//
time step is set to a different value than
-1.
// search for the value of the View at point
x, y, z. Values are
//
interpolated using standard first order shape functions in the
// post element. If several time steps
are present, they are all
//
interpolated unless time step is set to a different value than
// -1.
bool
searchScalar
(
double
x
,
double
y
,
double
z
,
double
*
values
,
int
timestep
=
-
1
,
double
*
size_elem
=
0
);
bool
searchVector
(
double
x
,
double
y
,
double
z
,
double
*
values
,
...
...
This diff is collapsed.
Click to expand it.
Plugin/Probe.cpp
+
2
−
1
View file @
107f0acc
// $Id: Probe.cpp,v 1.1
0
2005-
03-09 02:19:09
geuzaine Exp $
// $Id: Probe.cpp,v 1.1
1
2005-
12-17 22:26:44
geuzaine Exp $
//
// Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle
//
...
...
@@ -86,6 +86,7 @@ void GMSH_ProbePlugin::draw()
glVertex3d
(
x
,
y
,
z
-
d
);
glVertex3d
(
x
,
y
,
z
+
d
);
glEnd
();
}
Draw_Point
(
1
,
CTX
.
point_size
,
&
x
,
&
y
,
&
z
,
1
);
#endif
}
...
...
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