Commit 121d8f88 authored by Jerry Clarke's avatar Jerry Clarke
Browse files

Properly apply DataDesc->Selection in ::UpdateFunction()

parent b73fb5ce
......@@ -27,6 +27,7 @@
#include "XdmfExpression.h"
#include "XdmfArray.h"
#include "XdmfDOM.h"
#include "XdmfHDF.h"
// Supported Xdmf Formats
#include "XdmfValuesXML.h"
......@@ -271,7 +272,7 @@ XdmfInt32 XdmfDataItem::UpdateInformation(){
Value = this->Get("Dimensions");
if(!Value) {
XdmfErrorMessage("Dimensions are not set in XML Element");
cout << this->DOM->Serialize(this->Element) << endl;
XdmfErrorMessage(this->DOM->Serialize(this->Element));
return(XDMF_FAIL);
}
if(!this->DataDesc) this->DataDesc = new XdmfDataDesc();
......@@ -431,6 +432,20 @@ XdmfInt32 XdmfDataItem::UpdateFunction(){
if(Value && ReturnArray){
ReturnArray->ReformFromString(Value);
}
// If only a portion of the DataItem was requested
// the XdmfValues did not reflect this selection since
// DataDesc was used to select HyperSlad | Coordinates | Function
if(this->DataDesc->GetSelectionType() != XDMF_SELECTALL){
XdmfArray *Portion;
XdmfInt64 SelectionSize = this->DataDesc->GetSelectionSize();
Portion = ReturnArray->Clone();
ReturnArray->SetShape(1, &SelectionSize);
ReturnArray->SelectAll();
Portion->CopySelection(this->DataDesc);
CopyArray(Portion, ReturnArray);
delete Portion;
}
while( NTmp ){
NTmp--;
XdmfDebug("Deleteing DataItem #" << NTmp );
......
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