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
f12fdc7b
Commit
f12fdc7b
authored
15 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
new MinMax plugin
parent
4551bc74
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Plugin/CMakeLists.txt
+1
-1
1 addition, 1 deletion
Plugin/CMakeLists.txt
Plugin/MinMax.cpp
+79
-0
79 additions, 0 deletions
Plugin/MinMax.cpp
Plugin/MinMax.h
+31
-0
31 additions, 0 deletions
Plugin/MinMax.h
Plugin/PluginManager.cpp
+3
-0
3 additions, 0 deletions
Plugin/PluginManager.cpp
with
114 additions
and
1 deletion
Plugin/CMakeLists.txt
+
1
−
1
View file @
f12fdc7b
...
...
@@ -20,7 +20,7 @@ set(SRC
MakeSimplex.cpp
Integrate.cpp Gradient.cpp Curl.cpp Divergence.cpp
Annotate.cpp Remove.cpp
Probe.cpp
Probe.cpp
MinMax.cpp
HarmonicToTime.cpp ModulusPhase.cpp
HomologyComputation.cpp
Distance.cpp ExtractEdges.cpp
...
...
This diff is collapsed.
Click to expand it.
Plugin/MinMax.cpp
0 → 100644
+
79
−
0
View file @
f12fdc7b
// Gmsh - Copyright (C) 1997-2010 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
#include
"MinMax.h"
#include
"shapeFunctions.h"
#include
"PViewOptions.h"
StringXNumber
MinMaxOptions_Number
[]
=
{
{
GMSH_FULLRC
,
"View"
,
NULL
,
-
1.
}
};
extern
"C"
{
GMSH_Plugin
*
GMSH_RegisterMinMaxPlugin
()
{
return
new
GMSH_MinMaxPlugin
();
}
}
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
"
"Plugin(MinMax) creates one new view."
;
}
int
GMSH_MinMaxPlugin
::
getNbOptions
()
const
{
return
sizeof
(
MinMaxOptions_Number
)
/
sizeof
(
StringXNumber
);
}
StringXNumber
*
GMSH_MinMaxPlugin
::
getOption
(
int
iopt
)
{
return
&
MinMaxOptions_Number
[
iopt
];
}
PView
*
GMSH_MinMaxPlugin
::
execute
(
PView
*
v
)
{
int
iView
=
(
int
)
MinMaxOptions_Number
[
0
].
def
;
PView
*
v1
=
getView
(
iView
,
v
);
if
(
!
v1
)
return
v
;
PViewData
*
data1
=
v1
->
getData
();
PView
*
vMin
=
new
PView
();
PView
*
vMax
=
new
PView
();
PViewDataList
*
dataMin
=
getDataList
(
vMin
);
PViewDataList
*
dataMax
=
getDataList
(
vMax
);
double
x
=
data1
->
getBoundingBox
().
center
().
x
();
double
y
=
data1
->
getBoundingBox
().
center
().
y
();
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
);
for
(
int
step
=
0
;
step
<
data1
->
getNumTimeSteps
();
step
++
){
dataMin
->
SP
.
push_back
(
data1
->
getMin
(
step
));
dataMax
->
SP
.
push_back
(
data1
->
getMax
(
step
));
}
dataMin
->
NbSP
=
1
;
dataMax
->
NbSP
=
1
;
vMin
->
getOptions
()
->
intervalsType
=
PViewOptions
::
Numeric
;
vMax
->
getOptions
()
->
intervalsType
=
PViewOptions
::
Numeric
;
for
(
int
i
=
0
;
i
<
data1
->
getNumTimeSteps
();
i
++
){
double
time
=
data1
->
getTime
(
i
);
dataMin
->
Time
.
push_back
(
time
);
dataMax
->
Time
.
push_back
(
time
);
}
dataMin
->
setName
(
data1
->
getName
()
+
"_Min"
);
dataMin
->
setFileName
(
data1
->
getName
()
+
"_Min.pos"
);
dataMin
->
finalize
();
dataMax
->
setName
(
data1
->
getName
()
+
"_Max"
);
dataMax
->
setFileName
(
data1
->
getName
()
+
"_Max.pos"
);
dataMax
->
finalize
();
return
0
;
}
This diff is collapsed.
Click to expand it.
Plugin/MinMax.h
0 → 100644
+
31
−
0
View file @
f12fdc7b
// Gmsh - Copyright (C) 1997-2010 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
#ifndef _MIN_MAX_H_
#define _MIN_MAX_H_
#include
"Plugin.h"
extern
"C"
{
GMSH_Plugin
*
GMSH_RegisterMinMaxPlugin
();
}
class
GMSH_MinMaxPlugin
:
public
GMSH_PostPlugin
{
public:
GMSH_MinMaxPlugin
(){}
std
::
string
getName
()
const
{
return
"MinMax"
;
}
std
::
string
getShortHelp
()
const
{
return
"Get the min/max of a dataset"
;
}
std
::
string
getHelp
()
const
;
int
getNbOptions
()
const
;
StringXNumber
*
getOption
(
int
iopt
);
PView
*
execute
(
PView
*
);
};
#endif
This diff is collapsed.
Click to expand it.
Plugin/PluginManager.cpp
+
3
−
0
View file @
f12fdc7b
...
...
@@ -23,6 +23,7 @@
#include
"HarmonicToTime.h"
#include
"ModulusPhase.h"
#include
"Integrate.h"
#include
"MinMax.h"
#include
"Gradient.h"
#include
"Curl.h"
#include
"Divergence.h"
...
...
@@ -186,6 +187,8 @@ void PluginManager::registerDefaultPlugins()
(
"ModulusPhase"
,
GMSH_RegisterModulusPhasePlugin
()));
allPlugins
.
insert
(
std
::
pair
<
std
::
string
,
GMSH_Plugin
*>
(
"Integrate"
,
GMSH_RegisterIntegratePlugin
()));
allPlugins
.
insert
(
std
::
pair
<
std
::
string
,
GMSH_Plugin
*>
(
"MinMax"
,
GMSH_RegisterMinMaxPlugin
()));
allPlugins
.
insert
(
std
::
pair
<
std
::
string
,
GMSH_Plugin
*>
(
"Gradient"
,
GMSH_RegisterGradientPlugin
()));
allPlugins
.
insert
(
std
::
pair
<
std
::
string
,
GMSH_Plugin
*>
...
...
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