/[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

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 472 by jgs, Fri Jan 27 01:50:59 2006 UTC
# Line 13  Line 13 
13   ******************************************************************************   ******************************************************************************
14  */  */
15    
16  extern "C" {  #include "MeshAdapterFactory.h"
 #include "finley/finleyC/Finley.h"  
 #include "finley/finleyC/Mesh.h"  
 #include "finley/finleyC/RectangularMesh.h"  
 }  
 #include "finley/CPPAdapter/FinleyError.h"  
 #include "finley/CPPAdapter/MeshAdapterFactory.h"  
   
   
   
 #include <iostream>  
 #include <sstream>  
17    
18  using namespace std;  using namespace std;
19  using namespace escript;  using namespace escript;
# Line 138  namespace finley { Line 127  namespace finley {
127      AbstractContinuousDomain* temp=new MeshAdapter(fMesh);      AbstractContinuousDomain* temp=new MeshAdapter(fMesh);
128      return temp;      return temp;
129    }    }
130    AbstractContinuousDomain*  meshMerge(const boost::python::list& meshList)    AbstractContinuousDomain* meshMerge(const boost::python::list& meshList)
131    {    {
132      AbstractContinuousDomain* temp=new MeshAdapter(0);      Finley_Mesh* fMesh=0;
133        //
134        // extract the meshes from meshList
135        int numMsh=boost::python::extract<int>(meshList.attr("__len__")());
136        Finley_Mesh* mshes[numMsh];
137        for (int i=0;i<numMsh;++i) {
138             AbstractContinuousDomain& meshListMember=boost::python::extract<AbstractContinuousDomain&>(meshList[i]);
139             const MeshAdapter* finley_meshListMember=static_cast<const MeshAdapter*>(&meshListMember);
140             mshes[i]=finley_meshListMember->getFinley_Mesh();
141        }
142        //
143        // merge the meshes:
144        fMesh=Finley_Mesh_merge(numMsh,mshes);
145        //
146        // Convert any finley errors into a C++ exception
147        checkFinleyError();
148        AbstractContinuousDomain* temp=new MeshAdapter(fMesh);
149      return temp;      return temp;
150    }    }
151    AbstractContinuousDomain*  glueFaces(const boost::python::list& meshList,    AbstractContinuousDomain*  glueFaces(const boost::python::list& meshList,
152              double safetyFactor,              double safety_factor,
153              double tolerance)              double tolerance)
154    {    {
155      AbstractContinuousDomain* temp=new MeshAdapter(0);      Finley_Mesh* fMesh=0;
156      return temp;      //
157        // merge the meshes:
158        AbstractContinuousDomain* merged_meshes=meshMerge(meshList);
159        //
160        // glue the faces:
161        const MeshAdapter* merged_finley_meshes=static_cast<const MeshAdapter*>(merged_meshes);
162        fMesh=merged_finley_meshes->getFinley_Mesh();
163        Finley_Mesh_glueFaces(fMesh,safety_factor,tolerance);
164        //
165        // Convert any finley errors into a C++ exception
166        checkFinleyError();
167        return merged_meshes;
168    }    }
169    AbstractContinuousDomain*  joinFaces(const boost::python::list& meshList,    AbstractContinuousDomain*  joinFaces(const boost::python::list& meshList,
170              double safety_factor,              double safety_factor,
171              double tolerance)              double tolerance)
172    {    {
173      AbstractContinuousDomain* temp=new MeshAdapter(0);      Finley_Mesh* fMesh=0;
174      return temp;      //
175        // merge the meshes:
176        AbstractContinuousDomain* merged_meshes=meshMerge(meshList);
177        //
178        // join the faces:
179        const MeshAdapter* merged_finley_meshes=static_cast<const MeshAdapter*>(merged_meshes);
180        fMesh=merged_finley_meshes->getFinley_Mesh();
181        Finley_Mesh_joinFaces(fMesh,safety_factor,tolerance);
182        //
183        // Convert any finley errors into a C++ exception
184        checkFinleyError();
185        return merged_meshes;
186    }    }
187    
188  }  // end of namespace  }  // end of namespace

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

  ViewVC Help
Powered by ViewVC 1.1.26