Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
S
src
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
6
Issues
6
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Code Review
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
H5hut
src
Commits
82c594c1
Commit
82c594c1
authored
Dec 07, 2006
by
Christina Siegerist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made the new api changes again. They were probably lost in overlapping
commits.
parent
c96b859f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
35 deletions
+35
-35
visit_plugins/databases/H5Part/avth5partFileFormat.C
visit_plugins/databases/H5Part/avth5partFileFormat.C
+34
-34
visit_plugins/databases/H5Part/avth5partFileFormat.h
visit_plugins/databases/H5Part/avth5partFileFormat.h
+1
-1
No files found.
visit_plugins/databases/H5Part/avth5partFileFormat.C
View file @
82c594c1
...
@@ -24,7 +24,6 @@
...
@@ -24,7 +24,6 @@
//h5part specific
//h5part specific
#include <H5Part.h>
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
...
@@ -82,11 +81,11 @@ avth5partFileFormat::avth5partFileFormat(const char *filename)
...
@@ -82,11 +81,11 @@ avth5partFileFormat::avth5partFileFormat(const char *filename)
pointvarnames
.
resize
(
npointvars
);
pointvarnames
.
resize
(
npointvars
);
cout
<<
"constructor: nvariables: "
<<
npointvars
<<
"
\n
"
;
cout
<<
"constructor: nvariables: "
<<
npointvars
<<
"
\n
"
;
char
name
[
64
];
char
name
[
128
];
in
t
status
;
h5part_int64_
t
status
;
for
(
j
=
0
;
j
<
npointvars
;
j
++
){
for
(
j
=
0
;
j
<
npointvars
;
j
++
){
status
=
H5PartGetDatasetName
(
file
,
j
,
name
,
64
);
status
=
H5PartGetDatasetName
(
file
,
j
,
name
,
128
);
if
(
status
!=
1
){
if
(
status
!=
H5PART_SUCCESS
){
EXCEPTION1
(
VisItException
,
"could not read a variable name"
);
EXCEPTION1
(
VisItException
,
"could not read a variable name"
);
}
}
pointvarnames
[
j
]
=
name
;
pointvarnames
[
j
]
=
name
;
...
@@ -110,13 +109,13 @@ avth5partFileFormat::avth5partFileFormat(const char *filename)
...
@@ -110,13 +109,13 @@ avth5partFileFormat::avth5partFileFormat(const char *filename)
int
int
avth5partFileFormat
::
GetNTimesteps
(
void
)
avth5partFileFormat
::
GetNTimesteps
(
void
)
{
{
in
t
nt
;
h5part_int64_
t
nt
;
H5PartFile
*
file
;
H5PartFile
*
file
;
file
=
H5PartOpenFile
(
fname
.
c_str
(),
H5PART_READ
);
file
=
H5PartOpenFile
(
fname
.
c_str
(),
H5PART_READ
);
H5PartSetStep
(
file
,
0
);
H5PartSetStep
(
file
,
0
);
nt
=
H5PartGetNumSteps
(
file
);
/* get number of steps in file */
nt
=
H5PartGetNumSteps
(
file
);
/* get number of steps in file */
H5PartCloseFile
(
file
);
H5PartCloseFile
(
file
);
return
nt
;
return
(
int
)
nt
;
}
}
...
@@ -333,14 +332,15 @@ avth5partFileFormat::GetMesh(int timestate, int domain, const char *meshname)
...
@@ -333,14 +332,15 @@ avth5partFileFormat::GetMesh(int timestate, int domain, const char *meshname)
#ifdef PARALLEL_IO
#ifdef PARALLEL_IO
nprocs
=
PAR_Size
();
nprocs
=
PAR_Size
();
#endif
#endif
H5PartSetStep
(
file
,
timestate
);
H5PartSetStep
(
file
,
timestate
);
//points
//points
tnpoints
=
(
int
)
H5PartGetNumParticles
(
file
);
tnpoints
=
(
int
)
H5PartGetNumParticles
(
file
);
unsigned
long
long
idStart
=
((
in
t
)(
tnpoints
/
nprocs
))
*
domain
;
h5part_int64_t
idStart
=
((
h5part_int64_
t
)(
tnpoints
/
nprocs
))
*
domain
;
unsigned
long
long
idEnd
;
h5part_int64_t
idEnd
;
if
(
domain
<
nprocs
-
1
)
if
(
domain
<
nprocs
-
1
)
idEnd
=
((
unsigned
long
in
t
)(
tnpoints
/
nprocs
))
*
(
domain
+
1
);
idEnd
=
((
h5part_int64_
t
)(
tnpoints
/
nprocs
))
*
(
domain
+
1
);
else
if
(
domain
==
nprocs
-
1
)
else
if
(
domain
==
nprocs
-
1
)
idEnd
=
tnpoints
;
idEnd
=
tnpoints
;
...
@@ -358,21 +358,21 @@ avth5partFileFormat::GetMesh(int timestate, int domain, const char *meshname)
...
@@ -358,21 +358,21 @@ avth5partFileFormat::GetMesh(int timestate, int domain, const char *meshname)
EXCEPTION1
(
VisItException
,
"npoints is zero"
);
EXCEPTION1
(
VisItException
,
"npoints is zero"
);
points
.
resize
(
npoints
*
nspace
);
points
.
resize
(
npoints
*
nspace
);
double
*
x
,
*
y
,
*
z
;
h5part_float64_t
*
x
,
*
y
,
*
z
;
x
=
(
double
*
)
malloc
(
sizeof
(
double
)
*
npoints
);
x
=
(
h5part_float64_t
*
)
malloc
(
sizeof
(
h5part_float64_t
)
*
npoints
);
y
=
(
double
*
)
malloc
(
sizeof
(
double
)
*
npoints
);
y
=
(
h5part_float64_t
*
)
malloc
(
sizeof
(
h5part_float64_t
)
*
npoints
);
z
=
(
double
*
)
malloc
(
sizeof
(
double
)
*
npoints
);
z
=
(
h5part_float64_t
*
)
malloc
(
sizeof
(
h5part_float64_t
)
*
npoints
);
int
status
=
0
;
h5part_int64_t
status
=
H5PART_SUCCESS
;
status
=
H5PartReadDataFloat64
(
file
,
"x"
,
x
);
status
=
H5PartReadDataFloat64
(
file
,
"x"
,
x
);
if
(
status
!=
1
)
if
(
status
!=
H5PART_SUCCESS
)
EXCEPTION1
(
VisItException
,
"Could not read x coordinates"
);
EXCEPTION1
(
VisItException
,
"Could not read x coordinates"
);
status
=
H5PartReadDataFloat64
(
file
,
"y"
,
y
);
status
=
H5PartReadDataFloat64
(
file
,
"y"
,
y
);
if
(
status
!=
1
)
if
(
status
!=
H5PART_SUCCESS
)
EXCEPTION1
(
VisItException
,
"Could not read y coordinates"
);
EXCEPTION1
(
VisItException
,
"Could not read y coordinates"
);
status
=
H5PartReadDataFloat64
(
file
,
"z"
,
z
);
status
=
H5PartReadDataFloat64
(
file
,
"z"
,
z
);
if
(
status
!=
1
)
if
(
status
!=
H5PART_SUCCESS
)
EXCEPTION1
(
VisItException
,
"Could not read z coordinates"
);
EXCEPTION1
(
VisItException
,
"Could not read z coordinates"
);
for
(
long
int
i
=
0
;
i
<
npoints
;
i
++
){
for
(
long
int
i
=
0
;
i
<
npoints
;
i
++
){
points
[
nspace
*
i
]
=
(
float
)
x
[
i
];
points
[
nspace
*
i
]
=
(
float
)
x
[
i
];
...
@@ -464,8 +464,8 @@ avth5partFileFormat::GetVar(int timestate, int domain, const char *varname)
...
@@ -464,8 +464,8 @@ avth5partFileFormat::GetVar(int timestate, int domain, const char *varname)
if
(
!
file
)
if
(
!
file
)
EXCEPTION1
(
InvalidFilesException
,
fname
.
c_str
());
EXCEPTION1
(
InvalidFilesException
,
fname
.
c_str
());
in
t
status
;
h5part_int64_
t
status
;
long
in
t
tnpoints
,
npoints
;
h5part_int64_
t
tnpoints
,
npoints
;
int
npointvars
;
int
npointvars
;
int
nspace
=
3
;
int
nspace
=
3
;
int
nprocs
=
1
;
int
nprocs
=
1
;
...
@@ -475,44 +475,44 @@ avth5partFileFormat::GetVar(int timestate, int domain, const char *varname)
...
@@ -475,44 +475,44 @@ avth5partFileFormat::GetVar(int timestate, int domain, const char *varname)
H5PartSetStep
(
file
,
timestate
);
H5PartSetStep
(
file
,
timestate
);
//points
//points
tnpoints
=
(
long
int
)
H5PartGetNumParticles
(
file
);
tnpoints
=
H5PartGetNumParticles
(
file
);
//point vars
//point vars
char
name
[
64
];
char
name
[
64
];
long
long
*
idvar
;
h5part_int64_t
*
idvar
;
double
*
data
;
double
*
data
;
unsigned
long
long
idStart
=
((
in
t
)(
tnpoints
/
nprocs
))
*
domain
;
h5part_int64_t
idStart
=
((
h5part_int64_
t
)(
tnpoints
/
nprocs
))
*
domain
;
unsigned
long
long
idEnd
;
h5part_int64_t
idEnd
;
if
(
domain
<
nprocs
-
1
)
if
(
domain
<
nprocs
-
1
)
idEnd
=
((
unsigned
long
in
t
)(
tnpoints
/
nprocs
))
*
(
domain
+
1
);
idEnd
=
((
h5part_int64_
t
)(
tnpoints
/
nprocs
))
*
(
domain
+
1
);
else
if
(
domain
==
nprocs
-
1
)
else
if
(
domain
==
nprocs
-
1
)
idEnd
=
tnpoints
;
idEnd
=
(
h5part_int64_t
)
tnpoints
;
H5PartSetView
(
file
,
idStart
,
idEnd
);
H5PartSetView
(
file
,
idStart
,
idEnd
);
npoints
=
(
int
)
H5PartGetNumParticles
(
file
);
npoints
=
H5PartGetNumParticles
(
file
);
cout
<<
"GetVar: npoints for domain "
<<
domain
<<
": "
<<
npoints
<<
"
\n
"
;
cout
<<
"GetVar: npoints for domain "
<<
domain
<<
": "
<<
npoints
<<
"
\n
"
;
for
(
int
j
=
0
;
j
<
pointvarnames
.
size
(
);
j
++
){
for
(
size_t
j
=
0
;
j
<
(
size_t
)(
pointvarnames
.
size
()
);
j
++
){
status
=
H5PartGetDatasetName
(
file
,
j
,
name
,
64
);
status
=
H5PartGetDatasetName
(
file
,
j
,
name
,
64
);
if
(
pointvarnames
[
j
]
==
name
)
{
if
(
pointvarnames
[
j
]
==
name
)
{
if
(
strstr
(
name
,
"id"
)
!=
NULL
){
if
(
strstr
(
name
,
"id"
)
!=
NULL
){
idvar
=
(
long
long
*
)
malloc
(
sizeof
(
long
long
)
*
npoints
);
idvar
=
(
h5part_int64_t
*
)
malloc
(
sizeof
(
h5part_int64_t
)
*
npoints
);
status
=
H5PartReadDataInt64
(
file
,
name
,
idvar
);
status
=
H5PartReadDataInt64
(
file
,
name
,
idvar
);
if
(
status
!=
1
)
if
(
status
!=
H5PART_SUCCESS
)
EXCEPTION1
(
VisItException
,
"Could not read dataset"
);
EXCEPTION1
(
VisItException
,
"Could not read dataset"
);
pointvars
[
j
].
resize
(
npoints
);
pointvars
[
j
].
resize
(
npoints
);
for
(
long
int
i
=
0
;
i
<
npoints
;
i
++
){
for
(
size_t
i
=
0
;
i
<
(
size_t
)
npoints
;
i
++
){
pointvars
[
j
][
i
]
=
(
float
)
idvar
[
i
];
pointvars
[
j
][
i
]
=
(
float
)
idvar
[
i
];
}
}
if
(
idvar
!=
NULL
)
if
(
idvar
!=
NULL
)
free
(
idvar
);
free
(
idvar
);
}
else
{
}
else
{
data
=
(
double
*
)
malloc
(
sizeof
(
double
)
*
npoints
);
data
=
(
h5part_float64_t
*
)
malloc
(
sizeof
(
h5part_float64_t
)
*
npoints
);
status
=
H5PartReadDataFloat64
(
file
,
name
,
data
);
status
=
H5PartReadDataFloat64
(
file
,
name
,
data
);
if
(
status
!=
1
)
if
(
status
!=
H5PART_SUCCESS
)
EXCEPTION1
(
VisItException
,
"Could not read dataset"
);
EXCEPTION1
(
VisItException
,
"Could not read dataset"
);
pointvars
[
j
].
resize
(
npoints
);
pointvars
[
j
].
resize
(
npoints
);
for
(
long
int
i
=
0
;
i
<
npoints
;
i
++
){
for
(
size_t
i
=
0
;
i
<
(
size_t
)(
npoints
)
;
i
++
){
pointvars
[
j
][
i
]
=
(
float
)
data
[
i
];
pointvars
[
j
][
i
]
=
(
float
)
data
[
i
];
}
}
if
(
data
!=
NULL
)
if
(
data
!=
NULL
)
...
...
visit_plugins/databases/H5Part/avth5partFileFormat.h
View file @
82c594c1
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
#define AVT_h5part_FILE_FORMAT_H
#define AVT_h5part_FILE_FORMAT_H
#include <avtMTMDFileFormat.h>
#include <avtMTMDFileFormat.h>
#include <H5Part.h
h
>
#include <H5Part.h>
#include <vector>
#include <vector>
#include <string>
#include <string>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment