/[escript]/branches/diaplayground/dudley/src/CPPAdapter/dudleycpp.cpp
ViewVC logotype

Diff of /branches/diaplayground/dudley/src/CPPAdapter/dudleycpp.cpp

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

revision 3469 by jfenwick, Tue Feb 22 06:39:16 2011 UTC revision 4114 by caltinay, Fri Dec 14 04:24:46 2012 UTC
# Line 1  Line 1 
1    
2  /*******************************************************  /*****************************************************************************
3  *  *
4  * Copyright (c) 2003-2010 by University of Queensland  * Copyright (c) 2003-2012 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 since 2012 by School of Earth Sciences
13    *
14    *****************************************************************************/
15    
16    
17  #ifdef ESYS_MPI  #ifdef ESYS_MPI
# Line 19  extern "C" { Line 21  extern "C" {
21  #include "../Dudley.h"  #include "../Dudley.h"
22  }  }
23    
24    #include <pasowrap/SystemMatrixAdapter.h>
25    #include <pasowrap/TransportProblemAdapter.h>
26    
27  #include "MeshAdapter.h"  #include "MeshAdapter.h"
28  #include "MeshAdapterFactory.h"  #include "MeshAdapterFactory.h"
 #include "SystemMatrixAdapter.h"  
 #include "TransportProblemAdapter.h"  
29    
30  #include "DudleyAdapterException.h"  #include "DudleyAdapterException.h"
31  // #include "esysUtils/EsysException.h"  // #include "esysUtils/EsysException.h"
# Line 38  extern "C" { Line 41  extern "C" {
41    
42  using namespace boost::python;  using namespace boost::python;
43    
 /**  
    \page dudley Dudley  
    Dudley is the python module name that contains the interfaces  
    to the C++ wrapper to dudley.  
   
    \version 1.0.0  
   
    \section class_desc Class Description:  
    Data  
   
    \section class_limits Class Limitations:  
    None  
   
    \section class_conds Class Conditions of Use:  
    None  
   
    \section throws Throws:  
    None  
   
 */  
   
44  BOOST_PYTHON_MODULE(dudleycpp)  BOOST_PYTHON_MODULE(dudleycpp)
45  {  {
46  // This feature was added in boost v1.34  // This feature was added in boost v1.34
# Line 67  BOOST_PYTHON_MODULE(dudleycpp) Line 49  BOOST_PYTHON_MODULE(dudleycpp)
49    docstring_options docopt(true, true, false);    docstring_options docopt(true, true, false);
50  #endif  #endif
51    
52      scope().attr("__doc__") = "To use this module, please import esys.dudley";  
53      
54      
55    //    //
56    // NOTE: The return_value_policy is necessary for functions that    // NOTE: The return_value_policy is necessary for functions that
57    // return pointers.    // return pointers.
# Line 115  BOOST_PYTHON_MODULE(dudleycpp) Line 100  BOOST_PYTHON_MODULE(dudleycpp)
100        arg("useFullElementOrder")=false,        arg("useFullElementOrder")=false,
101        arg("optimize")=false)        arg("optimize")=false)
102  ,"Creates a tetrahedral mesh by subdividing n0 x n1 x n2 rectangular elements over the brick [0,l0] x [0,l1] x [0,l2]."  ,"Creates a tetrahedral mesh by subdividing n0 x n1 x n2 rectangular elements over the brick [0,l0] x [0,l1] x [0,l2]."
103    "We accept floating point values for n0, n1 only to ease transition of scripts to python3 when the time comes."
104  "\n\n:param n0:\n:type n0:\n:param n1:\n:type n1:\n:param n2:\n:type n2:\n"  "\n\n:param n0:\n:type n0:\n:param n1:\n:type n1:\n:param n2:\n:type n2:\n"
105  ":param order: =1, =-1 or =2 gives the order of shape function. If -1 macro elements of order 1 are used.\n"  ":param order: =1, =-1 or =2 gives the order of shape function. If -1 macro elements of order 1 are used.\n"
106  ":param l0: length of side 0\n:param l1:\n:param l2:\n"  ":param l0: length of side 0\n:param l1:\n:param l2:\n"
# Line 137  BOOST_PYTHON_MODULE(dudleycpp) Line 123  BOOST_PYTHON_MODULE(dudleycpp)
123        arg("useFullElementOrder")=false,        arg("useFullElementOrder")=false,
124        arg("optimize")=false)        arg("optimize")=false)
125  ,"Creates a triangular mesh by subdividing n0 x n1 rectangular elements over the brick [0,l0] x [0,l1]."  ,"Creates a triangular mesh by subdividing n0 x n1 rectangular elements over the brick [0,l0] x [0,l1]."
126    "We accept floating point values for n0, n1 only to ease transition of scripts to python3 when the time comes."
127  "\n\n:param n0:\n:type n0:\n:param n1:\n:type n1:\n"  "\n\n:param n0:\n:type n0:\n:param n1:\n:type n1:\n"
128  ":param order: =1, =-1 or =2 gives the order of shape function. If -1 macro elements of order 1 are used.\n"  ":param order: =1, =-1 or =2 gives the order of shape function. If -1 macro elements of order 1 are used.\n"
129  ":param l0: length of side 0\n:param l1:\n"  ":param l0: length of side 0\n:param l1:\n"
# Line 259  args("arg"), "assigns new location to th Line 246  args("arg"), "assigns new location to th
246  ":rtype: `Data`")  ":rtype: `Data`")
247        .def("getSize",&dudley::MeshAdapter::getSize,":return: the element size\n"        .def("getSize",&dudley::MeshAdapter::getSize,":return: the element size\n"
248  ":rtype: `Data`")  ":rtype: `Data`")
       .def("saveDX",&dudley::MeshAdapter::saveDX,args("filename" ,"arg"),  
 "Saves a dictonary of Data objects to an OpenDX input file. The keywords are used as identifier"  
 "\n\n:param filename: \n:type filename: ``string``\n"  
 "\n:param arg: \n:type arg: ``dict``\n")  
       .def("saveVTK",&dudley::MeshAdapter::saveVTK,  
 args("filename" ,"arg",  "metadata", "metadata_schema"),  
 "Saves a dictonary of Data objects to an VTK XML input file. The keywords are used as identifier"  
 "\n\n:param filename:\n:type filename: ``string``\n"  
 ":param arg:\n:type arg: ``dict``\n"  
 ":param metadata:\n:type metadata: ``string``\n"  
 ":param metadata_schema:\n:type metadata_schema: ``string``\n"  
 )  
