/[escript]/branches/refine/buckley/src/buckleycpp.cpp
ViewVC logotype

Diff of /branches/refine/buckley/src/buckleycpp.cpp

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

branches/refine/refine/src/refinecpp.cpp revision 3658 by jfenwick, Fri Nov 11 06:55:48 2011 UTC branches/refine/buckley/src/buckleycpp.cpp revision 3668 by jfenwick, Wed Nov 16 01:49:46 2011 UTC
# Line 35  Line 35 
35  using namespace boost::python;  using namespace boost::python;
36    
37  /**  /**
38     \page refine     \page buckley
39    
40     \version 1.0.0     \version 1.0.0
41    
# Line 53  using namespace boost::python; Line 53  using namespace boost::python;
53    
54  */  */
55    
56  BOOST_PYTHON_MODULE(refinecpp)  BOOST_PYTHON_MODULE(buckleycpp)
57  {  {
58  // This feature was added in boost v1.34  // This feature was added in boost v1.34
59  #if ((BOOST_VERSION/100)%1000 > 34) || (BOOST_VERSION/100000 >1)  #if ((BOOST_VERSION/100)%1000 > 34) || (BOOST_VERSION/100000 >1)
# Line 65  BOOST_PYTHON_MODULE(refinecpp) Line 65  BOOST_PYTHON_MODULE(refinecpp)
65    // NOTE: The return_value_policy is necessary for functions that    // NOTE: The return_value_policy is necessary for functions that
66    // return pointers.    // return pointers.
67    //    //
68    register_exception_translator<refine::RDomainException>(&(esysUtils::esysExceptionTranslator));    register_exception_translator<buckley::RDomainException>(&(esysUtils::esysExceptionTranslator));
69    
70  //   def("LoadMesh",refine::loadMesh,  //   def("LoadMesh",buckley::loadMesh,
71  //       (arg("fileName")="file.nc"),":rtype: `Domain`"  //       (arg("fileName")="file.nc"),":rtype: `Domain`"
72  //       );  //       );
73  //  //
74  //   def("ReadMesh",refine::readMesh,  //   def("ReadMesh",buckley::readMesh,
75  //       (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)
76  //  ,"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"
77  // ":rtype: `Domain`\n:param fileName:\n:type fileName: ``string``\n"  // ":rtype: `Domain`\n:param fileName:\n:type fileName: ``string``\n"
# Line 82  BOOST_PYTHON_MODULE(refinecpp) Line 82  BOOST_PYTHON_MODULE(refinecpp)
82    
83    
84    
85  //   def ("Brick",refine::brick,  //   def ("Brick",buckley::brick,
86  //       (arg("n0")=1,arg("n1")=1,arg("n2")=1,  //       (arg("n0")=1,arg("n1")=1,arg("n2")=1,
87  //       arg("order")=1,  //       arg("order")=1,
88  //       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 106  BOOST_PYTHON_MODULE(refinecpp) Line 106  BOOST_PYTHON_MODULE(refinecpp)
106  // );  // );
107    
108    
109    class_<refine::RDomain, bases<escript::AbstractContinuousDomain> >    class_<buckley::RDomain, bases<escript::AbstractContinuousDomain> >
110        ("RDomain","A concrete class representing a domain. For more details, please consult the c++ documentation.",init<double, double, double>())        ("RDomain","A concrete class representing a domain. For more details, please consult the c++ documentation.",init<double, double, double>())
111        .def(init<const refine::RDomain&>())        .def(init<const buckley::RDomain&>())
112        .def("write",&refine::RDomain::write,args("filename"),        .def("write",&buckley::RDomain::write,args("filename"),
113  "Write the current mesh to a file with the given name.")  "Write the current mesh to a file with the given name.")
114        .def("print_mesh_info",&refine::RDomain::Print_Mesh_Info,(arg("full")=false),        .def("print_mesh_info",&buckley::RDomain::Print_Mesh_Info,(arg("full")=false),
115  ":param full:\n:type full: ``bool``")  ":param full:\n:type full: ``bool``")
116        .def("dump",&refine::RDomain::dump,args("fileName")        .def("dump",&buckley::RDomain::dump,args("fileName")
117  ,"dumps the mesh to a file with the given name.")  ,"dumps the mesh to a file with the given name.")
118        .def("getDescription",&refine::RDomain::getDescription,        .def("getDescription",&buckley::RDomain::getDescription,
119  ":return: a description for this domain\n:rtype: ``string``")  ":return: a description for this domain\n:rtype: ``string``")
120        .def("getDim",&refine::RDomain::getDim,":rtype: ``int``")        .def("getDim",&buckley::RDomain::getDim,":rtype: ``int``")
121        .def("getDataShape",&refine::RDomain::getDataShape, args("functionSpaceCode"),        .def("getDataShape",&buckley::RDomain::getDataShape, args("functionSpaceCode"),
122  ":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``")
123        .def("getNumDataPointsGlobal",&refine::RDomain::getNumDataPointsGlobal,        .def("getNumDataPointsGlobal",&buckley::RDomain::getNumDataPointsGlobal,
124  ":return: the number of data points summed across all MPI processes\n"  ":return: the number of data points summed across all MPI processes\n"
125  ":rtype: ``int``")  ":rtype: ``int``")
126        .def("addPDEToSystem",&refine::RDomain::addPDEToSystem,        .def("addPDEToSystem",&buckley::RDomain::addPDEToSystem,
127  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"),
128  "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"
129  ":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 138  args("mat", "rhs","A", "B", "C", "D", "X Line 138  args("mat", "rhs","A", "B", "C", "D", "X
138  ":param y_contact:\n:type y_contact: `Data`\n"  ":param y_contact:\n:type y_contact: `Data`\n"
139  )  )
140    
141        .def("addPDEToRHS",&refine::RDomain::addPDEToRHS,        .def("addPDEToRHS",&buckley::RDomain::addPDEToRHS,
142  args("rhs", "X", "Y", "y", "y_contact"),  args("rhs", "X", "Y", "y", "y_contact"),
143  "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"
144  ":param rhs:\n:type rhs: `Data`\n"  ":param rhs:\n:type rhs: `Data`\n"
# Line 147  args("rhs", "X", "Y", "y", "y_contact"), Line 147  args("rhs", "X", "Y", "y", "y_contact"),
147  ":param y:\n:type y: `Data`\n"  ":param y:\n:type y: `Data`\n"
148  ":param y_contact:\n:type y_contact: `Data`"  ":param y_contact:\n:type y_contact: `Data`"
149  )  )
150        .def("addPDEToTransportProblem",&refine::RDomain::addPDEToTransportProblem,        .def("addPDEToTransportProblem",&buckley::RDomain::addPDEToTransportProblem,
151  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"),
152  ":param tp:\n:type tp: `TransportProblemAdapter`\n"  ":param tp:\n:type tp: `TransportProblemAdapter`\n"
153  ":param source:\n:type source: `Data`\n"  ":param source:\n:type source: `Data`\n"
# Line 163  args( "tp", "source", "M", "A", "B", "C" Line 163  args( "tp", "source", "M", "A", "B", "C"
163  ":param d_contact:\n:type d_contact: `Data`\n"  ":param d_contact:\n:type d_contact: `Data`\n"
164  ":param y_contact:\n:type y_contact: `Data`\n"  ":param y_contact:\n:type y_contact: `Data`\n"
165  )  )
166        .def("newOperator",&refine::RDomain::newSystemMatrix,        .def("newOperator",&buckley::RDomain::newSystemMatrix,
167  args("row_blocksize", "row_functionspace", "column_blocksize", "column_functionspace", "type"),  args("row_blocksize", "row_functionspace", "column_blocksize", "column_functionspace", "type"),
168  "creates a SystemMatrixAdapter stiffness matrix and initializes it with zeros\n\n"  "creates a SystemMatrixAdapter stiffness matrix and initializes it with zeros\n\n"
169  ":param row_blocksize:\n:type row_blocksize: ``int``\n"  ":param row_blocksize:\n:type row_blocksize: ``int``\n"
# Line 172  args("row_blocksize", "row_functionspace Line 172  args("row_blocksize", "row_functionspace
172  ":param column_functionspace:\n:type column_functionspace: `FunctionSpace`\n"  ":param column_functionspace:\n:type column_functionspace: `FunctionSpace`\n"
173  ":param type:\n:type type: ``int``\n"  ":param type:\n:type type: ``int``\n"
174  )  )
175        .def("newTransportProblem",&refine::RDomain::newTransportProblem,        .def("newTransportProblem",&buckley::RDomain::newTransportProblem,
176  args("theta", "blocksize", "functionspace", "type"),  args("theta", "blocksize", "functionspace", "type"),
177  "creates a TransportProblemAdapter\n\n"  "creates a TransportProblemAdapter\n\n"
178  ":param theta:\n:type theta: ``float``\n"  ":param theta:\n:type theta: ``float``\n"
# Line 180  args("theta", "blocksize", "functionspac Line 180  args("theta", "blocksize", "functionspac
180  ":param functionspace:\n:type functionspace: `FunctionSpace`\n"  ":param functionspace:\n:type functionspace: `FunctionSpace`\n"
181  ":param type:\n:type type: ``int``\n"  ":param type:\n:type type: ``int``\n"
182  )  )
183        .def("getSystemMatrixTypeId",&refine::RDomain::getSystemMatrixTypeId,        .def("getSystemMatrixTypeId",&buckley::RDomain::getSystemMatrixTypeId,
184  args("solver", "preconditioner", "package", "symmetry"),  args("solver", "preconditioner", "package", "symmetry"),
185  ":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"
186  ":rtype: ``int``\n"  ":rtype: ``int``\n"
# Line 189  args("solver", "preconditioner", "packag Line 189  args("solver", "preconditioner", "packag
189  ":param package:\n:type package: ``int``\n"  ":param package:\n:type package: ``int``\n"
190  ":param symmetry:\n:type symmetry: ``int``\n"  ":param symmetry:\n:type symmetry: ``int``\n"
191  )  )
192        .def("getTransportTypeId",&refine::RDomain::getTransportTypeId,        .def("getTransportTypeId",&buckley::RDomain::getTransportTypeId,
193  args("solver", "preconditioner", "package", "symmetry"),  args("solver", "preconditioner", "package", "symmetry"),
194  ":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"
195  ":rtype: ``int``\n"  ":rtype: ``int``\n"
# Line 198  args("solver", "preconditioner", "packag Line 198  args("solver", "preconditioner", "packag
198  ":param package:\n:type package: ``int``\n"  ":param package:\n:type package: ``int``\n"
199  ":param symmetry:\n:type symmetry: ``int``\n"  ":param symmetry:\n:type symmetry: ``int``\n"
200  )  )
201        .def("setX",&refine::RDomain::setNewX,        .def("setX",&buckley::RDomain::setNewX,
202  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`")
203        .def("getX",&refine::RDomain::getX, ":return: locations in the FEM nodes\n\n"        .def("getX",&buckley::RDomain::getX, ":return: locations in the FEM nodes\n\n"
204  ":rtype: `Data`")  ":rtype: `Data`")
205        .def("getNormal",&refine::RDomain::getNormal,        .def("getNormal",&buckley::RDomain::getNormal,
206  ":return: boundary normals at the quadrature point on the face elements\n"  ":return: boundary normals at the quadrature point on the face elements\n"
207  ":rtype: `Data`")  ":rtype: `Data`")
208        .def("getSize",&refine::RDomain::getSize,":return: the element size\n"        .def("getSize",&buckley::RDomain::getSize,":return: the element size\n"
209  ":rtype: `Data`")  ":rtype: `Data`")
210        .def("saveDX",&refine::RDomain::saveDX,args("filename" ,"arg"),        .def("saveDX",&buckley::RDomain::saveDX,args("filename" ,"arg"),
211  "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"
212  "\n\n:param filename: \n:type filename: ``string``\n"  "\n\n:param filename: \n:type filename: ``string``\n"
213  "\n:param arg: \n:type arg: ``dict``\n")  "\n:param arg: \n:type arg: ``dict``\n")
214        .def("saveVTK",&refine::RDomain::saveVTK,        .def("saveVTK",&buckley::RDomain::saveVTK,
215  args("filename" ,"arg",  "metadata", "metadata_schema"),  args("filename" ,"arg",  "metadata", "metadata_schema"),
216  "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"
217  "\n\n:param filename:\n:type filename: ``string``\n"  "\n\n:param filename:\n:type filename: ``string``\n"
# Line 219  args("filename" ,"arg",  "metadata", "me Line 219  args("filename" ,"arg",  "metadata", "me
219  ":param metadata:\n:type metadata: ``string``\n"  ":param metadata:\n:type metadata: ``string``\n"
220  ":param metadata_schema:\n:type metadata_schema: ``string``\n"  ":param metadata_schema:\n:type metadata_schema: ``string``\n"
221  )  )
222        .def("setTagMap",&refine::RDomain::setTagMap,args("name","tag"),        .def("setTagMap",&buckley::RDomain::setTagMap,args("name","tag"),
223  "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"
224  ":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")
225        .def("getTag",&refine::RDomain::getTag,args("name"),":return: tag id for "        .def("getTag",&buckley::RDomain::getTag,args("name"),":return: tag id for "
226  "``name``\n:rtype: ``string``")  "``name``\n:rtype: ``string``")
227        .def("isValidTagName",&refine::RDomain::isValidTagName,args("name"),        .def("isValidTagName",&buckley::RDomain::isValidTagName,args("name"),
228  ":return: True is ``name`` corresponds to a tag\n:rtype: ``bool``")  ":return: True is ``name`` corresponds to a tag\n:rtype: ``bool``")
229        .def("showTagNames",&refine::RDomain::showTagNames,":return: A space separated list of tag names\n:rtype: ``string``")        .def("showTagNames",&buckley::RDomain::showTagNames,":return: A space separated list of tag names\n:rtype: ``string``")
230        .def("getMPISize",&refine::RDomain::getMPISize,":return: the number of processes used for this `Domain`\n:rtype: ``int``")        .def("getMPISize",&buckley::RDomain::getMPISize,":return: the number of processes used for this `Domain`\n:rtype: ``int``")
231        .def("getMPIRank",&refine::RDomain::getMPIRank,":return: the rank of this process\n:rtype: ``int``")        .def("getMPIRank",&buckley::RDomain::getMPIRank,":return: the rank of this process\n:rtype: ``int``")
232        .def("MPIBarrier",&refine::RDomain::MPIBarrier,"Wait until all processes have reached this point")        .def("MPIBarrier",&buckley::RDomain::MPIBarrier,"Wait until all processes have reached this point")
233        .def("onMasterProcessor",&refine::RDomain::onMasterProcessor,":return: True if this code is executing on the master process\n:rtype: `bool`");        .def("onMasterProcessor",&buckley::RDomain::onMasterProcessor,":return: True if this code is executing on the master process\n:rtype: `bool`");
234    
235  }  }

Legend:
Removed from v.3658  
changed lines
  Added in v.3668

  ViewVC Help
Powered by ViewVC 1.1.26