Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nektar
Nektar
Commits
029285df
Commit
029285df
authored
Aug 12, 2016
by
Dave Moxey
Browse files
Address Chris' comments, fix missing virtual destructor
parent
10363372
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
cmake/ThirdPartyHDF5.cmake
View file @
029285df
...
...
@@ -11,7 +11,8 @@ OPTION(NEKTAR_USE_HDF5
IF
(
NEKTAR_USE_HDF5
)
IF
(
NOT NEKTAR_USE_MPI
)
MESSAGE
(
FATAL_ERROR
"HDF5 requires Nektar++ to be configured with NEKTAR_USE_MPI for MPI support."
)
MESSAGE
(
FATAL_ERROR
"HDF5 requires Nektar++ to be configured with "
"NEKTAR_USE_MPI for MPI support."
)
ENDIF
()
# Try to find parallel system HDF5 first.
...
...
@@ -32,7 +33,7 @@ IF (NEKTAR_USE_HDF5)
"NEKTAR_USE_HDF5"
OFF
)
IF
(
THIRDPARTY_BUILD_HDF5
)
IF
(
NOT
CMAKE_VERSION VERSION_
GREATER 3.1.0 AND NOT CMAKE_VERSION VERSION_EQUAL
3.1.0
)
IF
(
CMAKE_VERSION VERSION_
LESS
3.1.0
)
MESSAGE
(
FATAL_ERROR
"HDF5 compilation requires CMake 3.1.0 or later."
)
ENDIF
()
...
...
docs/user-guide/installation/source.tex
View file @
029285df
...
...
@@ -75,7 +75,7 @@ parallel execution\\
GSMPI
&
&
&
&
\cmark
&
For
parallel execution
\\
HDF5
&
&
\cmark
&
\cmark
&
\cmark
&
For
large-scale parallel I/O
\\
large-scale parallel I/O
(requires CMake >3.1)
\\
PETSc
&
&
&
\cmark
&
\cmark
&
Alternative linear solvers
\\
Scotch
&
&
\cmark
&
\cmark
&
\cmark
&
...
...
library/Demos/LibUtilities/FieldIOBenchmarker.cpp
View file @
029285df
This diff is collapsed.
Click to expand it.
library/FieldUtils/Field.hpp
View file @
029285df
...
...
@@ -399,6 +399,17 @@ struct Field
return
exp
;
};
/**
* @brief Construct a FieldIO object for the file @p filename.
*
* This routine constructs an appropriate FieldIO object for a filename
* through the LibUtilities::FieldIO::GetFileType function to detect the
* file format. The result is then cached in Field::m_fld to avoid needing
* to repeatedly construct the object.
*
* @param filename Filename to open.
* @return Reader for @p filename.
*/
FIELD_UTILS_EXPORT
LibUtilities
::
FieldIOSharedPtr
FieldIOForFile
(
string
filename
)
{
...
...
@@ -714,6 +725,8 @@ struct Field
}
private:
/// Map to store FieldIO instances. Key is the reader type, value is the
/// FieldIO object.
map
<
string
,
LibUtilities
::
FieldIOSharedPtr
>
m_fld
;
};
...
...
library/LibUtilities/BasicUtils/FieldIO.cpp
View file @
029285df
...
...
@@ -74,11 +74,17 @@ std::string fldCmdFormat = SessionReader::RegisterCmdLineArgument(
FieldIOFactory
&
GetFieldIOFactory
()
{
typedef
Loki
::
SingletonHolder
<
FieldIOFactory
,
Loki
::
CreateUsingNew
,
Loki
::
NoDestroy
>
Type
;
SingletonHolder
<
FieldIOFactory
,
Loki
::
CreateUsingNew
,
Loki
::
NoDestroy
,
Loki
::
ClassLevelLockable
>
Type
;
return
Type
::
Instance
();
}
/// Enumerator for auto-detection of FieldIO types.
enum
FieldIOType
{
eXML
,
eHDF5
};
/**
* @brief Determine file type of given input file.
*
...
...
@@ -94,8 +100,7 @@ FieldIOFactory &GetFieldIOFactory()
const
std
::
string
FieldIO
::
GetFileType
(
const
std
::
string
&
filename
,
CommSharedPtr
comm
)
{
// We'll use 0 => XML and 1 => HDF5.
int
code
=
0
;
FieldIOType
ioType
=
eXML
;
int
size
=
comm
->
GetSize
();
int
rank
=
comm
->
GetRank
();
...
...
@@ -123,13 +128,13 @@ const std::string FieldIO::GetFileType(const std::string &filename,
std
::
ifstream
datafile
(
datafilename
.
c_str
(),
ios_base
::
binary
);
code
=
1
;
ioType
=
eHDF5
;
for
(
unsigned
i
=
0
;
i
<
8
&&
datafile
.
good
();
++
i
)
{
unsigned
char
byte
=
datafile
.
get
();
if
(
byte
!=
magic
[
i
])
{
code
=
0
;
ioType
=
eXML
;
break
;
}
}
...
...
@@ -137,15 +142,17 @@ const std::string FieldIO::GetFileType(const std::string &filename,
if
(
size
>
1
)
{
int
code
=
(
int
)
ioType
;
comm
->
Bcast
(
code
,
0
);
ioType
=
(
FieldIOType
)
code
;
}
std
::
string
iofmt
;
if
(
cod
e
==
0
)
if
(
ioTyp
e
==
eXML
)
{
iofmt
=
"Xml"
;
}
else
if
(
code
==
1
)
else
if
(
ioType
==
eHDF5
)
{
iofmt
=
"Hdf5"
;
}
...
...
library/LibUtilities/BasicUtils/FieldIO.h
View file @
029285df
...
...
@@ -233,6 +233,10 @@ public:
LIB_UTILITIES_EXPORT
FieldIO
(
LibUtilities
::
CommSharedPtr
pComm
,
bool
sharedFilesystem
);
LIB_UTILITIES_EXPORT
virtual
~
FieldIO
()
{
}
LIB_UTILITIES_EXPORT
inline
void
Write
(
const
std
::
string
&
outFile
,
std
::
vector
<
FieldDefinitionsSharedPtr
>
&
fielddefs
,
...
...
library/LibUtilities/BasicUtils/FieldIOHdf5.h
View file @
029285df
...
...
@@ -200,6 +200,10 @@ public:
LibUtilities
::
CommSharedPtr
pComm
,
bool
sharedFilesystem
);
LIB_UTILITIES_EXPORT
virtual
~
FieldIOHdf5
()
{
}
/// Get class name
inline
virtual
const
std
::
string
&
GetClassName
()
const
{
...
...
library/LibUtilities/BasicUtils/FieldIOXml.h
View file @
029285df
...
...
@@ -192,6 +192,10 @@ public:
LibUtilities
::
CommSharedPtr
pComm
,
bool
sharedFilesystem
);
LIB_UTILITIES_EXPORT
virtual
~
FieldIOXml
()
{
}
LIB_UTILITIES_EXPORT
void
ImportFieldDefs
(
DataSourceSharedPtr
dataSource
,
std
::
vector
<
FieldDefinitionsSharedPtr
>
&
fielddefs
,
...
...
library/LibUtilities/BasicUtils/PtsIO.h
View file @
029285df
...
...
@@ -73,6 +73,10 @@ public:
LIB_UTILITIES_EXPORT
PtsIO
(
LibUtilities
::
CommSharedPtr
pComm
,
bool
sharedFilesystem
=
false
);
LIB_UTILITIES_EXPORT
virtual
~
PtsIO
()
{
}
LIB_UTILITIES_EXPORT
void
Import
(
const
string
&
inFile
,
PtsFieldSharedPtr
&
ptsField
,
...
...
Write
Preview
Supports
Markdown
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