/[escript]/branches/more_shared_ptrs_from_1812/finley/src/CPPAdapter/MeshAdapterFactory.cpp
ViewVC logotype

Diff of /branches/more_shared_ptrs_from_1812/finley/src/CPPAdapter/MeshAdapterFactory.cpp

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

trunk/esys2/finley/src/CPPAdapter/MeshAdapterFactory.cpp revision 102 by jgs, Wed Dec 15 07:08:39 2004 UTC trunk/finley/src/CPPAdapter/MeshAdapterFactory.cpp revision 480 by jgs, Wed Feb 1 05:15:12 2006 UTC
# Line 13  Line 13 
13   ******************************************************************************   ******************************************************************************
14  */  */
15    
16  extern "C" {  #include "MeshAdapterFactory.h"
17  #include "finley/finleyC/Finley.h"  #include "FinleyError.h"
 #include "finley/finleyC/Mesh.h"  
 #include "finley/finleyC/RectangularMesh.h"  
 }  
 #include "finley/CPPAdapter/FinleyError.h"  
 #include "finley/CPPAdapter/MeshAdapterFactory.h"  
18    
19    #include <boost/python/extract.hpp>
20    
   
 #include <iostream>  
21  #include <sstream>  #include <sstream>
22    
23  using namespace std;  using namespace std;
# Line 138  namespace finley { Line 132  namespace finley {
132      AbstractContinuousDomain* temp=new MeshAdapter(fMesh);      AbstractContinuousDomain* temp=new MeshAdapter(fMesh);
133      return temp;      return temp;
134    }    }
135    AbstractContinuousDomain*  meshMerge(const boost::python::list& meshList)    AbstractContinuousDomain* meshMerge(const boost::python::list& meshList)
136    {    {
137      AbstractContinuousDomain* temp=new MeshAdapter(0);      Finley_Mesh* fMesh=0;
138        //
139        // extract the meshes from meshList
140        int numMsh=boost::python::extract<int>(meshList.attr("__len__")());
141        Finley_Mesh* mshes[numMsh];
142        for (int i=0;i<numMsh;++i) {
143             AbstractContinuousDomain& meshListMember=boost::python::extract<AbstractContinuousDomain&>(meshList[i]);
144             const MeshAdapter* finley_meshListMember=static_cast<const MeshAdapter*>(&meshListMember);
145             mshes[i]=finley_meshListMember->getFinley_Mesh();
146        }
147        //
148        // merge the meshes:
149        fMesh=Finley_Mesh_merge(numMsh,mshes);
150        //
151        // Convert any finley errors into a C++ exception
152        checkFinleyError();
153        AbstractContinuousDomain* temp=new MeshAdapter(fMesh);
154      return temp;      return temp;
155    }    }
156    AbstractContinuousDomain*  glueFaces(const boost::python::list& meshList,    AbstractContinuousDomain*  glueFaces(const boost::python::list& meshList,
157              double safetyFactor,              double safety_factor,
158              double tolerance)              double tolerance)
159    {    {
160      AbstractContinuousDomain* temp=new MeshAdapter(0);      Finley_Mesh* fMesh=0;
161      return temp;      //
162        // merge the meshes:
163        AbstractContinuousDomain* merged_meshes=meshMerge(meshList);
164        //
165        // glue the faces:
166        const MeshAdapter* merged_finley_meshes=static_cast<const MeshAdapter*>(merged_meshes);
167        fMesh=merged_finley_meshes->getFinley_Mesh();
168        Finley_Mesh_glueFaces(fMesh,safety_factor,tolerance);
169        //
170        // Convert any finley errors into a C++ exception
171        checkFinleyError();
172        return merged_meshes;
173    }    }
174    AbstractContinuousDomain*  joinFaces(const boost::python::list& meshList,    AbstractContinuousDomain*  joinFaces(const boost::python::list& meshList,
175              double safety_factor,              double safety_factor,
176              double tolerance)              double tolerance)
177    {    {
178      AbstractContinuousDomain* temp=new MeshAdapter(0);      Finley_Mesh* fMesh=0;
179      return temp;      //
180        // merge the meshes:
181        AbstractContinuousDomain* merged_meshes=meshMerge(meshList);
182        //
183        // join the faces:
184        const MeshAdapter* merged_finley_meshes=static_cast<const MeshAdapter*>(merged_meshes);
185        fMesh=merged_finley_meshes->getFinley_Mesh();
186        Finley_Mesh_joinFaces(fMesh,safety_factor,tolerance);
187        //
188        // Convert any finley errors into a C++ exception
189        checkFinleyError();
190        return merged_meshes;
191    }    }
192    
193  }  // end of namespace  }  // end of namespace

Legend:
Removed from v.102  
changed lines
  Added in v.480

  ViewVC Help
Powered by ViewVC 1.1.26