00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #ifndef BRIDGINGPAR_H
00043 #define BRIDGINGPAR_H
00044
00045 #include "duo_distributed_vector.h"
00046 #include "bridging.h"
00047
00052 template <typename DomainA, typename DomainC,unsigned int Dim,int Pond>
00053 class BridgingPar : public Bridging<DomainA,DomainC,Dim,Pond>
00054 {
00055
00056 public:
00057 BridgingPar<DomainA,DomainC,Dim,Pond>(DomainAtomicInterface & A,DomainContinuumInterface & C,int geomID):
00058 Bridging<DomainA,DomainC,Dim,Pond>(A,C,geomID),communicateur(NULL)
00059 {
00060 total_atoms_in_rec=0;
00061 local_atoms_in_rec=0;
00062 total_atoms_fictifs=0;
00063 local_atoms_fictifs=0;
00064
00065 correction_fictifs = NULL;
00066 GROUP_ID_ATOMS = A.GetGroupID();
00067 GROUP_ID_CONTINU = C.GetGroupID();
00068
00069 centers = NULL;
00070 whole_atomes_par_proc = NULL;
00071 duo_vector = NULL;
00072 duo_vector_fictifs = NULL;
00073 };
00074
00075 virtual ~BridgingPar(){
00076 if (correction_fictifs)
00077 delete [] correction_fictifs;
00078
00079 if (whole_atomes_par_proc)
00080 delete [] whole_atomes_par_proc;
00081
00082 if (duo_vector)
00083 delete duo_vector;
00084
00085 if (duo_vector_fictifs)
00086 delete duo_vector_fictifs;
00087
00088 }
00089
00090 typedef Bridging<DomainA,DomainC,Dim,Pond> Parent;
00091
00093 void SetCommunicator(Communicator * com,
00094 int group_id_atoms,int group_id_continu){
00095 communicateur = com;
00096 GROUP_ID_CONTINU = group_id_continu;
00097 GROUP_ID_ATOMS = group_id_atoms;
00098 }
00099
00100 protected:
00101
00103 void GenerateCommunicationScheme();
00105 void UnfragmentScheme(DuoDistributedVecteur & duo);
00107 void UnfragmentIndirectionArrays(std::vector<int> & assoc,ShapeMatrix<typename Parent::_Vec_,Dim> * smatrix,DuoDistributedVecteur & duo);
00109 #ifdef DEBUG_BRIDGE
00110 void UnfragmentArray(double * array,unsigned int nmax,unsigned int size,DuoDistributedVecteur & duo,unsigned int stride=1);
00111 #else
00112 void UnfragmentArray(double * array,unsigned int size,DuoDistributedVecteur & duo,unsigned int stride=1);
00113 #endif
00115 void UnfragmentContener(ContenerTableau<typename Parent::RefAtom> & atoms,DuoDistributedVecteur & duo);
00116 #ifdef USING_SCOTCH
00118 void DumpScotchPartition(int nb_atome,int * atomes_par_proc,DuoDistributedVecteur & duo);
00119 #endif
00120
00122 virtual void CorrectSurfaceEffect();
00123
00125 DuoDistributedVecteur * duo_vector;
00127 DuoDistributedVecteur * duo_vector_fictifs;
00128
00130 Communicator * communicateur;
00131
00133 int GROUP_ID_CONTINU;
00135 int GROUP_ID_ATOMS;
00136
00138 unsigned int total_atoms_in_rec;
00140 unsigned int local_atoms_in_rec;
00141
00143 unsigned int total_atoms_fictifs;
00145 unsigned int local_atoms_fictifs;
00146
00148 double * correction_fictifs;
00149
00150 private:
00151
00153 int * exchangeGeometries();
00155 int * exchangeAtomsRecPositions(int * com_with,unsigned int & local_atoms,unsigned int & total_atoms);
00157 DuoDistributedVecteur * ExchangeAssociationInformation(int * com_with,int * atomes_par_proc,
00158 unsigned int local_atoms,unsigned int total_atoms,
00159 std::vector<int> & association);
00160
00161
00162 int * whole_atomes_par_proc;
00163 double * centers;
00164 };
00165
00166 #endif //BRIDGING