Commit b17ab6e3 authored by Kenneth Leiter's avatar Kenneth Leiter
Browse files

ENH: Added XdmfTopologyType to XdmfTopology to handle element types and...

ENH: Added XdmfTopologyType to XdmfTopology to handle element types and associated const data like nodesPerElement and name.  This resembles "Replace subclass with fields" implementation in Refactoring and does a nice job encapsulating element type data in an enum like way avoiding unneccesary subclassing.
parent f0246ede
......@@ -7,28 +7,32 @@ set(BUILD_SHARED_LIBS true)
find_package(Boost REQUIRED)
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
message(${Boost_INCLUDE_DIRS})
include_directories(${Boost_INCLUDE_DIRS})
message(${Boost_INCLUDE_DIRS})
endif(Boost_FOUND)
find_package(PythonLibs REQUIRED)
if(PYTHONLIBS_FOUND)
include_directories(${PYTHON_INCLUDE_DIRS})
include_directories(${PYTHON_INCLUDE_DIRS})
endif(PYTHONLIBS_FOUND)
set(XdmfSources
XdmfGeometry
XdmfGrid
XdmfObject
XdmfTopology
XdmfGeometry
XdmfGrid
XdmfObject
XdmfTopology
)
add_library(Xdmf ${XdmfSources})
add_library(_Xdmf MODULE XdmfPython)
set_target_properties(_Xdmf PROPERTIES PREFIX "")
target_link_libraries(_Xdmf Xdmf)
configure_file(Xdmf.py Xdmf.py COPYONLY)
add_executable(XdmfTest test.cpp)
target_link_libraries(XdmfTest Xdmf)
#add_library(_Xdmf MODULE XdmfPython)
#set_target_properties(_Xdmf PROPERTIES PREFIX "")
#target_link_libraries(_Xdmf Xdmf)
#configure_file(Xdmf.py Xdmf.py COPYONLY)
option(BUILD_TESTING OFF)
if(BUILD_TESTING)
add_subdirectory(tests)
add_executable(XdmfTest test.cpp)
target_link_libraries(XdmfTest Xdmf)
endif(BUILD_TESTING)
\ No newline at end of file
/*
XdmfPython.cpp:
swig -v -c++ -make_default -python -shadow -I/share/kleiter/boost-1.41.0-install/include -o XdmfPython.cpp Xdmf.i
*/
%include std_string.i
%include std_vector.i
namespace boost {
template<class T> class shared_ptr
{
public:
T * operator-> () const;
};
}
%template(XdmfGridPtr) boost::shared_ptr<XdmfGrid>;
%module Xdmf
%{
#include <XdmfGeometry.hpp>
#include <XdmfGrid.hpp>
#include <XdmfObject.hpp>
#include <XdmfTopology.hpp>
%}
%include XdmfObject.hpp
%include XdmfGeometry.hpp
%include XdmfGrid.hpp
%include XdmfObject.hpp
%include XdmfTopology.hpp
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 1.3.37
# Version 1.3.40
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
......@@ -10,12 +10,18 @@ if version_info >= (2,6,0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_Xdmf', [dirname(__file__)])
_mod = imp.load_module('_Xdmf', fp, pathname, description)
finally:
if fp is not None: fp.close()
return _mod
except ImportError:
import _Xdmf
return _Xdmf
if fp is not None:
try:
_mod = imp.load_module('_Xdmf', fp, pathname, description)
finally:
fp.close()
return _mod
_Xdmf = swig_import_helper()
del swig_import_helper
else:
......@@ -65,7 +71,7 @@ class SwigPyIterator(_object):
__setattr__ = lambda self, name, value: _swig_setattr(self, SwigPyIterator, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, SwigPyIterator, name)
def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract")
__repr__ = _swig_repr
__swig_destroy__ = _Xdmf.delete_SwigPyIterator
__del__ = lambda self : None;
......@@ -161,6 +167,9 @@ class XdmfTopologyPtr(_object):
__swig_destroy__ = _Xdmf.delete_XdmfTopologyPtr
__del__ = lambda self : None;
def New(self): return _Xdmf.XdmfTopologyPtr_New(self)
def getTopologyType(self): return _Xdmf.XdmfTopologyPtr_getTopologyType(self)
def setTopologyType(self, *args): return _Xdmf.XdmfTopologyPtr_setTopologyType(self, *args)
def getTopologyTypeAsString(self): return _Xdmf.XdmfTopologyPtr_getTopologyTypeAsString(self)
def printSelf(self): return _Xdmf.XdmfTopologyPtr_printSelf(self)
XdmfTopologyPtr_swigregister = _Xdmf.XdmfTopologyPtr_swigregister
XdmfTopologyPtr_swigregister(XdmfTopologyPtr)
......@@ -224,6 +233,30 @@ def XdmfGrid_New():
return _Xdmf.XdmfGrid_New()
XdmfGrid_New = _Xdmf.XdmfGrid_New
XDMF_NOTOPOLOGY = _Xdmf.XDMF_NOTOPOLOGY
XDMF_POLYVERTEX = _Xdmf.XDMF_POLYVERTEX
XDMF_POLYLINE = _Xdmf.XDMF_POLYLINE
XDMF_POLYGON = _Xdmf.XDMF_POLYGON
XDMF_TRI = _Xdmf.XDMF_TRI
XDMF_QUAD = _Xdmf.XDMF_QUAD
XDMF_TET = _Xdmf.XDMF_TET
XDMF_PYRAMID = _Xdmf.XDMF_PYRAMID
XDMF_WEDGE = _Xdmf.XDMF_WEDGE
XDMF_HEX = _Xdmf.XDMF_HEX
XDMF_EDGE_3 = _Xdmf.XDMF_EDGE_3
XDMF_TRI_6 = _Xdmf.XDMF_TRI_6
XDMF_QUAD_8 = _Xdmf.XDMF_QUAD_8
XDMF_TET_10 = _Xdmf.XDMF_TET_10
XDMF_PYRAMID_13 = _Xdmf.XDMF_PYRAMID_13
XDMF_WEDGE_15 = _Xdmf.XDMF_WEDGE_15
XDMF_HEX_20 = _Xdmf.XDMF_HEX_20
XDMF_MIXED = _Xdmf.XDMF_MIXED
XDMF_2DSMESH = _Xdmf.XDMF_2DSMESH
XDMF_2DRECTMESH = _Xdmf.XDMF_2DRECTMESH
XDMF_2DCORECTMESH = _Xdmf.XDMF_2DCORECTMESH
XDMF_3DSMESH = _Xdmf.XDMF_3DSMESH
XDMF_3DRECTMESH = _Xdmf.XDMF_3DRECTMESH
XDMF_3DCORECTMESH = _Xdmf.XDMF_3DCORECTMESH
class XdmfTopology(XdmfObject):
__swig_setmethods__ = {}
for _s in [XdmfObject]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
......@@ -235,6 +268,9 @@ class XdmfTopology(XdmfObject):
__repr__ = _swig_repr
__swig_getmethods__["New"] = lambda x: _Xdmf.XdmfTopology_New
if _newclass:New = staticmethod(_Xdmf.XdmfTopology_New)
def getTopologyType(self): return _Xdmf.XdmfTopology_getTopologyType(self)
def setTopologyType(self, *args): return _Xdmf.XdmfTopology_setTopologyType(self, *args)
def getTopologyTypeAsString(self): return _Xdmf.XdmfTopology_getTopologyTypeAsString(self)
def printSelf(self): return _Xdmf.XdmfTopology_printSelf(self)
XdmfTopology_swigregister = _Xdmf.XdmfTopology_swigregister
XdmfTopology_swigregister(XdmfTopology)
......
......@@ -17,7 +17,7 @@ XdmfGeometry::~XdmfGeometry()
std::cout << "Deleted Geometry " << this << std::endl;
}
std::string XdmfGeometry::printSelf() const
const std::string XdmfGeometry::printSelf() const
{
return "XdmfGeometry";
}
......@@ -15,7 +15,7 @@ class XdmfGeometry : public XdmfObject {
public:
XdmfNewMacro(XdmfGeometry);
virtual std::string printSelf() const;
virtual const std::string printSelf() const;
protected:
......
......@@ -21,7 +21,7 @@ XdmfGrid::~XdmfGrid()
std::cout << "Deleted Grid " << this << std::endl;
}
std::string XdmfGrid::printSelf() const
const std::string XdmfGrid::printSelf() const
{
return "XdmfGrid containing a " + mGeometry->printSelf() + " and a " + mTopology->printSelf();
}
......@@ -31,7 +31,7 @@ public:
// Set the XdmfTopology for this grid
XdmfSetValueMacro(Topology, boost::shared_ptr<XdmfTopology>);
virtual std::string printSelf() const;
virtual const std::string printSelf() const;
protected:
......
......@@ -17,7 +17,7 @@ XdmfObject::~XdmfObject()
}
std::string XdmfObject::printSelf() const
const std::string XdmfObject::printSelf() const
{
return "XdmfObject";
}
......
......@@ -20,14 +20,14 @@ static boost::shared_ptr<type> New() \
return p; \
}
#define XdmfGetValueMacro(var,type) \
#define XdmfGetValueMacro(var, type) \
type get##var () \
{ \
return ( this->m##var ); \
}
#define XdmfSetValueMacro(var,type) \
void set##var (type _arg) \
void set##var (const type _arg) \
{ \
this->m##var = _arg; \
}
......@@ -37,7 +37,7 @@ class XdmfObject {
public:
XdmfNewMacro(XdmfObject);
virtual std::string printSelf() const;
virtual const std::string printSelf() const;
protected:
......
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 1.3.37
* Version 1.3.40
*
* This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
......@@ -749,7 +749,7 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
/* Compatibility marcos for Python 3 */
/* Compatibility macros for Python 3 */
#if PY_VERSION_HEX >= 0x03000000
#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type)
......@@ -772,17 +772,35 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
# define SWIG_Python_str_FromFormat PyString_FromFormat
#endif
/* Warning: This function will allocate a new string in Python 3,
* so please call SWIG_Python_str_DelForPy3(x) to free the space.
*/
SWIGINTERN char*
SWIG_Python_str_AsChar(PyObject *str)
{
#if PY_VERSION_HEX >= 0x03000000
char *cstr;
char *newstr;
Py_ssize_t len;
str = PyUnicode_AsUTF8String(str);
return PyBytes_AsString(str);
PyBytes_AsStringAndSize(str, &cstr, &len);
newstr = (char *) malloc(len+1);
memcpy(newstr, cstr, len+1);
Py_XDECREF(str);
return newstr;
#else
return PyString_AsString(str);
#endif
}
#if PY_VERSION_HEX >= 0x03000000
# define SWIG_Python_str_DelForPy3(x) free( (void*) (x) )
#else
# define SWIG_Python_str_DelForPy3(x)
#endif
SWIGINTERN PyObject*
SWIG_Python_str_FromChar(const char *c)
{
......@@ -937,11 +955,13 @@ SWIG_Python_AddErrorMsg(const char* mesg)
if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback);
if (value) {
char *tmp;
PyObject *old_str = PyObject_Str(value);
PyErr_Clear();
Py_XINCREF(type);
PyErr_Format(type, "%s %s", SWIG_Python_str_AsChar(old_str), mesg);
PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
SWIG_Python_str_DelForPy3(tmp);
Py_DECREF(old_str);
Py_DECREF(value);
} else {
......@@ -1452,9 +1472,7 @@ SwigPyObject_repr(SwigPyObject *v, PyObject *args)
#endif
{
const char *name = SWIG_TypePrettyName(v->ty);
PyObject *hex = SwigPyObject_hex(v);
PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", name, hex);
Py_DECREF(hex);
PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", name, v);
if (v->next) {
#ifdef METH_NOARGS
PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
......@@ -1476,13 +1494,16 @@ SwigPyObject_repr(SwigPyObject *v, PyObject *args)
SWIGRUNTIME int
SwigPyObject_print(SwigPyObject *v, FILE *fp, int SWIGUNUSEDPARM(flags))
{
char *str;
#ifdef METH_NOARGS
PyObject *repr = SwigPyObject_repr(v);
#else
PyObject *repr = SwigPyObject_repr(v, NULL);
#endif
if (repr) {
fputs(SWIG_Python_str_AsChar(repr), fp);
str = SWIG_Python_str_AsChar(repr);
fputs(str, fp);
SWIG_Python_str_DelForPy3(str);
Py_DECREF(repr);
return 0;
} else {
......@@ -1506,7 +1527,7 @@ SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
return (i < j) ? -1 : ((i > j) ? 1 : 0);
}
/* Added for Python 3.x, whould it also useful for Python 2.x? */
/* Added for Python 3.x, would it also be useful for Python 2.x? */
SWIGRUNTIME PyObject*
SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
{
......@@ -1554,7 +1575,7 @@ SwigPyObject_dealloc(PyObject *v)
/* destroy is always a VARARGS method */
PyObject *res;
if (data->delargs) {
/* we need to create a temporal object to carry the destroy operation */
/* we need to create a temporary object to carry the destroy operation */
PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
res = SWIG_Python_CallFunctor(destroy, tmp);
Py_DECREF(tmp);
......@@ -1729,7 +1750,11 @@ _PySwigObject_type(void) {
0, /*nb_coerce*/
#endif
(unaryfunc)SwigPyObject_long, /*nb_int*/
#if PY_VERSION_HEX < 0x03000000
(unaryfunc)SwigPyObject_long, /*nb_long*/
#else
0, /*nb_reserved*/
#endif
(unaryfunc)0, /*nb_float*/
#if PY_VERSION_HEX < 0x03000000
(unaryfunc)SwigPyObject_oct, /*nb_oct*/
......@@ -1751,7 +1776,7 @@ _PySwigObject_type(void) {
if (!type_init) {
const PyTypeObject tmp
= {
/* PyOjbect header changed in Python 3 */
/* PyObject header changed in Python 3 */
#if PY_VERSION_HEX >= 0x03000000
PyVarObject_HEAD_INIT(&PyType_Type, 0)
#else
......@@ -1769,7 +1794,11 @@ _PySwigObject_type(void) {
(getattrfunc)0, /* tp_getattr */
#endif
(setattrfunc)0, /* tp_setattr */
(cmpfunc)SwigPyObject_compare, /* tp_compare */
#if PY_VERSION_HEX >= 0x03000000
0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
#else
(cmpfunc)SwigPyObject_compare, /* tp_compare */
#endif
(reprfunc)SwigPyObject_repr, /* tp_repr */
&SwigPyObject_as_number, /* tp_as_number */
0, /* tp_as_sequence */
......@@ -1816,7 +1845,7 @@ _PySwigObject_type(void) {
#endif
};
swigpyobject_type = tmp;
/* for Python 3 we already assigned the ob_type in PyVarObject_HEAD_INIT() */
/* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */
#if PY_VERSION_HEX < 0x03000000
swigpyobject_type.ob_type = &PyType_Type;
#endif
......@@ -1940,14 +1969,18 @@ _PySwigPacked_type(void) {
(printfunc)SwigPyPacked_print, /* tp_print */
(getattrfunc)0, /* tp_getattr */
(setattrfunc)0, /* tp_setattr */
(cmpfunc)SwigPyPacked_compare, /* tp_compare */
(reprfunc)SwigPyPacked_repr, /* tp_repr */
0, /* tp_as_number */
#if PY_VERSION_HEX>=0x03000000
0, /* tp_reserved in 3.0.1 */
#else
(cmpfunc)SwigPyPacked_compare, /* tp_compare */
#endif
(reprfunc)SwigPyPacked_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
(hashfunc)0, /* tp_hash */
(ternaryfunc)0, /* tp_call */
(reprfunc)SwigPyPacked_str, /* tp_str */
0, /* tp_as_mapping */
(hashfunc)0, /* tp_hash */
(ternaryfunc)0, /* tp_call */
(reprfunc)SwigPyPacked_str, /* tp_str */
PyObject_GenericGetAttr, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
......@@ -2219,10 +2252,10 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
/* here we get the method pointer for callbacks */
const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
if (desc) {
if (desc)
desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
if (!desc) return SWIG_ERROR;
}
if (!desc)
return SWIG_ERROR;
if (ty) {
swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
if (tc) {
......@@ -2260,7 +2293,7 @@ SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *t
* ----------------------------------------------------------------------------- */
/*
Create a new instance object, whitout calling __init__, and set the
Create a new instance object, without calling __init__, and set the
'this' attribute.
*/
......@@ -2291,7 +2324,6 @@ SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
} else {
#if PY_VERSION_HEX >= 0x03000000
inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None);
Py_INCREF(data->newargs);
PyObject_SetAttr(inst, SWIG_This(), swig_this);
Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
#else
......@@ -2532,21 +2564,23 @@ SWIG_Python_TypeQuery(const char *type)
SWIGRUNTIME int
SWIG_Python_AddErrMesg(const char* mesg, int infront)
{
{
if (PyErr_Occurred()) {
PyObject *type = 0;
PyObject *value = 0;
PyObject *traceback = 0;
PyErr_Fetch(&type, &value, &traceback);
if (value) {
char *tmp;
PyObject *old_str = PyObject_Str(value);
Py_XINCREF(type);
PyErr_Clear();
if (infront) {
PyErr_Format(type, "%s %s", mesg, SWIG_Python_str_AsChar(old_str));
PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str));
} else {
PyErr_Format(type, "%s %s", SWIG_Python_str_AsChar(old_str), mesg);
PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
}
SWIG_Python_str_DelForPy3(tmp);
Py_DECREF(old_str);
}
return 1;
......@@ -2598,6 +2632,7 @@ SWIG_Python_TypeError(const char *type, PyObject *obj)
if (cstr) {
PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
type, otype, cstr);
SWIG_Python_str_DelForPy3(cstr);
} else {
PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
type, otype);
......@@ -2619,10 +2654,12 @@ SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags)
void *result;
if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
PyErr_Clear();
if (flags & SWIG_POINTER_EXCEPTION) {
#if SWIG_POINTER_EXCEPTION
if (flags) {
SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
SWIG_Python_ArgFail(argnum);
}
#endif
}
return result;
}
......@@ -2684,7 +2721,7 @@ static swig_module_info swig_module = {swig_types, 11, 0, 0, 0, 0};
#endif
#define SWIG_name "_Xdmf"
#define SWIGVERSION 0x010337
#define SWIGVERSION 0x010340
#define SWIG_VERSION SWIGVERSION
......@@ -3150,6 +3187,39 @@ SWIG_From_std_string (const std::string& s)
}
SWIGINTERNINLINE PyObject *
SWIG_From_int (int value)
{
return SWIG_From_long (value);
}
#include <limits.h>
#if !defined(SWIG_NO_LLONG_MAX)
# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
# define LLONG_MAX __LONG_LONG_MAX__
# define LLONG_MIN (-LLONG_MAX - 1LL)
# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
# endif
#endif
SWIGINTERN int
SWIG_AsVal_int (PyObject * obj, int *val)
{
long v;
int res = SWIG_AsVal_long (obj, &v);
if (SWIG_IsOK(res)) {
if ((v < INT_MIN || v > INT_MAX)) {
return SWIG_OverflowError;
} else {
if (val) *val = static_cast< int >(v);
}
}
return res;
}
#include <XdmfGeometry.hpp>
#include <XdmfGrid.hpp>
#include <XdmfObject.hpp>
......@@ -3776,10 +3846,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___iadd__(PyObject *SWIGUNUSEDPARM(self
}
arg2 = static_cast< ptrdiff_t >(val2);
try {
{
swig::SwigPyIterator &_result_ref = (arg1)->operator +=(arg2);
result = (swig::SwigPyIterator *) &_result_ref;
}
result = (swig::SwigPyIterator *) &(arg1)->operator +=(arg2);
}
catch(swig::stop_iteration &_e) {
{
......@@ -3820,10 +3887,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___isub__(PyObject *SWIGUNUSEDPARM(self
}
arg2 = static_cast< ptrdiff_t >(val2);
try {
{
swig::SwigPyIterator &_result_ref = (arg1)->operator -=(arg2);
result = (swig::SwigPyIterator *) &_result_ref;
}
result = (swig::SwigPyIterator *) &(arg1)->operator -=(arg2);
}
catch(swig::stop_iteration &_e) {
{
......@@ -4527,6 +4591,80 @@ fail:
}
SWIGINTERN PyObject *_wrap_XdmfTopologyPtr_getTopologyType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
boost::shared_ptr< XdmfTopology > *arg1 = (boost::shared_ptr< XdmfTopology > *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
XdmfTopologyType result;
if (!PyArg_ParseTuple(args,(char *)"O:XdmfTopologyPtr_getTopologyType",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_boost__shared_ptrT_XdmfTopology_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "XdmfTopologyPtr_getTopologyType" "', argument " "1"" of type '" "boost::shared_ptr< XdmfTopology > *""'");
}
arg1 = reinterpret_cast< boost::shared_ptr< XdmfTopology > * >(argp1);
result = (XdmfTopologyType)(*arg1)->getTopologyType();
resultobj = SWIG_From_int(static_cast< int >(result));
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_XdmfTopologyPtr_setTopologyType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
boost::shared_ptr< XdmfTopology > *arg1 = (boost::shared_ptr< XdmfTopology > *) 0 ;
XdmfTopologyType arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
int val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OO:XdmfTopologyPtr_setTopologyType",&obj0,&obj1)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_boost__shared_ptrT_XdmfTopology_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "XdmfTopologyPtr_setTopologyType" "', argument " "1"" of type '" "boost::shared_ptr< XdmfTopology > *""'");
}
arg1 = reinterpret_cast< boost::shared_ptr< XdmfTopology > * >(argp1);
ecode2 = SWIG_AsVal_int(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "XdmfTopologyPtr_setTopologyType" "', argument " "2"" of type '" "XdmfTopologyType""'");
}
arg2 = static_cast< XdmfTopologyType >(val2);
(*arg1)->setTopologyType(arg2);
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_XdmfTopologyPtr_getTopologyTypeAsString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
boost::shared_ptr< XdmfTopology > *arg1 = (boost::shared_ptr< XdmfTopology > *) 0 ;
void *argp1 = 0 ;
int res1 =