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
72dfacdc
Commit
72dfacdc
authored
10 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
new 'visible' option for MinMax
parent
2243435d
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
Plugin/Integrate.cpp
+3
-3
3 additions, 3 deletions
Plugin/Integrate.cpp
Plugin/MinMax.cpp
+11
-6
11 additions, 6 deletions
Plugin/MinMax.cpp
with
14 additions
and
9 deletions
Plugin/Integrate.cpp
+
3
−
3
View file @
72dfacdc
...
...
@@ -52,7 +52,7 @@ PView *GMSH_IntegratePlugin::execute(PView * v)
int
iView
=
(
int
)
IntegrateOptions_Number
[
0
].
def
;
int
overTime
=
(
int
)
IntegrateOptions_Number
[
1
].
def
;
int
dimension
=
(
int
)
IntegrateOptions_Number
[
2
].
def
;
bool
checkV
isible
=
(
bool
)
IntegrateOptions_Number
[
3
].
def
;
bool
v
isible
=
(
bool
)
IntegrateOptions_Number
[
3
].
def
;
PView
*
v1
=
getView
(
iView
,
v
);
if
(
!
v1
)
return
v
;
...
...
@@ -72,9 +72,9 @@ PView *GMSH_IntegratePlugin::execute(PView * v)
double
res
=
0
,
resv
[
9
]
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
};
bool
simpleSum
=
false
;
for
(
int
ent
=
0
;
ent
<
data1
->
getNumEntities
(
step
);
ent
++
){
if
(
checkV
isible
&&
data1
->
skipEntity
(
step
,
ent
))
continue
;
if
(
v
isible
&&
data1
->
skipEntity
(
step
,
ent
))
continue
;
for
(
int
ele
=
0
;
ele
<
data1
->
getNumElements
(
step
,
ent
);
ele
++
){
if
(
data1
->
skipElement
(
step
,
ent
,
ele
,
checkV
isible
))
continue
;
if
(
data1
->
skipElement
(
step
,
ent
,
ele
,
v
isible
))
continue
;
int
numComp
=
data1
->
getNumComponents
(
step
,
ent
,
ele
);
int
numEdges
=
data1
->
getNumEdges
(
step
,
ent
,
ele
);
bool
scalar
=
(
numComp
==
1
);
...
...
This diff is collapsed.
Click to expand it.
Plugin/MinMax.cpp
+
11
−
6
View file @
72dfacdc
...
...
@@ -9,7 +9,8 @@
StringXNumber
MinMaxOptions_Number
[]
=
{
{
GMSH_FULLRC
,
"View"
,
NULL
,
-
1.
},
{
GMSH_FULLRC
,
"OverTime"
,
NULL
,
0
},
{
GMSH_FULLRC
,
"Argument"
,
NULL
,
0
}
{
GMSH_FULLRC
,
"Argument"
,
NULL
,
0
},
{
GMSH_FULLRC
,
"Visible"
,
NULL
,
1
}
};
extern
"C"
...
...
@@ -23,9 +24,11 @@ extern "C"
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
"
"If `Argument' = 1, calculates the min/max AND the argmin/argmax
\n\n
"
"If `View' < 0, the plugin is run on the current view. "
"If `OverTime' = 1, the plugin calculates the min/max over "
"space and time. If `Argument' = 1, the plugin calculates the "
"min/max and the argmin/argmax. If `Visible' = 1, the plugin "
"is only applied to visible entities.
\n\n
"
"Plugin(MinMax) creates two new views."
;
}
...
...
@@ -44,6 +47,7 @@ PView *GMSH_MinMaxPlugin::execute(PView * v)
int
iView
=
(
int
)
MinMaxOptions_Number
[
0
].
def
;
int
overTime
=
(
int
)
MinMaxOptions_Number
[
1
].
def
;
int
argument
=
(
int
)
MinMaxOptions_Number
[
2
].
def
;
bool
visible
=
(
bool
)
MinMaxOptions_Number
[
3
].
def
;
PView
*
v1
=
getView
(
iView
,
v
);
if
(
!
v1
)
return
v
;
...
...
@@ -64,15 +68,16 @@ PView *GMSH_MinMaxPlugin::execute(PView * v)
dataMax
->
NbSP
=
1
;
}
double
min
=
VAL_INF
,
max
=
-
VAL_INF
,
timeMin
=
0
,
timeMax
=
0
;
double
min
=
VAL_INF
,
max
=
-
VAL_INF
,
timeMin
=
0
,
timeMax
=
0
;
for
(
int
step
=
0
;
step
<
data1
->
getNumTimeSteps
();
step
++
){
if
(
data1
->
hasTimeStep
(
step
)){
double
minView
=
VAL_INF
,
maxView
=
-
VAL_INF
;
double
xmin
=
0.
,
ymin
=
0.
,
zmin
=
0.
,
xmax
=
0.
,
ymax
=
0.
,
zmax
=
0.
;
for
(
int
ent
=
0
;
ent
<
data1
->
getNumEntities
(
step
);
ent
++
){
if
(
visible
&&
data1
->
skipEntity
(
step
,
ent
))
continue
;
for
(
int
ele
=
0
;
ele
<
data1
->
getNumElements
(
step
,
ent
);
ele
++
){
if
(
data1
->
skipElement
(
step
,
ent
,
ele
,
visible
))
continue
;
for
(
int
nod
=
0
;
nod
<
data1
->
getNumNodes
(
step
,
ent
,
ele
);
nod
++
){
double
val
;
data1
->
getScalarValue
(
step
,
ent
,
ele
,
nod
,
val
);
...
...
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