/[escript]/trunk/ripley/src/ripleycpp.cpp
ViewVC logotype

Diff of /trunk/ripley/src/ripleycpp.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

branches/ripleygmg_from_3668/ripley/src/ripleycpp.cpp revision 3791 by caltinay, Wed Feb 1 05:10:22 2012 UTC trunk/ripley/src/ripleycpp.cpp revision 4828 by sshaw, Wed Apr 2 07:01:38 2014 UTC
# Line 1  Line 1 
1    
2  /*******************************************************  /*****************************************************************************
3  *  *
4  * Copyright (c) 2003-2012 by University of Queensland  * Copyright (c) 2003-2014 by University of Queensland
5  * Earth Systems Science Computational Center (ESSCC)  * http://www.uq.edu.au
 * http://www.uq.edu.au/esscc  
6  *  *
7  * Primary Business: Queensland, Australia  * Primary Business: Queensland, Australia
8  * Licensed under the Open Software License version 3.0  * Licensed under the Open Software License version 3.0
9  * http://www.opensource.org/licenses/osl-3.0.php  * http://www.opensource.org/licenses/osl-3.0.php
10  *  *
11  *******************************************************/  * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12    * Development 2012-2013 by School of Earth Sciences
13    * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14    *
15    *****************************************************************************/
16    
17  #include <ripley/Brick.h>  #include <ripley/Brick.h>
18  #include <ripley/Rectangle.h>  #include <ripley/Rectangle.h>
# Line 25  using namespace boost::python; Line 28  using namespace boost::python;
28    
29  namespace ripley {  namespace ripley {
30    
31    template<typename T>
32    std::vector<T> extractPyArray(const object& obj, const std::string& name,
33                                  int expectedLength=0)
34    {
35        std::vector<T> result;
36        if (extract<tuple>(obj).check() || extract<list>(obj).check()) {
37            if (expectedLength==0 || len(obj)==expectedLength) {
38                for (int i=0; i<len(obj); i++) {
39                    result.push_back(extract<T>(obj[i]));
40                }
41            } else {
42                std::stringstream ssError;
43                ssError << "argument '" << name << "' has wrong length";
44                std::string error(ssError.str());
45                throw RipleyException(error.c_str());
46            }
47        } else {
48            std::stringstream ssError;
49            ssError << "argument '" << name << "' must be a tuple or list";
50            std::string error(ssError.str());
51            throw RipleyException(error.c_str());
52        }
53    
54        return result;
55    }
56    
57    escript::Data readBinaryGrid(std::string filename, escript::FunctionSpace fs,
58            const object& pyShape, double fill, int byteOrder, int dataType,
59            const object& pyFirst, const object& pyNum, const object& pyMultiplier,
60            const object& pyReverse)
61    {
62        int dim=fs.getDim();
63        ReaderParameters params;
64    
65        params.first = extractPyArray<int>(pyFirst, "first", dim);
66        params.numValues = extractPyArray<int>(pyNum, "numValues", dim);
67        params.multiplier = extractPyArray<int>(pyMultiplier, "multiplier", dim);
68        params.reverse = extractPyArray<int>(pyReverse, "reverse", dim);
69        params.byteOrder = byteOrder;
70        params.dataType = dataType;
71        std::vector<int> shape(extractPyArray<int>(pyShape, "shape"));
72    
73        const RipleyDomain* dom=dynamic_cast<const RipleyDomain*>(fs.getDomain().get());
74        if (!dom)
75            throw RipleyException("Function space must be on a ripley domain");
76    
77        escript::Data res(fill, shape, fs, true);
78        dom->readBinaryGrid(res, filename, params);
79        return res;
80    }
81    
82    #ifdef USE_BOOSTIO
83    escript::Data readBinaryGridFromZipped(std::string filename, escript::FunctionSpace fs,
84            const object& pyShape, double fill, int byteOrder, int dataType,
85            const object& pyFirst, const object& pyNum, const object& pyMultiplier,
86            const object& pyReverse)
87    {
88        int dim=fs.getDim();
89        ReaderParameters params;
90    
91        params.first = extractPyArray<int>(pyFirst, "first", dim);
92        params.numValues = extractPyArray<int>(pyNum, "numValues", dim);
93        params.multiplier = extractPyArray<int>(pyMultiplier, "multiplier", dim);
94        params.reverse = extractPyArray<int>(pyReverse, "reverse", dim);
95        params.byteOrder = byteOrder;
96        params.dataType = dataType;
97        std::vector<int> shape(extractPyArray<int>(pyShape, "shape"));
98    
99        const RipleyDomain* dom=dynamic_cast<const RipleyDomain*>(fs.getDomain().get());
100        if (!dom)
101            throw RipleyException("Function space must be on a ripley domain");
102    
103        escript::Data res(fill, shape, fs, true);
104        dom->readBinaryGridFromZipped(res, filename, params);
105        return res;
106    }
107    #endif
108    
109    escript::Data readNcGrid(std::string filename, std::string varname,
110            escript::FunctionSpace fs, const object& pyShape, double fill,
111            const object& pyFirst, const object& pyNum, const object& pyMultiplier,
112            const object& pyReverse)
113    {
114        int dim=fs.getDim();
115        ReaderParameters params;
116    
117        params.first = extractPyArray<int>(pyFirst, "first", dim);
118        params.numValues = extractPyArray<int>(pyNum, "numValues", dim);
119        params.multiplier = extractPyArray<int>(pyMultiplier, "multiplier", dim);
120        params.reverse = extractPyArray<int>(pyReverse, "reverse", dim);
121        std::vector<int> shape(extractPyArray<int>(pyShape, "shape"));
122    
123        const RipleyDomain* dom=dynamic_cast<const RipleyDomain*>(fs.getDomain().get());
124        if (!dom)
125            throw RipleyException("Function space must be on a ripley domain");
126    
127        escript::Data res(fill, shape, fs, true);
128        dom->readNcGrid(res, filename, varname, params);
129        return res;
130    }
131    
132  // These wrappers are required to make the shared pointers work through the  // These wrappers are required to make the shared pointers work through the
133  // Python wrapper  // Python wrapper
134    
135  escript::Domain_ptr _brick(int n0, int n1, int n2, const object& l0,  // The double for n? is just to keep python happy when people need to deal with
136                   const object& l1, const object& l2, int d0, int d1, int d2)  // truediv
137    escript::Domain_ptr _brick(double _n0, double _n1, double _n2, const object& l0,
138                     const object& l1, const object& l2, int d0, int d1, int d2,
139                     const object& objpoints, const object& objtags)
140  {  {
141        int n0=static_cast<int>(_n0), n1=static_cast<int>(_n1), n2=static_cast<int>(_n2);
142      double x0=0., x1=1., y0=0., y1=1., z0=0., z1=1.;      double x0=0., x1=1., y0=0., y1=1., z0=0., z1=1.;
143      if (extract<tuple>(l0).check()) {      if (extract<tuple>(l0).check()) {
144          tuple x=extract<tuple>(l0);          tuple x=extract<tuple>(l0);
# Line 67  escript::Domain_ptr _brick(int n0, int n Line 175  escript::Domain_ptr _brick(int n0, int n
175          z1=extract<double>(l2);          z1=extract<double>(l2);
176      } else      } else
177          throw RipleyException("Argument l2 must be a float or 2-tuple");          throw RipleyException("Argument l2 must be a float or 2-tuple");
178        boost::python::list pypoints=extract<boost::python::list>(objpoints);
179      return escript::Domain_ptr(new Brick(n0,n1,n2, x0,y0,z0, x1,y1,z1, d0,d1,d2));      boost::python::list pytags=extract<boost::python::list>(objtags);
180        int numpts=extract<int>(pypoints.attr("__len__")());
181        int numtags=extract<int>(pytags.attr("__len__")());
182        if (numtags != numpts)
183            throw RipleyException("Number of tags does not match number of points.");
184        std::vector<double> points;
185        std::vector<int> tags;
186        tags.resize(numtags, -1);
187        for (int i=0;i<numpts;++i) {
188            tuple temp = extract<tuple>(pypoints[i]);
189            int l=extract<int>(temp.attr("__len__")());
190            if (l != 3)
191                throw RipleyException("Number of coordinates for each dirac point must match dimensions.");
192            for (int k=0;k<l;++k) {
193                points.push_back(extract<double>(temp[k]));
194            }
195        }
196        std::map<std::string, int> tagstonames;
197        int curmax=40;
198        // but which order to assign tags to names?????
199        for (int i=0;i<numtags;++i) {
200            extract<int> ex_int(pytags[i]);
201            extract<std::string> ex_str(pytags[i]);
202            if (ex_int.check()) {
203                tags[i]=ex_int();
204                if (tags[i]>= curmax) {
205                    curmax=tags[i]+1;
206                }
207            } else if (ex_str.check()) {
208                std::string s=ex_str();
209                std::map<std::string, int>::iterator it=tagstonames.find(s);
210                if (it!=tagstonames.end()) {
211                    // we have the tag already so look it up
212                    tags[i]=it->second;
213                } else {
214                    tagstonames[s]=curmax;
215                    tags[i]=curmax;
216                    curmax++;
217                }
218            } else {
219                throw RipleyException("Error - Unable to extract tag value.");
220            }
221        }
222        return escript::Domain_ptr(new Brick(n0,n1,n2, x0,y0,z0, x1,y1,z1, d0,d1,d2,
223                                                points, tags, tagstonames));
224  }  }
225    
226  const int _q[]={0x61686969,0x746c4144,0x79616e43};  //const int _q[]={0x61686969,0x746c4144,0x79616e43};
227  escript::Domain_ptr _rectangle(int n0, int n1, const object& l0,  const int _q[]={0x62207363, 0x6574735F, 0x2020214e};
228                                 const object& l1, int d0, int d1)  escript::Domain_ptr _rectangle(double _n0, double _n1, const object& l0,
229                                   const object& l1, int d0, int d1,
230                                   const object& objpoints, const object& objtags)
231  {  {
232        int n0=static_cast<int>(_n0), n1=static_cast<int>(_n1);
233      double x0=0., x1=1., y0=0., y1=1.;      double x0=0., x1=1., y0=0., y1=1.;
234      if (extract<tuple>(l0).check()) {      if (extract<tuple>(l0).check()) {
235          tuple x=extract<tuple>(l0);          tuple x=extract<tuple>(l0);
# Line 99  escript::Domain_ptr _rectangle(int n0, i Line 254  escript::Domain_ptr _rectangle(int n0, i
254          y1=extract<double>(l1);          y1=extract<double>(l1);
255      } else      } else
256          throw RipleyException("Argument l1 must be a float or 2-tuple");          throw RipleyException("Argument l1 must be a float or 2-tuple");
257        boost::python::list pypoints=extract<boost::python::list>(objpoints);
258      return escript::Domain_ptr(new Rectangle(n0,n1, x0,y0, x1,y1, d0,d1));      boost::python::list pytags=extract<boost::python::list>(objtags);
259        int numpts=extract<int>(pypoints.attr("__len__")());
260        int numtags=extract<int>(pytags.attr("__len__")());
261        if (numtags != numpts)
262            throw RipleyException("Number of tags does not match number of points.");
263        std::vector<double> points;
264        std::vector<int> tags;
265        tags.resize(numtags, -1);
266        for (int i=0;i<numpts;++i) {
267            tuple temp = extract<tuple>(pypoints[i]);
268            int l=extract<int>(temp.attr("__len__")());
269            if (l != 2)
270                throw RipleyException("Number of coordinates for each dirac point must match dimensions.");
271            for (int k=0;k<l;++k) {
272                points.push_back(extract<double>(temp[k]));
273            }
274        }
275        std::map<std::string, int> tagstonames;
276        int curmax=40;
277        // but which order to assign tags to names?????
278        for (int i=0;i<numtags;++i) {
279            extract<int> ex_int(pytags[i]);
280            extract<std::string> ex_str(pytags[i]);
281            if (ex_int.check()) {
282                tags[i]=ex_int();
283                if (tags[i]>= curmax) {
284                    curmax=tags[i]+1;
285                }
286            } else if (ex_str.check()) {
287                std::string s=ex_str();
288                std::map<std::string, int>::iterator it=tagstonames.find(s);
289                if (it!=tagstonames.end()) {
290                    // we have the tag already so look it up
291                    tags[i]=it->second;
292                } else {
293                    tagstonames[s]=curmax;
294                    tags[i]=curmax;
295                    curmax++;
296                }
297            } else {
298                throw RipleyException("Error - Unable to extract tag value.");
299            }
300        }
301        return escript::Domain_ptr(new Rectangle(n0,n1, x0,y0, x1,y1, d0,d1,
302                                                 points, tags, tagstonames));
303  }  }
304  std::string _who(){int a[]={_q[0]^42,_q[1]^42,_q[2]^42,0};return (char*)&a[0];}  std::string _who(){int a[]={_q[0]^42,_q[1]^42,_q[2]^42,0};return (char*)&a[0];}
305    
306  }  } // end of namespace ripley
307    
 /**  
     \page ripley Ripley  
     ripleycpp is the python module name that contains the interfaces  
     to the C++ wrapper to ripley.  
 */  
