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
d75aa7f8
Commit
d75aa7f8
authored
15 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
avoid numerical errors on min/max in getScaleValue
parent
c21803e7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+2
-2
2 additions, 2 deletions
CMakeLists.txt
Post/PViewOptions.cpp
+6
-1
6 additions, 1 deletion
Post/PViewOptions.cpp
with
8 additions
and
3 deletions
CMakeLists.txt
+
2
−
2
View file @
d75aa7f8
...
...
@@ -398,8 +398,8 @@ if(ENABLE_METIS)
add_subdirectory
(
contrib/Metis
)
set
(
HAVE_METIS TRUE
)
list
(
APPEND CONFIG_OPTIONS
"Metis"
)
message
(
"WARNING: By including Metis you have to comply with Metis' "
"
special
licensing requirements stated in contrib/Metis/README."
)
message
(
"WARNING: By including Metis you have to comply with Metis'
special
"
"licensing requirements stated in contrib/Metis/README.
txt.
"
)
endif
(
ENABLE_METIS
)
if
(
ENABLE_NETGEN
)
...
...
This diff is collapsed.
Click to expand it.
Post/PViewOptions.cpp
+
6
−
1
View file @
d75aa7f8
...
...
@@ -28,7 +28,12 @@ double PViewOptions::getScaleValue(int iso, int numIso, double min, double max)
if
(
numIso
==
1
)
return
(
min
+
max
)
/
2.
;
if
(
scaleType
==
Linear
){
return
min
+
iso
*
(
max
-
min
)
/
(
numIso
-
1.
);
// treat min/max separately to avoid numerical errors (important
// not to miss first/last discrete iso on piece-wise constant
// datasets)
if
(
iso
==
0
)
return
min
;
else
if
(
iso
==
numIso
-
1
)
return
max
;
else
return
min
+
iso
*
(
max
-
min
)
/
(
numIso
-
1.
);
}
else
if
(
scaleType
==
Logarithmic
){
// should translate scale instead, with smallest val an option!
...
...
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