STYLE: consistent of enumerations between ensight components

This commit is contained in:
Mark Olesen
2016-12-13 08:09:26 +01:00
parent 9041c9083e
commit 17bedf58d9
5 changed files with 25 additions and 36 deletions

View File

@ -452,24 +452,21 @@ void Foam::ensightMesh::writeCellConnectivity
ensightCells::NFACED
};
for (int i=0; i < 5; ++i)
for (label typei=0; typei < ensightCells::nTypes; ++typei)
{
const ensightCells::elemType& what = oldOrder[i];
const ensightCells::elemType& what = oldOrder[typei];
writeCellConnectivity(what, ensCells, pointToGlobal, os);
}
return;
}
else
for (label typei=0; typei < ensightCells::nTypes; ++typei)
{
const List<ensightCells::elemType> enums =
ensightCells::elemEnum.enums();
const ensightCells::elemType what = ensightCells::elemType(typei);
forAllConstIter(List<ensightCells::elemType>, enums, iter)
{
const ensightCells::elemType what = *iter;
writeCellConnectivity(what, ensCells, pointToGlobal, os);
}
writeCellConnectivity(what, ensCells, pointToGlobal, os);
}
}
@ -614,13 +611,11 @@ void Foam::ensightMesh::writeFaceConnectivity
const bool raw
) const
{
const List<ensightFaces::elemType> enums = ensightFaces::elemEnum.enums();
if (raw)
{
forAllConstIter(List<ensightFaces::elemType>, enums, iter)
for (label typei=0; typei < ensightFaces::nTypes; ++typei)
{
const ensightFaces::elemType what = *iter;
const ensightFaces::elemType what = ensightFaces::elemType(typei);
writeFaceConnectivity
(
@ -638,9 +633,9 @@ void Foam::ensightMesh::writeFaceConnectivity
}
else
{
forAllConstIter(List<ensightFaces::elemType>, enums, iter)
for (label typei=0; typei < ensightFaces::nTypes; ++typei)
{
const ensightFaces::elemType what = *iter;
const ensightFaces::elemType what = ensightFaces::elemType(typei);
writeFaceConnectivity
(

View File

@ -101,7 +101,8 @@ bool Foam::ensightOutput::writeFaceField
for (label typei=0; typei < ensightFaces::nTypes; ++typei)
{
const ensightFaces::elemType what = ensightFaces::elemType(typei);
const ensightFaces::elemType what =
ensightFaces::elemType(typei);
writeFieldContent
(
@ -136,7 +137,7 @@ bool Foam::ensightOutput::writeFaceSubField
}
label start = 0; // start of sublist
for (label typei = 0; typei < ensightFaces::nTypes; ++typei)
for (label typei=0; typei < ensightFaces::nTypes; ++typei)
{
const ensightFaces::elemType what = ensightFaces::elemType(typei);
const label size = ensFaces.faceIds(what).size();

View File

@ -84,7 +84,8 @@ bool Foam::ensightSerialOutput::writeField
for (label typei=0; typei < ensightFaces::nTypes; ++typei)
{
const ensightFaces::elemType what = ensightFaces::elemType(typei);
const ensightFaces::elemType what =
ensightFaces::elemType(typei);
writeFieldContent
(

View File

@ -263,12 +263,9 @@ void Foam::ensightPartCells::write
}
// write each element type
const List<ensightCells::elemType> enums =
ensightCells::elemEnum.enums();
forAllConstIter(List<ensightCells::elemType>, enums, iter)
for (label typei=0; typei < ensightCells::nTypes; ++typei)
{
const ensightCells::elemType what = *iter;
const ensightCells::elemType what = ensightCells::elemType(typei);
writeConnectivity
(
@ -308,10 +305,9 @@ void Foam::ensightPartCells::dumpInfo(Ostream& os) const
os.writeEntry("name", name());
os.writeEntry("size", size());
const List<ensightCells::elemType> enums = ensightCells::elemEnum.enums();
forAllConstIter(List<ensightCells::elemType>, enums, iter)
for (label typei=0; typei < ensightCells::nTypes; ++typei)
{
const ensightCells::elemType what = *iter;
const ensightCells::elemType what = ensightCells::elemType(typei);
const labelUList& addr = this->cellIds(what);
os.writeKeyword(ensightCells::key(what));

View File

@ -226,12 +226,9 @@ void Foam::ensightPartFaces::write
}
// write part
const List<ensightFaces::elemType> enums =
ensightFaces::elemEnum.enums();
forAllConstIter(List<ensightFaces::elemType>, enums, iter)
for (label typei=0; typei < ensightFaces::nTypes; ++typei)
{
const ensightFaces::elemType what = *iter;
const ensightFaces::elemType what = ensightFaces::elemType(typei);
writeConnectivity
(
@ -273,10 +270,9 @@ void Foam::ensightPartFaces::dumpInfo(Ostream& os) const
os.writeEntry("start", start_);
os.writeEntry("size", size());
const List<ensightFaces::elemType> enums = ensightFaces::elemEnum.enums();
forAllConstIter(List<ensightFaces::elemType>, enums, iter)
for (label typei=0; typei < ensightFaces::nTypes; ++typei)
{
const ensightFaces::elemType what = *iter;
const ensightFaces::elemType what = ensightFaces::elemType(typei);
const labelUList& addr = this->faceIds(what);
os.writeKeyword(ensightFaces::key(what));