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
d49e1793
Commit
d49e1793
authored
12 years ago
by
Thomas De Maet
Browse files
Options
Downloads
Patches
Plain Diff
isinside: security for dims > dimElmt
parent
ec2ca7b7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Geo/MElementOctree.cpp
+25
-26
25 additions, 26 deletions
Geo/MElementOctree.cpp
Geo/MLine.h
+1
-1
1 addition, 1 deletion
Geo/MLine.h
Geo/MQuadrangle.h
+1
-1
1 addition, 1 deletion
Geo/MQuadrangle.h
with
27 additions
and
28 deletions
Geo/MElementOctree.cpp
+
25
−
26
View file @
d49e1793
...
@@ -132,8 +132,7 @@ std::vector<MElement *> MElementOctree::findAll(double x, double y, double z, in
...
@@ -132,8 +132,7 @@ std::vector<MElement *> MElementOctree::findAll(double x, double y, double z, in
std
::
vector
<
void
*>
v
;
std
::
vector
<
void
*>
v
;
std
::
vector
<
MElement
*>
e
;
std
::
vector
<
MElement
*>
e
;
Octree_SearchAll
(
P
,
_octree
,
&
v
);
Octree_SearchAll
(
P
,
_octree
,
&
v
);
for
(
std
::
vector
<
void
*>::
iterator
it
=
v
.
begin
();
for
(
std
::
vector
<
void
*>::
iterator
it
=
v
.
begin
();
it
!=
v
.
end
();
++
it
)
{
it
!=
v
.
end
();
++
it
){
MElement
*
el
=
(
MElement
*
)
*
it
;
MElement
*
el
=
(
MElement
*
)
*
it
;
if
(
dim
==
-
1
||
el
->
getDim
()
==
dim
)
e
.
push_back
(
el
);
if
(
dim
==
-
1
||
el
->
getDim
()
==
dim
)
e
.
push_back
(
el
);
}
}
...
@@ -146,14 +145,14 @@ std::vector<MElement *> MElementOctree::findAll(double x, double y, double z, in
...
@@ -146,14 +145,14 @@ std::vector<MElement *> MElementOctree::findAll(double x, double y, double z, in
std
::
vector
<
GEntity
*>
entities
;
std
::
vector
<
GEntity
*>
entities
;
_gm
->
getEntities
(
entities
);
_gm
->
getEntities
(
entities
);
for
(
unsigned
int
i
=
0
;
i
<
entities
.
size
();
i
++
){
for
(
unsigned
int
i
=
0
;
i
<
entities
.
size
();
i
++
){
for
(
unsigned
int
j
=
0
;
j
<
entities
[
i
]
->
getNumMeshElements
();
j
++
){
for
(
unsigned
int
j
=
0
;
j
<
entities
[
i
]
->
getNumMeshElements
();
j
++
){
MElement
*
el
=
entities
[
i
]
->
getMeshElement
(
j
);
MElement
*
el
=
entities
[
i
]
->
getMeshElement
(
j
);
if
(
dim
==
-
1
||
el
->
getDim
()
==
dim
){
if
(
dim
==
-
1
||
el
->
getDim
()
==
dim
){
if
(
MElementInEle
(
el
,
P
)){
if
(
MElementInEle
(
el
,
P
)){
e
.
push_back
(
el
);
e
.
push_back
(
el
);
}
}
}
}
}
}
}
}
if
(
!
e
.
empty
())
{
if
(
!
e
.
empty
())
{
MElement
::
setTolerance
(
initialTol
);
MElement
::
setTolerance
(
initialTol
);
...
@@ -212,15 +211,15 @@ MElement *MElementOctree::find(double x, double y, double z, int dim, bool stric
...
@@ -212,15 +211,15 @@ MElement *MElementOctree::find(double x, double y, double z, int dim, bool stric
std
::
vector
<
GEntity
*>
entities
;
std
::
vector
<
GEntity
*>
entities
;
_gm
->
getEntities
(
entities
);
_gm
->
getEntities
(
entities
);
for
(
unsigned
int
i
=
0
;
i
<
entities
.
size
();
i
++
){
for
(
unsigned
int
i
=
0
;
i
<
entities
.
size
();
i
++
){
for
(
unsigned
int
j
=
0
;
j
<
entities
[
i
]
->
getNumMeshElements
();
j
++
){
for
(
unsigned
int
j
=
0
;
j
<
entities
[
i
]
->
getNumMeshElements
();
j
++
){
e
=
entities
[
i
]
->
getMeshElement
(
j
);
e
=
entities
[
i
]
->
getMeshElement
(
j
);
if
(
dim
==
-
1
||
e
->
getDim
()
==
dim
){
if
(
dim
==
-
1
||
e
->
getDim
()
==
dim
){
if
(
MElementInEle
(
e
,
P
)){
if
(
MElementInEle
(
e
,
P
))
{
MElement
::
setTolerance
(
initialTol
);
MElement
::
setTolerance
(
initialTol
);
return
e
;
return
e
;
}
}
}
}
}
}
}
}
}
}
MElement
::
setTolerance
(
initialTol
);
MElement
::
setTolerance
(
initialTol
);
...
@@ -233,14 +232,14 @@ MElement *MElementOctree::find(double x, double y, double z, int dim, bool stric
...
@@ -233,14 +232,14 @@ MElement *MElementOctree::find(double x, double y, double z, int dim, bool stric
tol
*=
10.0
;
tol
*=
10.0
;
MElement
::
setTolerance
(
tol
);
MElement
::
setTolerance
(
tol
);
for
(
unsigned
int
i
=
0
;
i
<
_elems
.
size
();
i
++
){
for
(
unsigned
int
i
=
0
;
i
<
_elems
.
size
();
i
++
){
e
=
_elems
[
i
];
e
=
_elems
[
i
];
if
(
dim
==
-
1
||
e
->
getDim
()
==
dim
){
if
(
dim
==
-
1
||
e
->
getDim
()
==
dim
){
if
(
MElementInEle
(
e
,
P
)){
if
(
MElementInEle
(
e
,
P
)){
MElement
::
setTolerance
(
initialTol
);
MElement
::
setTolerance
(
initialTol
);
return
e
;
return
e
;
}
}
}
}
}
}
}
}
MElement
::
setTolerance
(
initialTol
);
MElement
::
setTolerance
(
initialTol
);
//Msg::Warning("Point %g %g %g not found",x,y,z);
//Msg::Warning("Point %g %g %g not found",x,y,z);
...
...
This diff is collapsed.
Click to expand it.
Geo/MLine.h
+
1
−
1
View file @
d49e1793
...
@@ -76,7 +76,7 @@ class MLine : public MElement {
...
@@ -76,7 +76,7 @@ class MLine : public MElement {
virtual
bool
isInside
(
double
u
,
double
v
,
double
w
)
virtual
bool
isInside
(
double
u
,
double
v
,
double
w
)
{
{
double
tol
=
_isInsideTolerance
;
double
tol
=
_isInsideTolerance
;
if
(
u
<
-
(
1.
+
tol
)
||
u
>
(
1.
+
tol
))
if
(
u
<
-
(
1.
+
tol
)
||
u
>
(
1.
+
tol
)
||
fabs
(
v
)
>
tol
||
fabs
(
w
)
>
tol
)
return
false
;
return
false
;
return
true
;
return
true
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Geo/MQuadrangle.h
+
1
−
1
View file @
d49e1793
...
@@ -140,7 +140,7 @@ class MQuadrangle : public MElement {
...
@@ -140,7 +140,7 @@ class MQuadrangle : public MElement {
virtual
bool
isInside
(
double
u
,
double
v
,
double
w
)
virtual
bool
isInside
(
double
u
,
double
v
,
double
w
)
{
{
double
tol
=
_isInsideTolerance
;
double
tol
=
_isInsideTolerance
;
if
(
u
<
-
(
1.
+
tol
)
||
v
<
-
(
1.
+
tol
)
||
u
>
(
1.
+
tol
)
||
v
>
(
1.
+
tol
))
if
(
u
<
-
(
1.
+
tol
)
||
v
<
-
(
1.
+
tol
)
||
u
>
(
1.
+
tol
)
||
v
>
(
1.
+
tol
)
||
fabs
(
w
)
>
tol
)
return
false
;
return
false
;
return
true
;
return
true
;
}
}
...
...
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