STYLE: use Time::printExecutionTime() method

- makes format of ExecutionTime = ... output configurable (#788)
  and reduces code clutter.

STYLE: more consistent line-breaks after "End" tag
This commit is contained in:
Mark Olesen
2020-08-07 09:18:26 +02:00
parent 1178fc190b
commit b2bded48c9
21 changed files with 26 additions and 29 deletions

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -144,9 +145,7 @@ int main(int argc, char *argv[])
runTime.write(); runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" runTime.printExecutionTime(Info);
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
} }
Info<< "End\n" << endl; Info<< "End\n" << endl;

View File

@ -93,8 +93,8 @@ int main(int argc, char *argv[])
runTime.printExecutionTime(Info); runTime.printExecutionTime(Info);
} }
Info << "Number of steps = " << runTime.timeIndex() << endl; Info<< "Number of steps = " << runTime.timeIndex() << nl;
Info << "End" << nl << endl; Info<< "End\n" << endl;
return 0; return 0;
} }

View File

@ -130,7 +130,7 @@ int main(int argc, char *argv[])
runTime.printExecutionTime(Info); runTime.printExecutionTime(Info);
} }
Info<< "End" << endl; Info<< "End\n" << endl;
return 0; return 0;
} }

View File

@ -75,9 +75,10 @@ int main(int argc, char *argv[])
// Compute all sensitivities // Compute all sensitivities
om.computeSensitivities(); om.computeSensitivities();
} }
Info<< "End\n" << endl; Info<< "End\n" << endl;
return(0); return 0;
} }

View File

@ -151,7 +151,7 @@ int main(int argc, char *argv[])
runTime.printExecutionTime(Info); runTime.printExecutionTime(Info);
} }
Info<< "End" << endl; Info<< "End\n" << endl;
return 0; return 0;
} }

View File

@ -98,7 +98,7 @@ int main(int argc, char *argv[])
Info<< "End\n" << endl; Info<< "End\n" << endl;
return(0); return 0;
} }

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -121,9 +122,7 @@ int main(int argc, char *argv[])
combustion->Qdot()().write(); combustion->Qdot()().write();
} }
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" runTime.printExecutionTime(Info);
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
} }
Info<< "End\n" << endl; Info<< "End\n" << endl;

View File

@ -130,9 +130,7 @@ int main(int argc, char *argv[])
runTime.write(); runTime.write();
Info<< "ExecutionTime = " runTime.printExecutionTime(Info);
<< runTime.elapsedCpuTime()
<< " s\n\n" << endl;
} }
Info<< "End\n" << endl; Info<< "End\n" << endl;

View File

@ -57,7 +57,7 @@ int main(int argc, char *argv[])
Info<< fvc::div(U); Info<< fvc::div(U);
Info<< "End" << endl; Info<< "End\n" << endl;
} }

View File

@ -56,7 +56,7 @@ int main()
a = h + i + j; a = h + i + j;
Info<< a << endl; Info<< a << endl;
Info<< "End" << endl; Info<< "End\n" << endl;
return 0; return 0;
} }

View File

@ -59,7 +59,7 @@ int main(int argc, char *argv[])
Info<< (gradx4a - gradx4[i])/gradx4a << endl; Info<< (gradx4a - gradx4[i])/gradx4a << endl;
} }
Info<< "End" << endl; Info<< "End\n" << endl;
} }

View File

@ -67,7 +67,7 @@ int main(int argc, char *argv[])
mesh mesh
); );
Info<< "End" << endl; Info<< "End\n" << endl;
} }

View File

@ -67,7 +67,7 @@ int main()
); );
phi.write("phi", "xmgr"); phi.write("phi", "xmgr");
Info<< "End" << endl; Info<< "End\n" << endl;
} }

View File

@ -59,7 +59,7 @@ int main()
"xmgr" "xmgr"
); );
Info<< "End" << endl; Info<< "End\n" << endl;
} }

View File

@ -59,7 +59,7 @@ int main()
graph("r", "x", "r", x, r).write("r", "xmgr"); graph("r", "x", "r", x, r).write("r", "xmgr");
Info<< "End" << endl; Info<< "End\n" << endl;
return 0; return 0;
} }

View File

@ -159,7 +159,7 @@ int main(int argc, char *argv[])
runTime.writeEndDivider(pFile); runTime.writeEndDivider(pFile);
Info<< "End" << endl; Info<< "End\n" << endl;
return 0; return 0;
} }

View File

@ -146,7 +146,7 @@ int main(int argc, char *argv[])
refData.updateMesh(map); refData.updateMesh(map);
refData.write(); refData.write();
Info<< "End" << nl << endl; Info<< "End\n" << endl;
return 0; return 0;
} }

View File

@ -346,7 +346,7 @@ int main(int argc, char *argv[])
Info<< endl; Info<< endl;
} }
Info<< "End" << nl << endl; Info<< "End\n" << endl;
return 0; return 0;
} }

View File

@ -66,9 +66,9 @@ int main(int argc, char *argv[])
runTime.printExecutionTime(Info); runTime.printExecutionTime(Info);
Info<< "End" << endl; Info<< "End\n" << endl;
return(0); return 0;
} }

View File

@ -154,7 +154,7 @@ int main(int argc, char *argv[])
Info<< "End\n" << endl; Info<< "End\n" << endl;
return(0); return 0;
} }

View File

@ -85,7 +85,7 @@ int main(int argc, char *argv[])
runTime.graphFormat() runTime.graphFormat()
); );
Info<< "End" << nl << endl; Info<< "End\n" << endl;
return 0; return 0;
} }