[cig-commits] r6809 - in short/3D/PyLith/trunk: . modulesrc/meshio
unittests/libtests/meshio unittests/libtests/meshio/data
brad at geodynamics.org
brad at geodynamics.org
Wed May 9 12:31:28 PDT 2007
Author: brad
Date: 2007-05-09 12:31:28 -0700 (Wed, 09 May 2007)
New Revision: 6809
Modified:
short/3D/PyLith/trunk/configure.ac
short/3D/PyLith/trunk/modulesrc/meshio/meshio.pyxe.src
short/3D/PyLith/trunk/unittests/libtests/meshio/Makefile.am
short/3D/PyLith/trunk/unittests/libtests/meshio/data/cube2_ascii.gmv
short/3D/PyLith/trunk/unittests/libtests/meshio/data/cube2_ascii.pset
short/3D/PyLith/trunk/unittests/libtests/meshio/data/cube2_binary.pset
Log:
Fixed bugs associated with making configuring with CUBIT optional.
Modified: short/3D/PyLith/trunk/configure.ac
===================================================================
--- short/3D/PyLith/trunk/configure.ac 2007-05-09 19:05:31 UTC (rev 6808)
+++ short/3D/PyLith/trunk/configure.ac 2007-05-09 19:31:28 UTC (rev 6809)
@@ -40,7 +40,8 @@
AC_ARG_ENABLE([cubit],
[AC_HELP_STRING([--enable-cubit],
[enable reading/writing Cubit EXODUS files (requires netcdf) @<:@default=no@:>@])],
- [enable_cubit=yes],
+ [enable_cubit=yes
+ CXXFLAGS="-DENABLE_CUBIT $CXXFLAGS"; export CXXFLAGS],
[enable_cubit=no])
AM_CONDITIONAL([ENABLE_CUBIT], [test "$enable_cubit" = yes])
Modified: short/3D/PyLith/trunk/modulesrc/meshio/meshio.pyxe.src
===================================================================
--- short/3D/PyLith/trunk/modulesrc/meshio/meshio.pyxe.src 2007-05-09 19:05:31 UTC (rev 6808)
+++ short/3D/PyLith/trunk/modulesrc/meshio/meshio.pyxe.src 2007-05-09 19:31:28 UTC (rev 6809)
@@ -13,9 +13,12 @@
#header{
#include "pylith/meshio/MeshIO.hh"
#include "pylith/meshio/MeshIOAscii.hh"
-#include "pylith/meshio/MeshIOCubit.hh"
#include "pylith/meshio/MeshIOLagrit.hh"
+#if defined(ENABLE_CUBIT)
+#include "pylith/meshio/MeshIOCubit.hh"
+#endif
+
#include <stdexcept>
#include <assert.h>
#include <Python.h>
@@ -295,6 +298,7 @@
"""Constructor."""
# create shim for constructor
#embed{ void* MeshIOCubit_constructor()
+ #if defined(ENABLE_CUBIT)
void* result = 0;
try {
result = (void*)(new pylith::meshio::MeshIOCubit);
@@ -307,6 +311,10 @@
"Caught unknown C++ exception.");
} // try/catch
return result;
+ #else
+ throw std::logic_error("Not configured to use CUBIT.");
+ return 0;
+ #endif
#}embed
MeshIO.__init__(self)
@@ -320,6 +328,7 @@
"""Set filename."""
# create shim for method 'filename'
#embed{ void MeshIOCubit_filename_set(void* objVptr, char* name)
+ #if defined(ENABLE_CUBIT)
try {
assert(0 != objVptr);
((pylith::meshio::MeshIOCubit*) objVptr)->filename(name);
@@ -330,6 +339,9 @@
PyErr_SetString(PyExc_RuntimeError,
"Caught unknown C++ exception.");
} // try/catch
+ #else
+ throw std::logic_error("Not configured to use CUBIT.");
+ #endif
#}embed
MeshIOCubit_filename_set(self.thisptr, name)
@@ -337,6 +349,7 @@
"""Get filename."""
# create shim for method 'filename'
#embed{ char* MeshIOCubit_filename_get(void* objVptr)
+ #if defined(ENABLE_CUBIT)
char* result = 0;
try {
assert(0 != objVptr);
@@ -350,9 +363,12 @@
"Caught unknown C++ exception.");
} // try/catch
return result;
+ #else
+ throw std::logic_error("Not configured to use CUBIT.");
+ return 0;
+ #endif
#}embed
return MeshIOCubit_filename_get(self.thisptr)
-
# ----------------------------------------------------------------------
cdef class MeshIOLagrit(MeshIO):
Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/Makefile.am 2007-05-09 19:05:31 UTC (rev 6808)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/Makefile.am 2007-05-09 19:31:28 UTC (rev 6809)
@@ -23,14 +23,12 @@
testmeshio_SOURCES = \
TestMeshIO.cc \
TestMeshIOAscii.cc \
- TestMeshIOCubit.cc \
TestMeshIOLagrit.cc \
test_meshio.cc
noinst_HEADERS = \
TestMeshIO.hh \
TestMeshIOAscii.hh \
- TestMeshIOCubit.hh \
TestMeshIOLagrit.hh
# Source files associated with testing data
@@ -69,6 +67,8 @@
$(top_builddir)/libsrc/libpylith.la
if ENABLE_CUBIT
+ testmeshio_SOURCES += TestMeshIOCubit.cc
+ noinst_HEADERS += TestMeshIOCubit.hh
testmeshio_LDADD += -lnetcdf_c++ -lnetcdf
endif
Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/cube2_ascii.gmv
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/cube2_ascii.gmv 2007-05-09 19:05:31 UTC (rev 6808)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/cube2_ascii.gmv 2007-05-09 19:31:28 UTC (rev 6809)
@@ -1,6 +1,6 @@
gmvinput ascii
codename LaGriT
-simdate 05/08/07
+simdate 05/09/07
nodes 12
0.00000E+000 0.00000E+000 1.00000E+000 1.00000E+000 0.00000E+000 0.00000E+000 1.00000E+000 1.00000E+000 -1.00000E+000 -1.00000E+000
-1.00000E+000 -1.00000E+000
Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/cube2_ascii.pset
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/cube2_ascii.pset 2007-05-09 19:05:31 UTC (rev 6808)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/cube2_ascii.pset 2007-05-09 19:31:28 UTC (rev 6809)
@@ -1,5 +1,4 @@
-pset ascii
- 7
+pset ascii 7
fault 1 4
1 2 5 6
xm 2 4
Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/cube2_binary.pset
===================================================================
(Binary files differ)
More information about the cig-commits
mailing list