Commit e8b85490 authored by Andrew J. Burns (Cont's avatar Andrew J. Burns (Cont

changed tabs to spaces and pulled dsm to a separate folder under core

parent 6e0d6c9b
......@@ -49,6 +49,10 @@ option(XDMF_WRAP_JAVA OFF)
# Test for DSM
option(XDMF_BUILD_DSM OFF)
if(XDMF_BUILD_DSM)
option(XDMF_BUILD_DSM_THREADS ON)
endif(XDMF_BUILD_DSM)
# If we are wrapping either, we need swig
if(XDMF_WRAP_PYTHON OR XDMF_WRAP_JAVA)
find_package(SWIG REQUIRED)
......@@ -214,7 +218,7 @@ if(XDMF_WRAP_JAVA)
endif(XDMF_WRAP_JAVA)
add_subdirectory(core)
include_directories(${XdmfCore_INCLUDE_DIRS})
include_directories(${XdmfCore_INCLUDE_DIRS} ${XdmfDSM_INCLUDE_DIRS})
link_directories(${XDMF_LIBRARY_DIRS})
option(XDMF_BUILD_CORE_ONLY OFF)
......@@ -244,7 +248,11 @@ if(NOT XDMF_BUILD_CORE_ONLY)
XdmfUnstructuredGrid)
add_library(Xdmf ${XdmfSources})
target_link_libraries(Xdmf XdmfCore)
if(XDMF_BUILD_DSM)
target_link_libraries(Xdmf XdmfCore XdmfDSM)
else(XDMF_BUILD_DSM)
target_link_libraries(Xdmf XdmfCore)
endif(XDMF_BUILD_DSM)
if(WIN32)
set_target_properties(Xdmf PROPERTIES
......@@ -264,7 +272,7 @@ if(NOT XDMF_BUILD_CORE_ONLY)
endif(XDMF_WRAP_JAVA)
if(XDMF_WRAP_PYTHON)
XDMF_SWIG_PYTHON(Xdmf XdmfCore)
XDMF_SWIG_PYTHON(Xdmf XdmfCore XdmfDSM)
endif(XDMF_WRAP_PYTHON)
if(BUILD_TESTING)
......
......@@ -135,6 +135,11 @@
#undef XDMFCORE_TEMPLATE
#define XDMFCORE_TEMPLATE extern
#undef XDMFDSM_EXPORT
#define XDMFDSM_EXPORT __declspec(dllimport)
#undef XDMFDSM_TEMPLATE
#define XDMFDSM_TEMPLATE extern
#ifdef Xdmf_EXPORTS
#define XDMF_EXPORT __declspec(dllexport)
#define XDMF_TEMPLATE
......@@ -158,8 +163,10 @@
#else /* _WIN32 */
/* We don't need to export/import since there are no dlls */
#define XDMFCORE_EXPORT
#define XDMFDSM_EXPORT
#define XDMF_EXPORT
#define XDMFCORE_TEMPLATE
#define XDMFDSM_TEMPLATE
#define XDMF_TEMPLATE
#endif /* _WIN32 */
#endif /* _XDMF_HPP */
......
......@@ -62,8 +62,11 @@ swig -v -c++ -python -o XdmfPython.cpp Xdmf.i
#include <XdmfTopology.hpp>
#include <XdmfTopologyType.hpp>
#include <XdmfUnstructuredGrid.hpp>
%}
%import XdmfDSM.i
#else
%module Xdmf
%{
......@@ -254,6 +257,15 @@ swig -v -c++ -python -o XdmfPython.cpp Xdmf.i
from XdmfCore import *
}
#ifdef XDMF_BUILD_DSM
%pythoncode {
from XdmfDSM import *
}
#endif /* XDMF_BUILD_DSM */
%fragment("XdmfItemCast", "header") {
#include <XdmfSharedPtr.hpp>
PyObject * XdmfItemCast(shared_ptr<XdmfItem> obj) {
......
......@@ -62,7 +62,7 @@ public:
* @skipline #//initialization
* @until #//initialization
*
* @return Constructed XdmfAttribute.
* @return Constructed XdmfAttribute.
*/
static shared_ptr<XdmfAttribute> New();
......@@ -96,7 +96,7 @@ public:
* @skipline #//getCenter
* @until #//getCenter
*
* @return XdmfAttributeCenter of the attribute.
* @return XdmfAttributeCenter of the attribute.
*/
shared_ptr<const XdmfAttributeCenter> getCenter() const;
......@@ -129,7 +129,7 @@ public:
* @skipline #//getName
* @until #//getName
*
* @return A string containing the name of the attribute.
* @return A string containing the name of the attribute.
*/
std::string getName() const;
......@@ -158,7 +158,7 @@ public:
* @skipline #//getType
* @until #//getType
*
* @return XdmfAttributeType of the attribute.
* @return XdmfAttributeType of the attribute.
*/
shared_ptr<const XdmfAttributeType> getType() const;
......@@ -183,7 +183,7 @@ public:
* @skipline #//setCenter
* @until #//setCenter
*
* @param center The XdmfAttributeCenter to set.
* @param center The XdmfAttributeCenter to set.
*/
void setCenter(const shared_ptr<const XdmfAttributeCenter> center);
......@@ -208,7 +208,7 @@ public:
* @skipline #//setName
* @until #//setName
*
* @param name A string containing the name to set.
* @param name A string containing the name to set.
*/
void setName(const std::string & name);
......@@ -233,7 +233,7 @@ public:
* @skipline #//setType
* @until #//setType
*
* @param type XdmfAttributeType to set.
* @param type XdmfAttributeType to set.
*/
void setType(const shared_ptr<const XdmfAttributeType> type);
......
......@@ -93,7 +93,7 @@ protected:
* construct XdmfAttributeCenters -
* i.e. XdmfAttributeCenter::Node().
*
* @param name The name of the XdmfAttributeCenter to construct.
* @param name The name of the XdmfAttributeCenter to construct.
*/
XdmfAttributeCenter(const std::string & name);
......
......@@ -96,7 +96,7 @@ protected:
* accessed through more specific static methods that construct
* XdmfAttributeTypes - i.e. XdmfAttributeType::Scalar().
*
* @param name The name of the XdmfAttributeType to construct.
* @param name The name of the XdmfAttributeType to construct.
*/
XdmfAttributeType(const std::string & name);
......
......@@ -65,10 +65,10 @@ public:
* @skipline #//constructor2
* @until #//constructor2
*
* @param xNumPoints The number of points in the x direction.
* @param yNumPoints The number of points in the y direction.
* @param xNumPoints The number of points in the x direction.
* @param yNumPoints The number of points in the y direction.
*
* @return Constructed curvilinear grid.
* @return Constructed curvilinear grid.
*/
static shared_ptr<XdmfCurvilinearGrid>
New(const unsigned int xNumPoints,
......@@ -93,11 +93,11 @@ public:
* @skipline #//constructor3
* @until #//constructor3
*
* @param xNumPoints The number of points in the x direction.
* @param yNumPoints The number of points in the y direction.
* @param zNumPoints The number of points in the z direction.
* @param xNumPoints The number of points in the x direction.
* @param yNumPoints The number of points in the y direction.
* @param zNumPoints The number of points in the z direction.
*
* @return Constructed curvilinear grid.
* @return Constructed curvilinear grid.
*/
static shared_ptr<XdmfCurvilinearGrid>
New(const unsigned int xNumPoints,
......@@ -123,9 +123,9 @@ public:
* @skipline #//constructorvector
* @until #//constructorvector
*
* @param numPoints The number of points in each direction.
* @param numPoints The number of points in each direction.
*
* @return Constructed curvilinear grid.
* @return Constructed curvilinear grid.
*/
static shared_ptr<XdmfCurvilinearGrid>
New(const shared_ptr<XdmfArray> numPoints);
......@@ -163,7 +163,7 @@ public:
* @skipline #//getDimensions
* @until #//getDimensions
*
* @return XdmfArray containing dimensions of this grid.
* @return XdmfArray containing dimensions of this grid.
*/
shared_ptr<XdmfArray> getDimensions();
......@@ -185,7 +185,7 @@ public:
*
* Python: Python doesn't have a constant version
*
* @return XdmfArray containing the dimensions of this grid.
* @return XdmfArray containing the dimensions of this grid.
*/
shared_ptr<const XdmfArray> getDimensions() const;
......@@ -216,7 +216,7 @@ public:
* @skipline #//getGeometry
* @until #//getGeometry
*
* @return The geometry associated with this grid.
* @return The geometry associated with this grid.
*/
shared_ptr<XdmfGeometry> getGeometry();
......@@ -244,7 +244,7 @@ public:
* @skipline #//setDimensions
* @until #//setDimensions
*
* @param dimensions The dimension of the grid.
* @param dimensions The dimension of the grid.
*/
void setDimensions(const shared_ptr<XdmfArray> dimensions);
......@@ -271,7 +271,7 @@ public:
* @skipline #//setGeometry
* @until #//setGeometry
*
* @param geometry An XdmfGeometry to associate with this grid.
* @param geometry An XdmfGeometry to associate with this grid.
*/
void setGeometry(const shared_ptr<XdmfGeometry> geometry);
......
......@@ -64,7 +64,7 @@ public:
* @skipline #//initialization
* @until #//initialization
*
* @return Constructed XdmfDomain.
* @return Constructed XdmfDomain.
*/
static shared_ptr<XdmfDomain> New();
......
......@@ -60,7 +60,7 @@ public:
* @skipline #//initialization
* @until #//initialization
*
* @return Constructed XdmfGeometry.
* @return Constructed XdmfGeometry.
*/
static shared_ptr<XdmfGeometry> New();
......@@ -117,7 +117,7 @@ public:
* @skipline #//getType
* @until #//getType
*
* @return XdmfGeometryType of this geometry.
* @return XdmfGeometryType of this geometry.
*/
shared_ptr<const XdmfGeometryType> getType() const;
......@@ -142,7 +142,7 @@ public:
* @skipline #//setType
* @until #//setType
*
* @param type The XdmfGeometryType to set.
* @param type The XdmfGeometryType to set.
*/
void setType(const shared_ptr<const XdmfGeometryType> type);
......
......@@ -88,7 +88,7 @@ public:
* @skipline #//getDimensions
* @until #//getDimensions
*
* @return An int containing number of dimensions.
* @return An int containing number of dimensions.
*/
virtual unsigned int getDimensions() const;
......@@ -109,7 +109,7 @@ public:
* @skipline #//getName
* @until #//getName
*
* @return The name of this geometry type.
* @return The name of this geometry type.
*/
std::string getName() const;
......
......@@ -60,7 +60,7 @@ public:
*
* @param numberNodes number of nodes in graph.
*
* @return Constructed XdmfGraph.
* @return Constructed XdmfGraph.
*/
static shared_ptr<XdmfGraph> New(const unsigned int numberNodes);
......
......@@ -84,7 +84,7 @@ public:
* @skipline #//getGeometry
* @until #//getGeometry
*
* @return The geometry associated with this grid.
* @return The geometry associated with this grid.
*/
shared_ptr<const XdmfGeometry> getGeometry() const;
......@@ -117,7 +117,7 @@ public:
* @skipline #//getName
* @until #//getName
*
* @return The name of the grid.
* @return The name of the grid.
*/
std::string getName() const;
......@@ -146,8 +146,8 @@ public:
* @skipline #//getTime
* @until #//getTime
*
* @return Pointer to the XdmfTime attached to this grid. If no
* XdmfTime is attached, return a NULL pointer.
* @return Pointer to the XdmfTime attached to this grid. If no
* XdmfTime is attached, return a NULL pointer.
*/
shared_ptr<XdmfTime> getTime();
......@@ -168,8 +168,8 @@ public:
*
* Python: Python doesn't have a constant version
*
* @return Pointer to the XdmfTime attached to this grid. If no
* XdmfTime is attached, return a NULL pointer.
* @return Pointer to the XdmfTime attached to this grid. If no
* XdmfTime is attached, return a NULL pointer.
*/
shared_ptr<const XdmfTime> getTime() const;
......@@ -194,7 +194,7 @@ public:
* @skipline #//getTopology
* @until #//getTopology
*
* @return The topology associated with this grid.
* @return The topology associated with this grid.
*/
shared_ptr<const XdmfTopology> getTopology() const;
......@@ -221,7 +221,7 @@ public:
* @skipline #//setName
* @until #//setName
*
* @param name Name of the grid to set.
* @param name Name of the grid to set.
*/
void setName(const std::string & name);
......@@ -246,7 +246,7 @@ public:
* @skipline #//setTime
* @until #//setTime
*
* @param time An XdmfTime to associate with this grid.
* @param time An XdmfTime to associate with this grid.
*/
void setTime(const shared_ptr<XdmfTime> time);
......
......@@ -65,7 +65,7 @@ public:
* @skipline #//initalization
* @until #//initalization
*
* @return Constructed XdmfGridCollection.
* @return Constructed XdmfGridCollection.
*/
static shared_ptr<XdmfGridCollection> New();
......@@ -99,7 +99,7 @@ public:
* @skipline #//getType
* @until #//getType
*
* @return XdmfGridCollectionType of this collection.
* @return XdmfGridCollectionType of this collection.
*/
shared_ptr<const XdmfGridCollectionType> getType() const;
......@@ -127,7 +127,7 @@ public:
* @skipline #//insert
* @until #//insert
*
* @param information An XdmfInformation to attach to this item.
* @param information An XdmfInformation to attach to this item.
*/
void insert(const shared_ptr<XdmfInformation> information);
......@@ -153,7 +153,7 @@ public:
* @skipline #//setType
* @until #//setType
*
* @param type The XdmfGridCollectionType to set.
* @param type The XdmfGridCollectionType to set.
*/
void setType(const shared_ptr<const XdmfGridCollectionType> type);
......
......@@ -56,7 +56,7 @@ public:
* @skipline #//initialization
* @until #//initialization
*
* @return Constructed XdmfItemFactory.
* @return Constructed XdmfItemFactory.
*/
static shared_ptr<XdmfItemFactory> New();
......
......@@ -79,7 +79,7 @@ public:
* @skipline #//initialization
* @until #//initialization
*
* @return Constructed XdmfMap.
* @return Constructed XdmfMap.
*/
static shared_ptr<XdmfMap> New();
......@@ -102,12 +102,12 @@ public:
* @skipline #//initializationnode
* @until #//initializationnode
*
* @param globalNodeIds A vector of attributes containing globalNodeId
* @param globalNodeIds A vector of attributes containing globalNodeId
* values for each partition to be mapped.
*
* @return Constructed XdmfMaps for each partition. The
* size of the vector will be the same as the
* globalNodeIds vector.
* @return Constructed XdmfMaps for each partition. The
* size of the vector will be the same as the
* globalNodeIds vector.
*/
static std::vector<shared_ptr<XdmfMap> >
New(const std::vector<shared_ptr<XdmfAttribute> > & globalNodeIds);
......@@ -140,7 +140,7 @@ public:
* @skipline #//getMap
* @until #//getMap
*
* @return Stored boundary communicator map.
* @return Stored boundary communicator map.
*/
std::map<task_id, node_id_map> getMap() const;
......@@ -169,7 +169,7 @@ public:
* @skipline #//getName
* @until #//getName
*
* @return Name of boundary communicator map.
* @return Name of boundary communicator map.
*/
std::string getName() const;
......@@ -195,10 +195,10 @@ public:
* @skipline #//getRemoteNodeIds
* @until #//getRemoteNodeIds
*
* @param remoteTaskId Task id to retrieve mapping for.
* @param remoteTaskId Task id to retrieve mapping for.
*
* @return A map of local node ids to a vector of
* remote node ids on remoteTaskId.
* @return A map of local node ids to a vector of
* remote node ids on remoteTaskId.
*/
node_id_map getRemoteNodeIds(const task_id remoteTaskId);
......@@ -227,11 +227,11 @@ public:
* @skipline #//inserttuple
* @until #//inserttuple
*
* @param remoteTaskId task id where the remoteLoalNodeId is
* located.
* @param localNodeId The node id of the node being mapped.
* @param remoteLocalNodeId A node id on the remoteTaskId that the
* localNodeId is mapped to.
* @param remoteTaskId task id where the remoteLoalNodeId is
* located.
* @param localNodeId The node id of the node being mapped.
* @param remoteLocalNodeId A node id on the remoteTaskId that the
* localNodeId is mapped to.
*/
void insert(const task_id remoteTaskId,
const node_id localNodeId,
......@@ -259,7 +259,7 @@ public:
* @skipline #//isInitialized
* @until #//isInitialized
*
* @return bool true if map contains values in memory.
* @return bool true if map contains values in memory.
*/
bool isInitialized() const;
......@@ -330,12 +330,12 @@ public:
* @skipline #//setHeavyDataController
* @until #//setHeavyDataController
*
* @param remoteTaskIdsControllers A vector of XdmfHeavyDataControllers
* to the remote task ids dataset.
* @param localNodeIdsControllers A vector of XdmfHeavyDataControllers
* to the local node ids dataset.
* @param remoteLocalNodeIdsControllers A vector of XdmfHeavyDataControllers
* to the remote local node ids dataset.
* @param remoteTaskIdsControllers A vector of XdmfHeavyDataControllers
* to the remote task ids dataset.
* @param localNodeIdsControllers A vector of XdmfHeavyDataControllers
* to the local node ids dataset.
* @param remoteLocalNodeIdsControllers A vector of XdmfHeavyDataControllers
* to the remote local node ids dataset.
*/
void
setHeavyDataControllers(std::vector<shared_ptr<XdmfHeavyDataController> > remoteTaskIdsControllers,
......@@ -363,7 +363,7 @@ public:
* @skipline #//setMap
* @until #//setMap
*
* @param map The boundary communicator map to store.
* @param map The boundary communicator map to store.
*/
void setMap(std::map<task_id, node_id_map> map);
......@@ -388,7 +388,7 @@ public:
* @skipline #//setName
* @until #//setName
*
* @param name The name of the boundary communicator map to set.
* @param name The name of the boundary communicator map to set.
*/
void setName(const std::string & name);
......
......@@ -57,7 +57,7 @@ public:
* @skipline #//initialization
* @until #//initialization
*
* @return Constructed XdmfReader.
* @return Constructed XdmfReader.
*/
static shared_ptr<XdmfReader> New();
......
......@@ -68,10 +68,10 @@ public:
* @skipline #//initialization2
* @until #//initialization2
*
* @param xCoordinates The coordinates of points along the x axis
* @param yCoordinates The coordinates of points along the y axis.
* @param xCoordinates The coordinates of points along the x axis
* @param yCoordinates The coordinates of points along the y axis.
*
* @return Constructed rectilinear grid.
* @return Constructed rectilinear grid.
*/
static shared_ptr<XdmfRectilinearGrid>
New(const shared_ptr<XdmfArray> xCoordinates,
......@@ -98,11 +98,11 @@ public:
* @skipline #//initialization3
* @until #//initialization3
*
* @param xCoordinates The coordinates of points along the x axis
* @param yCoordinates The coordinates of points along the y axis.
* @param zCoordinates The coordinates of points along the z axis.
* @param xCoordinates The coordinates of points along the x axis
* @param yCoordinates The coordinates of points along the y axis.
* @param zCoordinates The coordinates of points along the z axis.
*
* @return Constructed rectilinear grid.
* @return Constructed rectilinear grid.
*/
static shared_ptr<XdmfRectilinearGrid>
New(const shared_ptr<XdmfArray> xCoordinates,
......@@ -130,9 +130,9 @@ public:
* @skipline #//initializationvector
* @until #//initializationvector
*
* @param axesCoordinates The coordinates of points along each axis.
* @param axesCoordinates The coordinates of points along each axis.
*
* @return Constructed rectilinear grid.
* @return Constructed rectilinear grid.
*/
static shared_ptr<XdmfRectilinearGrid>
New(const std::vector<shared_ptr<XdmfArray> > & axesCoordinates);
......@@ -167,11 +167,11 @@ public:
* @skipline #//getCoodinatessingle
* @until #//getCoodinatessingle
*
* @param axisIndex The index of the axis to retrieve, (i.e. 0 for
* x-axis). If no array exists at the index,
* return NULL.
* @param axisIndex The index of the axis to retrieve, (i.e. 0 for
* x-axis). If no array exists at the index,
* return NULL.
*
* @return Array of coordinates along requested axis
* @return Array of coordinates along requested axis
*/
shared_ptr<XdmfArray> getCoordinates(const unsigned int axisIndex);
......@@ -193,11 +193,11 @@ public:
*
* Python: does not support a constant version of this function
*
* @param axisIndex The index of the axis to retrieve (i.e. 0 for
* x-axis). If no array exists at the index,
* return NULL.
* @param axisIndex The index of the axis to retrieve (i.e. 0 for
* x-axis). If no array exists at the index,
* return NULL.
*
* @return Array of coordinates along requeste axis
* @return Array of coordinates along requeste axis
*/
shared_ptr<const XdmfArray>
getCoordinates(const unsigned int axisIndex) const;
......@@ -227,8 +227,8 @@ public:
* @skipline #//getCoodinatesvector
* @until #//getCoodinatesvector
*
* @return Vector containing an array of coordinates along each
* direction.
* @return Vector containing an array of coordinates along each
* direction.
*/
std::vector<shared_ptr<XdmfArray> > getCoordinates();
......@@ -249,8 +249,8 @@ public:
*
* Python: does not support a constant version of this function
*
* @return Vector containing an array of coordinates along each
* direction.
* @return Vector containing an array of coordinates along each
* direction.
*/
const std::vector<shared_ptr<XdmfArray> > getCoordinates() const;
......@@ -280,7 +280,7 @@ public:
* @skipline #//getDimensions
* @until #//getDimensions
*
* @return XdmfArray containing dimensions of this grid.
* @return XdmfArray containing dimensions of this grid.
*/
shared_ptr<XdmfArray> getDimensions();
......@@ -302,7 +302,7 @@ public:
*
* Python: Doesn't support a constant version of this function
*
* @return XdmfArray containing the dimensions of this grid.
* @return XdmfArray containing the dimensions of this grid.
*/
shared_ptr<const XdmfArray> getDimensions() const;
......@@ -331,10 +331,10 @@ public:
* @skipline #//setCoordinatessingle
* @until #//setCoordinatessingle
*
* @param axisIndex The index of the axis to set
* (i.e. 0 for x-axis).
* @param axisCoordinates The coordinates of points along
* a single axis to set.
* @param axisIndex The index of the axis to set
* (i.e. 0 for x-axis).
* @param axisCoordinates The coordinates of points along
* a single axis to set.
*/
void setCoordinates(const unsigned int axisIndex,
const shared_ptr<XdmfArray> axisCoordinates);
......@@ -364,8 +364,8 @@ public:
* @skipline #//setCoordinatesvector
* @until #//setCoordinatesvector
*
* @param axesCoordinates The coordinates of points
* along each axis.
* @param axesCoordinates The coordinates of points
* along each axis.
*/
void
setCoordinates(const std::vector<shared_ptr<XdmfArray> > axesCoordinates);
......
......@@ -68,14 +68,14 @@ public:
* @skipline #//initialization2
* @until #//initialization2
*
* @param xBrickSize The size of the brick in the x direction.
* @param yBrickSize The size of the brick in the y direction.
* @param xNumPoints The number of points in the x direction.
* @param yNumPoints The number of points in the y direction.
* @param xOrigin The x coordinate of the origin.
* @param yOrigin The y coordinate of the origin.
*
* @return Constructed structured grid.
* @param xBrickSize The size of the brick in the x direction.
* @param yBrickSize The size of the brick in the y direction.
* @param xNumPoints The number of points in the x direction.
* @param yNumPoints The number of points in the y direction.
* @param xOrigin The x coordinate of the origin.
* @param yOrigin The y coordinate of the origin.
*
* @return Constructed structured grid.
*/
static shared_ptr<XdmfRegularGrid> New(const double xBrickSize,