/[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 1044 by gross, Mon Mar 19 07:29:31 2007 UTC revision 1360 by ksteube, Thu Dec 13 05:05:00 2007 UTC
# Line 1  Line 1 
1  // $Id$  
2  /*  /* $Id$ */
3   ******************************************************************************  
4   *                                                                            *  /*******************************************************
5   *       COPYRIGHT ACcESS 2004 -  All Rights Reserved                         *   *
6   *                                                                            *   *           Copyright 2003-2007 by ACceSS MNRF
7   * This software is the property of ACcESS.  No part of this code             *   *       Copyright 2007 by University of Queensland
8   * may be copied in any form or by any means without the expressed written    *   *
9   * consent of ACcESS.  Copying, use or modification of this software          *   *                http://esscc.uq.edu.au
10   * by any unauthorised person is illegal unless that                          *   *        Primary Business: Queensland, Australia
11   * person has a software license agreement with ACcESS.                       *   *  Licensed under the Open Software License version 3.0
12   *                                                                            *   *     http://www.opensource.org/licenses/osl-3.0.php
13   ******************************************************************************   *
14     *******************************************************/
 ******************************************************************************/  
15    
16  #ifdef PASO_MPI  #ifdef PASO_MPI
17  #include <mpi.h>  #include <mpi.h>
# Line 89  BOOST_PYTHON_MODULE(finleycpp) Line 88  BOOST_PYTHON_MODULE(finleycpp)
88    // NOTE: The return_value_policy is necessary for functions that    // NOTE: The return_value_policy is necessary for functions that
89    // return pointers.    // return pointers.
90    
91      def("LoadMesh",finley::loadMesh,
92          (arg("fileName")="file.nc"),
93          return_value_policy<manage_new_object>());
94    def("ReadMesh",finley::readMesh,    def("ReadMesh",finley::readMesh,
95        (arg("fileName"),arg("integrationOrder")=-1),        (arg("fileName")="file.fly",arg("integrationOrder")=-1,  arg("reducedIntegrationOrder")=-1,  arg("optimize")=true),
96          return_value_policy<manage_new_object>());
97      def("ReadMeshMPI",finley::readMeshMPI,
98          (arg("fileName")="file.fly",arg("integrationOrder")=-1,  arg("reducedIntegrationOrder")=-1,  arg("optimize")=true),
99        return_value_policy<manage_new_object>());        return_value_policy<manage_new_object>());
100    
101    def("ReadGmsh",finley::readGmsh,    def("ReadGmsh",finley::readGmsh,
102        (arg("fileName"),arg("numDim"), arg("integrationOrder")=-1, arg("reducedIntegrationOrder")=-1, arg("optimizeLabeling")=true),        (arg("fileName")="file.msh",arg("numDim"), arg("integrationOrder")=-1, arg("reducedIntegrationOrder")=-1, arg("optimize")=true),
103        return_value_policy<manage_new_object>());        return_value_policy<manage_new_object>());
104    
105    def ("Brick",finley::brick,    def ("Brick",finley::brick,
# Line 102  BOOST_PYTHON_MODULE(finleycpp) Line 107  BOOST_PYTHON_MODULE(finleycpp)
107        arg("order")=1,        arg("order")=1,
108        arg("l0")=1.0,arg("l1")=1.0,arg("l2")=1.0,        arg("l0")=1.0,arg("l1")=1.0,arg("l2")=1.0,
109        arg("periodic0")=false,arg("periodic1")=false,arg("periodic2")=false,        arg("periodic0")=false,arg("periodic1")=false,arg("periodic2")=false,
110        arg("integrationOrder")=-1,        arg("integrationOrder")=-1,  arg("reducedIntegrationOrder")=-1,
111        arg("useElementsOnFace")=false),        arg("useElementsOnFace")=false,
112          arg("useFullElementOrder")=false,
113          arg("optimize")=false),
114        return_value_policy<manage_new_object>());        return_value_policy<manage_new_object>());
115    
116    def ("Rectangle",finley::rectangle,    def ("Rectangle",finley::rectangle,
117        (arg("n0")=1,arg("n1")=1,arg("order")=1,        (arg("n0")=1,arg("n1")=1,arg("order")=1,
118        arg("l0")=1.0,arg("l1")=1.0,        arg("l0")=1.0,arg("l1")=1.0,
119        arg("periodic0")=false,arg("periodic1")=false,        arg("periodic0")=false,arg("periodic1")=false,
120        arg("integrationOrder")=-1,        arg("integrationOrder")=-1,  arg("reducedIntegrationOrder")=-1,
121        arg("useElementsOnFace")=false),        arg("useElementsOnFace")=false,
122        return_value_policy<manage_new_object>());        arg("useFullElementOrder")=false,
123          arg("optimize")=false),
   def("Interval",finley::interval,  
       (arg("n1")=1,arg("order")=1,  
       arg("l1")=1.0,arg("periodic0")=false,  
       arg("integrationOrder")=-1,  
       arg("useElementsOnFace")=false),  
124        return_value_policy<manage_new_object>());        return_value_policy<manage_new_object>());
125    
126    def("Merge",finley::meshMerge,    def("Merge",finley::meshMerge,
# Line 126  BOOST_PYTHON_MODULE(finleycpp) Line 128  BOOST_PYTHON_MODULE(finleycpp)
128    
129    def("GlueFaces",finley::glueFaces,    def("GlueFaces",finley::glueFaces,
130        (arg("safetyFactor")=0.2,        (arg("safetyFactor")=0.2,
131        arg("tolerance")=1.e-8),        arg("tolerance")=1.e-8,
132          arg("optimize")=true),
133        return_value_policy<manage_new_object>());        return_value_policy<manage_new_object>());
134    
135    def("JoinFaces",finley::joinFaces,    def("JoinFaces",finley::joinFaces,
136        (arg("safetyFactor")=0.2,        (arg("safetyFactor")=0.2,
137        arg("tolerance")=1.e-8),        arg("tolerance")=1.e-8,
138          arg("optimize")=true),
139        return_value_policy<manage_new_object>());        return_value_policy<manage_new_object>());
140    
141    register_exception_translator<finley::FinleyAdapterException>(&(esysUtils::esysExceptionTranslator));    register_exception_translator<finley::FinleyAdapterException>(&(esysUtils::esysExceptionTranslator));
# Line 140  BOOST_PYTHON_MODULE(finleycpp) Line 144  BOOST_PYTHON_MODULE(finleycpp)
144        ("MeshAdapter",init<optional <Finley_Mesh*> >())        ("MeshAdapter",init<optional <Finley_Mesh*> >())
145        .def(init<const finley::MeshAdapter&>())        .def(init<const finley::MeshAdapter&>())
146        .def("write",&finley::MeshAdapter::write)        .def("write",&finley::MeshAdapter::write)
147          .def("print_mesh_info",&finley::MeshAdapter::Print_Mesh_Info,(arg("full")=false))
148          .def("dump",&finley::MeshAdapter::dump)
149        .def("getDescription",&finley::MeshAdapter::getDescription)        .def("getDescription",&finley::MeshAdapter::getDescription)
150        .def("getDim",&finley::MeshAdapter::getDim)        .def("getDim",&finley::MeshAdapter::getDim)
151        .def("getDataShape",&finley::MeshAdapter::getDataShape)        .def("getDataShape",&finley::MeshAdapter::getDataShape)
152        .def("addPDEToSystem",&finley::MeshAdapter::addPDEToSystem)        .def("addPDEToSystem",&finley::MeshAdapter::addPDEToSystem)
153          .def("addPDEToLumpedSystem",&finley::MeshAdapter::addPDEToLumpedSystem)
154        .def("addPDEToRHS",&finley::MeshAdapter::addPDEToRHS)        .def("addPDEToRHS",&finley::MeshAdapter::addPDEToRHS)
155        .def("newOperator",&finley::MeshAdapter::newSystemMatrix)        .def("newOperator",&finley::MeshAdapter::newSystemMatrix)
156        .def("getSystemMatrixTypeId",&finley::MeshAdapter::getSystemMatrixTypeId)        .def("getSystemMatrixTypeId",&finley::MeshAdapter::getSystemMatrixTypeId)
# Line 156  BOOST_PYTHON_MODULE(finleycpp) Line 163  BOOST_PYTHON_MODULE(finleycpp)
163        .def("setTagMap",&finley::MeshAdapter::setTagMap)        .def("setTagMap",&finley::MeshAdapter::setTagMap)
164        .def("getTag",&finley::MeshAdapter::getTag)        .def("getTag",&finley::MeshAdapter::getTag)
165        .def("isValidTagName",&finley::MeshAdapter::isValidTagName)        .def("isValidTagName",&finley::MeshAdapter::isValidTagName)
166        .def("showTagNames",&finley::MeshAdapter::showTagNames);        .def("showTagNames",&finley::MeshAdapter::showTagNames)
167          .def("getMPISize",&finley::MeshAdapter::getMPISize)
168          .def("getMPIRank",&finley::MeshAdapter::getMPIRank);
169    
170    class_<finley::SystemMatrixAdapter, bases<escript::AbstractSystemMatrix> >    class_<finley::SystemMatrixAdapter, bases<escript::AbstractSystemMatrix> >
171        ("OperatorAdapter",no_init)        ("OperatorAdapter",no_init)
172          .def("print_matrix_info",&finley::SystemMatrixAdapter::Print_Matrix_Info,(arg("full")=false))
173        .def("nullifyRowsAndCols",&finley::SystemMatrixAdapter::nullifyRowsAndCols)        .def("nullifyRowsAndCols",&finley::SystemMatrixAdapter::nullifyRowsAndCols)
174        .def("resetValues",&finley::SystemMatrixAdapter::resetValues)        .def("resetValues",&finley::SystemMatrixAdapter::resetValues)
175        .def("saveMM",&finley::SystemMatrixAdapter::saveMM)        .def("saveMM",&finley::SystemMatrixAdapter::saveMM)

Legend:
Removed from v.1044  
changed lines
  Added in v.1360

  ViewVC Help
Powered by ViewVC 1.1.26