/*!
* Entry point for iteration over cells of this. Warning the returned cell iterator should be deallocated.
+ * Useful for python users.
*/
MEDCouplingUMeshCellIterator *MEDCouplingUMesh::cellIterator()
{
return new MEDCouplingUMeshCellIterator(this);
}
+/*!
+ * Entry point for iteration over cells groups geo types per geotypes. Warning the returned cell iterator should be deallocated.
+ * If 'this' is not so that that cells are grouped by geo types this method will throw an exception.
+ * In this case MEDCouplingUMesh::sortCellsInMEDFileFrmt or MEDCouplingUMesh::rearrange2ConsecutiveCellTypes methods for example can be called before invoking this method.
+ * Useful for python users.
+ */
MEDCouplingUMeshCellByTypeEntry *MEDCouplingUMesh::cellsByType() throw(INTERP_KERNEL::Exception)
{
if(!checkConsecutiveCellTypes())
getCellsContainingPoints(pos,1,eps,elts,eltsIndex);
}
+/// @cond INTERNAL
+
namespace ParaMEDMEM
{
template<const int SPACEDIMM>
};
}
+/// @endcond
+
template<int SPACEDIM>
void MEDCouplingUMesh::getCellsContainingPointsAlg(const double *coords, const double *pos, int nbOfPoints,
double eps, std::vector<int>& elts, std::vector<int>& eltsIndex) const
}
}
+/// @cond INTERNAL
+
namespace ParaMEDMEMImpl
{
class ConnReader
};
}
+/// @endcond
+
/*!
* This method expects that 'this' is sorted by types. If not an exception will be thrown.
* This method returns in the same format as code (see MEDCouplingUMesh::checkTypeConsistencyAndContig or MEDCouplingUMesh::splitProfilePerType) how
/*!
* This method reorganize the cells of 'this' so that the cells with same geometric types are put together.
- * If checkConsecutiveCellTypes() returns true, this method do not change anything of this.
* The number of cells remains unchanged after the call of this method.
+ * This method tries to minimizes the number of needed permutations. So, this method behaves not exactly as
+ * MEDCouplingUMesh::sortCellsInMEDFileFrmt.
+ *
* @return the array giving the correspondance old to new.
*/
DataArrayInt *MEDCouplingUMesh::rearrange2ConsecutiveCellTypes()
}
}
}
+
+/*!
+ * Non regression test testing copy constructor of InterpKernelDEC.
+ */
+void ParaMEDMEMTest::testGauthier3()
+{
+ int num_cas=0;
+ int rank, size;
+ MPI_Comm_rank(MPI_COMM_WORLD,&rank);
+ MPI_Comm_size(MPI_COMM_WORLD,&size);
+
+ int is_master=0;
+
+ CommInterface comm;
+ set<int> emetteur_ids;
+ set<int> recepteur_ids;
+ emetteur_ids.insert(0);
+ if(size!=4)
+ return;
+ recepteur_ids.insert(1);
+ if (size >2)
+ recepteur_ids.insert(2);
+ if (size >2)
+ emetteur_ids.insert(3);
+ if ((rank==0)||(rank==1))
+ is_master=1;
+
+ MPIProcessorGroup recepteur_group(comm,recepteur_ids);
+ MPIProcessorGroup emetteur_group(comm,emetteur_ids);
+
+
+ string cas;
+ if (recepteur_group.containsMyRank())
+ {
+ cas="recepteur";
+ //freopen("recpeteur.out","w",stdout);
+ //freopen("recepteur.err","w",stderr);
+
+ }
+ else
+ {
+ cas="emetteur";
+ // freopen("emetteur.out","w",stdout);
+ //freopen("emetteur.err","w",stderr);
+ }
+ double expected[8][4]={
+ {1.,1.,1.,1.},
+ {40., 40., 1., 1.},
+ {1.,1.,1e200,1e200},
+ {40.,1.,1e200,1e200},
+ {1.,1.,1.,1.},
+ {40.,1.,1.,1.},
+ {1.,1.,1e200,1e200},
+ {20.5,1.,1e200,1e200}
+ };
+
+ int expectedLgth[8]={4,4,2,2,4,4,2,2};
+
+ for (int send=0;send<2;send++)
+ for (int rec=0;rec<2;rec++)
+ {
+
+ std::vector<InterpKernelDEC> decu(1);
+ decu[0]=InterpKernelDEC(emetteur_group, recepteur_group);
+ InterpKernelDEC& dec_emetteur=decu[0];
+
+ //InterpKernelDEC dec_emetteur(emetteur_group, recepteur_group);
+ dec_emetteur.setOrientation(2);
+ TrioField champ_emetteur, champ_recepteur;
+
+ if (send==0)
+ init_quadGauthier1(champ_emetteur,is_master);
+ else
+ init_triangleGauthier1(champ_emetteur,is_master);
+ if (rec==0)
+ init_triangleGauthier1(champ_recepteur,is_master);
+ else
+ init_quadGauthier1(champ_recepteur,is_master);
+
+ if (cas=="emetteur")
+ {
+ champ_emetteur._field=new double[champ_emetteur._nb_elems];
+ for (int ele=0;ele<champ_emetteur._nb_elems;ele++)
+ champ_emetteur._field[ele]=1;
+
+ champ_emetteur._has_field_ownership=true;
+ }
+
+
+ MPI_Barrier(MPI_COMM_WORLD);
+
+ //clock_t clock0= clock ();
+ int compti=0;
+
+ bool init=true; // first time step ??
+ bool stop=false;
+ //boucle sur les pas de quads
+ while (!stop) {
+
+ compti++;
+ //clock_t clocki= clock ();
+ //cout << compti << " CLOCK " << (clocki-clock0)*1.e-6 << endl;
+ for (int non_unif=0;non_unif<2;non_unif++)
+ {
+ // if (champ_recepteur._field)
+ // delete [] champ_recepteur._field;
+ champ_recepteur._field=0;
+ // champ_recepteur._has_field_ownership=false;
+
+
+
+ if (cas=="emetteur")
+ {
+ if (non_unif)
+ if(rank!=3)
+ champ_emetteur._field[0]=40;
+ }
+ //bool ok=false; // Is the time interval successfully solved ?
+
+ // Loop on the time interval tries
+ if(1) {
+
+
+ if (cas=="emetteur")
+ dec_emetteur.attachLocalField((ICoCo::Field*) &champ_emetteur);
+ else
+ dec_emetteur.attachLocalField((ICoCo::Field*) &champ_recepteur);
+
+
+ if(init) dec_emetteur.synchronize();
+ init=false;
+
+ if (cas=="emetteur") {
+ // affiche(champ_emetteur);
+ dec_emetteur.sendData();
+ }
+ else if (cas=="recepteur")
+ {
+ dec_emetteur.recvData();
+ if (is_master)
+ afficheGauthier1(champ_recepteur,expected[num_cas],expectedLgth[num_cas]);
+ }
+ else
+ throw 0;
+ MPI_Barrier(MPI_COMM_WORLD);
+ }
+ stop=true;
+ num_cas++;
+ }
+ // destruction des champs, des DEC, et des tableaux associés
+ }
+ }
+}