From 50f2b4bb993aac658387f3dac980db9177fe7b2a Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Tue, 19 Aug 2014 20:26:19 +0100 Subject: [PATCH 1/6] Formatting --- .../polyPatches/constraint/overlapGgi/overlapGgiPolyPatch.H | 2 ++ .../constraint/overlapGgi/overlapGgiPolyPatchTemplates.C | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/foam/meshes/polyMesh/polyPatches/constraint/overlapGgi/overlapGgiPolyPatch.H b/src/foam/meshes/polyMesh/polyPatches/constraint/overlapGgi/overlapGgiPolyPatch.H index 9532a3442..533b22d88 100644 --- a/src/foam/meshes/polyMesh/polyPatches/constraint/overlapGgi/overlapGgiPolyPatch.H +++ b/src/foam/meshes/polyMesh/polyPatches/constraint/overlapGgi/overlapGgiPolyPatch.H @@ -87,6 +87,7 @@ class overlapGgiPolyPatch // Number of copies in order to complete 360 degrees const label nCopies_; + // Interpolation //- Pointer to expanded master patch @@ -106,6 +107,7 @@ class overlapGgiPolyPatch //- Reconstructed patch neighbour cell centres mutable vectorField* reconFaceCellCentresPtr_; + // Private member functions //- Return reference to patch-to-patch interpolation diff --git a/src/foam/meshes/polyMesh/polyPatches/constraint/overlapGgi/overlapGgiPolyPatchTemplates.C b/src/foam/meshes/polyMesh/polyPatches/constraint/overlapGgi/overlapGgiPolyPatchTemplates.C index 8792147ae..dea315d7e 100644 --- a/src/foam/meshes/polyMesh/polyPatches/constraint/overlapGgi/overlapGgiPolyPatchTemplates.C +++ b/src/foam/meshes/polyMesh/polyPatches/constraint/overlapGgi/overlapGgiPolyPatchTemplates.C @@ -85,6 +85,7 @@ Foam::overlapGgiPolyPatch::expandData(const Field& pf) const return texpandField; } + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template @@ -138,4 +139,5 @@ Foam::overlapGgiPolyPatch::interpolate(const tmp >& tpf) const return tint; } + // ************************************************************************* // From b9497d6460542d9d8dd2fc84629d22334f44c395 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Tue, 19 Aug 2014 21:32:03 +0100 Subject: [PATCH 2/6] Type --- .../fvMesh/fvPatches/constraint/cyclic/cyclicFvPatch.C | 2 +- .../fvMesh/fvPatches/constraint/cyclicGgi/cyclicGgiFvPatch.C | 2 +- src/finiteVolume/fvMesh/fvPatches/constraint/ggi/ggiFvPatch.C | 2 +- .../fvPatches/constraint/mixingPlane/mixingPlaneFvPatch.C | 2 +- .../fvMesh/fvPatches/constraint/overlapGgi/overlapGgiFvPatch.C | 2 +- .../fvMesh/fvPatches/constraint/processor/processorFvPatch.C | 2 +- .../fvPatches/constraint/regionCouple/regionCoupleFvPatch.C | 2 +- .../surfaceInterpolation/surfaceInterpolation.C | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/finiteVolume/fvMesh/fvPatches/constraint/cyclic/cyclicFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/constraint/cyclic/cyclicFvPatch.C index e88c0617d..d756175dd 100644 --- a/src/finiteVolume/fvMesh/fvPatches/constraint/cyclic/cyclicFvPatch.C +++ b/src/finiteVolume/fvMesh/fvPatches/constraint/cyclic/cyclicFvPatch.C @@ -46,7 +46,7 @@ void cyclicFvPatch::makeWeights(scalarField& w) const const scalarField& magFa = magSf(); // Note: mag in the dot-product. - // For all valid meshes, the non-orthogonality will be less that + // For all valid meshes, the non-orthogonality will be less than // 90 deg and the dot-product will be positive. For invalid // meshes (d & s <= 0), this will stabilise the calculation // but the result will be poor. HJ, 24/Aug/2011 diff --git a/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicGgi/cyclicGgiFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicGgi/cyclicGgiFvPatch.C index 8ca21308b..7cf818939 100644 --- a/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicGgi/cyclicGgiFvPatch.C +++ b/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicGgi/cyclicGgiFvPatch.C @@ -55,7 +55,7 @@ void Foam::cyclicGgiFvPatch::makeWeights(scalarField& w) const vectorField n = nf(); // Note: mag in the dot-product. - // For all valid meshes, the non-orthogonality will be less that + // For all valid meshes, the non-orthogonality will be less than // 90 deg and the dot-product will be positive. For invalid // meshes (d & s <= 0), this will stabilise the calculation // but the result will be poor. HJ, 24/Aug/2011 diff --git a/src/finiteVolume/fvMesh/fvPatches/constraint/ggi/ggiFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/constraint/ggi/ggiFvPatch.C index 1e55bea85..5d8803c20 100644 --- a/src/finiteVolume/fvMesh/fvPatches/constraint/ggi/ggiFvPatch.C +++ b/src/finiteVolume/fvMesh/fvPatches/constraint/ggi/ggiFvPatch.C @@ -65,7 +65,7 @@ void Foam::ggiFvPatch::makeWeights(scalarField& w) const vectorField n = nf(); // Note: mag in the dot-product. - // For all valid meshes, the non-orthogonality will be less that + // For all valid meshes, the non-orthogonality will be less than // 90 deg and the dot-product will be positive. For invalid // meshes (d & s <= 0), this will stabilise the calculation // but the result will be poor. HJ, 24/Aug/2011 diff --git a/src/finiteVolume/fvMesh/fvPatches/constraint/mixingPlane/mixingPlaneFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/constraint/mixingPlane/mixingPlaneFvPatch.C index ec24a6fa2..5ffa52042 100644 --- a/src/finiteVolume/fvMesh/fvPatches/constraint/mixingPlane/mixingPlaneFvPatch.C +++ b/src/finiteVolume/fvMesh/fvPatches/constraint/mixingPlane/mixingPlaneFvPatch.C @@ -64,7 +64,7 @@ void Foam::mixingPlaneFvPatch::makeWeights(scalarField& w) const vectorField n = nf(); // Note: mag in the dot-product. - // For all valid meshes, the non-orthogonality will be less that + // For all valid meshes, the non-orthogonality will be less than // 90 deg and the dot-product will be positive. For invalid // meshes (d & s <= 0), this will stabilise the calculation // but the result will be poor. HJ, 24/Aug/2011 diff --git a/src/finiteVolume/fvMesh/fvPatches/constraint/overlapGgi/overlapGgiFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/constraint/overlapGgi/overlapGgiFvPatch.C index a33e7f8dd..0b7189937 100644 --- a/src/finiteVolume/fvMesh/fvPatches/constraint/overlapGgi/overlapGgiFvPatch.C +++ b/src/finiteVolume/fvMesh/fvPatches/constraint/overlapGgi/overlapGgiFvPatch.C @@ -52,7 +52,7 @@ void Foam::overlapGgiFvPatch::makeWeights(scalarField& w) const vectorField n = nf(); // Note: mag in the dot-product. - // For all valid meshes, the non-orthogonality will be less that + // For all valid meshes, the non-orthogonality will be less than // 90 deg and the dot-product will be positive. For invalid // meshes (d & s <= 0), this will stabilise the calculation // but the result will be poor. HJ, 24/Aug/2011 diff --git a/src/finiteVolume/fvMesh/fvPatches/constraint/processor/processorFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/constraint/processor/processorFvPatch.C index 9abf9ead9..75eb872eb 100644 --- a/src/finiteVolume/fvMesh/fvPatches/constraint/processor/processorFvPatch.C +++ b/src/finiteVolume/fvMesh/fvPatches/constraint/processor/processorFvPatch.C @@ -47,7 +47,7 @@ void processorFvPatch::makeWeights(scalarField& w) const // The face normals point in the opposite direction on the other side // Note: mag in the dot-product. - // For all valid meshes, the non-orthogonality will be less that + // For all valid meshes, the non-orthogonality will be less than // 90 deg and the dot-product will be positive. For invalid // meshes (d & s <= 0), this will stabilise the calculation // but the result will be poor. HJ, 24/Aug/2011 diff --git a/src/finiteVolume/fvMesh/fvPatches/constraint/regionCouple/regionCoupleFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/constraint/regionCouple/regionCoupleFvPatch.C index 7d19bbf52..c84d5b9f1 100644 --- a/src/finiteVolume/fvMesh/fvPatches/constraint/regionCouple/regionCoupleFvPatch.C +++ b/src/finiteVolume/fvMesh/fvPatches/constraint/regionCouple/regionCoupleFvPatch.C @@ -62,7 +62,7 @@ void Foam::regionCoupleFvPatch::makeWeights(scalarField& w) const vectorField n = nf(); // Note: mag in the dot-product. - // For all valid meshes, the non-orthogonality will be less that + // For all valid meshes, the non-orthogonality will be less than // 90 deg and the dot-product will be positive. For invalid // meshes (d & s <= 0), this will stabilise the calculation // but the result will be poor. HJ, 24/Aug/2011 diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C index ce4ca6ed8..a07f90cd2 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C @@ -171,7 +171,7 @@ void Foam::surfaceInterpolation::makeWeights() const forAll (owner, facei) { // Note: mag in the dot-product. - // For all valid meshes, the non-orthogonality will be less that + // For all valid meshes, the non-orthogonality will be less than // 90 deg and the dot-product will be positive. For invalid // meshes (d & s <= 0), this will stabilise the calculation // but the result will be poor. From a06d78d48b67d51218ac1b078e2c6175279aec77 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Sun, 24 Aug 2014 12:58:34 +0100 Subject: [PATCH 3/6] Formatting --- .../meshToMeshInterpolation/meshToMesh/meshToMesh.H | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/sampling/meshToMeshInterpolation/meshToMesh/meshToMesh.H b/src/sampling/meshToMeshInterpolation/meshToMesh/meshToMesh.H index 49d3d6761..d49c71828 100644 --- a/src/sampling/meshToMeshInterpolation/meshToMesh/meshToMesh.H +++ b/src/sampling/meshToMeshInterpolation/meshToMesh/meshToMesh.H @@ -275,7 +275,7 @@ public: ( Field&, const GeometricField&, - order=INTERPOLATE + order = INTERPOLATE ) const; template @@ -283,7 +283,7 @@ public: ( Field&, const tmp >&, - order=INTERPOLATE + order = INTERPOLATE ) const; @@ -293,7 +293,7 @@ public: ( GeometricField&, const GeometricField&, - order=INTERPOLATE + order = INTERPOLATE ) const; template @@ -301,7 +301,7 @@ public: ( GeometricField&, const tmp >&, - order=INTERPOLATE + order = INTERPOLATE ) const; @@ -310,14 +310,14 @@ public: tmp > interpolate ( const GeometricField&, - order=INTERPOLATE + order = INTERPOLATE ) const; template tmp > interpolate ( const tmp >&, - order=INTERPOLATE + order = INTERPOLATE ) const; }; From be2ecaad3b29da8b023b5f9a7f3af43a8a1560ab Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Wed, 27 Aug 2014 11:29:55 +0100 Subject: [PATCH 4/6] Removed empty line --- .../meshToMesh/calculateMeshToMeshAddressing.C | 1 - 1 file changed, 1 deletion(-) diff --git a/src/sampling/meshToMeshInterpolation/meshToMesh/calculateMeshToMeshAddressing.C b/src/sampling/meshToMeshInterpolation/meshToMesh/calculateMeshToMeshAddressing.C index d306d77b7..33f69875c 100644 --- a/src/sampling/meshToMeshInterpolation/meshToMesh/calculateMeshToMeshAddressing.C +++ b/src/sampling/meshToMeshInterpolation/meshToMesh/calculateMeshToMeshAddressing.C @@ -410,7 +410,6 @@ void meshToMesh::cellAddresses } } - } } } From 8166e39e54665d05e80f4ac21da15555aeba563c Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Fri, 26 Sep 2014 16:03:05 +0100 Subject: [PATCH 5/6] Formatting --- .../fvPatchFields/constraint/cyclic/cyclicFvPatchField.C | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.C index b85b27156..5732f36ff 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.C @@ -150,7 +150,7 @@ tmp > cyclicFvPatchField::patchNeighbourField() const if (doTransform()) { - for (label facei=0; facei > cyclicFvPatchField::patchNeighbourField() const } else { - for (label facei=0; facei::updateInterfaceMatrix label sizeby2 = this->size()/2; const unallocLabelList& faceCells = cyclicPatch_.faceCells(); - for (label facei=0; facei Date: Fri, 26 Sep 2014 15:07:18 +0100 Subject: [PATCH 6/6] Robustness change: empty face --- .../mesh/conversion/ansysToFoam/ansysToFoam.L | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L b/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L index 514b8383a..980d39da9 100644 --- a/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L +++ b/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L @@ -33,9 +33,9 @@ Description #undef yyFlexLexer - /* ------------------------------------------------------------------------- *\ + /* ------------------------------------------------------------------------ *\ ------ local definitions - \* ------------------------------------------------------------------------- */ + \* ------------------------------------------------------------------------ */ #include // For EOF only @@ -124,9 +124,9 @@ elementType ^{space}"TYPE"{cspace} %} - /* ------------------------------------------------------------------------- *\ + /* ------------------------------------------------------------------------ *\ ------ Start Lexing ------ - \* ------------------------------------------------------------------------- */ + \* ------------------------------------------------------------------------ */ {node}{label}{cspace}{x}{cspace}{y}{cspace}{z}{space}\n { IStringStream nodeStream(YYText()); @@ -249,16 +249,16 @@ elementType ^{space}"TYPE"{cspace} - /* ------------------------------------------------------------------------- *\ + /* ------------------------------------------------------------------------ *\ ------ Ignore remaining space and \n s. Any other characters are errors. - \* ------------------------------------------------------------------------- */ + \* ------------------------------------------------------------------------ */ .|\n {} - /* ------------------------------------------------------------------------- *\ + /* ------------------------------------------------------------------------ *\ ------ On EOF return to previous file, if none exists terminate. - \* ------------------------------------------------------------------------- */ + \* ------------------------------------------------------------------------ */ <> { yyterminate(); @@ -270,16 +270,24 @@ elementType ^{space}"TYPE"{cspace} #include using std::ifstream; - label findFace(const polyMesh& mesh, const face& f) { + if (f.empty()) + { + FatalErrorIn("findFace(const polyMesh&, const face&)") + << "Empty face found: " << f + << exit(FatalError); + } + + const faceList& faces = mesh.faces(); + const labelList& pFaces = mesh.pointFaces()[f[0]]; - forAll(pFaces, i) + forAll (pFaces, i) { label faceI = pFaces[i]; - if (mesh.faces()[faceI] == f) + if (faces[faceI] == f) { return faceI; }