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
285d97b7
Commit
285d97b7
authored
17 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
more work on MED IO
parent
8883a67a
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Graphics/Post.cpp
+4
-6
4 additions, 6 deletions
Graphics/Post.cpp
Post/PViewDataGModel.cpp
+10
-6
10 additions, 6 deletions
Post/PViewDataGModel.cpp
Post/PViewDataGModelIO.cpp
+10
-6
10 additions, 6 deletions
Post/PViewDataGModelIO.cpp
with
24 additions
and
18 deletions
Graphics/Post.cpp
+
4
−
6
View file @
285d97b7
// $Id: Post.cpp,v 1.1
59
2008-03-29 1
0:19
:3
6
geuzaine Exp $
// $Id: Post.cpp,v 1.1
60
2008-03-29 1
1:51
:3
7
geuzaine Exp $
//
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
//
...
...
@@ -1209,8 +1209,7 @@ class initPView {
PViewData
*
data
=
p
->
getData
();
PViewOptions
*
opt
=
p
->
getOptions
();
if
(
data
->
getDirty
()
||
!
p
->
getChanged
())
return
;
if
(
data
->
getDirty
()
||
!
data
->
getNumTimeSteps
()
||
!
p
->
getChanged
())
return
;
if
(
!
opt
->
Visible
||
opt
->
Type
!=
PViewOptions
::
Plot3D
)
return
;
if
(
opt
->
UseGenRaise
)
opt
->
createGeneralRaise
();
...
...
@@ -1271,10 +1270,9 @@ class drawPView {
PViewData
*
data
=
p
->
getData
();
PViewOptions
*
opt
=
p
->
getOptions
();
if
(
data
->
getDirty
()
||
!
data
->
getNumTimeSteps
())
return
;
if
(
!
opt
->
Visible
||
opt
->
Type
!=
PViewOptions
::
Plot3D
)
return
;
if
(
data
->
getDirty
())
return
;
glPointSize
(
opt
->
PointSize
);
gl2psPointSize
(
opt
->
PointSize
*
CTX
.
print
.
eps_point_size_factor
);
...
...
This diff is collapsed.
Click to expand it.
Post/PViewDataGModel.cpp
+
10
−
6
View file @
285d97b7
// $Id: PViewDataGModel.cpp,v 1.3
4
2008-03-2
0
11:
44:15
geuzaine Exp $
// $Id: PViewDataGModel.cpp,v 1.3
5
2008-03-2
9
11:
51:37
geuzaine Exp $
//
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
//
...
...
@@ -53,24 +53,25 @@ int PViewDataGModel::getNumTimeSteps()
double
PViewDataGModel
::
getTime
(
int
step
)
{
if
(
_steps
.
empty
())
return
0.
;
return
_steps
[
step
]
->
getTime
();
}
double
PViewDataGModel
::
getMin
(
int
step
)
{
if
(
step
<
0
)
return
_min
;
if
(
step
<
0
||
_steps
.
empty
()
)
return
_min
;
return
_steps
[
step
]
->
getMin
();
}
double
PViewDataGModel
::
getMax
(
int
step
)
{
if
(
step
<
0
)
return
_max
;
if
(
step
<
0
||
_steps
.
empty
()
)
return
_max
;
return
_steps
[
step
]
->
getMax
();
}
SBoundingBox3d
PViewDataGModel
::
getBoundingBox
(
int
step
)
{
if
(
step
<
0
){
if
(
step
<
0
||
_steps
.
empty
()
){
SBoundingBox3d
tmp
;
for
(
unsigned
int
i
=
0
;
i
<
_steps
.
size
();
i
++
)
tmp
+=
_steps
[
i
]
->
getBoundingBox
();
...
...
@@ -81,25 +82,28 @@ SBoundingBox3d PViewDataGModel::getBoundingBox(int step)
int
PViewDataGModel
::
getNumScalars
(
int
step
)
{
if
(
_steps
.
empty
())
return
0
;
if
(
_steps
[
0
]
->
getNumComp
()
==
1
)
return
getNumElements
(
0
);
return
0
;
}
int
PViewDataGModel
::
getNumVectors
(
int
step
)
{
if
(
_steps
.
empty
())
return
0
;
if
(
_steps
[
0
]
->
getNumComp
()
==
3
)
return
getNumElements
(
0
);
return
0
;
}
int
PViewDataGModel
::
getNumTensors
(
int
step
)
{
if
(
_steps
.
empty
())
return
0
;
if
(
_steps
[
0
]
->
getNumComp
()
==
9
)
return
getNumElements
(
0
);
return
0
;
}
int
PViewDataGModel
::
getNumEntities
(
int
step
)
{
if
(
step
<
0
){
if
(
step
<
0
||
_steps
.
empty
()
){
int
num
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
_steps
.
size
();
i
++
)
num
+=
_steps
[
i
]
->
getNumEntities
();
...
...
@@ -110,7 +114,7 @@ int PViewDataGModel::getNumEntities(int step)
int
PViewDataGModel
::
getNumElements
(
int
step
,
int
ent
)
{
if
(
step
<
0
){
if
(
step
<
0
||
_steps
.
empty
()
){
int
num
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
_steps
.
size
();
i
++
){
if
(
ent
<
0
)
...
...
This diff is collapsed.
Click to expand it.
Post/PViewDataGModelIO.cpp
+
10
−
6
View file @
285d97b7
// $Id: PViewDataGModelIO.cpp,v 1.1
4
2008-03-29 1
0:19:43
geuzaine Exp $
// $Id: PViewDataGModelIO.cpp,v 1.1
5
2008-03-29 1
1:51:37
geuzaine Exp $
//
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
//
...
...
@@ -189,8 +189,8 @@ bool PViewDataGModel::readMED(std::string fileName, int fileIndex)
setName
(
name
);
med_int
numSteps
=
MEDnPasdetemps
(
fid
,
name
,
MED_NOEUD
,
MED_NONE
);
if
(
numSteps
<
=
0
){
Msg
(
GERROR
,
"
Invalid
umber of steps"
);
if
(
numSteps
<
0
){
Msg
(
GERROR
,
"
Could not get n
umber of steps"
);
return
false
;
}
...
...
@@ -205,6 +205,7 @@ bool PViewDataGModel::readMED(std::string fileName, int fileIndex)
Msg
(
GERROR
,
"Could not get step info"
);
return
false
;
}
med_int
numNodes
=
MEDnVal
(
fid
,
name
,
MED_NOEUD
,
MED_NONE
,
numdt
,
numo
,
meshName
,
MED_COMPACT
);
if
(
numNodes
<=
0
)
continue
;
...
...
@@ -218,8 +219,9 @@ bool PViewDataGModel::readMED(std::string fileName, int fileIndex)
return
false
;
}
stepData
<
double
>
*
sd
=
new
stepData
<
double
>
(
GModel
::
current
(),
stepData
<
double
>::
NodeData
,
numComp
);
int
numCompGmsh
=
(
numComp
==
2
)
?
3
:
numComp
;
stepData
<
double
>
*
sd
=
new
stepData
<
double
>
(
GModel
::
current
(),
stepData
<
double
>::
NodeData
,
numCompGmsh
);
_steps
.
push_back
(
sd
);
sd
->
setFileName
(
fileName
);
sd
->
setFileIndex
(
fileIndex
);
...
...
@@ -263,7 +265,9 @@ bool PViewDataGModel::readMED(std::string fileName, int fileIndex)
double
*
d
=
sd
->
getData
(
index
,
true
);
for
(
int
j
=
0
;
j
<
numComp
;
j
++
)
d
[
j
]
=
val
[
numComp
*
i
+
j
];
double
s
=
ComputeScalarRep
(
numComp
,
d
);
for
(
int
j
=
numComp
;
j
<
numCompGmsh
;
j
++
)
d
[
j
]
=
0.
;
double
s
=
ComputeScalarRep
(
numCompGmsh
,
d
);
sd
->
setMin
(
std
::
min
(
sd
->
getMin
(),
s
));
sd
->
setMax
(
std
::
max
(
sd
->
getMax
(),
s
));
}
...
...
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