/[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

trunk/finley/src/CPPAdapter/finleycpp.cpp revision 2625 by jfenwick, Fri Aug 21 06:30:25 2009 UTC trunk/dudley/src/CPPAdapter/dudleycpp.cpp revision 3469 by jfenwick, Tue Feb 22 06:39:16 2011 UTC
# Line 1  Line 1 
1    
2  /*******************************************************  /*******************************************************
3  *  *
4  * Copyright (c) 2003-2009 by University of Queensland  * Copyright (c) 2003-2010 by University of Queensland
5  * Earth Systems Science Computational Center (ESSCC)  * Earth Systems Science Computational Center (ESSCC)
6  * http://www.uq.edu.au/esscc  * http://www.uq.edu.au/esscc
7  *  *
# Line 12  Line 12 
12  *******************************************************/  *******************************************************/
13    
14    
15  #ifdef PASO_MPI  #ifdef ESYS_MPI
16  #include <mpi.h>  #include "esysUtils/Esys_MPI.h"
 #include "paso/Paso_MPI.h"  
17  #endif  #endif
18  extern "C" {  extern "C" {
19  #include "../Finley.h"  #include "../Dudley.h"
20  }  }
21    
22  #include "MeshAdapter.h"  #include "MeshAdapter.h"
# Line 25  extern "C" { Line 24  extern "C" {
24  #include "SystemMatrixAdapter.h"  #include "SystemMatrixAdapter.h"
25  #include "TransportProblemAdapter.h"  #include "TransportProblemAdapter.h"
26    
27  #include "FinleyAdapterException.h"  #include "DudleyAdapterException.h"
28  // #include "esysUtils/EsysException.h"  // #include "esysUtils/EsysException.h"
29  #include "esysUtils/esysExceptionTranslator.h"  #include "esysUtils/esysExceptionTranslator.h"
30    
# Line 40  extern "C" { Line 39  extern "C" {
39  using namespace boost::python;  using namespace boost::python;
40    
41  /**  /**
42     \page finley Finley     \page dudley Dudley
43     Finley is the python module name that contains the interfaces     Dudley is the python module name that contains the interfaces
44     to the C++ wrapper to finley.     to the C++ wrapper to dudley.
45    
46     \version 1.0.0     \version 1.0.0
47    
# Line 60  using namespace boost::python; Line 59  using namespace boost::python;
59    
60  */  */
61    
62  //  BOOST_PYTHON_MODULE(dudleycpp)
 // The BOOST_PYTHON_FUNCTION_OVERLOADS macro generates function overloads for optional  
 // arguments to the respective finley functions.  
 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  
 //  
 // NOTE: If the number of arguments to the finley functions change  
 // the magic numbers in the BOOST_PYTHON_FUNCTION_OVERLOADS call  
 // must change.  
 //  
 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  
 // BOOST_PYTHON_FUNCTION_OVERLOADS(readMesh_overloads,finley::readMesh,1,2)  
 // BOOST_PYTHON_FUNCTION_OVERLOADS(brick_overloads,finley::brick,0,12)  
 // BOOST_PYTHON_FUNCTION_OVERLOADS(rectangle_overloads,finley::rectangle,0,9)  
 // BOOST_PYTHON_FUNCTION_OVERLOADS(interval_overloads,finley::interval,0,6)  
 // BOOST_PYTHON_FUNCTION_OVERLOADS(glueFaces_overloads,finley::glueFaces,1,3)  
 // BOOST_PYTHON_FUNCTION_OVERLOADS(joinFaces_overloads,finley::joinFaces,1,3)  
   
 BOOST_PYTHON_MODULE(finleycpp)  
63  {  {
64  // This feature was added in boost v1.34  // This feature was added in boost v1.34
65  #if ((BOOST_VERSION/100)%1000 > 34) || (BOOST_VERSION/100000 >1)  #if ((BOOST_VERSION/100)%1000 > 34) || (BOOST_VERSION/100000 >1)
# Line 89  BOOST_PYTHON_MODULE(finleycpp) Line 71  BOOST_PYTHON_MODULE(finleycpp)
71    // NOTE: The return_value_policy is necessary for functions that    // NOTE: The return_value_policy is necessary for functions that
72    // return pointers.    // return pointers.
73    //    //
74    register_exception_translator<finley::FinleyAdapterException>(&(esysUtils::esysExceptionTranslator));    register_exception_translator<dudley::DudleyAdapterException>(&(esysUtils::esysExceptionTranslator));
75    
76    def("LoadMesh",finley::loadMesh,    def("LoadMesh",dudley::loadMesh,
77        (arg("fileName")="file.nc"),":rtype: `Domain`"        (arg("fileName")="file.nc"),":rtype: `Domain`"
78  /*      ,return_value_policy<manage_new_object>());*/  /*      ,return_value_policy<manage_new_object>());*/
79        );        );
80    
81    def("ReadMesh",finley::readMesh,    def("ReadMesh",dudley::readMesh,
82        (arg("fileName")="file.fly",arg("integrationOrder")=-1,  arg("reducedIntegrationOrder")=-1,  arg("optimize")=true)        (arg("fileName")="file.fly",arg("integrationOrder")=-1,  arg("reducedIntegrationOrder")=-1,  arg("optimize")=true)
83  /*      ,return_value_policy<manage_new_object>());*/  /*      ,return_value_policy<manage_new_object>());*/
84      ,"Read a mesh from a file. For MPI parallel runs fan out the mesh to multiple processes.\n\n"      ,"Read a mesh from a file. For MPI parallel runs fan out the mesh to multiple processes.\n\n"
# Line 106  BOOST_PYTHON_MODULE(finleycpp) Line 88  BOOST_PYTHON_MODULE(finleycpp)
88  ":param reducedIntegrationOrder: order of the quadrature scheme. If *reducedIntegrationOrder<0* the integration order is selected independently.\n"  ":param reducedIntegrationOrder: order of the quadrature scheme. If *reducedIntegrationOrder<0* the integration order is selected independently.\n"
89  ":param optimize: Enable optimisation of node labels\n:type optimize: ``bool``");  ":param optimize: Enable optimisation of node labels\n:type optimize: ``bool``");
90    
91    def("ReadGmsh",finley::readGmsh,    def("ReadGmsh",dudley::readGmsh,
92        (arg("fileName")="file.msh",arg("numDim"), arg("integrationOrder")=-1, arg("reducedIntegrationOrder")=-1, arg("optimize")=true)        (arg("fileName")="file.msh",
93           arg("numDim"),
94           arg("integrationOrder")=-1,
95           arg("reducedIntegrationOrder")=-1,
96           arg("optimize")=true,  
97           arg("useMacroElements")=false)
98  //       ,return_value_policy<manage_new_object>());  //       ,return_value_policy<manage_new_object>());
99  ,"Read a gmsh mesh file\n\n"  ,"Read a gmsh mesh file\n\n"
100  ":rtype: `Domain`\n:param fileName:\n:type fileName: ``string``\n"  ":rtype: `Domain`\n:param fileName:\n:type fileName: ``string``\n"
101  ":param integrationOrder: order of the quadrature scheme. If *integrationOrder<0* the integration order is selected independently.\n"  ":param integrationOrder: order of the quadrature scheme. If *integrationOrder<0* the integration order is selected independently.\n"
102  ":type integrationOrder: ``int``\n"  ":type integrationOrder: ``int``\n"
103  ":param reducedIntegrationOrder: order of the quadrature scheme. If *reducedIntegrationOrder<0* the integration order is selected independently.\n"  ":param reducedIntegrationOrder: order of the quadrature scheme. If *reducedIntegrationOrder<0* the integration order is selected independently.\n"
104  ":param optimize: Enable optimisation of node labels\n:type optimize: ``bool``");  ":param optimize: Enable optimisation of node labels\n:type optimize: ``bool``\n"
105    ":param useMacroElements: Enable the usage of macro elements instead of second order elements.\n:type useMacroElements: ``bool``"
106    );
107    
108    def ("Brick",finley::brick,    def ("Brick",dudley::brick,
109        (arg("n0")=1,arg("n1")=1,arg("n2")=1,        (arg("n0")=1,arg("n1")=1,arg("n2")=1,
110        arg("order")=1,        arg("order")=1,
111        arg("l0")=1.0,arg("l1")=1.0,arg("l2")=1.0,        arg("l0")=1.0,arg("l1")=1.0,arg("l2")=1.0,
# Line 125  BOOST_PYTHON_MODULE(finleycpp) Line 114  BOOST_PYTHON_MODULE(finleycpp)
114        arg("useElementsOnFace")=false,        arg("useElementsOnFace")=false,
115        arg("useFullElementOrder")=false,        arg("useFullElementOrder")=false,
116        arg("optimize")=false)        arg("optimize")=false)
117  //       ,return_value_policy<manage_new_object>());  ,"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 rectangular mesh with n0 x n1 x n2 elements over the brick [0,l0] x [0,l1] x [0,l2]."  
118  "\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"
119  ":param order: =1 or =2 gives the order of shape function\n"  ":param order: =1, =-1 or =2 gives the order of shape function. If -1 macro elements of order 1 are used.\n"
120  ":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"
121  ":param integrationOrder: order of the quadrature scheme. If integrationOrder<0 the integration order is selected independently.\n"  ":param integrationOrder: order of the quadrature scheme. If integrationOrder<0 the integration order is selected independently.\n"
122  ":param reducedIntegrationOrder: order of the quadrature scheme. If reducedIntegrationOrder<0 the integration order is selected independently.\n"  ":param reducedIntegrationOrder: order of the quadrature scheme. If reducedIntegrationOrder<0 the integration order is selected independently.\n"
# Line 137  BOOST_PYTHON_MODULE(finleycpp) Line 125  BOOST_PYTHON_MODULE(finleycpp)
125  ":param periodic0:  whether or not boundary conditions are periodic\n"  ":param periodic0:  whether or not boundary conditions are periodic\n"
126  ":param periodic1:\n:param periodic2:\n"  ":param periodic1:\n:param periodic2:\n"
127  ":param useFullElementOrder:\n:param optimize:\n"  ":param useFullElementOrder:\n:param optimize:\n"
128    ":param optimize: Enable optimisation of node labels\n:type optimize: ``bool``"
129  );  );
130    
131    def ("Rectangle",finley::rectangle,    def ("Rectangle",dudley::rectangle,
132        (arg("n0")=1,arg("n1")=1,arg("order")=1,        (arg("n0")=1,arg("n1")=1,arg("order")=1,
133        arg("l0")=1.0,arg("l1")=1.0,        arg("l0")=1.0,arg("l1")=1.0,
134        arg("periodic0")=false,arg("periodic1")=false,        arg("periodic0")=false,arg("periodic1")=false,
# Line 147  BOOST_PYTHON_MODULE(finleycpp) Line 136  BOOST_PYTHON_MODULE(finleycpp)
136        arg("useElementsOnFace")=false,        arg("useElementsOnFace")=false,
137        arg("useFullElementOrder")=false,        arg("useFullElementOrder")=false,
138        arg("optimize")=false)        arg("optimize")=false)
139  //       ,return_value_policy<manage_new_object>());  ,"Creates a triangular mesh by subdividing n0 x n1 rectangular elements over the brick [0,l0] x [0,l1]."
 ,"Creates a rectangular mesh with n0 x n1 elements over the brick [0,l0] x [0,l1]."  
140  "\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"
141  ":param order: =1 or =2 gives the order of shape function\n"  ":param order: =1, =-1 or =2 gives the order of shape function. If -1 macro elements of order 1 are used.\n"
142  ":param l0: length of side 0\n:param l1:\n"  ":param l0: length of side 0\n:param l1:\n"
143  ":param integrationOrder: order of the quadrature scheme. If integrationOrder<0 the integration order is selected independently.\n"  ":param integrationOrder: order of the quadrature scheme. If integrationOrder<0 the integration order is selected independently.\n"
144  ":param reducedIntegrationOrder: order of the quadrature scheme. If reducedIntegrationOrder<0 the integration order is selected independently.\n"  ":param reducedIntegrationOrder: order of the quadrature scheme. If reducedIntegrationOrder<0 the integration order is selected independently.\n"
# Line 158  BOOST_PYTHON_MODULE(finleycpp) Line 146  BOOST_PYTHON_MODULE(finleycpp)
146  ":type useElementsOnFace: ``int``"  ":type useElementsOnFace: ``int``"
147  ":param periodic0:  whether or not boundary conditions are periodic\n"  ":param periodic0:  whether or not boundary conditions are periodic\n"
148  ":param periodic1:\n"  ":param periodic1:\n"
149  ":param useFullElementOrder:\n:param optimize:\n");  ":param useFullElementOrder:\n:param optimize:\n"
150    ":param useMacroElements: Enable the usage of first order macro elements.\n:type useMacroElements: ``bool``\n"
151    def("Merge",finley::meshMerge,args("meshList")  ":param optimize: Enable optimisation of node labels\n:type optimize: ``bool``"
152  //       ,return_value_policy<manage_new_object>());  );
 ,"Merges a list of meshes into one mesh.\n\n:rtype: `Domain`"  
   );  
   
   def("GlueFaces",finley::glueFaces,  
       (arg("meshList"),arg("safetyFactor")=0.2,  
       arg("tolerance")=1.e-8,  
       arg("optimize")=true)  
 //       ,return_value_policy<manage_new_object>());  
 ,"Detects matching faces in the mesh, removes them from the mesh and joins the elements touched by the face elements."  
     );  
   
   def("JoinFaces",finley::joinFaces,  
       (arg("meshList"), arg("safetyFactor")=0.2,  
       arg("tolerance")=1.e-8,  
       arg("optimize")=true)  
 //       ,return_value_policy<manage_new_object>());  
 ,"Detects matching faces in the mesh and replaces them by joint elements."  
     );  
   
153    
154    class_<finley::MeshAdapter, bases<escript::AbstractContinuousDomain> >    class_<dudley::MeshAdapter, bases<escript::AbstractContinuousDomain> >
155        ("MeshAdapter","A concrete class representing a domain. For more details, please consult the c++ documentation.",init<optional <Finley_Mesh*> >())        ("MeshAdapter","A concrete class representing a domain. For more details, please consult the c++ documentation.",init<optional <Dudley_Mesh*> >())
156        .def(init<const finley::MeshAdapter&>())        .def(init<const dudley::MeshAdapter&>())
157        .def("write",&finley::MeshAdapter::write,args("filename"),        .def("write",&dudley::MeshAdapter::write,args("filename"),
158  "Write the current mesh to a file with the given name.")  "Write the current mesh to a file with the given name.")
159        .def("print_mesh_info",&finley::MeshAdapter::Print_Mesh_Info,(arg("full")=false),        .def("print_mesh_info",&dudley::MeshAdapter::Print_Mesh_Info,(arg("full")=false),
160  ":param full:\n:type full: ``bool``")  ":param full:\n:type full: ``bool``")
161        .def("dump",&finley::MeshAdapter::dump,args("fileName")        .def("dump",&dudley::MeshAdapter::dump,args("fileName")
162  ,"dumps the mesh to a file with the given name.")  ,"dumps the mesh to a file with the given name.")
163        .def("getDescription",&finley::MeshAdapter::getDescription,        .def("getDescription",&dudley::MeshAdapter::getDescription,
164  ":return: a description for this domain\n:rtype: ``string``")  ":return: a description for this domain\n:rtype: ``string``")
165        .def("getDim",&finley::MeshAdapter::getDim,":rtype: ``int``")        .def("getDim",&dudley::MeshAdapter::getDim,":rtype: ``int``")
166        .def("getDataShape",&finley::MeshAdapter::getDataShape, args("functionSpaceCode"),        .def("getDataShape",&dudley::MeshAdapter::getDataShape, args("functionSpaceCode"),
167  ":return: a pair (dps, ns) where dps=the number of data points per sample, and ns=the number of samples\n:rtype: ``tuple``")  ":return: a pair (dps, ns) where dps=the number of data points per sample, and ns=the number of samples\n:rtype: ``tuple``")
168        .def("getNumDataPointsGlobal",&finley::MeshAdapter::getNumDataPointsGlobal,        .def("getNumDataPointsGlobal",&dudley::MeshAdapter::getNumDataPointsGlobal,
169  ":return: the number of data points summed across all MPI processes\n"  ":return: the number of data points summed across all MPI processes\n"
170  ":rtype: ``int``")  ":rtype: ``int``")
171        .def("addPDEToSystem",&finley::MeshAdapter::addPDEToSystem,        .def("addPDEToSystem",&dudley::MeshAdapter::addPDEToSystem,
172  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"),
173  "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"
174  ":param mat:\n:type mat: `OperatorAdapter`\n:param rhs:\n:type rhs: `Data`\n"  ":param mat:\n:type mat: `OperatorAdapter`\n:param rhs:\n:type rhs: `Data`\n"
# Line 213  args("mat", "rhs","A", "B", "C", "D", "X Line 182  args("mat", "rhs","A", "B", "C", "D", "X
182  ":param d_contact:\n:type d_contact: `Data`\n"  ":param d_contact:\n:type d_contact: `Data`\n"
183  ":param y_contact:\n:type y_contact: `Data`\n"  ":param y_contact:\n:type y_contact: `Data`\n"
184  )  )
185        .def("addPDEToLumpedSystem",&finley::MeshAdapter::addPDEToLumpedSystem,        .def("addPDEToLumpedSystem",&dudley::MeshAdapter::addPDEToLumpedSystem,
186  args("mat", "D", "d"),  args("mat", "D", "d"),
187  "adds a PDE onto the lumped stiffness matrix\n\n"  "adds a PDE onto the lumped stiffness matrix\n\n"
188  ":param mat:\n:type mat: `Data`\n"  ":param mat:\n:type mat: `Data`\n"
189  ":param D:\n:type D: `Data`\n"  ":param D:\n:type D: `Data`\n"
190  ":param d:\n:type d: `Data`\n")  ":param d:\n:type d: `Data`\n"
191        .def("addPDEToRHS",&finley::MeshAdapter::addPDEToRHS,  ":param useHRZ:\n:type useHRZ: bool\n"
192    )
193          .def("addPDEToRHS",&dudley::MeshAdapter::addPDEToRHS,
194  args("rhs", "X", "Y", "y", "y_contact"),  args("rhs", "X", "Y", "y", "y_contact"),
195  "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"
196  ":param rhs:\n:type rhs: `Data`\n"  ":param rhs:\n:type rhs: `Data`\n"
# Line 228  args("rhs", "X", "Y", "y", "y_contact"), Line 199  args("rhs", "X", "Y", "y", "y_contact"),
199  ":param y:\n:type y: `Data`\n"  ":param y:\n:type y: `Data`\n"
200  ":param y_contact:\n:type y_contact: `Data`"  ":param y_contact:\n:type y_contact: `Data`"
201  )  )
202        .def("addPDEToTransportProblem",&finley::MeshAdapter::addPDEToTransportProblem,        .def("addPDEToTransportProblem",&dudley::MeshAdapter::addPDEToTransportProblem,
203  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"),
204  ":param tp:\n:type tp: `TransportProblemAdapter`\n"  ":param tp:\n:type tp: `TransportProblemAdapter`\n"
205  ":param source:\n:type source: `Data`\n"  ":param source:\n:type source: `Data`\n"
# Line 244  args( "tp", "source", "M", "A", "B", "C" Line 215  args( "tp", "source", "M", "A", "B", "C"
215  ":param d_contact:\n:type d_contact: `Data`\n"  ":param d_contact:\n:type d_contact: `Data`\n"
216  ":param y_contact:\n:type y_contact: `Data`\n"  ":param y_contact:\n:type y_contact: `Data`\n"
217  )  )
218        .def("newOperator",&finley::MeshAdapter::newSystemMatrix,        .def("newOperator",&dudley::MeshAdapter::newSystemMatrix,
219  args("row_blocksize", "row_functionspace", "column_blocksize", "column_functionspace", "type"),  args("row_blocksize", "row_functionspace", "column_blocksize", "column_functionspace", "type"),
220  "creates a SystemMatrixAdapter stiffness matrix and initializes it with zeros\n\n"  "creates a SystemMatrixAdapter stiffness matrix and initializes it with zeros\n\n"
221  ":param row_blocksize:\n:type row_blocksize: ``int``\n"  ":param row_blocksize:\n:type row_blocksize: ``int``\n"
# Line 253  args("row_blocksize", "row_functionspace Line 224  args("row_blocksize", "row_functionspace
224  ":param column_functionspace:\n:type column_functionspace: `FunctionSpace`\n"  ":param column_functionspace:\n:type column_functionspace: `FunctionSpace`\n"
225  ":param type:\n:type type: ``int``\n"  ":param type:\n:type type: ``int``\n"
226  )  )
227        .def("newTransportProblem",&finley::MeshAdapter::newTransportProblem,        .def("newTransportProblem",&dudley::MeshAdapter::newTransportProblem,
228  args("theta", "blocksize", "functionspace", "type"),  args("theta", "blocksize", "functionspace", "type"),
229  "creates a TransportProblemAdapter\n\n"  "creates a TransportProblemAdapter\n\n"
230  ":param theta:\n:type theta: ``float``\n"  ":param theta:\n:type theta: ``float``\n"
# Line 261  args("theta", "blocksize", "functionspac Line 232  args("theta", "blocksize", "functionspac
232  ":param functionspace:\n:type functionspace: `FunctionSpace`\n"  ":param functionspace:\n:type functionspace: `FunctionSpace`\n"
233  ":param type:\n:type type: ``int``\n"  ":param type:\n:type type: ``int``\n"
234  )  )
235        .def("getSystemMatrixTypeId",&finley::MeshAdapter::getSystemMatrixTypeId,        .def("getSystemMatrixTypeId",&dudley::MeshAdapter::getSystemMatrixTypeId,
236  args("solver", "preconditioner", "package", "symmetry"),  args("solver", "preconditioner", "package", "symmetry"),
237  ":return: the identifier of the matrix type to be used for the global stiffness matrix when a particular solver, package, perconditioner, and symmetric matrix is used.\n"  ":return: the identifier of the matrix type to be used for the global stiffness matrix when a particular solver, package, perconditioner, and symmetric matrix is used.\n"
238  ":rtype: ``int``\n"  ":rtype: ``int``\n"
# Line 270  args("solver", "preconditioner", "packag Line 241  args("solver", "preconditioner", "packag
241  ":param package:\n:type package: ``int``\n"  ":param package:\n:type package: ``int``\n"
242  ":param symmetry:\n:type symmetry: ``int``\n"  ":param symmetry:\n:type symmetry: ``int``\n"
243  )  )
244        .def("getTransportTypeId",&finley::MeshAdapter::getTransportTypeId,        .def("getTransportTypeId",&dudley::MeshAdapter::getTransportTypeId,
245  args("solver", "preconditioner", "package", "symmetry"),  args("solver", "preconditioner", "package", "symmetry"),
246  ":return: the identifier of the transport problem type to be used when a particular solver, perconditioner, package and symmetric matrix is used.\n"  ":return: the identifier of the transport problem type to be used when a particular solver, perconditioner, package and symmetric matrix is used.\n"
247  ":rtype: ``int``\n"  ":rtype: ``int``\n"
# Line 279  args("solver", "preconditioner", "packag Line 250  args("solver", "preconditioner", "packag
250  ":param package:\n:type package: ``int``\n"  ":param package:\n:type package: ``int``\n"
251  ":param symmetry:\n:type symmetry: ``int``\n"  ":param symmetry:\n:type symmetry: ``int``\n"
252  )  )
253        .def("setX",&finley::MeshAdapter::setNewX,        .def("setX",&dudley::MeshAdapter::setNewX,
254  args("arg"), "assigns new location to the domain\n\n:param arg:\n:type arg: `Data`")  args("arg"), "assigns new location to the domain\n\n:param arg:\n:type arg: `Data`")
255        .def("getX",&finley::MeshAdapter::getX, ":return: locations in the FEM nodes\n\n"        .def("getX",&dudley::MeshAdapter::getX, ":return: locations in the FEM nodes\n\n"
256  ":rtype: `Data`")  ":rtype: `Data`")
257        .def("getNormal",&finley::MeshAdapter::getNormal,        .def("getNormal",&dudley::MeshAdapter::getNormal,
258  ":return: boundary normals at the quadrature point on the face elements\n"  ":return: boundary normals at the quadrature point on the face elements\n"
259  ":rtype: `Data`")  ":rtype: `Data`")
260        .def("getSize",&finley::MeshAdapter::getSize,":return: the element size\n"        .def("getSize",&dudley::MeshAdapter::getSize,":return: the element size\n"
261  ":rtype: `Data`")  ":rtype: `Data`")
262        .def("saveDX",&finley::MeshAdapter::saveDX,args("filename" ,"arg"),        .def("saveDX",&dudley::MeshAdapter::saveDX,args("filename" ,"arg"),
263  "Saves a dictonary of Data objects to an OpenDX input file. The keywords are used as identifier"  "Saves a dictonary of Data objects to an OpenDX input file. The keywords are used as identifier"
264  "\n\n:param filename: \n:type filename: ``string``\n"  "\n\n:param filename: \n:type filename: ``string``\n"
265  "\n:param arg: \n:type arg: ``dict``\n")  "\n:param arg: \n:type arg: ``dict``\n")
266        .def("saveVTK",&finley::MeshAdapter::saveVTK,        .def("saveVTK",&dudley::MeshAdapter::saveVTK,
267  args("filename" ,"arg",  "metadata", "metadata_schema"),  args("filename" ,"arg",  "metadata", "metadata_schema"),
268  "Saves a dictonary of Data objects to an VTK XML input file. The keywords are used as identifier"  "Saves a dictonary of Data objects to an VTK XML input file. The keywords are used as identifier"
269  "\n\n:param filename:\n:type filename: ``string``\n"  "\n\n:param filename:\n:type filename: ``string``\n"
# Line 300  args("filename" ,"arg",  "metadata", "me Line 271  args("filename" ,"arg",  "metadata", "me
271  ":param metadata:\n:type metadata: ``string``\n"  ":param metadata:\n:type metadata: ``string``\n"
272  ":param metadata_schema:\n:type metadata_schema: ``string``\n"  ":param metadata_schema:\n:type metadata_schema: ``string``\n"
273  )  )
274        .def("setTagMap",&finley::MeshAdapter::setTagMap,args("name","tag"),        .def("setTagMap",&dudley::MeshAdapter::setTagMap,args("name","tag"),
275  "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"
276  ":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")
277        .def("getTag",&finley::MeshAdapter::getTag,args("name"),":return: tag id for "        .def("getTag",&dudley::MeshAdapter::getTag,args("name"),":return: tag id for "
278  "``name``\n:rtype: ``string``")  "``name``\n:rtype: ``string``")
279        .def("isValidTagName",&finley::MeshAdapter::isValidTagName,args("name"),        .def("isValidTagName",&dudley::MeshAdapter::isValidTagName,args("name"),
280  ":return: True is ``name`` corresponds to a tag\n:rtype: ``bool``")  ":return: True is ``name`` corresponds to a tag\n:rtype: ``bool``")
281        .def("showTagNames",&finley::MeshAdapter::showTagNames,":return: A space separated list of tag names\n:rtype: ``string``")        .def("showTagNames",&dudley::MeshAdapter::showTagNames,":return: A space separated list of tag names\n:rtype: ``string``")
282        .def("getMPISize",&finley::MeshAdapter::getMPISize,":return: the number of processes used for this `Domain`\n:rtype: ``int``")        .def("getMPISize",&dudley::MeshAdapter::getMPISize,":return: the number of processes used for this `Domain`\n:rtype: ``int``")
283        .def("getMPIRank",&finley::MeshAdapter::getMPIRank,":return: the rank of this process\n:rtype: ``int``")        .def("getMPIRank",&dudley::MeshAdapter::getMPIRank,":return: the rank of this process\n:rtype: ``int``")
284        .def("MPIBarrier",&finley::MeshAdapter::MPIBarrier,"Wait until all processes have reached this point")        .def("MPIBarrier",&dudley::MeshAdapter::MPIBarrier,"Wait until all processes have reached this point")
285        .def("onMasterProcessor",&finley::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`");
286    
287    class_<finley::SystemMatrixAdapter, bases<escript::AbstractSystemMatrix> >    class_<dudley::SystemMatrixAdapter, bases<escript::AbstractSystemMatrix> >
288        ("OperatorAdapter","A concrete class representing an operator. For more details, please see the c++ documentation.", no_init)        ("OperatorAdapter","A concrete class representing an operator. For more details, please see the c++ documentation.", no_init)
289        .def("print_matrix_info",&finley::SystemMatrixAdapter::Print_Matrix_Info,(arg("full")=false),"prints information about a system matrix")        .def("print_matrix_info",&dudley::SystemMatrixAdapter::Print_Matrix_Info,(arg("full")=false),"prints information about a system matrix")
290        .def("nullifyRowsAndCols",&finley::SystemMatrixAdapter::nullifyRowsAndCols)        .def("nullifyRowsAndCols",&dudley::SystemMatrixAdapter::nullifyRowsAndCols)
291        .def("resetValues",&finley::SystemMatrixAdapter::resetValues, "resets the matrix entries")        .def("resetValues",&dudley::SystemMatrixAdapter::resetValues, "resets the matrix entries")
292        .def("saveMM",&finley::SystemMatrixAdapter::saveMM,args("fileName"),        .def("saveMM",&dudley::SystemMatrixAdapter::saveMM,args("fileName"),
293  "writes the matrix to a file using the Matrix Market file format")  "writes the matrix to a file using the Matrix Market file format")
294        .def("saveHB",&finley::SystemMatrixAdapter::saveHB, args("filename"),        .def("saveHB",&dudley::SystemMatrixAdapter::saveHB, args("filename"),
295  "writes the matrix to a file using the Harwell-Boeing file format");  "writes the matrix to a file using the Harwell-Boeing file format");
296    
297    class_<finley::TransportProblemAdapter, bases<escript::AbstractTransportProblem> >    class_<dudley::TransportProblemAdapter, bases<escript::AbstractTransportProblem> >
298        ("TransportProblemAdapter","",no_init)        ("TransportProblemAdapter","",no_init)
299        .def("getSafeTimeStepSize",&finley::TransportProblemAdapter::getSafeTimeStepSize)        .def("getSafeTimeStepSize",&dudley::TransportProblemAdapter::getSafeTimeStepSize)
300        .def("getUnlimitedTimeStepSize",&finley::TransportProblemAdapter::getUnlimitedTimeStepSize)        .def("getUnlimitedTimeStepSize",&dudley::TransportProblemAdapter::getUnlimitedTimeStepSize)
301        .def("resetTransport",&finley::TransportProblemAdapter::resetTransport,        .def("resetTransport",&dudley::TransportProblemAdapter::resetTransport,
302  "resets the transport operator typically as they have been updated");  "resets the transport operator typically as they have been updated");
303  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.26