[cig-commits] r4660 -
short/3D/PyLith/branches/pylith-0.8/pylith3d/module
willic3 at geodynamics.org
willic3 at geodynamics.org
Thu Sep 28 13:49:49 PDT 2006
Author: willic3
Date: 2006-09-28 13:49:49 -0700 (Thu, 28 Sep 2006)
New Revision: 4660
Modified:
short/3D/PyLith/branches/pylith-0.8/pylith3d/module/setup.cc
Log:
Added bindings for preshape2d.
Modified: short/3D/PyLith/branches/pylith-0.8/pylith3d/module/setup.cc
===================================================================
--- short/3D/PyLith/branches/pylith-0.8/pylith3d/module/setup.cc 2006-09-28 20:38:04 UTC (rev 4659)
+++ short/3D/PyLith/branches/pylith-0.8/pylith3d/module/setup.cc 2006-09-28 20:49:49 UTC (rev 4660)
@@ -236,7 +236,63 @@
Py_INCREF(Py_None);
return Py_None;
}
+
+// Precompute shape function info for element faces
+
+char pypylith3d_preshape2d__doc__[] = "";
+char pypylith3d_preshape2d__name__[] = "preshape2d";
+
+PyObject * pypylith3d_preshape2d(PyObject *, PyObject *args)
+{
+ PyObject* pyPointerToSh2d;
+ PyObject* pyPointerToGauss2d;
+ int quadratureOrderInt;
+ int elementType;
+ int numberSurfaceElementNodes;
+ int numberSurfaceElementGaussPoints;
+
+ int ok = PyArg_ParseTuple(args, "OOiiii:preshape2d",
+ &pyPointerToSh2d,
+ &pyPointerToGauss2d,
+ &quadratureOrderInt,
+ &elementType,
+ &numberSurfaceElementNodes,
+ &numberSurfaceElementGaussPoints);
+
+ if (!ok) {
+ return 0;
+ }
+
+ double* pointerToSh2d = (double*) PyCObject_AsVoidPtr(pyPointerToSh2d);
+ double* pointerToGauss2d = (double*) PyCObject_AsVoidPtr(pyPointerToGauss2d);
+ int errorcode = 0;
+ const int maxsize = 4096;
+ char errorstring[maxsize];
+
+ preshape2d_f(pointerToSh2d,
+ pointerToGauss2d,
+ &quadratureOrderInt,
+ &elementType,
+ &numberSurfaceElementNodes,
+ &numberSurfaceElementGaussPoints,
+ &errorcode,
+ errorstring,
+ sizeof(errorstring));
+
+ if(0 != exceptionhandler(errorcode, errorstring)) {
+ return 0;
+ }
+ journal::debug_t debug("pylith3d");
+ debug
+ << journal::at(__HERE__)
+ << "quadratureOrderInt:" << quadratureOrderInt
+ << journal::endl;
+
+ // return
+ Py_INCREF(Py_None);
+ return Py_None;
+
// version
// $Id: setup.cc,v 1.4 2005/06/07 19:39:11 willic3 Exp $
More information about the cig-commits
mailing list