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
478a5439
Commit
478a5439
authored
19 years ago
by
Jean-François Remacle
Browse files
Options
Downloads
Patches
Plain Diff
*** empty log message ***
parent
05f6b40b
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
Mesh/BDS.cpp
+39
-31
39 additions, 31 deletions
Mesh/BDS.cpp
Mesh/BDS.h
+4
-2
4 additions, 2 deletions
Mesh/BDS.h
configure.in
+32
-1
32 additions, 1 deletion
configure.in
with
75 additions
and
34 deletions
Mesh/BDS.cpp
+
39
−
31
View file @
478a5439
...
...
@@ -109,40 +109,48 @@ void BDS_GeomEntity::getClosestTriangles ( double x, double y, double z,
double
eps
;
kdTree
->
annkSearch
(
// search
queryPt
,
// query point
1
,
// number of near neighbors
nbK
,
// number of near neighbors
nnIdx
,
// nearest neighbors (returned)
dists
,
// distance (returned)
eps
);
// error bound
if
(
nnIdx
[
0
]
<
sP
.
size
())
for
(
int
K
=
0
;
K
<
nbK
;
K
++
)
{
sP
[
nnIdx
[
0
]]
->
getTriangles
(
l
);
if
(
nnIdx
[
K
]
<
sP
.
size
())
{
std
::
list
<
BDS_Triangle
*>
l1
;
sP
[
nnIdx
[
K
]]
->
getTriangles
(
l1
);
l
.
insert
(
l
.
begin
(),
l1
.
begin
(),
l1
.
end
());
}
else
if
(
nnIdx
[
K
]
<
sP
.
size
()
+
sE
.
size
()
)
{
BDS_Edge
*
e
=
sE
[
nnIdx
[
K
]
-
sP
.
size
()];
std
::
list
<
BDS_Triangle
*>
l1
,
l2
;
e
->
p1
->
getTriangles
(
l1
);
e
->
p2
->
getTriangles
(
l2
);
l
.
insert
(
l
.
begin
(),
l1
.
begin
(),
l1
.
end
());
l
.
insert
(
l
.
begin
(),
l2
.
begin
(),
l2
.
end
());
// for (int i=0;i<e->numfaces();i++)
// {
// app.push_back(e->faces(i));
// }
}
else
{
std
::
list
<
BDS_Triangle
*>
l1
,
l2
,
l3
;
BDS_Point
*
pts
[
3
];
sT
[
nnIdx
[
K
]
-
sP
.
size
()
-
sE
.
size
()]
->
getNodes
(
pts
);
pts
[
0
]
->
getTriangles
(
l1
);
pts
[
0
]
->
getTriangles
(
l2
);
pts
[
0
]
->
getTriangles
(
l3
);
l
.
insert
(
l
.
begin
(),
l1
.
begin
(),
l1
.
end
());
l
.
insert
(
l
.
begin
(),
l2
.
begin
(),
l2
.
end
());
l
.
insert
(
l
.
begin
(),
l3
.
begin
(),
l3
.
end
());
// l.push_back( sT[nnIdx[0] - sP.size() - sE.size()]);
}
}
else
if
(
nnIdx
[
0
]
<
sP
.
size
()
+
sE
.
size
()
)
{
BDS_Edge
*
e
=
sE
[
nnIdx
[
0
]
-
sP
.
size
()];
std
::
list
<
BDS_Triangle
*>
l1
;
//e->p1->getTriangles (l);
//e->p2->getTriangles (l1);
//l.insert(l.begin(),l1.begin(),l1.end());
for
(
int
i
=
0
;
i
<
e
->
numfaces
();
i
++
)
{
l
.
push_back
(
e
->
faces
(
i
));
}
}
else
{
std
::
list
<
BDS_Triangle
*>
l1
,
l2
;
BDS_Point
*
pts
[
3
];
sT
[
nnIdx
[
0
]
-
sP
.
size
()
-
sE
.
size
()]
->
getNodes
(
pts
);
pts
[
0
]
->
getTriangles
(
l
);
pts
[
0
]
->
getTriangles
(
l1
);
pts
[
0
]
->
getTriangles
(
l2
);
l
.
insert
(
l
.
begin
(),
l1
.
begin
(),
l1
.
end
());
l
.
insert
(
l
.
begin
(),
l2
.
begin
(),
l2
.
end
());
// l.push_back( sT[nnIdx[0] - sP.size() - sE.size()]);
}
#else
{
l
=
t
;
...
...
@@ -715,8 +723,8 @@ void BDS_Mesh :: createSearchStructures ( )
const
int
dim
=
3
;
(
*
it
)
->
queryPt
=
annAllocPt
(
dim
);
// allocate query point
(
*
it
)
->
dataPts
=
annAllocPts
(
maxPts
,
dim
);
// allocate data points
(
*
it
)
->
nnIdx
=
new
ANNidx
[
1
];
// allocate near neigh indices
(
*
it
)
->
dists
=
new
ANNdist
[
1
];
// allocate near neighbor dists
(
*
it
)
->
nnIdx
=
new
ANNidx
[
(
*
it
)
->
nbK
];
// allocate near neigh indices
(
*
it
)
->
dists
=
new
ANNdist
[
(
*
it
)
->
nbK
];
// allocate near neighbor dists
int
I
=
0
;
...
...
@@ -2250,7 +2258,7 @@ int BDS_Mesh :: adapt_mesh ( double l, bool smooth, BDS_Mesh *geom_mesh)
SNAP_SUCCESS
=
0
;
SNAP_FAILURE
=
0
;
BDS_Metric
metric
(
l
,
LC
/
1
00
,
LC
);
BDS_Metric
metric
(
l
,
LC
/
2
00
,
LC
);
// printf("METRIC %g %g %g\n",LC,metric._min,metric._max);
// add initial set of edges in a list
...
...
This diff is collapsed.
Click to expand it.
Mesh/BDS.h
+
4
−
2
View file @
478a5439
...
...
@@ -62,8 +62,9 @@ public :
class
BDS_GeomEntity
{
public:
int
classif_tag
;
int
classif_degree
;
int
nbK
;
int
classif_tag
;
int
classif_degree
;
#ifdef HAVE_ANN_
ANNpointArray
dataPts
;
// data points
...
...
@@ -91,6 +92,7 @@ public:
BDS_GeomEntity
(
int
a
,
int
b
)
:
classif_tag
(
a
),
classif_degree
(
b
),
p
(
0
),
surf
(
0
)
{
nbK
=
3
;
#ifdef HAVE_ANN_
kdTree
=
0
;
#endif
...
...
This diff is collapsed.
Click to expand it.
configure.in
+
32
−
1
View file @
478a5439
dnl $Id: configure.in,v 1.7
3
2005-0
7-03 08:02:23 geuzain
e Exp $
dnl $Id: configure.in,v 1.7
4
2005-0
8-22 07:17:34 remacl
e Exp $
dnl
dnl Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle
dnl
...
...
@@ -66,6 +66,9 @@ AC_ARG_ENABLE(triangle,
AC_ARG_ENABLE(netgen,
AC_HELP_STRING([--enable-netgen],
[compile Netgen if available (default=yes)]))
AC_ARG_ENABLE(ann,
AC_HELP_STRING([--enable-ann],
[compile ANN if available (default=yes)]))
AC_ARG_ENABLE(tetgen,
AC_HELP_STRING([--enable-tetgen],
[compile Tetgen if available (default=yes)]))
...
...
@@ -249,6 +252,34 @@ else
fi
fi
dnl Check if ANN is installed
AC_CHECK_FILE(./ANN/include/ANN/ANN.h, ANN="yes", ANN="no")
if test "x${ANN}" = "xyes"; then
if test "x$enable_ann" != "xno"; then
GMSH_DIRS="${GMSH_DIRS} Netgen"
GMSH_LIBS="${GMSH_LIBS} -lGmshNetgen"
FLAGS="-DHAVE_NETGEN ${FLAGS}"
echo "********************************************************************"
echo "You are building a version of Gmsh that contains ANN, the Approximate"
echo "Nearest Neighbor library."
echo "Please note that by doing so, you agree with ANN's licensing"
echo "requirements stated in ./ANN/Copyright.txt."
echo "To disable ANN, run configure again with the --disable-ann"
echo "option."
echo "********************************************************************"
fi
else
if test "x$enable_ann" != "xno"; then
echo "********************************************************************"
echo "If you want to use ANN for doing fast geometrical searchs in the"
echo "STL mesher, please download ANN from the"
echo "author's web site at http://www.cs.umd.edu/~mount/ANN/,"
echo "unpack the archive and copy both src and include directories in the ./ANN subdirectory."
echo "Then run ./configure again."
echo "********************************************************************"
fi
fi
dnl Check if Netgen is installed
AC_CHECK_FILE(./Netgen/libsrc/meshing/meshclass.cpp, NETGEN="yes", NETGEN="no")
if test "x${NETGEN}" = "xyes"; then
...
...
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