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
248b8f68
Commit
248b8f68
authored
8 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
revert to "step in [0,numsteps-1]"
parent
bca3490f
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
Graphics/drawScales.cpp
+25
-21
25 additions, 21 deletions
Graphics/drawScales.cpp
with
25 additions
and
21 deletions
Graphics/drawScales.cpp
+
25
−
21
View file @
248b8f68
...
...
@@ -172,57 +172,61 @@ static void drawScaleLabel(drawContext *ctx, PView *p, double xmin, double ymin,
char
label
[
1024
];
int
nt
=
data
->
getNumTimeSteps
();
int
n0
=
data
->
getFirstNonEmptyTimeStep
();
int
n
=
(
nt
-
n0
>
0
)
?
nt
-
n0
:
1
;
char
time
[
256
];
sprintf
(
time
,
opt
->
format
.
c_str
(),
data
->
getTime
(
opt
->
timeStep
));
int
choice
=
opt
->
showTime
;
if
(
choice
==
3
){
// automatic
if
(
n
t
==
1
)
choice
=
0
;
// nothing
else
if
(
n
t
==
2
)
choice
=
2
;
// harmonic
if
(
n
==
1
)
choice
=
0
;
// nothing
else
if
(
n
==
2
)
choice
=
2
;
// harmonic
else
choice
=
4
;
// multi-step data
}
switch
(
choice
){
case
1
:
// time series
if
(
n
t
==
1
)
if
(
n
==
1
)
sprintf
(
label
,
"%s - time %s"
,
data
->
getName
().
c_str
(),
time
);
else
sprintf
(
label
,
"%s - time %s (
%d/
%d)"
,
data
->
getName
().
c_str
(),
time
,
opt
->
timeStep
+
1
,
data
->
getNumTimeSteps
());
sprintf
(
label
,
"%s - time %s (
step %d in [0,
%d
]
)"
,
data
->
getName
().
c_str
(),
time
,
opt
->
timeStep
,
data
->
getNumTimeSteps
()
-
1
);
break
;
case
2
:
// harmonic data
if
(
n
t
<=
2
)
if
(
n
<=
2
)
sprintf
(
label
,
"%s - %s part"
,
data
->
getName
().
c_str
(),
(
opt
->
timeStep
%
2
)
?
"imaginary"
:
"real"
);
(
(
opt
->
timeStep
-
n0
)
%
2
)
?
"imaginary"
:
"real"
);
else
sprintf
(
label
,
"%s - harmonic %s (%d/%d, %s part)"
,
data
->
getName
().
c_str
(),
time
,
opt
->
timeStep
/
2
+
1
,
data
->
getNumTimeSteps
()
/
2
,
(
opt
->
timeStep
%
2
)
?
"imaginary"
:
"real"
);
sprintf
(
label
,
"%s - harmonic %s (%s part, step %d in [0,%d])"
,
data
->
getName
().
c_str
(),
time
,
((
opt
->
timeStep
-
n0
)
%
2
)
?
"imaginary"
:
"real"
,
opt
->
timeStep
,
data
->
getNumTimeSteps
()
-
1
);
break
;
case
3
:
// automatic
// never here
break
;
case
4
:
// multi-step data
if
(
n
t
==
1
)
if
(
n
==
1
)
sprintf
(
label
,
"%s - step %d"
,
data
->
getName
().
c_str
(),
opt
->
timeStep
);
else
sprintf
(
label
,
"%s - step %d
(%d/
%d
)
"
,
data
->
getName
().
c_str
(),
opt
->
timeStep
,
opt
->
timeStep
+
1
,
data
->
getNumTimeSteps
());
sprintf
(
label
,
"%s - step %d
in [0,
%d
]
"
,
data
->
getName
().
c_str
(),
opt
->
timeStep
,
data
->
getNumTimeSteps
()
-
1
);
break
;
case
5
:
// real eigenvalues
if
(
n
t
==
1
)
if
(
n
==
1
)
sprintf
(
label
,
"%s - eigenvalue %s"
,
data
->
getName
().
c_str
(),
time
);
else
sprintf
(
label
,
"%s - eigenvalue %s (
%d/
%d)"
,
data
->
getName
().
c_str
(),
time
,
opt
->
timeStep
+
1
,
data
->
getNumTimeSteps
());
sprintf
(
label
,
"%s - eigenvalue %s (
step %d in [0,
%d
]
)"
,
data
->
getName
().
c_str
(),
time
,
opt
->
timeStep
,
data
->
getNumTimeSteps
()
-
1
);
break
;
case
6
:
// complex eigenvalues
if
(
n
t
==
1
)
if
(
n
==
1
)
sprintf
(
label
,
"%s - eigenvalue %s (%s part)"
,
data
->
getName
().
c_str
(),
time
,
(
opt
->
timeStep
%
2
)
?
"imaginary"
:
"real"
);
time
,
(
(
opt
->
timeStep
-
n0
)
%
2
)
?
"imaginary"
:
"real"
);
else
sprintf
(
label
,
"%s - eigenvalue %s (%d/%d, %s part)"
,
data
->
getName
().
c_str
(),
time
,
opt
->
timeStep
/
2
+
1
,
data
->
getNumTimeSteps
()
/
2
,
(
opt
->
timeStep
%
2
)
?
"imaginary"
:
"real"
);
sprintf
(
label
,
"%s - eigenvalue %s (%s part, step %d in [0,%d])"
,
data
->
getName
().
c_str
(),
time
,
((
opt
->
timeStep
-
n0
)
%
2
)
?
"imaginary"
:
"real"
,
opt
->
timeStep
,
data
->
getNumTimeSteps
()
-
1
);
break
;
default:
sprintf
(
label
,
"%s"
,
data
->
getName
().
c_str
());
...
...
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