Commit e9a8338c authored by Kitware Robot's avatar Kitware Robot Committed by Joseph G. Hennessey

xdmf3 2016-08-24 (fb210b8c)

Code extracted from:

    git://xdmf.org/Xdmf.git

at commit fb210b8cc8061a7001f679f35e870416261237e5 (master).
parent aa488a65
Pipeline #27041 passed with stage
......@@ -62,7 +62,7 @@ MACRO(VersionWrite vProjectName export_name)
FOREACH(il ${include_list})
SET(includes "${includes}\n\#include \"${il}\"")
ENDFOREACH()
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${vProjectName}Version.hpp
FILE(WRITE ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${vProjectName}Version.hpp
"/* Current Version of ${vProjectName}
* Major is: ${vMajor}
* Minor is: ${vMinor}
......@@ -73,7 +73,7 @@ ${includes}
extern ${export_name} ProjectVersion ${vProjectName}Version;\n"
)
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${vProjectName}Version.cpp
FILE(WRITE ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${vProjectName}Version.cpp
"/* Current Version of ${vProjectName}
* Make sure to include this file in your built sources
*/
......
......@@ -59,10 +59,13 @@ include(XdmfFunctions)
get_filename_component(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" ABSOLUTE)
# RPath
#set(CMAKE_SKIP_BUILD_RPATH FALSE)
#set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
#set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
#set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
option(XDMF_SET_RPATH ON)
if (XDMF_SET_RPATH)
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
endif ()
# Should we build with documentation
option(XDMF_BUILD_DOCUMENTATION OFF)
......@@ -294,6 +297,7 @@ include_directories(${XdmfCore_INCLUDE_DIRS} ${XdmfDSM_INCLUDE_DIRS})
link_directories(${XDMF_LIBRARY_DIRS})
option(XDMF_BUILD_CORE_ONLY OFF)
mark_as_advanced(XDMF_BUILD_CORE_ONLY)
if(NOT XDMF_BUILD_CORE_ONLY)
set(XdmfSources
XdmfAggregate
......@@ -364,16 +368,16 @@ if(NOT XDMF_BUILD_CORE_ONLY)
set_target_properties(${XDMF_LIBNAME} PROPERTIES
PREFIX ../
IMPORT_PREFIX ../
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/${CMAKE_CFG_INTDIR}/
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/${CMAKE_CFG_INTDIR}/)
if(XDMF_STATIC_AND_SHARED AND BUILD_SHARED_LIBS)
set_target_properties(Xdmf_Static PROPERTIES
PREFIX ../
IMPORT_PREFIX ../
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/${CMAKE_CFG_INTDIR}/
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/${CMAKE_CFG_INTDIR}/)
endif ()
endif()
endif()
......
<?xml version="1.0" encoding="UTF-8"?>
<!--Root element of dataset-->
<!ELEMENT Xdmf (Information*, Domain+)>
<!ATTLIST Xdmf
Version CDATA #IMPLIED
>
<!--Contains domain data information-->
<!ELEMENT Domain (Information*, Grid+)>
<!ATTLIST Domain
Name CDATA #IMPLIED
>
<!--Contains a collection of homogeneous elements-->
<!ELEMENT Grid (Information*, Time*, Grid*, Topology*, Geometry*, Attribute*)>
<!ATTLIST Grid
Name CDATA #IMPLIED
GridType (Uniform | Collection) "Uniform"
CollectionType (Spatial | Temporal) "Spatial"
>
<!--Contains a graph of points-->
<!ELEMENT Graph (Information*, Time*, Attribute*)>
<!ATTLIST Graph
Name CDATA #IMPLIED
NumberColumns CDATA #REQUIRED
NumberRows CDATA #REQUIRED
>
<!-- Described Temporal Relationship -->
<!ELEMENT Time (Information*)>
<!ATTLIST Time
Value CDATA #IMPLIED
>
<!--Describes the general organization of the data-->
<!ELEMENT Topology (Information*, DataItem*)>
<!ATTLIST Topology
TopologyType (NoTopologyType | Polyvertex | Polyline | Polygon | Triangle | Quadrilateral | Tetrahedron | Wedge | Hexahedron | Edge_3 | Triangle_6 | Quadrilateral_8 | Quadrilateral_9 | Tetrahedron_10 | Pyramid_13 | Wedge_15 | Wedge_18 | Hexahedron_20 | Hexahedron_24 | Hexahedron_27 | Hexahedron_64 | Hexahedron_125 | Hexahedron_216 | Hexahedron_343 | Hexahedron_512 | Hexahedron_729 | Hexahedron_1000 | Hexahedron_1331 | Hexahedron_Spectral_64 | Hexahedron_Spectral_125 | Hexahedron_Spectral_216 | Hexahedron_Spectral_343 | Hexahedron_Spectral_512 | Hexahedron_Spectral_729 | Hexahedron_Spectral_1000 | Hexahedron_Spectral_1331 | Mixed | 2DSMesh | 2DRectMesh | 2DCoRectMesh | 3DSMesh | 3DRectMesh | 3DCoRectMesh) #REQUIRED
Dimensions CDATA #IMPLIED
Order CDATA #IMPLIED
NodesPerElement CDATA #IMPLIED
>
<!--Describes the XYZ values of the mesh-->
<!ELEMENT Geometry (Information*, DataItem+)>
<!ATTLIST Geometry
Name CDATA #IMPLIED
GeometryType (XYZ | XY | X_Y_Z | VXVYVZ | ORIGIN_DXDYDZ) "XYZ"
>
<!--Lowest level element, describes the data that is present in the XDMF dataset-->
<!ELEMENT DataItem (#PCDATA | DataItem)*>
<!ATTLIST DataItem
Name CDATA #IMPLIED
ItemType (Uniform | HyperSlab | Function) "Uniform"
Dimensions CDATA #REQUIRED
NumberType (Char | UChar | Float | Int | UInt) "Float"
Precision (1 | 4 | 8) "4"
Reference CDATA #IMPLIED
Endian (Big | Little | Native) "Native"
Format (XML | HDF | Binary | TIFF) "XML"
>
<!--Describes the values on the mesh-->
<!ELEMENT Attribute (Information*, DataItem)>
<!ATTLIST Attribute
Name CDATA #IMPLIED
Center (Node | Cell | Grid | Face | Edge) "Node"
AttributeType (Scalar | Vector | Tensor | Tensor6 | Matrix) "Scalar"
>
<!--Describes subsections of a grid-->
<!ELEMENT Set (Information*, DataItem)>
<!ATTLIST Set
Name CDATA #IMPLIED
Type (NoSetType | Node | Cell | Face | Edge) "Node"
>
<!--Describes a node maping-->
<!ELEMENT Map (Information*, DataItem*)>
<!ATTLIST Map
Name CDATA #IMPLIED
>
<!-- Application Dependent -->
<!ELEMENT Information (#PCDATA | Information | EMPTY)*>
<!ATTLIST Information
Name CDATA #IMPLIED
Value CDATA #IMPLIED
>
<!--The Definitions of these three items are extremely loose-->
<!ELEMENT Aggregate ANY>
<!ELEMENT Subset ANY>
<!ELEMENT Function ANY>
......@@ -192,7 +192,7 @@ protected:
private:
XdmfTopology(const XdmfTopology &);
XdmfTopology(const XdmfTopology &); // Not implemented.
void operator=(const XdmfTopology &); // Not implemented.
shared_ptr<const XdmfTopologyType> mType;
......
......@@ -9,7 +9,7 @@ include(SetUpVersion)
include(TestBigEndian)
if(VERSION_CONTROL_AUTOUPDATE OR
NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/XdmfVersion.hpp)
NOT EXISTS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/XdmfVersion.hpp)
VersionCreate("Xdmf" "3" "3" "0" "XDMFCORE_EXPORT" "XdmfCore.hpp")
endif()
......@@ -28,6 +28,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
#set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
option(XDMF_BUILD_DSM OFF)
mark_as_advanced(XDMF_BUILD_DSM)
if(XDMF_BUILD_DSM)
option(XDMF_BUILD_DSM_THREADS ON)
......@@ -53,6 +54,13 @@ endif ()
mark_as_advanced(CLEAR HDF5_C_INCLUDE_DIR)
mark_as_advanced(CLEAR HDF5_hdf5_LIBRARY_DEBUG)
mark_as_advanced(CLEAR HDF5_hdf5_LIBRARY_RELEASE)
if (NOT ("${vtkhdf5_LIBRARIES}" STREQUAL ""))
set(HDF5_LIBRARIES ${vtkhdf5_LIBRARIES})
set(HDF5_hdf5_LIBRARY_RELEASE ${vtkhdf5_LIBRARIES})
set(HDF5_INCLUDE_DIRS ${vtkhdf5_INCLUDE_DIRS})
set(HDF5_C_INCLUDE_DIR ${vtkhdf5_INCLUDE_DIRS})
set(HDF5_FOUND TRUE)
endif ()
find_package(HDF5 REQUIRED)
if(HDF5_FOUND)
mark_as_advanced(FORCE HDF5_C_INCLUDE_DIR)
......@@ -87,6 +95,9 @@ if(HDF5_FOUND)
endif()
set(LIBXML2_LIBRARIES ${vtklibxml2_LIBRARIES})
set(LIBXML2_INCLUDE_DIR ${vtklibxml2_INCLUDE_DIRS})
set(LIBXML2_FOUND TRUE)
find_package(LibXml2 REQUIRED)
if(LIBXML2_FOUND)
include_directories(${LIBXML2_INCLUDE_DIR})
......@@ -140,7 +151,7 @@ set(XdmfCoreSources
XdmfSparseMatrix
XdmfSubset
XdmfSystemUtils
${CMAKE_CURRENT_BINARY_DIR}/XdmfVersion
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/XdmfVersion
XdmfVisitor
XdmfWriter)
......@@ -189,16 +200,16 @@ if(WIN32)
set_target_properties(XdmfCore PROPERTIES
PREFIX ../
IMPORT_PREFIX ../
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/${CMAKE_CFG_INTDIR}/
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/${CMAKE_CFG_INTDIR}/)
if (XDMF_STATIC_AND_SHARED AND BUILD_SHARED_LIBS)
set_target_properties(XdmfCore_Static PROPERTIES
PREFIX ../
IMPORT_PREFIX ../
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/${CMAKE_CFG_INTDIR}/
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/${CMAKE_CFG_INTDIR}/)
endif ()
endif()
endif()
......
......@@ -26,9 +26,9 @@
// C Compatible Includes
#include "XdmfCore.hpp"
#include "XdmfItem.hpp"
#include "XdmfArrayReference.hpp"
#include "XdmfHeavyDataController.hpp"
#include "XdmfItem.hpp"
#ifdef __cplusplus
......
......@@ -662,9 +662,7 @@ XdmfArray::initialize(const std::vector<unsigned int> & dimensions)
{
mDimensions = dimensions;
const unsigned int size = static_cast<unsigned int>(
std::accumulate(dimensions.begin(),
dimensions.end(),
1,
std::accumulate(dimensions.begin(), dimensions.end(), 1,
std::multiplies<unsigned int>()));
return this->initialize<T>(size);
}
......@@ -707,10 +705,11 @@ template <typename T>
void
XdmfArray::pushBack(const T & value)
{
this->setIsChanged(true);
return boost::apply_visitor(PushBack<T>(value,
this),
mArray);
this->setIsChanged(true);
}
template<typename T>
......@@ -718,11 +717,12 @@ void
XdmfArray::resize(const unsigned int numValues,
const T & value)
{
this->setIsChanged(true);
return boost::apply_visitor(Resize<T>(this,
numValues,
value),
mArray);
this->setIsChanged(true);
}
template<typename T>
......@@ -730,11 +730,8 @@ void
XdmfArray::resize(const std::vector<unsigned int> & dimensions,
const T & value)
{
const unsigned int size = static_cast<unsigned int>(
std::accumulate(dimensions.begin(),
dimensions.end(),
1,
std::multiplies<unsigned int>()));
const unsigned int size = static_cast<unsigned int>(std::accumulate(dimensions.begin(), dimensions.end(), 1,
std::multiplies<unsigned int>()));
this->resize(size, value);
mDimensions = dimensions;
this->setIsChanged(true);
......
......@@ -21,9 +21,6 @@
/* */
/*****************************************************************************/
#include <libxml/uri.h>
#include <libxml/xpointer.h>
#include <libxml/xmlreader.h>
#include <boost/algorithm/string/trim.hpp>
#include <boost/tokenizer.hpp>
#include <cstring>
......@@ -215,7 +212,6 @@ public:
if (mItemFactory->isArrayTag((char *)currNode->name)) {
while(childNode != NULL) {
if(childNode->type == XML_TEXT_NODE && childNode->content) {
#if 1 //ARL's side
const char * content = (char*)childNode->content;
// Determine if content is whitespace
......@@ -237,16 +233,6 @@ public:
itemProperties.insert(std::make_pair("XMLDir", mXMLDir));
break;
}
#else //VTK's side, breaks XDMF's tests, revisit if problematic in VTK
std::string content((char *)childNode->content);
boost::algorithm::trim(content);
if(content.size() != 0) {
itemProperties.insert(std::make_pair("Content", content));
itemProperties.insert(std::make_pair("XMLDir", mXMLDir));
break;
}
#endif
}
childNode = childNode->next;
}
......
......@@ -323,4 +323,4 @@ catch (XdmfError & e) { \
}
#endif
#endif
#endif /* XDMFERROR_HPP_ */
......@@ -123,6 +123,7 @@ XdmfHDF5Writer::New(const std::string & filePath,
return p;
}
//Set mUseDeflate(true), and mDeflateFactor(6) for default compression
XdmfHDF5Writer::XdmfHDF5Writer(const std::string & filePath) :
XdmfHeavyDataWriter(filePath, 1, 800),
mImpl(new XdmfHDF5WriterImpl()),
......@@ -131,6 +132,7 @@ XdmfHDF5Writer::XdmfHDF5Writer(const std::string & filePath) :
{
}
//Set mUseDeflate(true), and mDeflateFactor(6) for default compression
XdmfHDF5Writer::XdmfHDF5Writer(const XdmfHDF5Writer & writerRef) :
XdmfHeavyDataWriter(writerRef.getFilePath(), 1, 800),
mImpl(new XdmfHDF5WriterImpl()),
......@@ -1399,7 +1401,7 @@ XdmfHDF5Writer::write(XdmfArray & array)
const hsize_t totalDimensionsSize =
std::accumulate(current_dims.begin(),
current_dims.end(),
1,
(hsize_t) 1,
std::multiplies<hsize_t>());
// The Nth root of the chunk size divided by the dimensions added together
const double factor =
......
......@@ -76,6 +76,8 @@ XdmfHeavyDataDescription::traverse(const shared_ptr<XdmfBaseVisitor> visitor)
}
// C Wrappers
XDMFHEAVYDATADESCRIPTION *
XdmfHeavyDataDescriptionNew(char * key, char * value)
{
......
......@@ -221,7 +221,7 @@ protected:
private:
XdmfInformation(const XdmfInformation &);
XdmfInformation(const XdmfInformation &); // Not implemented.
void operator=(const XdmfInformation &); // Not implemented.
std::string mKey;
......
......@@ -34,7 +34,7 @@ XdmfItem::XdmfItem() :
{
}
XdmfItem::XdmfItem(XdmfItem &refItem) :
XdmfItem::XdmfItem(const XdmfItem &refItem) :
mInformations(refItem.mInformations),
mIsChanged(true)
{
......
......@@ -37,8 +37,12 @@ class XdmfVisitor;
// Includes
#include <loki/Visitor.h>
#define vtk_libxml2_reference reference // Reversing VTK name mangling
#include <libxml/xmlexports.h>
#include <libxml/tree.h>
#include <libxml/uri.h>
#include <libxml/xpointer.h>
#include <libxml/xmlreader.h>
#include <map>
#include <set>
#include <string>
......@@ -375,7 +379,7 @@ public:
*/
virtual void traverse(const shared_ptr<XdmfBaseVisitor> visitor);
XdmfItem(XdmfItem &);
XdmfItem(const XdmfItem &);
protected:
......@@ -409,7 +413,7 @@ protected:
private:
XdmfItem(const XdmfItem &); // Not implemented.
// XdmfItem(const XdmfItem &); // It is implemented for C wrappers.
void operator=(const XdmfItem &); // Not implemented.
};
......
......@@ -22,7 +22,6 @@
/*****************************************************************************/
#include <fstream>
#include <libxml/tree.h>
#include <sstream>
#include <utility>
#include "XdmfArray.hpp"
......@@ -120,6 +119,9 @@ public:
(xmlChar*)"Version",
(xmlChar*)mVersionString.c_str());
xmlDocSetRootElement(mXMLDocument, mXMLCurrentNode);
if(mHeavyDataWriter->getMode() == XdmfHeavyDataWriter::Default) {
mHeavyDataWriter->openFile();
}
}
int mDepth;
......@@ -374,9 +376,11 @@ XdmfWriter::visit(XdmfArray & array,
// Take care of writing to single heavy data file (Default behavior)
if(!array.isInitialized() && array.getHeavyDataController(0) &&
array.getHeavyDataController(0)->getFilePath().compare(mImpl->mHeavyDataWriter->getFilePath()) != 0 &&
mImpl->mMode == Default) {
array.read();
if (array.getHeavyDataController(0)->getFilePath().compare(mImpl->mHeavyDataWriter->getFilePath()) != 0)
{
array.read();
}
}
if(array.getHeavyDataController(0) ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment