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

Diff of /trunk/dudley/src/CPPAdapter/dudleycpp.cpp

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

trunk/finley/src/CPPAdapter/finleycpp.cpp revision 155 by jgs, Wed Nov 9 02:02:19 2005 UTC branches/domexper/dudley/src/CPPAdapter/dudleycpp.cpp revision 3082 by jfenwick, Tue Aug 3 06:04:05 2010 UTC
# Line 1  Line 1 
 // $Id$  
 /*  
  ******************************************************************************  
  *                                                                            *  
  *       COPYRIGHT ACcESS 2004 -  All Rights Reserved                         *  
  *                                                                            *  
  * This software is the property of ACcESS.  No part of this code             *  
  * may be copied in any form or by any means without the expressed written    *  
  * consent of ACcESS.  Copying, use or modification of this software          *  
  * by any unauthorised person is illegal unless that                          *  
  * person has a software license agreement with ACcESS.                       *  
  *                                                                            *  
  ******************************************************************************  
   
 ******************************************************************************/  
1    
2    /*******************************************************
3    *
4    * Copyright (c) 2003-2010 by University of Queensland
5    * Earth Systems Science Computational Center (ESSCC)
6    * http://www.uq.edu.au/esscc
7    *
8    * Primary Business: Queensland, Australia
9    * Licensed under the Open Software License version 3.0
10    * http://www.opensource.org/licenses/osl-3.0.php
11    *
12    *******************************************************/
13    
14    
15    #ifdef PASO_MPI
16    #include <mpi.h>
17    #include "paso/Paso_MPI.h"
18    #endif
19  extern "C" {  extern "C" {
20  #include "finley/finleyC/Finley.h"  #include "../Dudley.h"
21  }  }
 #include "finley/CPPAdapter/MeshAdapter.h"  
 #include "finley/CPPAdapter/MeshAdapterFactory.h"  
 #include "finley/CPPAdapter/SystemMatrixAdapter.h"  
