259 Raccord_distant_homogene& raccord_distant = *
this;
262 Cerr <<
"Remote connection " << raccord_distant.
le_nom() <<
" already initialized." << finl;
263 Cerr <<
"Error, contact TRUST support." << finl;
271 DoubleTabs remote_xv(parts);
273 int nb_face2 = raccord_distant.
nb_faces();
275 remote_xv[moi].
resize(nb_face2,dim);
276 for (
int ind_face=0 ; ind_face < nb_face2 ; ind_face++)
278 int face = prem_face2 + ind_face;
279 for (
int j=0 ; j<dim ; j++)
280 remote_xv[moi](ind_face,j) = domaine_dis_vf.
xv(face,j);
285 for (
int p = 0; p < parts; p++)
286 envoyer_broadcast(remote_xv[p], p);
288 ArrsOfInt racc_vois(parts);
294 int nb_face1 = opposed_boundary.
nb_faces();
298 const DoubleTab& local_xv = opposed_domaine_dis_vf.
xv();
300 ArrOfInt& Recep=raccord_distant.
Tab_Recep();
306 std::vector<MCAuto<DataArrayDouble> > vxv(parts);
307 std::vector<const DataArrayDouble*> cvxv(parts);
308 for (
int p = 0; p < parts; p++)
310 vxv[p] = DataArrayDouble::New();
311 vxv[p]->useExternalArrayWithRWAccess(remote_xv[p].addr(), remote_xv[p].
dimension(0), remote_xv[p].
dimension(1));
314 MCAuto<DataArrayDouble> remote_xvs(DataArrayDouble::Aggregate(cvxv)), local_xvs(DataArrayDouble::New());
315 local_xvs->alloc(nb_face1, dim);
316 for (
int ind_face = 0; ind_face < nb_face1; ind_face++)
317 for (
int j = 0; j < dim; j++)
318 local_xvs->setIJ(ind_face, j, local_xv(prem_face1 + ind_face, j));
321 MCAuto<DataArrayIdType> glob_idx(DataArrayIdType::New());
323 glob_idx = remote_xvs->findClosestTupleId(local_xvs);
326 for (
int ind_face = 0, face1 = prem_face1; ind_face<nb_face1; ind_face++, face1++)
330 mcIdType ind_face2_big = glob_idx->getIJ(ind_face, 0);
331 while (ind_face2_big >= remote_xv[proc].
dimension(0))
333 ind_face2_big -= remote_xv[proc].
dimension(0);
336 assert(ind_face2_big < std::numeric_limits<int>::max());
337 int ind_face2 = (int)ind_face2_big;
338 assert(ind_face2 < remote_xv[proc].
dimension(0));
341 double distance2 = 0;
342 for (
int j=0; j<dim; j++)
344 double x1=local_xv(face1,j);
345 double x2=remote_xv[proc](ind_face2,j);
346 distance2 += (x1-x2)*(x1-x2);
348 if (distance2 > tolerance * tolerance)
350 Cerr <<
"Warning, there is no remote face found on the local boundary " << opposed_boundary.
le_nom() <<
" for the face local number " << ind_face <<
" (";
351 for (
int j=0; j<dim; j++) Cerr <<
" " << local_xv(face1,j);
352 Cerr <<
" )" << finl <<
"the nearest face on the remote boundary " << raccord_distant.
le_nom() <<
" is the face " << ind_face2 <<
" (";
353 for (
int j=0; j<dim; j++) Cerr <<
" " << remote_xv[proc](ind_face2,j);
354 Cerr <<
" )" << finl <<
"which is located at a distance of " << sqrt(distance2) <<
" and it is above the geometric tolerance " << tolerance << finl;
355 Cerr <<
"Check your mesh or contact TRUST support." << finl;
360 Recep[ind_face]=proc;
361 racc_vois[proc].append_array(ind_face2);
365 Cerr<<
"Raccord_distant_homogene_32_64 needs TRUST compiled with MEDCoupling."<<finl;
369 envoyer_all_to_all(racc_vois, facteurs);
371 IntTab& Envoi = raccord_distant.
Tab_Envoi();
373 Envoi.
resize(nb_face2, 2);
375 for (
int p = 0; p < parts; p++)
377 const ArrOfInt& facteur = facteurs[p];
379 for (
int d=0 ; d<sz ; d++)
382 Envoi(ind,1) = facteur[d];
386 raccord_distant.
e() = 0;
389 Cerr <<
"Initialize the remote connection " << domaine_dis.
domaine().
le_nom() <<
"/" << raccord_distant.
le_nom() <<
"<-" << opposed_domaine_dis.
domaine().
le_nom() <<
"/" << opposed_boundary.
le_nom() << finl;
double xv(int num_face, int k) const
const Nom & le_nom() const override
Donne le nom de l'Objet_U Methode a surcharger : renvoie "neant" dans cette implementation.
classe Domaine_dis_base Cette classe est la base de la hierarchie des domaines discretisees.
const Domaine & domaine() const