Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
X
Xdmf
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
4
Issues
4
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
CrayzeeWulf
Xdmf
Commits
1c4b3e25
Commit
1c4b3e25
authored
Apr 22, 2013
by
Andrew J. Burns (Cont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes to fortran for polylines and file splitting works for single dimensional arrays
parent
b8e830bf
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
148 additions
and
67 deletions
+148
-67
core/XdmfArray.cpp
core/XdmfArray.cpp
+13
-4
core/XdmfHDF5Writer.cpp
core/XdmfHDF5Writer.cpp
+69
-57
tests/Cxx/HugeWriteArray.cpp
tests/Cxx/HugeWriteArray.cpp
+9
-2
utils/XdmfFortran.cpp
utils/XdmfFortran.cpp
+37
-3
utils/XdmfFortran.hpp
utils/XdmfFortran.hpp
+19
-0
utils/tests/Fortran/OutputTestXdmfFortran.f90
utils/tests/Fortran/OutputTestXdmfFortran.f90
+1
-1
utils/tests/Fortran/outputTest
utils/tests/Fortran/outputTest
+0
-0
No files found.
core/XdmfArray.cpp
View file @
1c4b3e25
...
...
@@ -392,7 +392,7 @@ public:
{
unsigned
int
size
=
mStartIndex
+
mNumValues
;
if
(
mArrayStride
>
1
)
{
size
=
mStartIndex
+
mNumValues
*
mArrayStride
-
1
;
size
=
mStartIndex
+
mNumValues
*
mArrayStride
-
(
mStartIndex
%
mArrayStride
)
;
}
if
(
array
->
size
()
<
size
)
{
array
->
resize
(
size
);
...
...
@@ -1757,12 +1757,21 @@ void
XdmfArray
::
read
()
{
if
(
mHeavyDataControllers
.
size
()
>
0
)
{
mHeavyDataControllers
[
0
]
->
read
(
this
);
for
(
int
i
=
1
;
i
<
mHeavyDataControllers
.
size
();
i
++
)
this
->
release
(
);
for
(
int
i
=
0
;
i
<
mHeavyDataControllers
.
size
();
i
++
)
{
shared_ptr
<
XdmfArray
>
tempArray
=
XdmfArray
::
New
();
mHeavyDataControllers
[
i
]
->
read
(
tempArray
.
get
());
this
->
insert
(
this
->
getSize
(),
tempArray
,
0
,
tempArray
->
getSize
());
unsigned
int
startsTotal
=
0
;
unsigned
int
strideTotal
=
1
;
unsigned
int
dimTotal
=
1
;
for
(
int
j
=
0
;
j
<
mHeavyDataControllers
[
i
]
->
getDimensions
().
size
();
j
++
)
{
strideTotal
*=
mHeavyDataControllers
[
i
]
->
getStride
()[
j
];
startsTotal
+=
dimTotal
*
mHeavyDataControllers
[
i
]
->
getStart
()[
j
];
dimTotal
*=
mHeavyDataControllers
[
i
]
->
getDimensions
()[
j
];
}
this
->
insert
(
mHeavyDataControllers
[
i
]
->
getArrayOffset
()
+
startsTotal
,
tempArray
,
0
,
dimTotal
,
strideTotal
,
1
);
}
}
}
...
...
core/XdmfHDF5Writer.cpp
View file @
1c4b3e25
This diff is collapsed.
Click to expand it.
tests/Cxx/HugeWriteArray.cpp
View file @
1c4b3e25
...
...
@@ -47,9 +47,16 @@ int main(int, char **)
writtenArray
->
accept
(
arrayWriter
);
writtenArray
->
release
();
printf
(
"after release
\n
array contains: %s
\n
"
,
writtenArray
->
getValuesString
());
writtenArray
->
read
();
printf
(
"%s
\n\n
"
,
writtenArray
->
getValuesString
());
//printf("%s\n", writtenArray->getValuesString());
printf
(
"array size = %d
\n
"
,
writtenArray
->
getSize
());
for
(
int
i
=
0
;
i
<
writtenArray
->
getSize
();
i
++
)
{
if
(
i
!=
writtenArray
->
getValue
<
int
>
(
i
))
{
printf
(
"%d doesn't match %d
\n
"
,
i
,
writtenArray
->
getValue
<
int
>
(
i
));
}
}
return
0
;
}
utils/XdmfFortran.cpp
View file @
1c4b3e25
...
...
@@ -5890,6 +5890,7 @@ XdmfFortran::write(const char * const xmlFilePath, const int datalimit, const bo
shared_ptr
<
XdmfWriter
>
writer
=
XdmfWriter
::
New
(
xmlFilePath
);
writer
->
setLightDataLimit
(
datalimit
);
writer
->
getHeavyDataWriter
()
->
setReleaseData
(
release
);
shared_dynamic_cast
<
XdmfHDF5Writer
>
(
writer
->
getHeavyDataWriter
())
->
setFileSizeLimit
(
1
);
mDomain
->
accept
(
writer
);
}
...
...
@@ -5908,6 +5909,26 @@ XdmfFortran::read(const char * const xmlFilePath)
mDomain
=
shared_dynamic_cast
<
XdmfDomain
>
(
reader
->
read
(
xmlFilePath
));
}
//temporary fix, hopefully
int
XdmfFortran
::
setTopologyPolyline
(
const
unsigned
int
nodesPerElement
,
const
unsigned
int
numValues
,
const
int
arrayType
,
const
void
*
const
connectivityValues
)
{
mTopology
=
XdmfTopology
::
New
();
mTopology
->
setType
(
XdmfTopologyType
::
Polyline
(
nodesPerElement
));
// insert connectivity values into array
writeToArray
(
mTopology
,
numValues
,
arrayType
,
connectivityValues
);
const
int
id
=
mPreviousTopologies
.
size
();
mPreviousTopologies
.
push_back
(
mTopology
);
return
id
;
}
//
// C++ will mangle the name based on the argument list. This tells the
// compiler not to mangle the name so we can call it from 'C' (but
...
...
@@ -6042,15 +6063,14 @@ extern "C"
int
*
topologyType
,
int
*
numValues
,
int
*
arrayType
,
void
*
connectivityValues
,
int
*
numVals
)
void
*
connectivityValues
)
{
XdmfFortran
*
xdmfFortran
=
reinterpret_cast
<
XdmfFortran
*>
(
*
pointer
);
return
xdmfFortran
->
setTopology
(
*
topologyType
,
*
numValues
,
*
arrayType
,
connectivityValues
,
*
numVals
);
0
);
}
...
...
@@ -7229,5 +7249,19 @@ extern "C"
xdmfFortran
->
read
(
xmlFilePath
);
}
}
int
XdmfSetTopologyPolyline
(
long
*
pointer
,
int
*
nodesPerElement
,
int
*
numValues
,
int
*
arrayType
,
void
*
connectivityValues
)
{
XdmfFortran
*
xdmfFortran
=
reinterpret_cast
<
XdmfFortran
*>
(
*
pointer
);
return
xdmfFortran
->
setTopologyPolyline
(
*
nodesPerElement
,
*
numValues
,
*
arrayType
,
connectivityValues
);
}
}
utils/XdmfFortran.hpp
View file @
1c4b3e25
...
...
@@ -164,6 +164,8 @@ class XdmfUnstructuredGrid;
#define XdmfWriteHDF5 xdmfwritehdf5_
#define XdmfSetTopologyPolyline xdmfsettopologypolyline_
#define XdmfRetrieveNumDomainGridCollections xdmfretrievenumdomaingridcollections_
#define XdmfRetrieveNumGridCollectionGridCollections xdmfretrievenumgridcollectiongridcollections_
...
...
@@ -2196,6 +2198,23 @@ public:
void
read
(
const
char
*
const
xmlFilePath
);
/**
* Set the topology (connectivity data) for a polyline that will be
* added to the next grid.
*
* @param nodesPerElement number of nodes in the polyline.
* @param numValues number of connectivity values to copy.
* @param arrayType type of connectivity values.
* @param connectivityValues array of connectivity values.
*
* @return int providing id to fortran if reusing.
*/
int
setTopologyPolyline
(
const
unsigned
int
nodesPerElement
,
const
unsigned
int
numValues
,
const
int
arrayType
,
const
void
*
const
connectivityValues
);
private:
shared_ptr
<
XdmfDomain
>
mDomain
;
...
...
utils/tests/Fortran/OutputTestXdmfFortran.f90
View file @
1c4b3e25
...
...
@@ -165,7 +165,7 @@ PROGRAM XdmfFortranExample
CALL
XDMFADDGRID
(
obj
,
'Identical'
//
CHAR
(
0
),
XDMF_GRID_TYPE_UNSTRUCTURED
)
CALL
XDMFCLOSEGRIDCOLLECTION
(
obj
)
!! CALL XDMFWRITEHDF5(obj, 'my_output.h5'//CHAR(0))
CALL
XDMFWRITE
(
obj
,
filename
)
CALL
XDMFWRITE
(
obj
,
filename
,
10
,
.TRUE.
)
CALL
XDMFCLOSE
(
obj
)
...
...
utils/tests/Fortran/outputTest
View file @
1c4b3e25
No preview for this file type
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