fix types in ranged for loops

This commit is contained in:
Arne Morten Kvarving
2021-09-10 11:04:27 +02:00
parent 9dd8bbc23c
commit fd8ee565d6
7 changed files with 10 additions and 10 deletions

View File

@@ -59,7 +59,7 @@ bool SAMpatch::init (const std::vector<ASMbase*>& patches, int numNod,
ndofs[nodeType[n]] += madof[n+1] - madof[n];
for (size_t d = 0; d < dof_type.size(); d++)
ndofs[dof_type[d]] ++;
for (const std::pair<char,size_t>& dof : ndofs)
for (const std::pair<const char,size_t>& dof : ndofs)
if (dof.second > 0)
IFEM::cout <<"Number of "<< dof.first <<"-dofs "
<< dof.second << std::endl;
@@ -226,7 +226,7 @@ bool SAMpatch::initElementConn ()
int* new_mpmnpc = new int[nel+1];
int* new_mmnpc = new int[nmmnpc];
ip = new_mpmnpc[0] = 1;
for (const std::pair<int,Ipair>& elm : sortedElms)
for (const std::pair<const int,Ipair>& elm : sortedElms)
{
int nen = elm.second.second;
new_mpmnpc[ip] = new_mpmnpc[ip-1] + nen;
@@ -465,7 +465,7 @@ bool SAMpatch::merge (const SAM* other, const std::map<int,int>* old2new)
ndofs[nodeType[n]] += madof[n+1] - madof[n];
for (size_t d = 0; d < dof_type.size(); d++)
ndofs[dof_type[d]] ++;
for (const std::pair<char,size_t>& dof : ndofs)
for (const std::pair<const char,size_t>& dof : ndofs)
if (dof.second > 0)
IFEM::cout <<"Number of "<< dof.first <<"-dofs "
<< dof.second << std::endl;

View File

@@ -52,7 +52,7 @@ NonLinSIM::~NonLinSIM ()
cout <<"\n *** Here are the nodal points flagged with slow convergence"
<<"\n ======================================================="
<<"\n Node Count Patch Coordinates\n";
for (const std::pair<int,int>& node : slowNodes)
for (const std::pair<const int,int>& node : slowNodes)
{
Vec4 X = model.getNodeCoord(node.first);
cout << std::setw(9) << node.first
@@ -491,7 +491,7 @@ void NonLinSIM::printWorst (utl::LogStream& os, double eps)
else
os <<".";
for (const std::pair<std::pair<int,int>,RealArray>& wd : worstDOFs)
for (const std::pair<const std::pair<int,int>,RealArray>& wd : worstDOFs)
{
os <<"\n Node "<< wd.first.first <<" local DOF "<< wd.first.second;
char nodeType = model.getNodeType(wd.first.first);

View File

@@ -879,7 +879,7 @@ Vector SIM2D::getSolution (const Vector& psol, double u, double v,
bool SIM2D::writeAddFuncs (int iStep, int& nBlock, int idBlock, double time)
{
for (const std::pair<std::string,RealFunc*>& func : myAddScalars)
for (const std::pair<const std::string,RealFunc*>& func : myAddScalars)
if (!this->writeGlvF(*func.second, func.first.c_str(), iStep,
nBlock, idBlock++, time))
return false;

View File

@@ -142,7 +142,7 @@ bool SIMmultiCpl::preprocess (const std::vector<int>& ignored, bool fixDup)
return false;
IFEM::cout <<"\nCoupling node mapping:";
for (const std::pair<int,int>& cp : cplNodes)
for (const std::pair<const int,int>& cp : cplNodes)
IFEM::cout <<"\n\t"<< cp.first <<" -> "<< cp.second;
IFEM::cout << std::endl;

View File

@@ -1952,7 +1952,7 @@ bool SIMoutput::serialize (std::map<std::string,std::string>&) const
bool SIMoutput::writeAddFuncs (int iStep, int& nBlock, int idBlock, double time)
{
for (const std::pair<std::string,RealFunc*>& func : myAddScalars)
for (const std::pair<const std::string,RealFunc*>& func : myAddScalars)
if (!this->writeGlvF(*func.second, func.first.c_str(), iStep,
nBlock, idBlock++, time))
return false;

View File

@@ -122,7 +122,7 @@ bool DataExporter::dumpTimeLevel (const TimeStep* tp, bool geoUpd, bool doLog)
for (DataWriter* writer : m_writers) {
writer->openFile(m_level);
for (const DataEntry& it : m_entry) {
for (const std::pair<const std::string,DataExporter::FileEntry>& it : m_entry) {
if (!it.second.data)
return false;
switch (it.second.field) {

View File

@@ -100,7 +100,7 @@ bool HDF5Restart::writeData (const SerializeData& data)
};
for (int p = 0; p < ptot; p++)
for (const std::pair<std::string,std::string>& it : data) {
for (const std::pair<const std::string,std::string>& it : data) {
std::stringstream str;
str << m_level << '/' << p;
hid_t group;