vtf-logo

shells/parallel/test/MeshPartitioner.h

Go to the documentation of this file.
00001 // -*- C++ -*- 
00002 //
00003 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00004 //
00005 //                                   Fehmi Cirak
00006 //                        California Institute of Technology
00007 //                           (C) 2004 All Rights Reserved
00008 //
00009 // <LicenseText>
00010 //
00011 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00012 //
00013 #ifndef MESHPARTITIONER_H
00014 #define MESHPARTITIONER_H
00015 #include "mpi.h"
00016 
00017 #include <iostream>
00018 #include <vector>
00019 #include <set>
00020 
00021 
00022 namespace parallel {
00023     class MeshPartitioner;
00024     class PointSetPartitioner;
00025 }
00026 
00027 
00028 class parallel::MeshPartitioner {
00029 public:
00030     MeshPartitioner(const MPI_Comm& comm, std::istream& is, std::ostream& os);
00031     ~MeshPartitioner();
00032 
00033     void partition();
00034 
00035     void localToGlobalNodeIDs();
00036 
00037 private:    
00038     MeshPartitioner(const MeshPartitioner &);
00039     const MeshPartitioner & operator=(const MeshPartitioner &);
00040 
00041 private: 
00042     typedef std::vector<int>              _ConnectivityCont; 
00043     typedef std::vector<double>           _CoordinateCont;
00044     typedef std::vector<int>              _GhostMarkerCont; 
00045     typedef std::set<int>                 _LocalGlobalIDCont; 
00046 
00047     typedef _ConnectivityCont::iterator   _ConnectivityIt; 
00048     typedef _CoordinateCont::iterator     _CoordinateIt;
00049     typedef _GhostMarkerCont::iterator    _GhostMarkerIt;
00050     typedef _LocalGlobalIDCont::iterator  _LocalGlobalIDIt;
00051 
00052     _ConnectivityCont                     _connectivity;    // triangle connectivity
00053     _CoordinateCont                       _coordinate;      // nodal coordinates
00054 
00055     _GhostMarkerCont                      _ghostMarker;     // marker for ghost elements
00056                      
00057     _LocalGlobalIDCont                    _localGlobalNode; // mapping between global/local ID's  
00058                                                             // for repartitioning
00059 
00060     PointSetPartitioner                  *_psetPartitioner;
00061 
00062     std::ostream&                         _os;             
00063     
00064     private:
00065     template<typename OutputIt, typename InputIt>  
00066     void ghostAndActiveElements(InputIt elBegin, 
00067                                 InputIt elEnd, 
00068                                 OutputIt allElements);
00069     void computeElementCenters(_CoordinateCont& centerCoordinate);
00070     void readMeshSMF(std::istream &is);
00071     void writeMeshSMF();
00072 };
00073 
00074 #endif
00075 
00076 /* End of file */

Generated on Fri Aug 24 13:00:24 2007 for SFC Thin-Shell Finite Element Solver by  doxygen 1.4.7