308    
309  BOOST_PYTHON_MODULE(ripleycpp)  BOOST_PYTHON_MODULE(ripleycpp)
310  {  {
# Line 120  BOOST_PYTHON_MODULE(ripleycpp) Line 314  BOOST_PYTHON_MODULE(ripleycpp)
314      docstring_options docopt(true, true, false);      docstring_options docopt(true, true, false);
315  #endif  #endif
316    
317      register_exception_translator<ripley::RipleyException>(&(esysUtils::esysExceptionTranslator));      register_exception_translator<ripley::RipleyException>(&(esysUtils::RuntimeErrorTranslator));
318    
319      def("Brick", ripley::_brick, (arg("n0"),arg("n1"),arg("n2"),arg("l0")=1.0,arg("l1")=1.0,arg("l2")=1.0,arg("d0")=1,arg("d1")=1,arg("d2")=1),      scope().attr("__doc__") = "To use this module, please import esys.ripley";
320        scope().attr("BYTEORDER_NATIVE") = (int)ripley::BYTEORDER_NATIVE;
321        scope().attr("BYTEORDER_LITTLE_ENDIAN") = (int)ripley::BYTEORDER_LITTLE_ENDIAN;
322        scope().attr("BYTEORDER_BIG_ENDIAN") = (int)ripley::BYTEORDER_BIG_ENDIAN;
323        scope().attr("DATATYPE_INT32") = (int)ripley::DATATYPE_INT32;
324        scope().attr("DATATYPE_FLOAT32") = (int)ripley::DATATYPE_FLOAT32;
325        scope().attr("DATATYPE_FLOAT64") = (int)ripley::DATATYPE_FLOAT64;
326    
327        def("Brick", ripley::_brick, (arg("n0"),arg("n1"),arg("n2"),arg("l0")=1.0,arg("l1")=1.0,arg("l2")=1.0,arg("d0")=-1,arg("d1")=-1,arg("d2")=-1,arg("diracPoints")=list(),arg("diracTags")=list()),
328  "Creates a hexagonal mesh with n0 x n1 x n2 elements over the brick [0,l0] x [0,l1] x [0,l2].\n\n"  "Creates a hexagonal mesh with n0 x n1 x n2 elements over the brick [0,l0] x [0,l1] x [0,l2].\n\n"
329  ":param n0: number of elements in direction 0\n:type n0: ``int``\n"  ":param n0: number of elements in direction 0\n:type n0: ``int``\n"
330  ":param n1: number of elements in direction 1\n:type n1: ``int``\n"  ":param n1: number of elements in direction 1\n:type n1: ``int``\n"
# Line 134  BOOST_PYTHON_MODULE(ripleycpp) Line 336  BOOST_PYTHON_MODULE(ripleycpp)
336  ":param d1: number of subdivisions in direction 1\n:type d1: ``int``\n"  ":param d1: number of subdivisions in direction 1\n:type d1: ``int``\n"
337  ":param d2: number of subdivisions in direction 2\n:type d2: ``int``");  ":param d2: number of subdivisions in direction 2\n:type d2: ``int``");
338    
339      def("Rectangle", ripley::_rectangle, (arg("n0"),arg("n1"),arg("l0")=1.0,arg("l1")=1.0,arg("d0")=1,arg("d1")=1),      def("Rectangle", ripley::_rectangle, (arg("n0"),arg("n1"),arg("l0")=1.0,arg("l1")=1.0,arg("d0")=-1,arg("d1")=-1,arg("diracPoints")=list(),arg("diracTags")=list()),
340  "Creates a rectangular mesh with n0 x n1 elements over the rectangle [0,l0] x [0,l1].\n\n"  "Creates a rectangular mesh with n0 x n1 elements over the rectangle [0,l0] x [0,l1].\n\n"
341  ":param n0: number of elements in direction 0\n:type n0: ``int``\n"  ":param n0: number of elements in direction 0\n:type n0: ``int``\n"
342  ":param n1: number of elements in direction 1\n:type n1: ``int``\n"  ":param n1: number of elements in direction 1\n:type n1: ``int``\n"
# Line 142  BOOST_PYTHON_MODULE(ripleycpp) Line 344  BOOST_PYTHON_MODULE(ripleycpp)
344  ":param l1: length of side 1 or coordinate range of side 1\n:type l1: ``float`` or ``tuple``\n"  ":param l1: length of side 1 or coordinate range of side 1\n:type l1: ``float`` or ``tuple``\n"
345  ":param d0: number of subdivisions in direction 0\n:type d0: ``int``\n"  ":param d0: number of subdivisions in direction 0\n:type d0: ``int``\n"
346  ":param d1: number of subdivisions in direction 1\n:type d1: ``int``");  ":param d1: number of subdivisions in direction 1\n:type d1: ``int``");
347      def("_theculprit_", ripley::_who),      def("_theculprit_", ripley::_who);
348      def("LoadMesh", ripley::RipleyDomain::loadMesh, (arg("filename")),  
349             "Loads a ripley domain from a dump file" ":rtype: `Domain`");      def("_readBinaryGrid", &ripley::readBinaryGrid, (arg("filename"),
350                    arg("functionspace"), arg("shape"), arg("fill")=0.,
351      def("ReadMesh", ripley::RipleyDomain::readMesh, (arg("filename")),                  arg("byteOrder"), arg("dataType"), arg("first"),
352              "Reads a ripley domain from a file created by write().\n\n"                  arg("numValues"), arg("multiplier"), arg("reverse")),
353              ":rtype: `RipleyDomain`\n:param filename:\n:type filename: ``string``\n");  "Reads a binary Grid");
354    #ifdef USE_BOOSTIO
355        def("_readBinaryGridFromZipped", &ripley::readBinaryGridFromZipped, (arg("filename"),
356                    arg("functionspace"), arg("shape"), arg("fill")=0.,
357                    arg("byteOrder"), arg("dataType"), arg("first"),
358                    arg("numValues"), arg("multiplier"), arg("reverse")),
359    "Reads a binary Grid");
360    #endif
361        def("_readNcGrid", &ripley::readNcGrid, (arg("filename"), arg("varname"),
362                    arg("functionspace"), arg("shape"), arg("fill"), arg("first"),
363                    arg("numValues"), arg("multiplier"), arg("reverse")),
364    "Reads a grid from a netCDF file");
365    
366      class_<ripley::RipleyDomain, bases<escript::AbstractContinuousDomain> >      class_<ripley::RipleyDomain, bases<escript::AbstractContinuousDomain>, boost::noncopyable >
367          ("RipleyDomain", "", no_init)          ("RipleyDomain", "", no_init)
         .def("write", &ripley::RipleyDomain::write, args("filename"),  
                 "Writes the current mesh to a file with the given name. It can subsequently be recovered using ReadMesh().")  
368          .def("print_mesh_info", &ripley::RipleyDomain::Print_Mesh_Info, (arg("full")=false),          .def("print_mesh_info", &ripley::RipleyDomain::Print_Mesh_Info, (arg("full")=false),
369                  "Prints out a summary about the mesh.\n"                  "Prints out a summary about the mesh.\n"
370                  ":param full: whether to output additional data\n:type full: ``bool``")                  ":param full: whether to output additional data\n:type full: ``bool``")
371            .def("writeBinaryGrid", &ripley::RipleyDomain::writeBinaryGrid)
372    
373          .def("dump", &ripley::RipleyDomain::dump, args("filename"),          .def("dump", &ripley::RipleyDomain::dump, args("filename"),
374                  "Dumps the mesh to a file with the given name.")                  "Dumps the mesh to a file with the given name.")
375            .def("getGridParameters", &ripley::RipleyDomain::getGridParameters,
376    "Returns the tuple (origin, spacing, elements) where the entries are tuples:\n"
377    "``origin``=the coordinates of the domain's global origin,\n"
378    "``spacing``=the element size (=node spacing) of the domain,\n"
379    "``elements``=the global number of elements in all dimensions\n\n"
380    ":rtype: ``tuple``")
381          .def("getDescription", &ripley::RipleyDomain::getDescription,          .def("getDescription", &ripley::RipleyDomain::getDescription,
382  ":return: a description for this domain\n:rtype: ``string``")  ":return: a description for this domain\n:rtype: ``string``")
383          .def("getDim", &ripley::RipleyDomain::getDim, ":rtype: ``int``")          .def("getDim", &ripley::RipleyDomain::getDim, ":rtype: ``int``")
# Line 167  BOOST_PYTHON_MODULE(ripleycpp) Line 386  BOOST_PYTHON_MODULE(ripleycpp)
386          .def("getNumDataPointsGlobal", &ripley::RipleyDomain::getNumDataPointsGlobal,          .def("getNumDataPointsGlobal", &ripley::RipleyDomain::getNumDataPointsGlobal,
387  ":return: the number of data points summed across all MPI processes\n"  ":return: the number of data points summed across all MPI processes\n"
388  ":rtype: ``int``")  ":rtype: ``int``")
389            .def("addToSystem",&ripley::RipleyDomain::addToSystemFromPython,
390                args("mat", "rhs", "data"),
391                "adds a PDE to the system, results depend on domain\n\n"
392                ":param mat:\n:type mat: `OperatorAdapter`\n"
393                ":param rhs:\n:type rhs: `Data`\n"
394                ":param data:\ntype data: `list`")
395          .def("addPDEToSystem",&ripley::RipleyDomain::addPDEToSystem,          .def("addPDEToSystem",&ripley::RipleyDomain::addPDEToSystem,
396  args("mat", "rhs", "A", "B", "C", "D", "X", "Y", "d", "y", "d_contact", "y_contact"),  args("mat", "rhs", "A", "B", "C", "D", "X", "Y", "d", "y", "d_contact", "y_contact"),
397  "adds a PDE onto the stiffness matrix mat and a rhs\n\n"  "adds a PDE onto the stiffness matrix mat and a rhs\n\n"
# Line 181  args("mat", "rhs", "A", "B", "C", "D", " Line 406  args("mat", "rhs", "A", "B", "C", "D", "
406  ":param d_contact:\n:type d_contact: `Data`\n"  ":param d_contact:\n:type d_contact: `Data`\n"
407  ":param y_contact:\n:type y_contact: `Data`"  ":param y_contact:\n:type y_contact: `Data`"
408  )  )
409    
410          .def("addPDEToRHS",&ripley::RipleyDomain::addPDEToRHS,          .def("addPDEToRHS",&ripley::RipleyDomain::addPDEToRHS,
411  args("rhs", "X", "Y", "y", "y_contact"),  args("rhs", "X", "Y", "y", "y_contact"),
412  "adds a PDE onto the stiffness matrix mat and a rhs\n\n"  "adds a PDE onto the stiffness matrix mat and a rhs\n\n"
# Line 190  args("rhs", "X", "Y", "y", "y_contact"), Line 416  args("rhs", "X", "Y", "y", "y_contact"),
416  ":param y:\n:type y: `Data`\n"  ":param y:\n:type y: `Data`\n"
417  ":param y_contact:\n:type y_contact: `Data`"  ":param y_contact:\n:type y_contact: `Data`"
418  )  )
419            .def("addToRHS",&ripley::RipleyDomain::addToRHSFromPython,
420                args("rhs", "data"),
421                "adds a PDE onto the stiffness matrix mat and a rhs, "
422                "results depends on domain\n\n"
423                ":param rhs:\n:type rhs: `Data`\n"
424                ":param data:\ntype data: `list`")
425            .def("setAssembler", &ripley::RipleyDomain::setAssemblerFromPython,
426                args("typename", "options"),
427                "sets the domain to use the named assembler, if supported, using"
428                "the options if provided"
429                ":param typename:\n:type typename: `string`\n"
430                ":param options:\n:type options: `list`\n")
431          .def("addPDEToTransportProblem",&ripley::RipleyDomain::addPDEToTransportProblem,          .def("addPDEToTransportProblem",&ripley::RipleyDomain::addPDEToTransportProblem,
432  args( "tp", "source", "M", "A", "B", "C", "D", "X", "Y", "d", "y", "d_contact", "y_contact"),  args( "tp", "source", "M", "A", "B", "C", "D", "X", "Y", "d", "y", "d_contact", "y_contact"),
433  ":param tp:\n:type tp: `TransportProblemAdapter`\n"  ":param tp:\n:type tp: `TransportProblemAdapter`\n"
# Line 260  args("solver", "preconditioner", "packag Line 498  args("solver", "preconditioner", "packag
498          .def("getMPIRank",&ripley::RipleyDomain::getMPIRank,":return: the rank of this process\n:rtype: ``int``")          .def("getMPIRank",&ripley::RipleyDomain::getMPIRank,":return: the rank of this process\n:rtype: ``int``")
499          .def("MPIBarrier",&ripley::RipleyDomain::MPIBarrier,"Wait until all processes have reached this point")          .def("MPIBarrier",&ripley::RipleyDomain::MPIBarrier,"Wait until all processes have reached this point")
500          .def("onMasterProcessor",&ripley::RipleyDomain::onMasterProcessor,":return: True if this code is executing on the master process\n:rtype: `bool`");          .def("onMasterProcessor",&ripley::RipleyDomain::onMasterProcessor,":return: True if this code is executing on the master process\n:rtype: `bool`");
501        /* These two class exports are necessary to ensure that the extra methods added by ripley make it to python.
502         * This change became necessary when the Brick and Rectangle constructors turned into factories instead of classes */
503      class_<ripley::Brick, bases<ripley::RipleyDomain> >("RipleyBrick", "", no_init);      class_<ripley::Brick, bases<ripley::RipleyDomain> >("RipleyBrick", "", no_init);
504      class_<ripley::Rectangle, bases<ripley::RipleyDomain> >("RipleyRectangle", "", no_init);      class_<ripley::Rectangle, bases<ripley::RipleyDomain> >("RipleyRectangle", "", no_init);
505  }  }

Legend:
Removed from v.3791  
changed lines
  Added in v.4828

  ViewVC Help
Powered by ViewVC 1.1.26