22    
23  #include "esysUtils/EsysException.h"  #include "MeshAdapter.h"
24    #include "MeshAdapterFactory.h"
25    #include "SystemMatrixAdapter.h"
26    #include "TransportProblemAdapter.h"
27    
28    #include "FinleyAdapterException.h"
29    // #include "esysUtils/EsysException.h"
30  #include "esysUtils/esysExceptionTranslator.h"  #include "esysUtils/esysExceptionTranslator.h"
31    
32  #include "escript/Data/AbstractContinuousDomain.h"  #include "escript/AbstractContinuousDomain.h"
33    
34  #include <boost/python.hpp>  #include <boost/python.hpp>
35  #include <boost/python/module.hpp>  #include <boost/python/module.hpp>
36  #include <boost/python/def.hpp>  #include <boost/python/def.hpp>
37  #include <boost/python/detail/defaults_gen.hpp>  #include <boost/python/detail/defaults_gen.hpp>
38    #include <boost/version.hpp>
39    
40  using namespace boost::python;  using namespace boost::python;
41    
42  /**  /**
43     \page finley Finley     \page dudley Dudley
44     Finley is the python module name that contains the interfaces     Finley is the python module name that contains the interfaces
45     to the C++ wrapper to finley.     to the C++ wrapper to dudley.
46    
47     \version 1.0.0     \version 1.0.0
48    
# Line 54  using namespace boost::python; Line 60  using namespace boost::python;
60    
61  */  */
62    
63  //  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)  
64  {  {
65    // This feature was added in boost v1.34
66    #if ((BOOST_VERSION/100)%1000 > 34) || (BOOST_VERSION/100000 >1)
67      // params are: bool show_user_defined, bool show_py_signatures, bool show_cpp_signatures
68      docstring_options docopt(true, true, false);
69    #endif
70    
   // def("ReadMesh",finley::readMesh,readMesh_overloads());  
   // def("Brick",finley::brick,brick_overloads());  
   // def("Rectangle",finley::rectangle,rectangle_overloads());  
   // def("Interval",finley::interval,interval_overloads());  
   // def("GlueFaces",finley::glueFaces,glueFaces_overloads());  
   // def("JoinFaces",finley::joinFaces,joinFaces_overloads());  
71    //    //
72    // NOTE: The return_value_policy is necessary for functions that    // NOTE: The return_value_policy is necessary for functions that
73    // return pointers.    // return pointers.
74      //
75      register_exception_translator<dudley::FinleyAdapterException>(&(esysUtils::esysExceptionTranslator));
76    
77    def("ReadMesh",finley::readMesh,    def("LoadMesh",dudley::loadMesh,
78        (arg("fileName"),arg("integrationOrder")=-1),        (arg("fileName")="file.nc"),":rtype: `Domain`"
79        return_value_policy<manage_new_object>());  /*      ,return_value_policy<manage_new_object>());*/
80          );
81    
82      def("ReadMesh",dudley::readMesh,
83          (arg("fileName")="file.fly",arg("integrationOrder")=-1,  arg("reducedIntegrationOrder")=-1,  arg("optimize")=true)
84    /*      ,return_value_policy<manage_new_object>());*/
85        ,"Read a mesh from a file. For MPI parallel runs fan out the mesh to multiple processes.\n\n"
86    ":rtype: `Domain`\n:param fileName:\n:type fileName: ``string``\n"
87    ":param integrationOrder: order of the quadrature scheme. If *integrationOrder<0* the integration order is selected independently.\n"
88    ":type integrationOrder: ``int``\n"
89    ":param reducedIntegrationOrder: order of the quadrature scheme. If *reducedIntegrationOrder<0* the integration order is selected independently.\n"
90    ":param optimize: Enable optimisation of node labels\n:type optimize: ``bool``");
91    
92      def("ReadGmsh",dudley::readGmsh,
93          (arg("fileName")="file.msh",
94           arg("numDim"),
95           arg("integrationOrder")=-1,
96           arg("reducedIntegrationOrder")=-1,
97           arg("optimize")=true,  
98           arg("useMacroElements")=false)
99    //       ,return_value_policy<manage_new_object>());
100    ,"Read a gmsh mesh file\n\n"
101    ":rtype: `Domain`\n:param fileName:\n:type fileName: ``string``\n"
102    ":param integrationOrder: order of the quadrature scheme. If *integrationOrder<0* the integration order is selected independently.\n"
103    ":type integrationOrder: ``int``\n"
104    ":param reducedIntegrationOrder: order of the quadrature scheme. If *reducedIntegrationOrder<0* the integration order is selected independently.\n"
105    ":param optimize: Enable optimisation of node labels\n:type optimize: ``bool``\n"
106    ":param useMacroElements: Enable the usage of macro elements instead of second order elements.\n:type useMacroElements: ``bool``"
107    );
108    
109    def ("Brick",finley::brick,    def ("Brick",dudley::brick,
110        (arg("n0")=1,arg("n1")=1,arg("n2")=1,        (arg("n0")=1,arg("n1")=1,arg("n2")=1,
111        arg("order")=1,        arg("order")=1,
112        arg("l0")=1.0,arg("l1")=1.0,arg("l2")=1.0,        arg("l0")=1.0,arg("l1")=1.0,arg("l2")=1.0,
113        arg("periodic0")=false,arg("periodic1")=false,arg("periodic2")=false,        arg("periodic0")=false,arg("periodic1")=false,arg("periodic2")=false,
114        arg("integrationOrder")=-1,        arg("integrationOrder")=-1,  arg("reducedIntegrationOrder")=-1,
115        arg("useElementsOnFace")=false),        arg("useElementsOnFace")=false,
116        return_value_policy<manage_new_object>());        arg("useFullElementOrder")=false,
117          arg("optimize")=false)
118          
119    //       ,return_value_policy<manage_new_object>());
120    ,"Creates a rectangular mesh with n0 x n1 x n2 elements over the brick [0,l0] x [0,l1] x [0,l2]."
121    "\n\n:param n0:\n:type n0:\n:param n1:\n:type n1:\n:param n2:\n:type n2:\n"
122    ":param order: =1, =-1 or =2 gives the order of shape function. If -1 macro elements of order 1 are used.\n"
123    ":param l0: length of side 0\n:param l1:\n:param l2:\n"
124    ":param integrationOrder: order of the quadrature scheme. If integrationOrder<0 the integration order is selected independently.\n"
125    ":param reducedIntegrationOrder: order of the quadrature scheme. If reducedIntegrationOrder<0 the integration order is selected independently.\n"
126    ":param useElementsOnFace:  whether or not to use elements on face\n"
127    ":type useElementsOnFace: ``int``"
128    ":param periodic0:  whether or not boundary conditions are periodic\n"
129    ":param periodic1:\n:param periodic2:\n"
130    ":param useFullElementOrder:\n:param optimize:\n"
131    ":param optimize: Enable optimisation of node labels\n:type optimize: ``bool``"
132    );
133    
134    def ("Rectangle",finley::rectangle,    def ("Rectangle",dudley::rectangle,
135        (arg("n0")=1,arg("n1")=1,arg("order")=1,        (arg("n0")=1,arg("n1")=1,arg("order")=1,
136        arg("l0")=1.0,arg("l1")=1.0,        arg("l0")=1.0,arg("l1")=1.0,
137        arg("periodic0")=false,arg("periodic1")=false,        arg("periodic0")=false,arg("periodic1")=false,
138        arg("integrationOrder")=-1,        arg("integrationOrder")=-1,  arg("reducedIntegrationOrder")=-1,
139        arg("useElementsOnFace")=false),        arg("useElementsOnFace")=false,
140        return_value_policy<manage_new_object>());        arg("useFullElementOrder")=false,
141          arg("optimize")=false)
142    def("Interval",finley::interval,  //       ,return_value_policy<manage_new_object>());
143        (arg("n1")=1,arg("order")=1,  ,"Creates a rectangular mesh with n0 x n1 elements over the brick [0,l0] x [0,l1]."
144        arg("l1")=1.0,arg("periodic0")=false,  "\n\n:param n0:\n:type n0:\n:param n1:\n:type n1:\n"
145        arg("integrationOrder")=-1,  ":param order: =1, =-1 or =2 gives the order of shape function. If -1 macro elements of order 1 are used.\n"
146        arg("useElementsOnFace")=false),  ":param l0: length of side 0\n:param l1:\n"
147        return_value_policy<manage_new_object>());  ":param integrationOrder: order of the quadrature scheme. If integrationOrder<0 the integration order is selected independently.\n"
148    ":param reducedIntegrationOrder: order of the quadrature scheme. If reducedIntegrationOrder<0 the integration order is selected independently.\n"
149    def("Merge",finley::meshMerge,  ":param useElementsOnFace:  whether or not to use elements on face\n"
150        return_value_policy<manage_new_object>());  ":type useElementsOnFace: ``int``"
151    ":param periodic0:  whether or not boundary conditions are periodic\n"
152    def("GlueFaces",finley::glueFaces,  ":param periodic1:\n"
153        (arg("safetyFactor")=0.2,  ":param useFullElementOrder:\n:param optimize:\n"
154        arg("tolerance")=std::numeric_limits<double>::epsilon()),  ":param useMacroElements: Enable the usage of first order macro elements.\n:type useMacroElements: ``bool``\n"
155        return_value_policy<manage_new_object>());  ":param optimize: Enable optimisation of node labels\n:type optimize: ``bool``"
156    );
157    def("JoinFaces",finley::joinFaces,  
158        (arg("safetyFactor")=0.2,    def("Merge",dudley::meshMerge,args("meshList")
159        arg("tolerance")=std::numeric_limits<double>::epsilon()),  //       ,return_value_policy<manage_new_object>());
160        return_value_policy<manage_new_object>());  ,"Merges a list of meshes into one mesh.\n\n:rtype: `Domain`"
161      );
162    register_exception_translator<esysUtils::EsysException>(&esysUtils::esysExceptionTranslator);  
163      def("GlueFaces",dudley::glueFaces,
164    class_<finley::MeshAdapter, bases<escript::AbstractContinuousDomain> >        (arg("meshList"),arg("safetyFactor")=0.2,
165        ("MeshAdapter",init<optional <Finley_Mesh*> >())        arg("tolerance")=1.e-8,
166        .def(init<const finley::MeshAdapter&>())        arg("optimize")=true)
167        .def("write",&finley::MeshAdapter::write)  //       ,return_value_policy<manage_new_object>());
168        .def("getDescription",&finley::MeshAdapter::getDescription)  ,"Detects matching faces in the mesh, removes them from the mesh and joins the elements touched by the face elements."
169        .def("getDim",&finley::MeshAdapter::getDim)      );
170        .def("getDataShape",&finley::MeshAdapter::getDataShape)  
171        .def("addPDEToSystem",&finley::MeshAdapter::addPDEToSystem)    def("JoinFaces",dudley::joinFaces,
172        .def("addPDEToRHS",&finley::MeshAdapter::addPDEToRHS)        (arg("meshList"), arg("safetyFactor")=0.2,
173        .def("newOperator",&finley::MeshAdapter::newSystemMatrix)        arg("tolerance")=1.e-8,
174        .def("getSystemMatrixTypeId",&finley::MeshAdapter::getSystemMatrixTypeId)        arg("optimize")=true)
175        .def("setX",&finley::MeshAdapter::setNewX)  //       ,return_value_policy<manage_new_object>());
176        .def("getX",&finley::MeshAdapter::getX)  ,"Detects matching faces in the mesh and replaces them by joint elements."
177        .def("getNormal",&finley::MeshAdapter::getNormal)      );
178        .def("getSize",&finley::MeshAdapter::getSize)  
179        .def("saveDX",&finley::MeshAdapter::saveDX)  
180        .def("saveVTK",&finley::MeshAdapter::saveVTK);    class_<dudley::MeshAdapter, bases<escript::AbstractContinuousDomain> >
181          ("MeshAdapter","A concrete class representing a domain. For more details, please consult the c++ documentation.",init<optional <Finley_Mesh*> >())
182          .def(init<const dudley::MeshAdapter&>())
183    class_<finley::SystemMatrixAdapter, bases<escript::AbstractSystemMatrix> >        .def("write",&dudley::MeshAdapter::write,args("filename"),
184        ("OperatorAdapter",no_init)  "Write the current mesh to a file with the given name.")
185        .def("nullifyRowsAndCols",&finley::SystemMatrixAdapter::nullifyRowsAndCols)        .def("print_mesh_info",&dudley::MeshAdapter::Print_Mesh_Info,(arg("full")=false),
186        .def("resetValues",&finley::SystemMatrixAdapter::resetValues)  ":param full:\n:type full: ``bool``")
187        .def("saveMM",&finley::SystemMatrixAdapter::saveMM)        .def("dump",&dudley::MeshAdapter::dump,args("fileName")
188        .def("saveHB",&finley::SystemMatrixAdapter::saveHB);  ,"dumps the mesh to a file with the given name.")
189          .def("getDescription",&dudley::MeshAdapter::getDescription,
190    ":return: a description for this domain\n:rtype: ``string``")
191          .def("getDim",&dudley::MeshAdapter::getDim,":rtype: ``int``")
192          .def("getDataShape",&dudley::MeshAdapter::getDataShape, args("functionSpaceCode"),
193    ":return: a pair (dps, ns) where dps=the number of data points per sample, and ns=the number of samples\n:rtype: ``tuple``")
194          .def("getNumDataPointsGlobal",&dudley::MeshAdapter::getNumDataPointsGlobal,
195    ":return: the number of data points summed across all MPI processes\n"
196    ":rtype: ``int``")
197          .def("addPDEToSystem",&dudley::MeshAdapter::addPDEToSystem,
198    args("mat", "rhs","A", "B", "C", "D", "X", "Y", "d", "y", "d_contact", "y_contact"),
199    "adds a PDE onto the stiffness matrix mat and a rhs\n\n"
200    ":param mat:\n:type mat: `OperatorAdapter`\n:param rhs:\n:type rhs: `Data`\n"
201    ":param A:\n:type A: `Data`\n"
202    ":param B:\n:type B: `Data`\n"
203    ":param C:\n:type C: `Data`\n"
204    ":param D:\n:type D: `Data`\n"
205    ":param X:\n:type X: `Data`\n"
206    ":param Y:\n:type Y: `Data`\n"
207    ":param d:\n:type d: `Data`\n"
208    ":param d_contact:\n:type d_contact: `Data`\n"
209    ":param y_contact:\n:type y_contact: `Data`\n"
210    )
211          .def("addPDEToLumpedSystem",&dudley::MeshAdapter::addPDEToLumpedSystem,
212    args("mat", "D", "d"),
213    "adds a PDE onto the lumped stiffness matrix\n\n"
214    ":param mat:\n:type mat: `Data`\n"
215    ":param D:\n:type D: `Data`\n"
216    ":param d:\n:type d: `Data`\n")
217          .def("addPDEToRHS",&dudley::MeshAdapter::addPDEToRHS,
218    args("rhs", "X", "Y", "y", "y_contact"),
219    "adds a PDE onto the stiffness matrix mat and a rhs\n\n"
220    ":param rhs:\n:type rhs: `Data`\n"
221    ":param X:\n:type X: `Data`\n"
222    ":param Y:\n:type Y: `Data`\n"
223    ":param y:\n:type y: `Data`\n"
224    ":param y_contact:\n:type y_contact: `Data`"
225    )
226          .def("addPDEToTransportProblem",&dudley::MeshAdapter::addPDEToTransportProblem,
227    args( "tp", "source", "M", "A", "B", "C", "D", "X", "Y", "d", "y", "d_contact", "y_contact"),
228    ":param tp:\n:type tp: `TransportProblemAdapter`\n"
229    ":param source:\n:type source: `Data`\n"
230    ":param M:\n:type M: `Data`\n"
231    ":param A:\n:type A: `Data`\n"
232    ":param B:\n:type B: `Data`\n"
233    ":param C:\n:type C: `Data`\n"
234    ":param D:\n:type D: `Data`\n"
235    ":param X:\n:type X: `Data`\n"
236    ":param Y:\n:type Y: `Data`\n"
237    ":param d:\n:type d: `Data`\n"
238    ":param y:\n:type y: `Data`\n"
239    ":param d_contact:\n:type d_contact: `Data`\n"
240    ":param y_contact:\n:type y_contact: `Data`\n"
241    )
242          .def("newOperator",&dudley::MeshAdapter::newSystemMatrix,
243    args("row_blocksize", "row_functionspace", "column_blocksize", "column_functionspace", "type"),
244    "creates a SystemMatrixAdapter stiffness matrix and initializes it with zeros\n\n"
245    ":param row_blocksize:\n:type row_blocksize: ``int``\n"
246    ":param row_functionspace:\n:type row_functionspace: `FunctionSpace`\n"
247    ":param column_blocksize:\n:type column_blocksize: ``int``\n"
248    ":param column_functionspace:\n:type column_functionspace: `FunctionSpace`\n"
249    ":param type:\n:type type: ``int``\n"
250    )
251          .def("newTransportProblem",&dudley::MeshAdapter::newTransportProblem,
252    args("theta", "blocksize", "functionspace", "type"),
253    "creates a TransportProblemAdapter\n\n"
254    ":param theta:\n:type theta: ``float``\n"
255    ":param blocksize:\n:type blocksize: ``int``\n"
256    ":param functionspace:\n:type functionspace: `FunctionSpace`\n"
257    ":param type:\n:type type: ``int``\n"
258    )
259          .def("getSystemMatrixTypeId",&dudley::MeshAdapter::getSystemMatrixTypeId,
260    args("solver", "preconditioner", "package", "symmetry"),
261    ":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"
262    ":rtype: ``int``\n"
263    ":param solver:\n:type solver: ``int``\n"
264    ":param preconditioner:\n:type preconditioner: ``int``\n"
265    ":param package:\n:type package: ``int``\n"
266    ":param symmetry:\n:type symmetry: ``int``\n"
267    )
268          .def("getTransportTypeId",&dudley::MeshAdapter::getTransportTypeId,
269    args("solver", "preconditioner", "package", "symmetry"),
270    ":return: the identifier of the transport problem type to be used when a particular solver, perconditioner, package and symmetric matrix is used.\n"
271    ":rtype: ``int``\n"
272    ":param solver:\n:type solver: ``int``\n"
273    ":param preconditioner:\n:type preconditioner: ``int``\n"
274    ":param package:\n:type package: ``int``\n"
275    ":param symmetry:\n:type symmetry: ``int``\n"
276    )
277          .def("setX",&dudley::MeshAdapter::setNewX,
278    args("arg"), "assigns new location to the domain\n\n:param arg:\n:type arg: `Data`")
279          .def("getX",&dudley::MeshAdapter::getX, ":return: locations in the FEM nodes\n\n"
280    ":rtype: `Data`")
281          .def("getNormal",&dudley::MeshAdapter::getNormal,
282    ":return: boundary normals at the quadrature point on the face elements\n"
283    ":rtype: `Data`")
284          .def("getSize",&dudley::MeshAdapter::getSize,":return: the element size\n"
285    ":rtype: `Data`")
286          .def("saveDX",&dudley::MeshAdapter::saveDX,args("filename" ,"arg"),
287    "Saves a dictonary of Data objects to an OpenDX input file. The keywords are used as identifier"
288    "\n\n:param filename: \n:type filename: ``string``\n"
289    "\n:param arg: \n:type arg: ``dict``\n")
290          .def("saveVTK",&dudley::MeshAdapter::saveVTK,
291    args("filename" ,"arg",  "metadata", "metadata_schema"),
292    "Saves a dictonary of Data objects to an VTK XML input file. The keywords are used as identifier"
293    "\n\n:param filename:\n:type filename: ``string``\n"
294    ":param arg:\n:type arg: ``dict``\n"
295    ":param metadata:\n:type metadata: ``string``\n"
296    ":param metadata_schema:\n:type metadata_schema: ``string``\n"
297    )
298          .def("setTagMap",&dudley::MeshAdapter::setTagMap,args("name","tag"),
299    "Give a tag number a name.\n\n:param name: Name for the tag\n:type name: ``string``\n"
300    ":param tag: numeric id\n:type tag: ``int``\n:note: Tag names must be unique within a domain")
301          .def("getTag",&dudley::MeshAdapter::getTag,args("name"),":return: tag id for "
302    "``name``\n:rtype: ``string``")
303          .def("isValidTagName",&dudley::MeshAdapter::isValidTagName,args("name"),
304    ":return: True is ``name`` corresponds to a tag\n:rtype: ``bool``")
305          .def("showTagNames",&dudley::MeshAdapter::showTagNames,":return: A space separated list of tag names\n:rtype: ``string``")
306          .def("getMPISize",&dudley::MeshAdapter::getMPISize,":return: the number of processes used for this `Domain`\n:rtype: ``int``")
307          .def("getMPIRank",&dudley::MeshAdapter::getMPIRank,":return: the rank of this process\n:rtype: ``int``")
308          .def("MPIBarrier",&dudley::MeshAdapter::MPIBarrier,"Wait until all processes have reached this point")
309          .def("onMasterProcessor",&dudley::MeshAdapter::onMasterProcessor,":return: True if this code is executing on the master process\n:rtype: `bool`");
310    
311      class_<dudley::SystemMatrixAdapter, bases<escript::AbstractSystemMatrix> >
312          ("OperatorAdapter","A concrete class representing an operator. For more details, please see the c++ documentation.", no_init)
313          .def("print_matrix_info",&dudley::SystemMatrixAdapter::Print_Matrix_Info,(arg("full")=false),"prints information about a system matrix")
314          .def("nullifyRowsAndCols",&dudley::SystemMatrixAdapter::nullifyRowsAndCols)
315          .def("resetValues",&dudley::SystemMatrixAdapter::resetValues, "resets the matrix entries")
316          .def("saveMM",&dudley::SystemMatrixAdapter::saveMM,args("fileName"),
317    "writes the matrix to a file using the Matrix Market file format")
318          .def("saveHB",&dudley::SystemMatrixAdapter::saveHB, args("filename"),
319    "writes the matrix to a file using the Harwell-Boeing file format");
320    
321      class_<dudley::TransportProblemAdapter, bases<escript::AbstractTransportProblem> >
322          ("TransportProblemAdapter","",no_init)
323          .def("getSafeTimeStepSize",&dudley::TransportProblemAdapter::getSafeTimeStepSize)
324          .def("getUnlimitedTimeStepSize",&dudley::TransportProblemAdapter::getUnlimitedTimeStepSize)
325          .def("resetTransport",&dudley::TransportProblemAdapter::resetTransport,
326    "resets the transport operator typically as they have been updated");
327  }  }

Legend:
Removed from v.155  
changed lines
  Added in v.3082

  ViewVC Help
Powered by ViewVC 1.1.26