/[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 1871 by ksteube, Thu Sep 25 23:11:13 2008 UTC revision 1872 by jfenwick, Mon Oct 13 00:18:55 2008 UTC
# Line 48  namespace finley { Line 48  namespace finley {
48    }    }
49  #endif  #endif
50    
51    AbstractContinuousDomain* loadMesh(const std::string& fileName)  //   AbstractContinuousDomain* loadMesh(const std::string& fileName)
52      Domain_ptr loadMesh(const std::string& fileName)
53    {    {
54  #ifdef USE_NETCDF  #ifdef USE_NETCDF
55      bool optimize=FALSE; // Don't optimize since this would cause problems with Data().dump()      bool optimize=FALSE; // Don't optimize since this would cause problems with Data().dump()
# Line 465  namespace finley { Line 466  namespace finley {
466      TMPMEMFREE(fName);      TMPMEMFREE(fName);
467    
468      blocktimer_increment("LoadMesh()", blocktimer_start);      blocktimer_increment("LoadMesh()", blocktimer_start);
469      return temp;      return temp->getPtr();
470  #else  #else
471      throw DataException("Error - loadMesh: is not compiled with NetCFD. Please contact your installation manager.");      throw DataException("Error - loadMesh: is not compiled with NetCFD. Please contact your installation manager.");
472  #endif /* USE_NETCDF */  #endif /* USE_NETCDF */
473    }    }
474    
475    AbstractContinuousDomain* readMesh(const std::string& fileName,    Domain_ptr readMesh(const std::string& fileName,
476                       int integrationOrder,                       int integrationOrder,
477                                       int reducedIntegrationOrder,                                       int reducedIntegrationOrder,
478                                       int optimize)                                       int optimize)
# Line 499  namespace finley { Line 500  namespace finley {
500      TMPMEMFREE(fName);      TMPMEMFREE(fName);
501            
502      blocktimer_increment("ReadMesh()", blocktimer_start);      blocktimer_increment("ReadMesh()", blocktimer_start);
503      return temp;      return temp->getPtr();
504    }    }
505    
506    AbstractContinuousDomain* readGmsh(const std::string& fileName,    Domain_ptr readGmsh(const std::string& fileName,
507                                       int numDim,                                       int numDim,
508                                       int integrationOrder,                                       int integrationOrder,
509                                       int reducedIntegrationOrder,                                       int reducedIntegrationOrder,
# Line 531  namespace finley { Line 532  namespace finley {
532      TMPMEMFREE(fName);      TMPMEMFREE(fName);
533            
534      blocktimer_increment("ReadGmsh()", blocktimer_start);      blocktimer_increment("ReadGmsh()", blocktimer_start);
535      return temp;      return temp->getPtr();
536    }    }
537    
538    AbstractContinuousDomain* brick(int n0,int n1,int n2,int order,  /*  AbstractContinuousDomain* brick(int n0,int n1,int n2,int order,*/
539      Domain_ptr brick(int n0,int n1,int n2,int order,
540              double l0,double l1,double l2,              double l0,double l1,double l2,
541              int periodic0,int periodic1,              int periodic0,int periodic1,
542              int periodic2,              int periodic2,
# Line 568  namespace finley { Line 570  namespace finley {
570      // Convert any finley errors into a C++ exception      // Convert any finley errors into a C++ exception
571      checkFinleyError();      checkFinleyError();
572      AbstractContinuousDomain* temp=new MeshAdapter(fMesh);      AbstractContinuousDomain* temp=new MeshAdapter(fMesh);
573      return temp;      return temp->getPtr();
574    }    }
575    AbstractContinuousDomain*  rectangle(int n0,int n1,int order,  
576    /*  AbstractContinuousDomain*  rectangle(int n0,int n1,int order,*/
577      Domain_ptr  rectangle(int n0,int n1,int order,
578              double l0, double l1,              double l0, double l1,
579              int periodic0,int periodic1,              int periodic0,int periodic1,
580              int integrationOrder,              int integrationOrder,
# Line 601  namespace finley { Line 605  namespace finley {
605      // Convert any finley errors into a C++ exception      // Convert any finley errors into a C++ exception
606      checkFinleyError();      checkFinleyError();
607      AbstractContinuousDomain* temp=new MeshAdapter(fMesh);      AbstractContinuousDomain* temp=new MeshAdapter(fMesh);
608      return temp;      return temp->getPtr();
609    }    }
610    
611    AbstractContinuousDomain* meshMerge(const boost::python::list& meshList)    Domain_ptr meshMerge(const boost::python::list& meshList)
612    {    {
613      Finley_Mesh* fMesh=0;      Finley_Mesh* fMesh=0;
614      //      //
# Line 625  namespace finley { Line 629  namespace finley {
629      checkFinleyError();      checkFinleyError();
630      AbstractContinuousDomain* temp=new MeshAdapter(fMesh);      AbstractContinuousDomain* temp=new MeshAdapter(fMesh);
631    
632      return temp;      return temp->getPtr();
633    }    }
634    AbstractContinuousDomain*  glueFaces(const boost::python::list& meshList,  
635      Domain_ptr  glueFaces(const boost::python::list& meshList,
636                                     double safety_factor,                                     double safety_factor,
637                             double tolerance,                             double tolerance,
638                                         int optimize)                                         int optimize)
# Line 635  namespace finley { Line 640  namespace finley {
640      Finley_Mesh* fMesh=0;      Finley_Mesh* fMesh=0;
641      //      //
642      // merge the meshes:      // merge the meshes:
643      AbstractContinuousDomain* merged_meshes=meshMerge(meshList);      Domain_ptr merged_meshes=meshMerge(meshList);
644    
645      //      //
646      // glue the faces:      // glue the faces:
647      const MeshAdapter* merged_finley_meshes=static_cast<const MeshAdapter*>(merged_meshes);      const MeshAdapter* merged_finley_meshes=dynamic_cast<const MeshAdapter*>(merged_meshes.get());
648      fMesh=merged_finley_meshes->getFinley_Mesh();      fMesh=merged_finley_meshes->getFinley_Mesh();
649      Finley_Mesh_glueFaces(fMesh,safety_factor,tolerance,(optimize ? TRUE : FALSE));      Finley_Mesh_glueFaces(fMesh,safety_factor,tolerance,(optimize ? TRUE : FALSE));
650    
651      //      //
652      // Convert any finley errors into a C++ exception      // Convert any finley errors into a C++ exception
653      checkFinleyError();      checkFinleyError();
654      return merged_meshes;      return merged_meshes->getPtr();
655    }    }
656    AbstractContinuousDomain*  joinFaces(const boost::python::list& meshList,    Domain_ptr  joinFaces(const boost::python::list& meshList,
657              double safety_factor,              double safety_factor,
658              double tolerance,              double tolerance,
659                          int optimize)                          int optimize)
# Line 655  namespace finley { Line 661  namespace finley {
661      Finley_Mesh* fMesh=0;      Finley_Mesh* fMesh=0;
662      //      //
663      // merge the meshes:      // merge the meshes:
664      AbstractContinuousDomain* merged_meshes=meshMerge(meshList);      Domain_ptr merged_meshes=meshMerge(meshList);
665      //      //
666      // join the faces:      // join the faces:
667      const MeshAdapter* merged_finley_meshes=static_cast<const MeshAdapter*>(merged_meshes);      const MeshAdapter* merged_finley_meshes=static_cast<const MeshAdapter*>(merged_meshes.get());
668      fMesh=merged_finley_meshes->getFinley_Mesh();      fMesh=merged_finley_meshes->getFinley_Mesh();
669      Finley_Mesh_joinFaces(fMesh,safety_factor,tolerance, (optimize ? TRUE : FALSE));      Finley_Mesh_joinFaces(fMesh,safety_factor,tolerance, (optimize ? TRUE : FALSE));
670      //      //
671      // Convert any finley errors into a C++ exception      // Convert any finley errors into a C++ exception
672      checkFinleyError();      checkFinleyError();
673      return merged_meshes;      return merged_meshes->getPtr();
674    }    }
675    
676    // end of namespace    // end of namespace

Legend:
Removed from v.1871  
changed lines
  Added in v.1872

  ViewVC Help
Powered by ViewVC 1.1.26