Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __OVERLAPELEMENTLOCATOR_HXX__
00021 #define __OVERLAPELEMENTLOCATOR_HXX__
00022
00023 #include "InterpolationOptions.hxx"
00024 #include "MEDCouplingNatureOfField.hxx"
00025 #include "MEDCouplingPointSet.hxx"
00026 #include "MEDCouplingMemArray.hxx"
00027 #include "MEDCouplingAutoRefCountObjectPtr.hxx"
00028
00029 #include <mpi.h>
00030 #include <vector>
00031 #include <map>
00032 #include <set>
00033
00034 namespace ParaMEDMEM
00035 {
00036 class ParaFIELD;
00037 class ProcessorGroup;
00038 class ParaSUPPORT;
00039 class OverlapInterpolationMatrix;
00040
00041 class OverlapElementLocator : public INTERP_KERNEL::InterpolationOptions
00042 {
00043 public:
00044 OverlapElementLocator(const ParaFIELD *sourceField, const ParaFIELD *targetField, const ProcessorGroup& group);
00045 virtual ~OverlapElementLocator();
00046 const MPI_Comm *getCommunicator() const;
00047 void exchangeMeshes(OverlapInterpolationMatrix& matrix);
00048 std::vector< std::pair<int,int> > getToDoList() const { return _to_do_list; }
00049 std::vector< std::vector< int > > getProcsInInteraction() const { return _proc_pairs; }
00050 std::string getSourceMethod() const;
00051 std::string getTargetMethod() const;
00052 const MEDCouplingPointSet *getSourceMesh(int procId) const;
00053 const DataArrayInt *getSourceIds(int procId) const;
00054 const MEDCouplingPointSet *getTargetMesh(int procId) const;
00055 const DataArrayInt *getTargetIds(int procId) const;
00056 private:
00057 void computeBoundingBoxes();
00058 bool intersectsBoundingBox(int i, int j) const;
00059 void sendLocalMeshTo(int procId, bool sourceOrTarget, OverlapInterpolationMatrix& matrix) const;
00060 void receiveRemoteMesh(int procId, bool sourceOrTarget);
00061 void sendMesh(int procId, const MEDCouplingPointSet *mesh, const DataArrayInt *idsToSend) const;
00062 void receiveMesh(int procId, MEDCouplingPointSet* &mesh, DataArrayInt *&ids) const;
00063 private:
00064 const ParaFIELD *_local_source_field;
00065 const ParaFIELD *_local_target_field;
00066 int _local_space_dim;
00067 MEDCouplingPointSet *_local_source_mesh;
00068 MEDCouplingPointSet *_local_target_mesh;
00069 std::vector<MEDCouplingPointSet*> _distant_cell_meshes;
00070 std::vector<MEDCouplingPointSet*> _distant_face_meshes;
00072 std::vector< std::vector< int > > _proc_pairs;
00074 std::vector< std::pair<int,int> > _to_do_list;
00075 std::vector< std::pair<int,bool> > _procs_to_send;
00076 std::map<std::pair<int,bool>, MEDCouplingAutoRefCountObjectPtr< MEDCouplingPointSet > > _remote_meshes;
00077 std::map<std::pair<int,bool>, MEDCouplingAutoRefCountObjectPtr< DataArrayInt > > _remote_elems;
00078 double* _domain_bounding_boxes;
00079 const ProcessorGroup& _group;
00080 std::vector<int> _distant_proc_ids;
00081 const MPI_Comm *_comm;
00082
00083
00084
00085
00086
00087 };
00088
00089 }
00090
00091 #endif