CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (http://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   Bug in decomposePar and reconstructPar (http://www.cfd-online.com/Forums/openfoam-bugs/74158-bug-decomposepar-reconstructpar.html)

jutta March 25, 2010 13:38

Bug in decomposePar and reconstructPar
 
Hi,

while decomposing my initial fields I recognized a bug: In contrast to vol and point fields, only surfaceScalarFields are implemented in decomposePar and reconstructPar but no other surface<type>Fields. I found no reason for this restriction, so I added the missing field types in decomposePar.C and reconstructPar.C. I tested all types and it works fine.

For the sake of completeness, could you add it in 1.6.x, please?

Below you find my changes in the two mentioned files.

Best regards,
Jutta

Code:

diff --git a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C
index b2e08a6..5f80b17 100644
--- a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C
+++ b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C
@@ -316,6 +316,17 @@ int main(int argc, char *argv[])
    PtrList<surfaceScalarField> surfaceScalarFields;
    readFields(mesh, objects, surfaceScalarFields);
 
+    PtrList<surfaceVectorField> surfaceVectorFields;
+    readFields(mesh, objects, surfaceVectorFields);
+
+    PtrList<surfaceSphericalTensorField> surfaceSphericalTensorFields;
+    readFields(mesh, objects, surfaceSphericalTensorFields);
+
+    PtrList<surfaceSymmTensorField> surfaceSymmTensorFields;
+    readFields(mesh, objects, surfaceSymmTensorFields);
+
+    PtrList<surfaceTensorField> surfaceTensorFields;
+    readFields(mesh, objects, surfaceTensorFields);
 
    // Construct the point fields
    // ~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -600,6 +611,10 @@ int main(int argc, char *argv[])
          || volSymmTensorFields.size()
          || volTensorFields.size()
          || surfaceScalarFields.size()
+        || surfaceVectorFields.size()
+        || surfaceSphericalTensorFields.size()
+        || surfaceSymmTensorFields.size()
+        || surfaceTensorFields.size()
        )
        {
            labelIOList faceProcAddressing
@@ -631,6 +646,10 @@ int main(int argc, char *argv[])
            fieldDecomposer.decomposeFields(volTensorFields);
 
            fieldDecomposer.decomposeFields(surfaceScalarFields);
+            fieldDecomposer.decomposeFields(surfaceVectorFields);
+            fieldDecomposer.decomposeFields(surfaceSphericalTensorFields);
+            fieldDecomposer.decomposeFields(surfaceSymmTensorFields);
+            fieldDecomposer.decomposeFields(surfaceTensorFields);
        }
 
 
diff --git a/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C b/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C
index dd014c2..d2d61e5 100644
--- a/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C
+++ b/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C
@@ -181,6 +181,10 @@ int main(int argc, char *argv[])
          || objects.lookupClass(volSymmTensorField::typeName).size()
          || objects.lookupClass(volTensorField::typeName).size()
          || objects.lookupClass(surfaceScalarField::typeName).size()
+        || objects.lookupClass(surfaceVectorField::typeName).size()
+        || objects.lookupClass(surfaceSphericalTensorField::typeName).size()
+        || objects.lookupClass(surfaceSymmTensorField::typeName).size()
+        || objects.lookupClass(surfaceTensorField::typeName).size()
        )
        {
            Info << "Reconstructing FV fields" << nl << endl;
@@ -225,6 +229,26 @@ int main(int argc, char *argv[])
                objects,
                selectedFields
            );
+            fvReconstructor.reconstructFvSurfaceFields<vector>
+            (
+                objects,
+                selectedFields
+            );
+            fvReconstructor.reconstructFvSurfaceFields<sphericalTensor>
+            (
+                objects,
+                selectedFields
+            );
+            fvReconstructor.reconstructFvSurfaceFields<symmTensor>
+            (
+                objects,
+                selectedFields
+            );
+            fvReconstructor.reconstructFvSurfaceFields<tensor>
+            (
+                objects,
+                selectedFields
+            );
        }
        else
        {


mattijs March 26, 2010 05:51

Thanks - done.


All times are GMT -4. The time now is 02:50.