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

Diff of /trunk/finley/src/CPPAdapter/MeshAdapterFactory.cpp

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

revision 102 by jgs, Wed Dec 15 07:08:39 2004 UTC revision 110 by jgs, Mon Feb 14 04:14:42 2005 UTC
# Line 21  extern "C" { Line 21  extern "C" {
21  #include "finley/CPPAdapter/FinleyError.h"  #include "finley/CPPAdapter/FinleyError.h"
22  #include "finley/CPPAdapter/MeshAdapterFactory.h"  #include "finley/CPPAdapter/MeshAdapterFactory.h"
23    
   
   
24  #include <iostream>  #include <iostream>
25  #include <sstream>  #include <sstream>
26    #include <boost/python/extract.hpp>
27    
28  using namespace std;  using namespace std;
29  using namespace escript;  using namespace escript;
# Line 138  namespace finley { Line 137  namespace finley {
137      AbstractContinuousDomain* temp=new MeshAdapter(fMesh);      AbstractContinuousDomain* temp=new MeshAdapter(fMesh);
138      return temp;      return temp;
139    }    }
140    AbstractContinuousDomain*  meshMerge(const boost::python::list& meshList)    AbstractContinuousDomain* meshMerge(const boost::python::list& meshList)
141    {    {
142      AbstractContinuousDomain* temp=new MeshAdapter(0);      Finley_Mesh* fMesh=0;
143        //
144        // extract the meshes from meshList
145        int numMsh=boost::python::extract<int>(meshList.attr("__len__")());
146        Finley_Mesh* mshes[numMsh];
147        for (int i=0;i<numMsh;++i) {
148             AbstractContinuousDomain& meshListMember=boost::python::extract<AbstractContinuousDomain&>(meshList[i]);
149             const MeshAdapter* finley_meshListMember=static_cast<const MeshAdapter*>(&meshListMember);
150             mshes[i]=finley_meshListMember->getFinley_Mesh();
151        }
152        //
153        // merge the meshes:
154        fMesh=Finley_Mesh_merge(numMsh,mshes);
155        //
156        // Convert any finley errors into a C++ exception
157        checkFinleyError();
158        AbstractContinuousDomain* temp=new MeshAdapter(fMesh);
159      return temp;      return temp;
160    }    }
161    AbstractContinuousDomain*  glueFaces(const boost::python::list& meshList,    AbstractContinuousDomain*  glueFaces(const boost::python::list& meshList,
162              double safetyFactor,              double safety_factor,
163              double tolerance)              double tolerance)
164    {    {
165      AbstractContinuousDomain* temp=new MeshAdapter(0);      Finley_Mesh* fMesh=0;
166      return temp;      //
167        // merge the meshes:
168        AbstractContinuousDomain* merged_meshes=meshMerge(meshList);
169        //
170        // glue the faces:
171        const MeshAdapter* merged_finley_meshes=static_cast<const MeshAdapter*>(merged_meshes);
172        fMesh=merged_finley_meshes->getFinley_Mesh();
173        Finley_Mesh_glueFaces(fMesh,safety_factor,tolerance);
174        //
175        // Convert any finley errors into a C++ exception
176        checkFinleyError();
177        return merged_meshes;
178    }    }
179    AbstractContinuousDomain*  joinFaces(const boost::python::list& meshList,    AbstractContinuousDomain*  joinFaces(const boost::python::list& meshList,
180              double safety_factor,              double safety_factor,
181              double tolerance)              double tolerance)
182    {    {
183      AbstractContinuousDomain* temp=new MeshAdapter(0);      Finley_Mesh* fMesh=0;
184      return temp;      //
185        // merge the meshes:
186        AbstractContinuousDomain* merged_meshes=meshMerge(meshList);
187        //
188        // join the faces:
189        const MeshAdapter* merged_finley_meshes=static_cast<const MeshAdapter*>(merged_meshes);
190        fMesh=merged_finley_meshes->getFinley_Mesh();
191        Finley_Mesh_joinFaces(fMesh,safety_factor,tolerance);
192        //
193        // Convert any finley errors into a C++ exception
194        checkFinleyError();
195        return merged_meshes;
196    }    }
197    
198  }  // end of namespace  }  // end of namespace

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

  ViewVC Help
Powered by ViewVC 1.1.26