Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xdmf
Xdmf
Commits
939ff6ce
Commit
939ff6ce
authored
Jun 25, 2014
by
Andrew J. Burns (Cont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleaning up code
parent
db257fe6
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
187 additions
and
773 deletions
+187
-773
XdmfAttribute.cpp
XdmfAttribute.cpp
+2
-12
XdmfCurvilinearGrid.cpp
XdmfCurvilinearGrid.cpp
+0
-6
XdmfGrid.cpp
XdmfGrid.cpp
+1
-11
XdmfRectilinearGrid.cpp
XdmfRectilinearGrid.cpp
+0
-15
XdmfRegularGrid.cpp
XdmfRegularGrid.cpp
+0
-18
XdmfSet.cpp
XdmfSet.cpp
+2
-12
core/XdmfArray.cpp
core/XdmfArray.cpp
+3
-18
core/XdmfCoreReader.cpp
core/XdmfCoreReader.cpp
+0
-12
core/XdmfFunction.cpp
core/XdmfFunction.cpp
+2
-12
core/XdmfHDF5Writer.cpp
core/XdmfHDF5Writer.cpp
+30
-72
core/XdmfHeavyDataController.cpp
core/XdmfHeavyDataController.cpp
+0
-6
core/XdmfHeavyDataController.hpp
core/XdmfHeavyDataController.hpp
+1
-1
core/XdmfInformation.cpp
core/XdmfInformation.cpp
+4
-24
core/XdmfSparseMatrix.cpp
core/XdmfSparseMatrix.cpp
+1
-24
core/XdmfWriter.cpp
core/XdmfWriter.cpp
+1
-45
core/dsm/XdmfDSMBuffer.cpp
core/dsm/XdmfDSMBuffer.cpp
+91
-251
core/dsm/XdmfDSMCommMPI.cpp
core/dsm/XdmfDSMCommMPI.cpp
+32
-132
core/dsm/XdmfHDF5ControllerDSM.cpp
core/dsm/XdmfHDF5ControllerDSM.cpp
+8
-48
core/dsm/XdmfHDF5WriterDSM.cpp
core/dsm/XdmfHDF5WriterDSM.cpp
+9
-54
No files found.
XdmfAttribute.cpp
View file @
939ff6ce
...
...
@@ -72,12 +72,7 @@ XdmfAttribute::getItemTag() const
std
::
string
XdmfAttribute
::
getName
()
const
{
if
(
mName
.
c_str
()
==
NULL
)
{
return
""
;
}
else
{
return
mName
;
}
return
mName
;
}
shared_ptr
<
const
XdmfAttributeType
>
...
...
@@ -130,12 +125,7 @@ XdmfAttribute::setCenter(const shared_ptr<const XdmfAttributeCenter> center)
void
XdmfAttribute
::
setName
(
const
std
::
string
&
name
)
{
if
(
mName
.
c_str
()
==
NULL
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Internal Name String is a null reference"
);
}
else
{
mName
=
name
;
}
mName
=
name
;
}
void
...
...
XdmfCurvilinearGrid.cpp
View file @
939ff6ce
...
...
@@ -241,9 +241,6 @@ XdmfCurvilinearGrid::getDimensions()
shared_ptr
<
const
XdmfArray
>
XdmfCurvilinearGrid
::
getDimensions
()
const
{
if
(
mImpl
==
NULL
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Curvilinear Grid Internal Object is NULL"
);
}
return
mImpl
->
mDimensions
;
}
...
...
@@ -275,9 +272,6 @@ XdmfCurvilinearGrid::populateItem(const std::map<std::string, std::string> & ite
void
XdmfCurvilinearGrid
::
setDimensions
(
const
shared_ptr
<
XdmfArray
>
dimensions
)
{
if
(
mImpl
==
NULL
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Curvilinear Grid Internal Object is NULL"
);
}
mImpl
->
mDimensions
=
dimensions
;
}
...
...
XdmfGrid.cpp
View file @
939ff6ce
...
...
@@ -73,12 +73,7 @@ XdmfGrid::getItemTag() const
std
::
string
XdmfGrid
::
getName
()
const
{
if
(
mName
.
c_str
()
==
NULL
)
{
return
""
;
}
else
{
return
mName
;
}
}
shared_ptr
<
XdmfTime
>
...
...
@@ -148,12 +143,7 @@ XdmfGrid::populateItem(const std::map<std::string, std::string> & itemProperties
void
XdmfGrid
::
setName
(
const
std
::
string
&
name
)
{
if
(
mName
.
c_str
()
==
NULL
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Internal Name String is a null reference"
);
}
else
{
mName
=
name
;
}
mName
=
name
;
}
void
...
...
XdmfRectilinearGrid.cpp
View file @
939ff6ce
...
...
@@ -343,9 +343,6 @@ XdmfRectilinearGrid::getCoordinates(const unsigned int axisIndex)
shared_ptr
<
const
XdmfArray
>
XdmfRectilinearGrid
::
getCoordinates
(
const
unsigned
int
axisIndex
)
const
{
if
(
mImpl
==
NULL
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Xdmf Rectilinear Grid Internal Object is NULL"
);
}
if
(
axisIndex
<
mImpl
->
mCoordinates
.
size
())
{
return
mImpl
->
mCoordinates
[
axisIndex
];
}
...
...
@@ -361,9 +358,6 @@ XdmfRectilinearGrid::getCoordinates()
const
std
::
vector
<
shared_ptr
<
XdmfArray
>
>
XdmfRectilinearGrid
::
getCoordinates
()
const
{
if
(
mImpl
==
NULL
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Xdmf Rectilinear Grid Internal Object is NULL"
);
}
return
mImpl
->
mCoordinates
;
}
...
...
@@ -377,9 +371,6 @@ XdmfRectilinearGrid::getDimensions()
shared_ptr
<
const
XdmfArray
>
XdmfRectilinearGrid
::
getDimensions
()
const
{
if
(
mImpl
==
NULL
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Xdmf Rectilinear Grid Internal Object is NULL"
);
}
shared_ptr
<
XdmfArray
>
dimensions
=
XdmfArray
::
New
();
dimensions
->
reserve
(
mImpl
->
mCoordinates
.
size
());
for
(
std
::
vector
<
shared_ptr
<
XdmfArray
>
>::
const_iterator
iter
=
...
...
@@ -416,9 +407,6 @@ void
XdmfRectilinearGrid
::
setCoordinates
(
const
unsigned
int
axisIndex
,
const
shared_ptr
<
XdmfArray
>
axisCoordinates
)
{
if
(
mImpl
==
NULL
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Xdmf Rectilinear Grid Internal Object is NULL"
);
}
if
(
mImpl
->
mCoordinates
.
size
()
<=
axisIndex
)
{
mImpl
->
mCoordinates
.
reserve
(
axisIndex
+
1
);
unsigned
int
numArraysToInsert
=
...
...
@@ -433,8 +421,5 @@ XdmfRectilinearGrid::setCoordinates(const unsigned int axisIndex,
void
XdmfRectilinearGrid
::
setCoordinates
(
const
std
::
vector
<
shared_ptr
<
XdmfArray
>
>
axesCoordinates
)
{
if
(
mImpl
==
NULL
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Xdmf Rectilinear Grid Internal Object is NULL"
);
}
mImpl
->
mCoordinates
=
axesCoordinates
;
}
XdmfRegularGrid.cpp
View file @
939ff6ce
...
...
@@ -371,9 +371,6 @@ XdmfRegularGrid::getBrickSize()
shared_ptr
<
const
XdmfArray
>
XdmfRegularGrid
::
getBrickSize
()
const
{
if
(
mImpl
==
NULL
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Regular Grid Internal Object is NULL"
);
}
return
mImpl
->
mBrickSize
;
}
...
...
@@ -387,9 +384,6 @@ XdmfRegularGrid::getDimensions()
shared_ptr
<
const
XdmfArray
>
XdmfRegularGrid
::
getDimensions
()
const
{
if
(
mImpl
==
NULL
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Regular Grid Internal Object is NULL"
);
}
return
mImpl
->
mDimensions
;
}
...
...
@@ -403,9 +397,6 @@ XdmfRegularGrid::getOrigin()
shared_ptr
<
const
XdmfArray
>
XdmfRegularGrid
::
getOrigin
()
const
{
if
(
mImpl
==
NULL
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Regular Grid Internal Object is NULL"
);
}
return
mImpl
->
mOrigin
;
}
...
...
@@ -440,26 +431,17 @@ XdmfRegularGrid::populateItem(const std::map<std::string, std::string> & itemPro
void
XdmfRegularGrid
::
setBrickSize
(
const
shared_ptr
<
XdmfArray
>
brickSize
)
{
if
(
mImpl
==
NULL
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Regular Grid Internal Object is NULL"
);
}
mImpl
->
mBrickSize
=
brickSize
;
}
void
XdmfRegularGrid
::
setDimensions
(
const
shared_ptr
<
XdmfArray
>
dimensions
)
{
if
(
mImpl
==
NULL
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Regular Grid Internal Object is NULL"
);
}
mImpl
->
mDimensions
=
dimensions
;
}
void
XdmfRegularGrid
::
setOrigin
(
const
shared_ptr
<
XdmfArray
>
origin
)
{
if
(
mImpl
==
NULL
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Regular Grid Internal Object is NULL"
);
}
mImpl
->
mOrigin
=
origin
;
}
XdmfSet.cpp
View file @
939ff6ce
...
...
@@ -67,12 +67,7 @@ XdmfSet::getItemTag() const
std
::
string
XdmfSet
::
getName
()
const
{
if
(
mName
.
c_str
()
==
NULL
)
{
return
""
;
}
else
{
return
mName
;
}
return
mName
;
}
shared_ptr
<
const
XdmfSetType
>
...
...
@@ -117,12 +112,7 @@ XdmfSet::populateItem(const std::map<std::string, std::string> & itemProperties,
void
XdmfSet
::
setName
(
const
std
::
string
&
name
)
{
if
(
mName
.
c_str
()
==
NULL
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Internal Name String is a null reference"
);
}
else
{
mName
=
name
;
}
mName
=
name
;
}
void
...
...
core/XdmfArray.cpp
View file @
939ff6ce
...
...
@@ -706,23 +706,13 @@ XdmfArray::getItemTag() const
std
::
string
XdmfArray
::
getName
()
const
{
if
(
mName
.
c_str
()
==
NULL
)
{
return
""
;
}
else
{
return
mName
;
}
return
mName
;
}
XdmfArray
::
ReadMode
XdmfArray
::
getReadMode
()
const
{
if
(
mReadMode
)
{
return
mReadMode
;
}
else
{
return
XdmfArray
::
Controller
;
}
return
mReadMode
;
}
unsigned
int
...
...
@@ -1367,12 +1357,7 @@ XdmfArray::setHeavyDataController(shared_ptr<XdmfHeavyDataController> newControl
void
XdmfArray
::
setName
(
const
std
::
string
&
name
)
{
if
(
mName
.
c_str
()
==
NULL
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Internal Name String is a null reference"
);
}
else
{
mName
=
name
;
}
mName
=
name
;
}
void
...
...
core/XdmfCoreReader.cpp
View file @
939ff6ce
...
...
@@ -327,9 +327,6 @@ XdmfCoreReader::~XdmfCoreReader()
shared_ptr
<
XdmfItem
>
XdmfCoreReader
::
parse
(
const
std
::
string
&
lightData
)
const
{
if
(
mImpl
==
NULL
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Reader Internal Object is NULL"
);
}
mImpl
->
parse
(
lightData
);
const
xmlNodePtr
currNode
=
xmlDocGetRootElement
(
mImpl
->
mDocument
);
std
::
vector
<
shared_ptr
<
XdmfItem
>
>
toReturn
;
...
...
@@ -348,9 +345,6 @@ XdmfCoreReader::parse(const std::string & lightData) const
std
::
vector
<
shared_ptr
<
XdmfItem
>
>
XdmfCoreReader
::
readItems
(
const
std
::
string
&
filePath
)
const
{
if
(
mImpl
==
NULL
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Reader Internal Object is NULL"
);
}
mImpl
->
openFile
(
filePath
);
const
xmlNodePtr
currNode
=
xmlDocGetRootElement
(
mImpl
->
mDocument
);
const
std
::
vector
<
shared_ptr
<
XdmfItem
>
>
toReturn
=
...
...
@@ -373,9 +367,6 @@ std::vector<shared_ptr<XdmfItem> >
XdmfCoreReader
::
read
(
const
std
::
string
&
filePath
,
const
std
::
string
&
xPath
)
const
{
if
(
mImpl
==
NULL
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Reader Internal Object is NULL"
);
}
mImpl
->
openFile
(
filePath
);
std
::
vector
<
shared_ptr
<
XdmfItem
>
>
toReturn
=
this
->
readPathObjects
(
xPath
);
mImpl
->
closeFile
();
...
...
@@ -385,9 +376,6 @@ XdmfCoreReader::read(const std::string & filePath,
std
::
vector
<
shared_ptr
<
XdmfItem
>
>
XdmfCoreReader
::
readPathObjects
(
const
std
::
string
&
xPath
)
const
{
if
(
mImpl
==
NULL
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Reader Internal Object is NULL"
);
}
std
::
vector
<
shared_ptr
<
XdmfItem
>
>
toReturn
;
mImpl
->
readPathObjects
(
xPath
,
toReturn
);
return
toReturn
;
...
...
core/XdmfFunction.cpp
View file @
939ff6ce
...
...
@@ -748,12 +748,7 @@ XdmfFunction::evaluateFunction(std::vector<shared_ptr<XdmfArray> > valueVector,
std
::
string
XdmfFunction
::
getExpression
()
const
{
if
(
mExpression
.
c_str
()
==
NULL
)
{
return
""
;
}
else
{
return
mExpression
;
}
return
mExpression
;
}
std
::
string
...
...
@@ -1066,12 +1061,7 @@ XdmfFunction::removeVariable(std::string key)
void
XdmfFunction
::
setExpression
(
std
::
string
newExpression
)
{
if
(
mExpression
.
c_str
()
==
NULL
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Internal Expression String is a null reference"
);
}
else
{
mExpression
=
newExpression
;
}
mExpression
=
newExpression
;
}
shared_ptr
<
XdmfArray
>
...
...
core/XdmfHDF5Writer.cpp
View file @
939ff6ce
...
...
@@ -940,14 +940,7 @@ XdmfHDF5Writer::createController(const shared_ptr<XdmfHeavyDataController> & ref
unsigned
int
XdmfHDF5Writer
::
getChunkSize
()
const
{
if
(
mImpl
!=
NULL
)
{
return
mImpl
->
mChunkSize
;
}
else
{
// Fatal error if impl is null
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: HDF5 internal object is NULL"
);
return
0
;
}
return
mImpl
->
mChunkSize
;
}
int
...
...
@@ -1000,13 +993,7 @@ XdmfHDF5Writer::getDataSetSize(const std::string & fileName, const std::string &
void
XdmfHDF5Writer
::
closeFile
()
{
if
(
mImpl
!=
NULL
)
{
mImpl
->
closeFile
();
}
else
{
// Fatal error if impl is null
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: HDF5 internal object is NULL"
);
}
mImpl
->
closeFile
();
}
void
...
...
@@ -1018,54 +1005,36 @@ XdmfHDF5Writer::openFile()
void
XdmfHDF5Writer
::
openFile
(
const
int
fapl
)
{
if
(
mImpl
!=
NULL
)
{
mDataSetId
=
mImpl
->
openFile
(
mFilePath
,
fapl
,
mDataSetId
);
}
else
{
// Fatal error if impl is null
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: HDF5 internal object is NULL"
);
}
mDataSetId
=
mImpl
->
openFile
(
mFilePath
,
fapl
,
mDataSetId
);
}
void
XdmfHDF5Writer
::
setChunkSize
(
const
unsigned
int
chunkSize
)
{
if
(
mImpl
!=
NULL
)
{
mImpl
->
mChunkSize
=
chunkSize
;
}
else
{
// Fatal error if impl is null
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: HDF5 internal object is NULL"
);
}
mImpl
->
mChunkSize
=
chunkSize
;
}
void
XdmfHDF5Writer
::
visit
(
XdmfArray
&
array
,
const
shared_ptr
<
XdmfBaseVisitor
>
visitor
)
{
if
(
mImpl
!=
NULL
)
{
mImpl
->
mDepth
++
;
std
::
set
<
const
XdmfItem
*>::
iterator
checkWritten
=
mImpl
->
mWrittenItems
.
find
(
&
array
);
if
(
checkWritten
==
mImpl
->
mWrittenItems
.
end
()
||
array
.
getItemTag
()
==
"DataItem"
)
{
// If it has children send the writer to them too.
array
.
traverse
(
visitor
);
if
(
array
.
isInitialized
())
{
// Only do this if the object has not already been written
this
->
write
(
array
,
H5P_DEFAULT
);
mImpl
->
mWrittenItems
.
insert
(
&
array
);
}
}
// If the object has already been written, just end, it already has the data
mImpl
->
mDepth
--
;
if
(
mImpl
->
mDepth
<=
0
)
{
mImpl
->
mWrittenItems
.
clear
();
mImpl
->
mDepth
++
;
std
::
set
<
const
XdmfItem
*>::
iterator
checkWritten
=
mImpl
->
mWrittenItems
.
find
(
&
array
);
if
(
checkWritten
==
mImpl
->
mWrittenItems
.
end
()
||
array
.
getItemTag
()
==
"DataItem"
)
{
// If it has children send the writer to them too.
array
.
traverse
(
visitor
);
if
(
array
.
isInitialized
())
{
// Only do this if the object has not already been written
this
->
write
(
array
,
H5P_DEFAULT
);
mImpl
->
mWrittenItems
.
insert
(
&
array
);
}
}
else
{
// Fatal error if impl is null
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: HDF5 internal object is NULL"
);
// If the object has already been written, just end, it already has the data
mImpl
->
mDepth
--
;
if
(
mImpl
->
mDepth
<=
0
)
{
mImpl
->
mWrittenItems
.
clear
();
}
}
...
...
@@ -1074,24 +1043,18 @@ void
XdmfHDF5Writer
::
visit
(
XdmfItem
&
item
,
const
shared_ptr
<
XdmfBaseVisitor
>
visitor
)
{
if
(
mImpl
!=
NULL
)
{
mImpl
->
mDepth
++
;
// This is similar to the algorithm for writing XPaths
// shouldn't be a problem if XPaths are turned off because all this does is avoid writing an object twice
// if it was written once then all instances of the object should have the controller
std
::
set
<
const
XdmfItem
*>::
iterator
checkWritten
=
mImpl
->
mWrittenItems
.
find
(
&
item
);
if
(
checkWritten
==
mImpl
->
mWrittenItems
.
end
())
{
mImpl
->
mWrittenItems
.
insert
(
&
item
);
item
.
traverse
(
visitor
);
}
mImpl
->
mDepth
--
;
if
(
mImpl
->
mDepth
<=
0
)
{
mImpl
->
mWrittenItems
.
clear
();
}
mImpl
->
mDepth
++
;
// This is similar to the algorithm for writing XPaths
// shouldn't be a problem if XPaths are turned off because all this does is avoid writing an object twice
// if it was written once then all instances of the object should have the controller
std
::
set
<
const
XdmfItem
*>::
iterator
checkWritten
=
mImpl
->
mWrittenItems
.
find
(
&
item
);
if
(
checkWritten
==
mImpl
->
mWrittenItems
.
end
())
{
mImpl
->
mWrittenItems
.
insert
(
&
item
);
item
.
traverse
(
visitor
);
}
else
{
// Fatal error if impl is null
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: HDF5 internal object is NULL"
);
mImpl
->
mDepth
--
;
if
(
mImpl
->
mDepth
<=
0
)
{
mImpl
->
mWrittenItems
.
clear
(
);
}
}
...
...
@@ -1100,11 +1063,6 @@ void
XdmfHDF5Writer
::
write
(
XdmfArray
&
array
,
const
int
fapl
)
{
if
(
mImpl
==
NULL
)
{
// Fatal error if impl is null
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: HDF5 internal object is NULL"
);
}
hid_t
datatype
=
-
1
;
bool
closeDatatype
=
false
;
...
...
core/XdmfHeavyDataController.cpp
View file @
939ff6ce
...
...
@@ -48,12 +48,6 @@ XdmfHeavyDataController::getArrayOffset() const
return
mArrayStartOffset
;
}
std
::
string
XdmfHeavyDataController
::
getDescriptor
()
const
{
return
""
;
}
std
::
vector
<
unsigned
int
>
XdmfHeavyDataController
::
getDimensions
()
const
{
...
...
core/XdmfHeavyDataController.hpp
View file @
939ff6ce
...
...
@@ -76,7 +76,7 @@ public:
*
* @return A string that contains relevant information for the controller
*/
virtual
std
::
string
getDescriptor
()
const
;
virtual
std
::
string
getDescriptor
()
const
=
0
;
/**
* Get the dimensions of the heavy data set owned by this controller.
...
...
core/XdmfInformation.cpp
View file @
939ff6ce
...
...
@@ -74,23 +74,13 @@ XdmfInformation::getItemTag() const
std
::
string
XdmfInformation
::
getKey
()
const
{
if
(
mKey
.
c_str
()
==
NULL
)
{
return
""
;
}
else
{
return
mKey
;
}
return
mKey
;
}
std
::
string
XdmfInformation
::
getValue
()
const
{
if
(
mValue
.
c_str
()
==
NULL
)
{
return
""
;
}
else
{
return
mValue
;
}
return
mValue
;
}
void
...
...
@@ -140,23 +130,13 @@ XdmfInformation::populateItem(const std::map<std::string, std::string> & itemPro
void
XdmfInformation
::
setKey
(
const
std
::
string
&
key
)
{
if
(
mKey
.
c_str
()
==
NULL
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Internal Key String is a null reference"
);
}
else
{
mKey
=
key
;
}
mKey
=
key
;
}
void
XdmfInformation
::
setValue
(
const
std
::
string
&
value
)
{
if
(
mValue
.
c_str
()
==
NULL
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Internal Value String is a null reference"
);
}
else
{
mValue
=
value
;
}
mValue
=
value
;
}
void
...
...
core/XdmfSparseMatrix.cpp
View file @
939ff6ce
...
...
@@ -57,9 +57,6 @@ const std::string XdmfSparseMatrix::ItemTag = "SparseMatrix";
shared_ptr
<
XdmfArray
>
XdmfSparseMatrix
::
getColumnIndex
()
{
if
(
!
mColumnIndex
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Sparse Matrix Column Index is Null"
);
}
return
mColumnIndex
;
}
...
...
@@ -111,18 +108,12 @@ XdmfSparseMatrix::getNumberRows() const
shared_ptr
<
XdmfArray
>
XdmfSparseMatrix
::
getRowPointer
()
{
if
(
!
mRowPointer
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Sparse Matrix Row Pointer is Null"
);
}
return
mRowPointer
;
}
shared_ptr
<
XdmfArray
>
XdmfSparseMatrix
::
getValues
()
{
if
(
!
mValues
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Sparse Matrix Values are Null"
);
}
return
mValues
;
}
...
...
@@ -222,38 +213,24 @@ XdmfSparseMatrix::populateItem(const std::map<std::string, std::string> & itemPr
void
XdmfSparseMatrix
::
setColumnIndex
(
const
shared_ptr
<
XdmfArray
>
columnIndex
)
{
if
(
!
mColumnIndex
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Sparse Matrix Column Index is Null"
);
}
mColumnIndex
=
columnIndex
;
}
void
XdmfSparseMatrix
::
setName
(
const
std
::
string
&
name
)
{
if
(
mName
.
c_str
()
==
NULL
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Internal Name String is a null reference"
);
}
else
{
mName
=
name
;
}
mName
=
name
;
}
void
XdmfSparseMatrix
::
setRowPointer
(
const
shared_ptr
<
XdmfArray
>
rowPointer
)
{
if
(
!
mRowPointer
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Sparse Matrix Row Pointer is Null"
);
}
mRowPointer
=
rowPointer
;
}
void
XdmfSparseMatrix
::
setValues
(
const
shared_ptr
<
XdmfArray
>
values
)
{
if
(
!
mValues
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Sparse Matrix Values are Null"
);
}
mValues
=
values
;
}
...
...
core/XdmfWriter.cpp
View file @
939ff6ce
...
...
@@ -207,116 +207,78 @@ XdmfWriter::getHeavyDataWriter()
shared_ptr
<
const
XdmfHeavyDataWriter
>
XdmfWriter
::
getHeavyDataWriter
()
const
{
if
(
mImpl
==
NULL
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Writer Internal Object is Null"
);
}
return
mImpl
->
mHeavyDataWriter
;
}
std
::
string
XdmfWriter
::
getFilePath
()
const
{
if
(
mImpl
==
NULL
)
{
XdmfError
::
message
(
XdmfError
::
FATAL
,
"Error: Writer Internal Object is Null"
);
}