Commit 05d523d1 authored by Jerry Clarke's avatar Jerry Clarke
Browse files

Add a HeavyDataSetName to XdmfArray. This is used when the Array gets

written but the DataItem has no HeavyDataSetName
parent 9c36e7b4
......@@ -345,6 +345,8 @@ class XdmfArray(XdmfDataDesc):
def GetMean(*args): return _Xdmf.XdmfArray_GetMean(*args)
def SetDataFromChars(*args): return _Xdmf.XdmfArray_SetDataFromChars(*args)
def GetDataPointerAsCharPointer(*args): return _Xdmf.XdmfArray_GetDataPointerAsCharPointer(*args)
def SetHeavyDataSetName(*args): return _Xdmf.XdmfArray_SetHeavyDataSetName(*args)
def GetHeavyDataSetName(*args): return _Xdmf.XdmfArray_GetHeavyDataSetName(*args)
XdmfArray_swigregister = _Xdmf.XdmfArray_swigregister
XdmfArray_swigregister(XdmfArray)
......
......@@ -207,6 +207,7 @@ Tag << "_" << XDMF_64BIT_CAST GlobalTimeCntr << "_XdmfArray" << ends;
XdmfArray::XdmfArray() {
XdmfDebug("XdmfArray Constructor");
this->DataPointer = NULL;
this->HeavyDataSetName = NULL;
this->DataIsMine = 1;
this->AddArrayToList();
}
......
......@@ -375,6 +375,10 @@ public:
XdmfString GetDataPointerAsCharPointer( void ) {
return( (XdmfString)this->GetDataPointer() );
};
//! Set the name of the Heavy Data Set when written (if applicable)
XdmfSetStringMacro(HeavyDataSetName);
//! Get the name of the Heavy Data Set when written (if applicable)
XdmfGetStringMacro(HeavyDataSetName);
//! Copy Data From One Array to Another
// XdmfPointer MemCopy( XdmfLength StartOffset,
......@@ -409,6 +413,7 @@ public:
// };
protected:
XdmfString HeavyDataSetName;
XdmfPointer DataPointer;
XdmfBoolean DataIsMine;
char TagName[XDMF_ARRAY_TAG_LENGTH];
......
......@@ -12135,6 +12135,62 @@ fail:
}
 
 
SWIGINTERN PyObject *_wrap_XdmfArray_SetHeavyDataSetName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
XdmfArray *arg1 = (XdmfArray *) 0 ;
XdmfConstString arg2 = (XdmfConstString) 0 ;
XdmfInt32 result;
void *argp1 = 0 ;
int res1 = 0 ;
int res2 ;
char *buf2 = 0 ;
int alloc2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OO:XdmfArray_SetHeavyDataSetName",&obj0,&obj1)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_XdmfArray, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "XdmfArray_SetHeavyDataSetName" "', argument " "1"" of type '" "XdmfArray *""'");
}
arg1 = reinterpret_cast< XdmfArray * >(argp1);
res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "XdmfArray_SetHeavyDataSetName" "', argument " "2"" of type '" "XdmfConstString""'");
}
arg2 = reinterpret_cast< XdmfConstString >(buf2);
result = (XdmfInt32)(arg1)->SetHeavyDataSetName(arg2);
resultobj = SWIG_From_int(static_cast< int >(result));
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
return resultobj;
fail:
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
return NULL;
}
SWIGINTERN PyObject *_wrap_XdmfArray_GetHeavyDataSetName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
XdmfArray *arg1 = (XdmfArray *) 0 ;
XdmfConstString result;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"O:XdmfArray_GetHeavyDataSetName",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_XdmfArray, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "XdmfArray_GetHeavyDataSetName" "', argument " "1"" of type '" "XdmfArray *""'");
}
arg1 = reinterpret_cast< XdmfArray * >(argp1);
result = (XdmfConstString)(arg1)->GetHeavyDataSetName();
resultobj = SWIG_FromCharPtr((const char *)result);
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *XdmfArray_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *obj;
if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL;
......@@ -23402,6 +23458,8 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"XdmfArray_GetMean", _wrap_XdmfArray_GetMean, METH_VARARGS, NULL},
{ (char *)"XdmfArray_SetDataFromChars", _wrap_XdmfArray_SetDataFromChars, METH_VARARGS, NULL},
{ (char *)"XdmfArray_GetDataPointerAsCharPointer", _wrap_XdmfArray_GetDataPointerAsCharPointer, METH_VARARGS, NULL},
{ (char *)"XdmfArray_SetHeavyDataSetName", _wrap_XdmfArray_SetHeavyDataSetName, METH_VARARGS, NULL},
{ (char *)"XdmfArray_GetHeavyDataSetName", _wrap_XdmfArray_GetHeavyDataSetName, METH_VARARGS, NULL},
{ (char *)"XdmfArray_swigregister", XdmfArray_swigregister, METH_VARARGS, NULL},
{ (char *)"XdmfArrayList_name_set", _wrap_XdmfArrayList_name_set, METH_VARARGS, NULL},
{ (char *)"XdmfArrayList_name_get", _wrap_XdmfArrayList_name_get, METH_VARARGS, NULL},
......
......@@ -118,7 +118,11 @@ XdmfValuesHDF::Write(XdmfArray *anArray, XdmfConstString aHeavyDataSetName){
if(!aHeavyDataSetName) aHeavyDataSetName = this->GetHeavyDataSetName();
if(!aHeavyDataSetName){
aHeavyDataSetName = this->GetUniqueName("Xdmf.h5:/Data");
if(anArray->GetHeavyDataSetName()){
aHeavyDataSetName = (XdmfConstString)anArray->GetHeavyDataSetName();
}else{
aHeavyDataSetName = this->GetUniqueName("Xdmf.h5:/Data");
}
}
XdmfDebug("Writing Values to " << aHeavyDataSetName);
if(!this->DataDesc ){
......
Supports Markdown
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