Skip to content

Commit

Permalink
[arcane,std] Sort la définition d'un tableau de la boucle et corrige …
Browse files Browse the repository at this point in the history
…avertissement de compilation
  • Loading branch information
grospelliergilles committed Oct 7, 2024
1 parent c0d329d commit 831aa48
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions arcane/src/arcane/std/MeshPartitionerBase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -652,25 +652,25 @@ _cellsProjectWeights(VariableCellArrayReal& cellWgtIn, Int32 nbWgt) const
{
SharedArray<float> cellWgtOut(nbOwnCellsWithConstraints()*nbWgt);
if (nbWgt > cellWgtIn.arraySize()) {
throw FatalErrorException("MeshPartitionerBase: asked for too many weights");
ARCANE_FATAL("Asked for too many weights n={0} array_size={1}",nbWgt,cellWgtIn.arraySize());
}

ENUMERATE_CELL(icell, m_mesh->ownCells()){
if(m_filter_lid_cells[icell->localId()]==eCellClassical)
for ( int i = 0 ; i < nbWgt ; ++i)
cellWgtOut[m_local_id_2_local_id_compacted[icell->localId()]*nbWgt+i]
= static_cast<float>(cellWgtIn[icell][i]);
for ( int i = 0 ; i < nbWgt ; ++i){
float v = static_cast<float>(cellWgtIn[icell][i]);
cellWgtOut[m_local_id_2_local_id_compacted[icell->localId()]*nbWgt+i] = v;
}
}
RealUniqueArray w(nbWgt);
for( auto& ptr : m_cells_with_constraints ){
RealUniqueArray w(nbWgt);
w.fill(0);
for( const auto& cell : ptr ){
for (int i = 0 ; i <nbWgt ; ++i)
w[i] += cellWgtIn[cell][i];
}
for (int i=0 ; i<nbWgt ; ++i)
cellWgtOut[m_local_id_2_local_id_compacted[ptr[0].localId()]*nbWgt+i]
= (float)(w[i]);
cellWgtOut[m_local_id_2_local_id_compacted[ptr[0].localId()]*nbWgt+i] = (float)(w[i]);
}

return cellWgtOut;
Expand Down Expand Up @@ -883,13 +883,13 @@ MeshPartitionerBase::dumpObject(String filebase)
&&(m_filter_lid_cells[icell->localId()]!=eCellReference))
continue;

// on calcul un barycentre
for( Integer z=0, zs = (*icell).nbNode(); z<zs; ++z ){
const Node& node = (*icell).node(z);
my_coords[i] += coords[node];
}
my_coords[i] /= Convert::toDouble((*icell).nbNode());
i++;
// on calcul un barycentre
for( Integer z=0, zs = (*icell).nbNode(); z<zs; ++z ){
const Node& node = (*icell).node(z);
my_coords[i] += coords[node];
}
my_coords[i] /= Convert::toDouble((*icell).nbNode());
i++;
}
req = centralizePartInfo<Real3>(filebase+".xyz", pm, my_coords, header);
reqs.add(req);
Expand All @@ -909,7 +909,7 @@ MeshPartitionerBase::dumpObject(String filebase)
for (Integer j = 0 ; j < neighbourcells.size() ; ++j) {
if (neighbourcells[j] > my_uid)
continue;
Real3 tmp(my_uid+1, neighbourcells[j]+1, commWeights[j]);
Real3 tmp(static_cast<Real>(my_uid+1), static_cast<Real>(neighbourcells[j]+1), commWeights[j]);
nnz.add(tmp);
}
}
Expand Down

0 comments on commit 831aa48

Please sign in to comment.