[cig-commits] r11855 - in cs/benchmark/cigma/trunk: . src src/tests
luis at geodynamics.org
luis at geodynamics.org
Wed Apr 23 09:56:42 PDT 2008
Author: luis
Date: 2008-04-23 09:56:42 -0700 (Wed, 23 Apr 2008)
New Revision: 11855
Added:
cs/benchmark/cigma/trunk/src/DatasetPath.cpp
cs/benchmark/cigma/trunk/src/DatasetPath.h
Modified:
cs/benchmark/cigma/trunk/TODO
cs/benchmark/cigma/trunk/src/MeshPartReader.cpp
cs/benchmark/cigma/trunk/src/PathUtils.cpp
cs/benchmark/cigma/trunk/src/QuadratureReader.cpp
cs/benchmark/cigma/trunk/src/Residuals.cpp
cs/benchmark/cigma/trunk/src/TODO
cs/benchmark/cigma/trunk/src/tests/Makefile
Log:
Miscellaneous changes
Modified: cs/benchmark/cigma/trunk/TODO
===================================================================
--- cs/benchmark/cigma/trunk/TODO 2008-04-23 16:56:40 UTC (rev 11854)
+++ cs/benchmark/cigma/trunk/TODO 2008-04-23 16:56:42 UTC (rev 11855)
@@ -7,6 +7,7 @@
Add configure flag --with-boost
Add configure flag --with-cppunit
Write corresponding man page for each the 'cigma foo' command (see git man pages)
+Create testbuild directory (commit scripts in current /build/ directory)
Added: cs/benchmark/cigma/trunk/src/DatasetPath.cpp
===================================================================
--- cs/benchmark/cigma/trunk/src/DatasetPath.cpp (rev 0)
+++ cs/benchmark/cigma/trunk/src/DatasetPath.cpp 2008-04-23 16:56:42 UTC (rev 11855)
@@ -0,0 +1,8 @@
+#include "DatasetPath.h"
+
+using namespace cigma;
+
+DatasetPath::DatasetPath() {}
+DatasetPath::~DatasetPath() {}
+
+
Added: cs/benchmark/cigma/trunk/src/DatasetPath.h
===================================================================
--- cs/benchmark/cigma/trunk/src/DatasetPath.h (rev 0)
+++ cs/benchmark/cigma/trunk/src/DatasetPath.h 2008-04-23 16:56:42 UTC (rev 11855)
@@ -0,0 +1,24 @@
+#ifndef __DATASET_PATH_H__
+#define __DATASET_PATH_H__
+
+#include <string>
+
+namespace cigma
+{
+ class DatasetPath;
+}
+
+class cigma::DatasetPath
+{
+public:
+ DatasetPath();
+ DatasetPath(std::string path);
+ DatasetPath(const char *path);
+ ~DatasetPath();
+
+public:
+ std::string file;
+ std::string location;
+};
+
+#endif
Modified: cs/benchmark/cigma/trunk/src/MeshPartReader.cpp
===================================================================
--- cs/benchmark/cigma/trunk/src/MeshPartReader.cpp 2008-04-23 16:56:40 UTC (rev 11854)
+++ cs/benchmark/cigma/trunk/src/MeshPartReader.cpp 2008-04-23 16:56:42 UTC (rev 11855)
@@ -48,10 +48,12 @@
string optstr;
string mesh_name = opt_prefix;
- in = opt->getValue(mesh_name.c_str());
+ optstr = mesh_name;
+ in = opt->getValue(optstr.c_str());
if (in != 0)
{
this->meshPath = in;
+ //cout << "Reading option " << optstr << "=" << in << endl;
}
optstr = mesh_name + "-coordinates";
@@ -59,6 +61,7 @@
if (in != 0)
{
this->coordsPath = in;
+ //cout << "Reading option " << optstr << "=" << in << endl;
}
optstr = mesh_name + "-connectivity";
@@ -66,6 +69,7 @@
if (in != 0)
{
this->connectPath = in;
+ //cout << "Reading option " << optstr << "=" << in << endl;
}
}
Modified: cs/benchmark/cigma/trunk/src/PathUtils.cpp
===================================================================
--- cs/benchmark/cigma/trunk/src/PathUtils.cpp 2008-04-23 16:56:40 UTC (rev 11854)
+++ cs/benchmark/cigma/trunk/src/PathUtils.cpp 2008-04-23 16:56:42 UTC (rev 11855)
@@ -2,6 +2,9 @@
#include "PathUtils.h"
#include "StringUtils.h"
+#include <errno.h>
+#include <sys/stat.h>
+#include <sys/types.h>
using namespace std;
@@ -25,9 +28,9 @@
bool VtkExtension(const char *ext)
{
string fileExt = ext;
- return (fileExt == ".vtk")
- || (fileExt == ".vtu") || (fileExt == ".vts")
- || (fileExt == ".pvtu") || (fileExt == ".pvts");
+ return (fileExt == ".vtk") // legacy format
+ || (fileExt == ".vtu") || (fileExt == ".vts") || (fileExt == ".vtr") // XML formats
+ || (fileExt == ".pvtu") || (fileExt == ".pvts") || (fileExt == ".pvtr"); // Parallel XML formats
}
bool LibExtension(const char *ext)
@@ -39,9 +42,16 @@
// ---------------------------------------------------------------------------
+//#define S_ISREG(mode) (mode & _S_IFREG)
+//#define S_ISDIR(mode) (mode & _S_IFDIR)
bool FileExists(const char *filename)
{
- return false;
+ int old_errno = errno;
+ bool ret;
+ struct stat buf;
+ ret = (stat(filename, &buf) == 0) && S_ISREG(buf.st_mode);
+ errno = old_errno;
+ return ret;
}
bool IsHdfFile(const char *filename)
Modified: cs/benchmark/cigma/trunk/src/QuadratureReader.cpp
===================================================================
--- cs/benchmark/cigma/trunk/src/QuadratureReader.cpp 2008-04-23 16:56:40 UTC (rev 11854)
+++ cs/benchmark/cigma/trunk/src/QuadratureReader.cpp 2008-04-23 16:56:42 UTC (rev 11855)
@@ -181,6 +181,7 @@
cerr << "Could not open quadrature points file " << pointsFile << endl;
exit(1);
}
+ cout << endl;
cout << "quadrature points file = " << pointsFile << endl;
ierr = pointsReader->get_dataset(pointsLoc.c_str(), &qx, &nq, &nd);
if (ierr < 0)
@@ -242,6 +243,7 @@
cerr << "Could not open file " << quadratureFile << endl;
exit(1);
}
+ cout << endl;
cout << "quadrature file = " << quadratureFile << endl;
if (reader->getType() == Reader::HDF_READER)
Modified: cs/benchmark/cigma/trunk/src/Residuals.cpp
===================================================================
--- cs/benchmark/cigma/trunk/src/Residuals.cpp 2008-04-23 16:56:40 UTC (rev 11854)
+++ cs/benchmark/cigma/trunk/src/Residuals.cpp 2008-04-23 16:56:42 UTC (rev 11855)
@@ -4,6 +4,8 @@
#include <cmath>
#include "Residuals.h"
#include "VtkWriter.h"
+#include "HdfWriter.h"
+#include "HdfAttr.h"
using namespace std;
using namespace cigma;
@@ -94,6 +96,20 @@
writer.write_cell_types(meshPart->nsd, meshPart->nel, meshPart->ndofs); // XXX: call from w/i write_cells()
writer.write_cell_data("epsilon", epsilon, nel, 1);
writer.close();
+
+ const bool debug = false;
+ if (debug)
+ {
+ int ierr;
+ herr_t status;
+
+ HdfWriter hdfWriter;
+ ierr = hdfWriter.open("residuals-debug.h5");
+ ierr = hdfWriter.write_dataset("residuals", epsilon, nel, 1);
+ //status = HdfAttr::set_double(hdfWriter.h5.file_id, "L2", this->L2());
+ //status = HdfAttr::set_double(hdfWriter.h5.file_id, "Linf", this->max());
+ ierr = hdfWriter.close();
+ }
}
// ---------------------------------------------------------------------------
Modified: cs/benchmark/cigma/trunk/src/TODO
===================================================================
--- cs/benchmark/cigma/trunk/src/TODO 2008-04-23 16:56:40 UTC (rev 11854)
+++ cs/benchmark/cigma/trunk/src/TODO 2008-04-23 16:56:42 UTC (rev 11855)
@@ -1,8 +1,20 @@
---high-----------------------------------------------------------------------
-Refactor common functions into VtkReader
-Create VtkLegacyReader & VtkXmlReader subclasses of VtkReader
+Create vector.i, vector.j, vector.k analogues to scalar.one function
+Split zero function into scalar.zero, vector.zero?
+Write cigma kernel for remote operation
+Write own cigma object for debugging & tracking of memory
+Keep track of time and memory usage
+
+Commit testbuild directory in next version
+Add Field::activate() method to the Field interface so that we can add delayed
+ initialization of predefined fields in FieldSet (to implement lazy loading)
+Call Field::eval_batch() from 'cigma eval' method, instead of 'eval()' directly
+
+Refactor common functions into VtkReader (done)
+Create VtkLegacyReader & VtkXmlReader subclasses of VtkReader (not necessary)
+
Change points->num to points->npts
Rename ResidualField to Residuals
Rename Quadrature to QuadraturePoints
Modified: cs/benchmark/cigma/trunk/src/tests/Makefile
===================================================================
--- cs/benchmark/cigma/trunk/src/tests/Makefile 2008-04-23 16:56:40 UTC (rev 11854)
+++ cs/benchmark/cigma/trunk/src/tests/Makefile 2008-04-23 16:56:42 UTC (rev 11855)
@@ -27,6 +27,7 @@
TestZeroField.o \
TestFieldSet.o \
TestStringUtils.o \
+ TestVtkReader.o \
TESTS = $(TESTOBJS:.o=.out)
More information about the cig-commits
mailing list