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
8cdb70f5
Commit
8cdb70f5
authored
10 years ago
by
Thomas Toulorge
Browse files
Options
Downloads
Patches
Plain Diff
Fixed bugs in blob creation in old HO mesh optimizer
parent
d6a63345
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
contrib/HighOrderMeshOptimizer/OptHomRun.cpp
+8
-11
8 additions, 11 deletions
contrib/HighOrderMeshOptimizer/OptHomRun.cpp
with
8 additions
and
11 deletions
contrib/HighOrderMeshOptimizer/OptHomRun.cpp
+
8
−
11
View file @
8cdb70f5
...
@@ -48,7 +48,6 @@
...
@@ -48,7 +48,6 @@
#if defined(HAVE_BFGS)
#if defined(HAVE_BFGS)
typedef
std
::
vector
<
MElement
*>
elVec
;
typedef
std
::
vector
<
MElement
*>
elVec
;
typedef
elVec
::
iterator
elVecIter
;
typedef
elVec
::
const_iterator
elVecConstIter
;
typedef
elVec
::
const_iterator
elVecConstIter
;
typedef
std
::
set
<
MElement
*>
elSet
;
typedef
std
::
set
<
MElement
*>
elSet
;
typedef
elSet
::
iterator
elSetIter
;
typedef
elSet
::
iterator
elSetIter
;
...
@@ -233,7 +232,6 @@ static bool testTriSphereIntersect(SPoint3 A, SPoint3 B, SPoint3 C,
...
@@ -233,7 +232,6 @@ static bool testTriSphereIntersect(SPoint3 A, SPoint3 B, SPoint3 C,
// Approximate test of intersection element with circle/sphere by sampling
// Approximate test of intersection element with circle/sphere by sampling
static
bool
testElInDist
(
const
SPoint3
p
,
double
limDist
,
MElement
*
el
)
static
bool
testElInDist
(
const
SPoint3
p
,
double
limDist
,
MElement
*
el
)
{
{
const
double
sampleLen
=
0.5
*
limDist
;
// Distance between sample points
const
double
limDistSq
=
limDist
*
limDist
;
const
double
limDistSq
=
limDist
*
limDist
;
if
(
el
->
getDim
()
==
2
)
{
// 2D?
if
(
el
->
getDim
()
==
2
)
{
// 2D?
...
@@ -242,9 +240,7 @@ static bool testElInDist(const SPoint3 p, double limDist, MElement *el)
...
@@ -242,9 +240,7 @@ static bool testElInDist(const SPoint3 p, double limDist, MElement *el)
el
->
getEdgeVertices
(
iEd
,
edgeVert
);
el
->
getEdgeVertices
(
iEd
,
edgeVert
);
const
SPoint3
A
=
edgeVert
[
0
]
->
point
();
const
SPoint3
A
=
edgeVert
[
0
]
->
point
();
const
SPoint3
B
=
edgeVert
[
1
]
->
point
();
const
SPoint3
B
=
edgeVert
[
1
]
->
point
();
if
(
testSegSphereIntersect
(
A
,
B
,
p
,
limDistSq
))
{
if
(
testSegSphereIntersect
(
A
,
B
,
p
,
limDistSq
))
return
true
;
return
true
;
}
}
}
}
}
else
{
// 3D
else
{
// 3D
...
@@ -255,11 +251,11 @@ static bool testElInDist(const SPoint3 p, double limDist, MElement *el)
...
@@ -255,11 +251,11 @@ static bool testElInDist(const SPoint3 p, double limDist, MElement *el)
const
SPoint3
B
=
faceVert
[
1
]
->
point
();
const
SPoint3
B
=
faceVert
[
1
]
->
point
();
const
SPoint3
C
=
faceVert
[
2
]
->
point
();
const
SPoint3
C
=
faceVert
[
2
]
->
point
();
if
(
faceVert
.
size
()
==
3
)
if
(
faceVert
.
size
()
==
3
)
return
testTriSphereIntersect
(
A
,
B
,
C
,
p
,
limDistSq
);
if
(
testTriSphereIntersect
(
A
,
B
,
C
,
p
,
limDistSq
)
)
return
true
;
else
{
else
{
const
SPoint3
D
=
faceVert
[
3
]
->
point
();
const
SPoint3
D
=
faceVert
[
3
]
->
point
();
return
(
testTriSphereIntersect
(
A
,
B
,
C
,
p
,
limDistSq
)
||
if
(
testTriSphereIntersect
(
A
,
B
,
C
,
p
,
limDistSq
)
||
testTriSphereIntersect
(
A
,
C
,
D
,
p
,
limDistSq
));
testTriSphereIntersect
(
A
,
C
,
D
,
p
,
limDistSq
))
return
true
;
}
}
}
}
}
}
...
@@ -273,12 +269,13 @@ static void getElementNeighbours(MElement *el, const vertElVecMap &v2e,
...
@@ -273,12 +269,13 @@ static void getElementNeighbours(MElement *el, const vertElVecMap &v2e,
{
{
elElSetMap
::
iterator
it
=
e2e
.
find
(
el
);
elElSetMap
::
iterator
it
=
e2e
.
find
(
el
);
if
(
it
==
e2e
.
end
())
{
// If not in e2e, compute and store
if
(
it
==
e2e
.
end
())
{
// If not in e2e, compute and store
neighbours
.
clear
();
for
(
int
i
=
0
;
i
<
el
->
getNumPrimaryVertices
();
++
i
)
{
for
(
int
i
=
0
;
i
<
el
->
getNumPrimaryVertices
();
++
i
)
{
const
elVec
&
adjEl
=
v2e
.
find
(
el
->
getVertex
(
i
))
->
second
;
const
elVec
&
adjEl
=
v2e
.
find
(
el
->
getVertex
(
i
))
->
second
;
neighbours
.
clear
();
for
(
elVecConstIter
itA
=
adjEl
.
begin
();
itA
!=
adjEl
.
end
();
itA
++
)
neighbours
.
insert
(
adjEl
.
begin
(),
adjEl
.
end
());
if
(
*
itA
!=
el
)
neighbours
.
insert
(
*
itA
);
e2e
.
insert
(
std
::
pair
<
MElement
*
,
elSet
>
(
el
,
neighbours
));
}
}
e2e
.
insert
(
std
::
pair
<
MElement
*
,
elSet
>
(
el
,
neighbours
));
}
}
else
neighbours
=
it
->
second
;
else
neighbours
=
it
->
second
;
}
}
...
...
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