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
6d0291e1
Commit
6d0291e1
authored
13 years ago
by
Francois Henrotte
Browse files
Options
Downloads
Patches
Plain Diff
option overTime
parent
b249cc10
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Plugin/MinMax.cpp
+36
-6
36 additions, 6 deletions
Plugin/MinMax.cpp
with
36 additions
and
6 deletions
Plugin/MinMax.cpp
+
36
−
6
View file @
6d0291e1
...
...
@@ -7,7 +7,8 @@
#include
"PViewOptions.h"
StringXNumber
MinMaxOptions_Number
[]
=
{
{
GMSH_FULLRC
,
"View"
,
NULL
,
-
1.
}
{
GMSH_FULLRC
,
"View"
,
NULL
,
-
1.
},
{
GMSH_FULLRC
,
"OverTime"
,
NULL
,
0
}
};
extern
"C"
...
...
@@ -22,6 +23,7 @@ std::string GMSH_MinMaxPlugin::getHelp() const
{
return
"Plugin(MinMax) computes the min/max of a view.
\n\n
"
"If `View' < 0, the plugin is run on the current view.
\n\n
"
"If `OverTime' = 1, calculates the min-max over space AND time
\n\n
"
"Plugin(MinMax) creates two new views."
;
}
...
...
@@ -38,6 +40,7 @@ StringXNumber *GMSH_MinMaxPlugin::getOption(int iopt)
PView
*
GMSH_MinMaxPlugin
::
execute
(
PView
*
v
)
{
int
iView
=
(
int
)
MinMaxOptions_Number
[
0
].
def
;
int
overTime
=
(
int
)
MinMaxOptions_Number
[
1
].
def
;
PView
*
v1
=
getView
(
iView
,
v
);
if
(
!
v1
)
return
v
;
...
...
@@ -53,24 +56,51 @@ PView *GMSH_MinMaxPlugin::execute(PView * v)
double
z
=
data1
->
getBoundingBox
().
center
().
z
();
dataMin
->
SP
.
push_back
(
x
);
dataMin
->
SP
.
push_back
(
y
);
dataMin
->
SP
.
push_back
(
z
);
dataMax
->
SP
.
push_back
(
x
);
dataMax
->
SP
.
push_back
(
y
);
dataMax
->
SP
.
push_back
(
z
);
double
minView
,
maxView
,
min
=
1E200
,
max
=-
1E200
,
timeMin
=
0
,
timeMax
=
0
;
for
(
int
step
=
0
;
step
<
data1
->
getNumTimeSteps
();
step
++
){
if
(
data1
->
hasTimeStep
(
step
)){
dataMin
->
SP
.
push_back
(
data1
->
getMin
(
step
));
dataMax
->
SP
.
push_back
(
data1
->
getMax
(
step
));
minView
=
data1
->
getMin
(
step
);
maxView
=
data1
->
getMax
(
step
);
if
(
minView
<
min
){
min
=
minView
;
timeMin
=
data1
->
getTime
(
step
);
}
if
(
maxView
>
max
){
max
=
maxView
;
timeMax
=
data1
->
getTime
(
step
);
}
if
(
!
overTime
){
dataMin
->
SP
.
push_back
(
data1
->
getMin
(
step
));
dataMax
->
SP
.
push_back
(
data1
->
getMax
(
step
));
}
}
}
if
(
overTime
){
dataMin
->
SP
.
push_back
(
min
);
dataMax
->
SP
.
push_back
(
max
);
}
dataMin
->
NbSP
=
1
;
dataMax
->
NbSP
=
1
;
vMin
->
getOptions
()
->
intervalsType
=
PViewOptions
::
Numeric
;
vMax
->
getOptions
()
->
intervalsType
=
PViewOptions
::
Numeric
;
for
(
int
step
=
0
;
step
<
data1
->
getNumTimeSteps
();
step
++
){
if
(
data1
->
hasTimeStep
(
step
)){
double
time
=
data1
->
getTime
(
step
);
dataMin
->
Time
.
push_back
(
time
);
dataMax
->
Time
.
push_back
(
time
);
if
(
overTime
){
dataMin
->
Time
.
push_back
(
timeMin
);
dataMax
->
Time
.
push_back
(
timeMax
);
}
else
{
double
time
=
data1
->
getTime
(
step
);
dataMin
->
Time
.
push_back
(
time
);
dataMax
->
Time
.
push_back
(
time
);
}
}
}
dataMin
->
setName
(
data1
->
getName
()
+
"_Min"
);
dataMin
->
setFileName
(
data1
->
getName
()
+
"_Min.pos"
);
dataMin
->
finalize
();
...
...
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