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 __OVERLAPMAPPING_HXX__
00021 #define __OVERLAPMAPPING_HXX__
00022
00023 #include "MEDCouplingAutoRefCountObjectPtr.hxx"
00024
00025 #include <vector>
00026 #include <map>
00027
00028 namespace ParaMEDMEM
00029 {
00030 class ProcessorGroup;
00031 class DataArrayInt;
00032 class MEDCouplingFieldDouble;
00033
00034 class OverlapMapping
00035 {
00036 public:
00037 OverlapMapping(const ProcessorGroup& group);
00038 void keepTracksOfSourceIds(int procId, DataArrayInt *ids);
00039 void keepTracksOfTargetIds(int procId, DataArrayInt *ids);
00040 void addContributionST(const std::vector< std::map<int,double> >& matrixST, const DataArrayInt *srcIds, int srcProcId, const DataArrayInt *trgIds, int trgProcId);
00041 void prepare(const std::vector< std::vector<int> >& procsInInteraction, int nbOfTrgElems);
00042 void computeDenoConservativeVolumic(int nbOfTuplesTrg);
00043 void computeDenoGlobConstraint();
00044
00045 void multiply(const MEDCouplingFieldDouble *fieldInput, MEDCouplingFieldDouble *fieldOutput) const;
00046 void transposeMultiply(const MEDCouplingFieldDouble *fieldInput, MEDCouplingFieldDouble *fieldOutput);
00047 private:
00048 void serializeMatrixStep0ST(const int *nbOfElemsSrc, int *&bigArr, int *count, int *offsets,
00049 int *countForRecv, int *offsetsForRecv) const;
00050 int serializeMatrixStep1ST(const int *nbOfElemsSrc, const int *recvStep0, const int *countStep0, const int *offsStep0,
00051 int *&bigArrI, double *&bigArrD, int *count, int *offsets,
00052 int *countForRecv, int *offsForRecv) const;
00053 void unserializationST(int nbOfTrgElems, const int *nbOfElemsSrcPerProc, const int *bigArrRecv, const int *bigArrRecvCounts, const int *bigArrRecvOffs,
00054 const int *bigArrRecv2, const double *bigArrDRecv2, const int *bigArrRecv2Count, const int *bigArrRecv2Offs);
00055 void finishToFillFinalMatrixST();
00056 void prepareIdsToSendST();
00057 void updateZipSourceIdsForFuture();
00058
00059 private:
00060 const ProcessorGroup &_group;
00062 std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > _src_ids_st2;
00063 std::vector< int > _src_proc_st2;
00064 std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > _trg_ids_st2;
00065 std::vector< int > _trg_proc_st2;
00066 std::vector< int > _nb_of_src_ids_proc_st2;
00067 std::vector< int > _src_ids_proc_st2;
00068 std::vector< std::vector<int> > _src_ids_zip_st2;
00069 std::vector< int > _src_ids_zip_proc_st2;
00071 std::vector< std::vector< std::map<int,double> > > _matrixes_st;
00072 std::vector< std::vector<int> > _source_ids_st;
00073 std::vector< int > _source_proc_id_st;
00074 std::vector< std::vector<int> > _target_ids_st;
00075 std::vector< int > _target_proc_id_st;
00077 std::vector< std::vector< std::map<int,double> > > _the_matrix_st;
00078 std::vector< int > _the_matrix_st_source_proc_id;
00079 std::vector< std::vector<int> > _the_matrix_st_source_ids;
00080 std::vector< std::vector< std::map<int,double> > > _the_deno_st;
00082 std::vector< int > _proc_ids_to_send_vector_st;
00083 std::vector< int > _proc_ids_to_recv_vector_st;
00085 std::vector< std::vector<int> > _source_ids_to_send_st;
00086 };
00087 }
00088
00089 #endif