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
da65fb08
Commit
da65fb08
authored
12 years ago
by
Thomas Toulorge
Browse files
Options
Downloads
Patches
Plain Diff
Take closest point if point not found in meshMetric evaluation
parent
df187230
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Mesh/meshMetric.cpp
+24
-5
24 additions, 5 deletions
Mesh/meshMetric.cpp
with
24 additions
and
5 deletions
Mesh/meshMetric.cpp
+
24
−
5
View file @
da65fb08
...
...
@@ -771,17 +771,28 @@ double meshMetric::operator() (double x, double y, double z, GEntity *ge)
MElement
::
setTolerance
(
1.e-4
);
MElement
*
e
=
_octree
->
find
(
x
,
y
,
z
,
_dim
);
MElement
::
setTolerance
(
initialTol
);
if
(
e
){
double
value
=
0.
;
if
(
e
)
{
e
->
xyz2uvw
(
xyz
,
uvw
);
double
*
val
=
new
double
[
e
->
getNumVertices
()];
for
(
int
i
=
0
;
i
<
e
->
getNumVertices
();
i
++
){
val
[
i
]
=
_nodalSizes
[
e
->
getVertex
(
i
)];
}
double
value
=
e
->
interpolate
(
val
,
uvw
[
0
],
uvw
[
1
],
uvw
[
2
]);
value
=
e
->
interpolate
(
val
,
uvw
[
0
],
uvw
[
1
],
uvw
[
2
]);
delete
[]
val
;
return
value
;
}
return
1.e22
;
else
{
Msg
::
Warning
(
"point %g %g %g not found, looking for nearest node"
,
x
,
y
,
z
);
double
minDist
=
1.e100
;
for
(
nodalField
::
iterator
it
=
_nodalSizes
.
begin
();
it
!=
_nodalSizes
.
end
();
it
++
)
{
const
double
dist
=
xyz
.
distance
(
it
->
first
->
point
());
if
(
dist
<=
minDist
)
{
minDist
=
dist
;
value
=
it
->
second
;
}
}
}
return
value
;
}
void
meshMetric
::
operator
()
(
double
x
,
double
y
,
double
z
,
SMetric3
&
metr
,
GEntity
*
ge
)
...
...
@@ -813,7 +824,15 @@ void meshMetric::operator() (double x, double y, double z, SMetric3 &metr, GEnti
}
}
else
{
Msg
::
Warning
(
"point %g %g %g not found"
,
x
,
y
,
z
);
Msg
::
Warning
(
"point %g %g %g not found, looking for nearest node"
,
x
,
y
,
z
);
double
minDist
=
1.e100
;
for
(
nodalMetricTensor
::
iterator
it
=
_nodalMetrics
.
begin
();
it
!=
_nodalMetrics
.
end
();
it
++
)
{
const
double
dist
=
xyz
.
distance
(
it
->
first
->
point
());
if
(
dist
<=
minDist
)
{
minDist
=
dist
;
metr
=
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