View Issue Details

IDProjectCategoryView StatusLast Update
0002356OpenFOAMPatchpublic2016-11-28 21:27
Reporterwyldckat Assigned Tohenry  
PrioritylowSeveritytextReproducibilityN/A
Status resolvedResolutionfixed 
Product Versiondev 
Fixed in Versiondev 
Summary0002356: A couple of outdated member type comments were found: realizableKE and incompressibleTwoPhaseMixture
DescriptionMy colleague Pedro Freitas happened to notice this past Friday that the 'realizableKE.C' file in OpenFOAM 2.2.x had the comment "Private Member Functions" when the members are actually in the "Protected" section of the class. We then went looking and this was still occurring in 4.x and OpenFOAM-dev.

I suspected that there were likely more occurrences like this and used something like the following command to find similar occurrences:

  find src -name "*.C" -type f | xargs grep "Private" -sl | while read line; do [ -e ${line%%.C}.H ] && grep protected ${line%%.C}.H -q && echo "${line%%.C}.[CH]" ; done

It allowed to spot at least a few similar occurrences and the only one I bothered also fixing was 'incompressibleTwoPhaseMixture'.

I'll attach the patch for these two in a few minutes.
TagsNo tags attached.

Activities

wyldckat

2016-11-28 00:28

updater   ~0007349

Attached is the package "realizableKE_incompressibleTwoPhaseMixture.tar.gz" that provides the following files:

  src/TurbulenceModels/turbulenceModels/RAS/realizableKE/realizableKE.C
  src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.C
  src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.H

The attached file "realizableKE_incompressibleTwoPhaseMixture.patch" shows the changes made.

wyldckat

2016-11-28 00:29

updater  

realizableKE_incompressibleTwoPhaseMixture.patch (2,021 bytes)   
diff --git a/src/TurbulenceModels/turbulenceModels/RAS/realizableKE/realizableKE.C b/src/TurbulenceModels/turbulenceModels/RAS/realizableKE/realizableKE.C
index dccfea3..38269f2 100644
--- a/src/TurbulenceModels/turbulenceModels/RAS/realizableKE/realizableKE.C
+++ b/src/TurbulenceModels/turbulenceModels/RAS/realizableKE/realizableKE.C
@@ -34,7 +34,7 @@ namespace Foam
 namespace RASModels
 {
 
-// * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 template<class BasicTurbulenceModel>
 tmp<volScalarField> realizableKE<BasicTurbulenceModel>::rCmu
diff --git a/src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.C b/src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.C
index ecd9105..f951140 100644
--- a/src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.C
+++ b/src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.C
@@ -36,7 +36,7 @@ namespace Foam
 }
 
 
-// * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 void Foam::incompressibleTwoPhaseMixture::calcNu()
 {
diff --git a/src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.H b/src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.H
index 6928f50..a9c9a29 100644
--- a/src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.H
+++ b/src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.H
@@ -72,7 +72,7 @@ protected:
         volScalarField nu_;
 
 
-    // Private Member Functions
+    // Protected Member Functions
 
         //- Calculate and return the laminar viscosity
         void calcNu();

wyldckat

2016-11-28 00:33

updater   ~0007350

In order to fix all similar occurrences, a C++ parser application of some sort will be needed to assist us in ensuring the comments properly match up with the respective sections. Unfortunately I'm not aware of any application that does this.

Furthermore, this kind of decomposition of the C++ code into each section would make it easier to use spelling checking for the comments.

henry

2016-11-28 21:27

manager   ~0007355

Resolved by

commit 8bfff27468a602cf2f3417190c98e4b96c77997c
commit ea67173330a9ac6736df39780cee55beb8469e8e

Issue History

Date Modified Username Field Change
2016-11-28 00:25 wyldckat New Issue
2016-11-28 00:25 wyldckat Status new => assigned
2016-11-28 00:25 wyldckat Assigned To => henry
2016-11-28 00:28 wyldckat File Added: realizableKE_incompressibleTwoPhaseMixture.tar.gz
2016-11-28 00:28 wyldckat Note Added: 0007349
2016-11-28 00:29 wyldckat File Added: realizableKE_incompressibleTwoPhaseMixture.patch
2016-11-28 00:33 wyldckat Note Added: 0007350
2016-11-28 21:27 henry Status assigned => resolved
2016-11-28 21:27 henry Resolution open => fixed
2016-11-28 21:27 henry Fixed in Version => dev
2016-11-28 21:27 henry Note Added: 0007355