[cig-commits] r9015 - short/3D/PyLith/trunk/modulesrc/meshio
brad at geodynamics.org
brad at geodynamics.org
Mon Jan 14 12:42:22 PST 2008
Author: brad
Date: 2008-01-14 12:42:22 -0800 (Mon, 14 Jan 2008)
New Revision: 9015
Modified:
short/3D/PyLith/trunk/modulesrc/meshio/meshio.pyxe.src
Log:
Removed SolutionIO stuff from meshio module.
Modified: short/3D/PyLith/trunk/modulesrc/meshio/meshio.pyxe.src
===================================================================
--- short/3D/PyLith/trunk/modulesrc/meshio/meshio.pyxe.src 2008-01-14 19:48:58 UTC (rev 9014)
+++ short/3D/PyLith/trunk/modulesrc/meshio/meshio.pyxe.src 2008-01-14 20:42:22 UTC (rev 9015)
@@ -17,8 +17,6 @@
#include "pylith/meshio/MeshIO.hh"
#include "pylith/meshio/MeshIOAscii.hh"
#include "pylith/meshio/MeshIOLagrit.hh"
-#include "pylith/meshio/SolutionIO.hh"
-#include "pylith/meshio/SolutionIOVTK.hh"
#include "pylith/meshio/OutputManager.hh"
#include "pylith/meshio/VertexFilter.hh"
@@ -552,348 +550,6 @@
# ----------------------------------------------------------------------
-cdef void SolutionIO_destructor(void* obj):
- """
- Destroy SolutionIO object.
- """
- # create shim for destructor
- #embed{ void SolutionIO_destructor_cpp(void* pObj)
- pylith::meshio::SolutionIO* io = (pylith::meshio::SolutionIO*) pObj;
- delete io;
- #}embed
- SolutionIO_destructor_cpp(obj)
- return
-
-cdef class SolutionIO:
-
- cdef void* thisptr # Pointer to C++ object
- cdef readonly object handle # PyCObject holding pointer to C++ object
- cdef readonly object name # Identifier for object base type
-
- def __init__(self):
- """
- Constructor.
- """
- self.handle = None
- self.thisptr = NULL
- self.name = "pylith_meshio_SolutionIO"
- return
-
-
- def open(self, mesh):
- """
- Open solution files.
- """
- # create shim for method 'open'
- #embed{ void SolutionIO_open(void* objVptr, void* meshVptr)
- try {
- assert(0 != objVptr);
- assert(0 != meshVptr);
- ALE::Obj<ALE::Mesh>* mesh = (ALE::Obj<ALE::Mesh>*) meshVptr;
- ((pylith::meshio::SolutionIO*) objVptr)->open(*mesh);
- } catch (const std::exception& err) {
- PyErr_SetString(PyExc_RuntimeError,
- const_cast<char*>(err.what()));
- } catch (const ALE::Exception& err) {
- PyErr_SetString(PyExc_RuntimeError,
- const_cast<char*>(err.msg().c_str()));
- } catch (...) {
- PyErr_SetString(PyExc_RuntimeError,
- "Caught unknown C++ exception.");
- } // try/catch
- #}embed
- if mesh.name != "pylith_topology_Mesh":
- raise TypeError, \
- "Argument must be extension module type 'Mesh'."
- SolutionIO_open(self.thisptr, ptrFromHandle(mesh))
- return
-
-
- def close(self):
- """
- Close solution files.
- """
- # create shim for method 'close'
- #embed{ void SolutionIO_close(void* objVptr)
- try {
- assert(0 != objVptr);
- ((pylith::meshio::SolutionIO*) objVptr)->close();
- } catch (const std::exception& err) {
- PyErr_SetString(PyExc_RuntimeError,
- const_cast<char*>(err.what()));
- } catch (const ALE::Exception& err) {
- PyErr_SetString(PyExc_RuntimeError,
- const_cast<char*>(err.msg().c_str()));
- } catch (...) {
- PyErr_SetString(PyExc_RuntimeError,
- "Caught unknown C++ exception.");
- } // try/catch
- #}embed
- SolutionIO_close(self.thisptr)
- return
-
-
- def openTimeStep(self, t, mesh, cs):
- """
- Prepare for writing solution to file.
- """
- # create shim for method 'openTimeStep'
- #embed{ void SolutionIO_openTimeStep(void* objVptr, double t, void* meshVptr, void* csVptr)
- try {
- assert(0 != objVptr);
- assert(0 != meshVptr);
- assert(0 != csVptr);
- ALE::Obj<ALE::Mesh>* mesh = (ALE::Obj<ALE::Mesh>*) meshVptr;
- spatialdata::geocoords::CoordSys* cs =
- (spatialdata::geocoords::CoordSys*) csVptr;
- ((pylith::meshio::SolutionIO*) objVptr)->openTimeStep(t, *mesh, cs);
- } catch (const std::exception& err) {
- PyErr_SetString(PyExc_RuntimeError,
- const_cast<char*>(err.what()));
- } catch (const ALE::Exception& err) {
- PyErr_SetString(PyExc_RuntimeError,
- const_cast<char*>(err.msg().c_str()));
- } catch (...) {
- PyErr_SetString(PyExc_RuntimeError,
- "Caught unknown C++ exception.");
- } // try/catch
- #}embed
- if not mesh.name == "pylith_topology_Mesh":
- raise TypeError, \
- "Argument must be extension module type 'Mesh'."
- if not cs.name == "spatialdata_geocoords_CoordSys":
- raise TypeError, \
- "Argument must be extension module type 'CoordSys'."
- SolutionIO_openTimeStep(self.thisptr, t,
- ptrFromHandle(mesh), ptrFromHandle(cs))
- return
-
-
- def closeTimeStep(self):
- """
- Prepare for writing solution to file.
- """
- # create shim for method 'closeTimeStep'
- #embed{ void SolutionIO_closeTimeStep(void* objVptr)
- try {
- assert(0 != objVptr);
- ((pylith::meshio::SolutionIO*) objVptr)->closeTimeStep();
- } catch (const std::exception& err) {
- PyErr_SetString(PyExc_RuntimeError,
- const_cast<char*>(err.what()));
- } catch (const ALE::Exception& err) {
- PyErr_SetString(PyExc_RuntimeError,
- const_cast<char*>(err.msg().c_str()));
- } catch (...) {
- PyErr_SetString(PyExc_RuntimeError,
- "Caught unknown C++ exception.");
- } // try/catch
- #}embed
- SolutionIO_closeTimeStep(self.thisptr)
- return
-
-
- def writeVertexField(self, t, name, field, mesh):
- """
- Write field over vertices to file.
- """
- # create shim for method 'writeVertxField'
- #embed{ void SolutionIO_writeVertexField(void* objVptr, double t, char* name, void* fieldVptr, void* meshVptr)
- try {
- assert(0 != objVptr);
- assert(0 != fieldVptr);
- assert(0 != name);
- assert(0 != meshVptr);
- ALE::Obj<pylith::real_section_type>* field =
- (ALE::Obj<pylith::real_section_type>*) fieldVptr;
- ALE::Obj<ALE::Mesh>* mesh = (ALE::Obj<ALE::Mesh>*) meshVptr;
- ((pylith::meshio::SolutionIO*) objVptr)->writeVertexField(t, name,
- *field, *mesh);
- } catch (const std::exception& err) {
- PyErr_SetString(PyExc_RuntimeError,
- const_cast<char*>(err.what()));
- } catch (const ALE::Exception& err) {
- PyErr_SetString(PyExc_RuntimeError,
- const_cast<char*>(err.msg().c_str()));
- } catch (...) {
- PyErr_SetString(PyExc_RuntimeError,
- "Caught unknown C++ exception.");
- } // try/catch
- #}embed
- if not mesh.name == "pylith_topology_Mesh":
- raise TypeError, \
- "Argument must be extension module type 'Mesh'."
- cdef void* fieldVptr
- fieldVptr = PyCObject_AsVoidPtr(field)
- SolutionIO_writeVertexField(self.thisptr, t, name, fieldVptr,
- ptrFromHandle(mesh))
- return
-
-
- def writeCellField(self, t, name, field, mesh):
- """
- Write field over cells to file.
- """
- # create shim for method 'writeCellField'
- #embed{ void SolutionIO_writeCellField(void* objVptr, double t, char* name, void* fieldVptr, void* meshVptr)
- try {
- assert(0 != objVptr);
- assert(0 != fieldVptr);
- assert(0 != name);
- assert(0 != meshVptr);
- ALE::Obj<pylith::real_section_type>* field =
- (ALE::Obj<pylith::real_section_type>*) fieldVptr;
- ALE::Obj<ALE::Mesh>* mesh = (ALE::Obj<ALE::Mesh>*) meshVptr;
- ((pylith::meshio::SolutionIO*) objVptr)->writeCellField(t, name, *field,
- *mesh);
- } catch (const std::exception& err) {
- PyErr_SetString(PyExc_RuntimeError,
- const_cast<char*>(err.what()));
- } catch (const ALE::Exception& err) {
- PyErr_SetString(PyExc_RuntimeError,
- const_cast<char*>(err.msg().c_str()));
- } catch (...) {
- PyErr_SetString(PyExc_RuntimeError,
- "Caught unknown C++ exception.");
- } // try/catch
- #}embed
- if not mesh.name == "pylith_topology_Mesh":
- raise TypeError, \
- "Argument must be extension module type 'Mesh'."
- cdef void* fieldVptr
- fieldVptr = PyCObject_AsVoidPtr(field)
- SolutionIO_writeCellField(self.thisptr, t, name, fieldVptr,
- ptrFromHandle(mesh))
- return
-
-
- def _createHandle(self):
- """Wrap pointer to C++ object in PyCObject."""
- return PyCObject_FromVoidPtr(self.thisptr, SolutionIO_destructor)
-
-
- property coordsys:
- def __set__(self, cs):
- """Set coordinate system."""
- # create shim for method 'coordsys'
- #embed{ void SolutionIO_coordsys_set(void* objVptr, void* csVptr)
- try {
- assert(0 != objVptr);
- assert(0 != csVptr);
- spatialdata::geocoords::CoordSys* cs =
- (spatialdata::geocoords::CoordSys*) csVptr;
- ((pylith::meshio::SolutionIO*) objVptr)->coordsys(cs);
- } catch (const std::exception& err) {
- PyErr_SetString(PyExc_RuntimeError,
- const_cast<char*>(err.what()));
- } catch (const ALE::Exception& err) {
- PyErr_SetString(PyExc_RuntimeError,
- const_cast<char*>(err.msg().c_str()));
- } catch (...) {
- PyErr_SetString(PyExc_RuntimeError,
- "Caught unknown C++ exception.");
- } // try/catch
- #}embed
- SolutionIO_coordsys_set(self.thisptr, ptrFromHandle(cs))
-
-
-# ----------------------------------------------------------------------
-cdef class SolutionIOVTK(SolutionIO):
-
- def __init__(self):
- """Constructor."""
- # create shim for constructor
- #embed{ void* SolutionIOVTK_constructor()
- void* result = 0;
- try {
- result = (void*)(new pylith::meshio::SolutionIOVTK);
- assert(0 != result);
- } catch (const std::exception& err) {
- PyErr_SetString(PyExc_RuntimeError,
- const_cast<char*>(err.what()));
- } catch (const ALE::Exception& err) {
- PyErr_SetString(PyExc_RuntimeError,
- const_cast<char*>(err.msg().c_str()));
- } catch (...) {
- PyErr_SetString(PyExc_RuntimeError,
- "Caught unknown C++ exception.");
- } // try/catch
- return result;
- #}embed
-
- SolutionIO.__init__(self)
- self.thisptr = SolutionIOVTK_constructor()
- self.handle = self._createHandle()
- return
-
-
- property filename:
- def __set__(self, name):
- """Set filename."""
- # create shim for method 'filename'
- #embed{ void SolutionIOVTK_filename_set(void* objVptr, char* name)
- try {
- assert(0 != objVptr);
- ((pylith::meshio::SolutionIOVTK*) objVptr)->filename(name);
- } catch (const std::exception& err) {
- PyErr_SetString(PyExc_RuntimeError,
- const_cast<char*>(err.what()));
- } catch (const ALE::Exception& err) {
- PyErr_SetString(PyExc_RuntimeError,
- const_cast<char*>(err.msg().c_str()));
- } catch (...) {
- PyErr_SetString(PyExc_RuntimeError,
- "Caught unknown C++ exception.");
- } // try/catch
- #}embed
- SolutionIOVTK_filename_set(self.thisptr, name)
-
- def __get__(self):
- """Get filename."""
- # create shim for method 'filename'
- #embed{ char* SolutionIOVTK_filename_get(void* objVptr)
- char* result = 0;
- try {
- assert(0 != objVptr);
- result = (char*) ((pylith::meshio::SolutionIOVTK*) objVptr)->filename();
- assert(0 != result);
- } catch (const std::exception& err) {
- PyErr_SetString(PyExc_RuntimeError,
- const_cast<char*>(err.what()));
- } catch (const ALE::Exception& err) {
- PyErr_SetString(PyExc_RuntimeError,
- const_cast<char*>(err.msg().c_str()));
- } catch (...) {
- PyErr_SetString(PyExc_RuntimeError,
- "Caught unknown C++ exception.");
- } // try/catch
- return result;
- #}embed
- return SolutionIOVTK_filename_get(self.thisptr)
-
- property timeFormat:
- def __set__(self, format):
- """Set timeFormat."""
- # create shim for method 'timeFormat'
- #embed{ void SolutionIOVTK_timeFormat_set(void* objVptr, char* format)
- try {
- assert(0 != objVptr);
- ((pylith::meshio::SolutionIOVTK*) objVptr)->timeFormat(format);
- } catch (const std::exception& err) {
- PyErr_SetString(PyExc_RuntimeError,
- const_cast<char*>(err.what()));
- } catch (const ALE::Exception& err) {
- PyErr_SetString(PyExc_RuntimeError,
- const_cast<char*>(err.msg().c_str()));
- } catch (...) {
- PyErr_SetString(PyExc_RuntimeError,
- "Caught unknown C++ exception.");
- } // try/catch
- #}embed
- SolutionIOVTK_timeFormat_set(self.thisptr, format)
-
-
-# ----------------------------------------------------------------------
cdef void OutputManager_destructor(void* obj):
"""
Destroy OutputManager object.
More information about the cig-commits
mailing list