249        .def("setTagMap",&dudley::MeshAdapter::setTagMap,args("name","tag"),        .def("setTagMap",&dudley::MeshAdapter::setTagMap,args("name","tag"),
250  "Give a tag number a name.\n\n:param name: Name for the tag\n:type name: ``string``\n"  "Give a tag number a name.\n\n:param name: Name for the tag\n:type name: ``string``\n"
251  ":param tag: numeric id\n:type tag: ``int``\n:note: Tag names must be unique within a domain")  ":param tag: numeric id\n:type tag: ``int``\n:note: Tag names must be unique within a domain")
# Line 284  args("filename" ,"arg",  "metadata", "me Line 259  args("filename" ,"arg",  "metadata", "me
259        .def("MPIBarrier",&dudley::MeshAdapter::MPIBarrier,"Wait until all processes have reached this point")        .def("MPIBarrier",&dudley::MeshAdapter::MPIBarrier,"Wait until all processes have reached this point")
260        .def("onMasterProcessor",&dudley::MeshAdapter::onMasterProcessor,":return: True if this code is executing on the master process\n:rtype: `bool`");        .def("onMasterProcessor",&dudley::MeshAdapter::onMasterProcessor,":return: True if this code is executing on the master process\n:rtype: `bool`");
261    
   class_<dudley::SystemMatrixAdapter, bases<escript::AbstractSystemMatrix> >  
       ("OperatorAdapter","A concrete class representing an operator. For more details, please see the c++ documentation.", no_init)  
       .def("print_matrix_info",&dudley::SystemMatrixAdapter::Print_Matrix_Info,(arg("full")=false),"prints information about a system matrix")  
       .def("nullifyRowsAndCols",&dudley::SystemMatrixAdapter::nullifyRowsAndCols)  
       .def("resetValues",&dudley::SystemMatrixAdapter::resetValues, "resets the matrix entries")  
       .def("saveMM",&dudley::SystemMatrixAdapter::saveMM,args("fileName"),  
 "writes the matrix to a file using the Matrix Market file format")  
       .def("saveHB",&dudley::SystemMatrixAdapter::saveHB, args("filename"),  
 "writes the matrix to a file using the Harwell-Boeing file format");  
   
   class_<dudley::TransportProblemAdapter, bases<escript::AbstractTransportProblem> >  
       ("TransportProblemAdapter","",no_init)  
       .def("getSafeTimeStepSize",&dudley::TransportProblemAdapter::getSafeTimeStepSize)  
       .def("getUnlimitedTimeStepSize",&dudley::TransportProblemAdapter::getUnlimitedTimeStepSize)  
       .def("resetTransport",&dudley::TransportProblemAdapter::resetTransport,  
 "resets the transport operator typically as they have been updated");  
262  }  }

Legend:
Removed from v.3469  
changed lines
  Added in v.4114

  ViewVC Help
Powered by ViewVC 1.1.26