From 2a4b7df8fc2c3ab57886951998e08dfd501f0e57 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 18 Dec 2013 11:34:48 +0000 Subject: [PATCH 1/9] ENH: pitzDailyExptInlet: do not supply initial value --- .../simpleFoam/pitzDailyExptInlet/0/epsilon | 35 ------------------- .../simpleFoam/pitzDailyExptInlet/0/k | 35 ------------------- 2 files changed, 70 deletions(-) diff --git a/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/0/epsilon b/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/0/epsilon index b70f15f119..01dccefae7 100644 --- a/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/0/epsilon +++ b/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/0/epsilon @@ -26,41 +26,6 @@ boundaryField type timeVaryingMappedFixedValue; setAverage 0; offset 0; - value nonuniform List -30 -( -9813.84 -8665.24 -1866.31 -755.118 -205.654 -76.6694 -28.4518 -16.0868 -15.9867 -11.0187 -7.95753 -5.26064 -3.44136 -2.55317 -2.27183 -2.33608 -2.9115 -3.59492 -3.0497 -2.716 -2.9325 -3.88456 -6.91821 -14.9754 -37.5461 -217.022 -2043.58 -4864.22 -6244 -6334.7 -) -; } outlet { diff --git a/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/0/k b/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/0/k index f5f11a1aed..c0fa4d80d4 100644 --- a/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/0/k +++ b/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/0/k @@ -26,41 +26,6 @@ boundaryField type timeVaryingMappedFixedValue; setAverage 0; offset 0; - value nonuniform List -30 -( -2.95219 -2.54219 -0.725449 -0.486465 -0.353566 -0.240375 -0.172984 -0.147052 -0.146827 -0.135658 -0.12147 -0.0942189 -0.0833465 -0.0828453 -0.0955983 -0.0920838 -0.0967682 -0.0990811 -0.100866 -0.101556 -0.0967155 -0.0841739 -0.0904567 -0.130411 -0.194046 -0.219327 -0.975528 -2.22578 -3.12421 -2.28104 -) -; } outlet { From cb8b96d2cf5ff4cc541533171296fcd2955ff810 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 18 Dec 2013 12:06:06 +0000 Subject: [PATCH 2/9] ENH: OFstream: corrected message --- src/OpenFOAM/db/IOstreams/Fstreams/OFstream.C | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/OpenFOAM/db/IOstreams/Fstreams/OFstream.C b/src/OpenFOAM/db/IOstreams/Fstreams/OFstream.C index 3feefdaf40..1a09b7f473 100644 --- a/src/OpenFOAM/db/IOstreams/Fstreams/OFstream.C +++ b/src/OpenFOAM/db/IOstreams/Fstreams/OFstream.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -104,10 +104,10 @@ Foam::OFstream::OFstream { if (debug) { - Info<< "IFstream::IFstream(const fileName&," - "streamFormat format=ASCII," - "versionNumber version=currentVersion) : " - "could not open file for input\n" + Info<< "OFstream::OFstream(const fileName&," + "streamFormat, versionNumber, compressionType) : " + "could not open file " << pathname + << "for input\n" "in stream " << info() << Foam::endl; } From a494b17e98cc8a24f5cba1f2c7991a171bd95391 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 18 Dec 2013 12:08:42 +0000 Subject: [PATCH 3/9] ENH: extendedEdgeMesh: check for support --- src/edgeMesh/Make/files | 2 - .../extendedEdgeMesh/extendedEdgeMesh.C | 63 ++++++++++ .../extendedEdgeMesh/extendedEdgeMesh.H | 12 ++ .../obj/OBJextendedEdgeFormat.C | 66 ---------- .../obj/OBJextendedEdgeFormat.H | 119 ------------------ .../obj/OBJextendedEdgeFormatRunTime.C | 60 --------- 6 files changed, 75 insertions(+), 247 deletions(-) delete mode 100644 src/edgeMesh/extendedEdgeMesh/extendedEdgeMeshFormats/obj/OBJextendedEdgeFormat.C delete mode 100644 src/edgeMesh/extendedEdgeMesh/extendedEdgeMeshFormats/obj/OBJextendedEdgeFormat.H delete mode 100644 src/edgeMesh/extendedEdgeMesh/extendedEdgeMeshFormats/obj/OBJextendedEdgeFormatRunTime.C diff --git a/src/edgeMesh/Make/files b/src/edgeMesh/Make/files index ed4cec5d95..0438dd204e 100644 --- a/src/edgeMesh/Make/files +++ b/src/edgeMesh/Make/files @@ -35,8 +35,6 @@ eem = $(em)/extendedEdgeMesh $(eem)/extendedEdgeMesh.C $(eem)/extendedEdgeMeshNew.C -$(eem)/extendedEdgeMeshFormats/obj/OBJextendedEdgeFormat.C -$(eem)/extendedEdgeMeshFormats/obj/OBJextendedEdgeFormatRunTime.C $(eem)/extendedEdgeMeshFormats/extendedEdgeMeshFormat/extendedEdgeMeshFormat.C $(eem)/extendedEdgeMeshFormats/extendedEdgeMeshFormat/extendedEdgeMeshFormatRunTime.C diff --git a/src/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.C b/src/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.C index 999d2f0651..5ac41224e3 100644 --- a/src/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.C +++ b/src/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.C @@ -30,6 +30,7 @@ License #include "Time.H" #include "OBJstream.H" #include "DynamicField.H" +#include "edgeMeshFormatsCore.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -104,6 +105,68 @@ Foam::label Foam::extendedEdgeMesh::nPointTypes = 4; Foam::label Foam::extendedEdgeMesh::nEdgeTypes = 5; +Foam::wordHashSet Foam::extendedEdgeMesh::readTypes() +{ + return wordHashSet(*fileExtensionConstructorTablePtr_); +} + + +Foam::wordHashSet Foam::extendedEdgeMesh::writeTypes() +{ + return wordHashSet(*writefileExtensionMemberFunctionTablePtr_); +} + + + +// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // + +bool Foam::extendedEdgeMesh::canReadType +( + const word& ext, + const bool verbose +) +{ + return edgeMeshFormatsCore::checkSupport + ( + readTypes(), + ext, + verbose, + "reading" + ); +} + + +bool Foam::extendedEdgeMesh::canWriteType +( + const word& ext, + const bool verbose +) +{ + return edgeMeshFormatsCore::checkSupport + ( + writeTypes(), + ext, + verbose, + "writing" + ); +} + + +bool Foam::extendedEdgeMesh::canRead +( + const fileName& name, + const bool verbose +) +{ + word ext = name.ext(); + if (ext == "gz") + { + ext = name.lessExt().ext(); + } + return canReadType(ext, verbose); +} + + // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // Foam::extendedEdgeMesh::pointStatus diff --git a/src/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.H b/src/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.H index 2648321888..58e2ba8cab 100644 --- a/src/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.H +++ b/src/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.H @@ -225,6 +225,18 @@ public: //- Number of possible feature edge types (i.e. number of slices) static label nEdgeTypes; + //- Can we read this file format? + static bool canRead(const fileName&, const bool verbose=false); + + //- Can we read this file format? + static bool canReadType(const word& ext, const bool verbose=false); + + //- Can we write this file format type? + static bool canWriteType(const word& ext, const bool verbose=false); + + static wordHashSet readTypes(); + static wordHashSet writeTypes(); + // Constructors diff --git a/src/edgeMesh/extendedEdgeMesh/extendedEdgeMeshFormats/obj/OBJextendedEdgeFormat.C b/src/edgeMesh/extendedEdgeMesh/extendedEdgeMeshFormats/obj/OBJextendedEdgeFormat.C deleted file mode 100644 index d63ad27ed9..0000000000 --- a/src/edgeMesh/extendedEdgeMesh/extendedEdgeMeshFormats/obj/OBJextendedEdgeFormat.C +++ /dev/null @@ -1,66 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "OBJextendedEdgeFormat.H" -#include "OBJedgeFormat.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::fileFormats::OBJextendedEdgeFormat::OBJextendedEdgeFormat -( - const fileName& filename -) -{ - read(filename); -} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -bool Foam::fileFormats::OBJextendedEdgeFormat::read(const fileName& filename) -{ - edgeMesh em(filename); - - clear(); - - // Note: should transfer here instead - storedPoints() = em.points(); - storedEdges() = em.edges(); - - return true; -} - - -void Foam::fileFormats::OBJextendedEdgeFormat::write -( - const fileName& filename, - const extendedEdgeMesh& mesh -) -{ - OBJedgeFormat::write(filename, mesh); -} - - -// ************************************************************************* // diff --git a/src/edgeMesh/extendedEdgeMesh/extendedEdgeMeshFormats/obj/OBJextendedEdgeFormat.H b/src/edgeMesh/extendedEdgeMesh/extendedEdgeMeshFormats/obj/OBJextendedEdgeFormat.H deleted file mode 100644 index a65409f446..0000000000 --- a/src/edgeMesh/extendedEdgeMesh/extendedEdgeMeshFormats/obj/OBJextendedEdgeFormat.H +++ /dev/null @@ -1,119 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Class - Foam::fileFormats::OBJextendedEdgeFormat - -Description - Provide a means of reading/writing Alias/Wavefront OBJ format. - - Does not handle negative vertex indices. - -SourceFiles - OBJextendedEdgeFormat.C - -\*---------------------------------------------------------------------------*/ - -#ifndef OBJextendedEdgeFormat_H -#define OBJextendedEdgeFormat_H - -#include "extendedEdgeMesh.H" -//#include "IFstream.H" -//#include "Ostream.H" -#include "OFstream.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace fileFormats -{ - -/*---------------------------------------------------------------------------*\ - Class OBJextendedEdgeFormat Declaration -\*---------------------------------------------------------------------------*/ - -class OBJextendedEdgeFormat -: - public extendedEdgeMesh -{ - // Private Member Functions - - //- Disallow default bitwise copy construct - OBJextendedEdgeFormat(const OBJextendedEdgeFormat&); - - //- Disallow default bitwise assignment - void operator=(const OBJextendedEdgeFormat&); - - -public: - - // Constructors - - //- Construct from file name - OBJextendedEdgeFormat(const fileName&); - - -// // Selectors -// -// //- Read file and return surface -// static autoPtr New(const fileName& name) -// { -// return autoPtr -// ( -// new OBJextendedEdgeFormat(name) -// ); -// } -// - - //- Destructor - virtual ~OBJextendedEdgeFormat() - {} - - - // Member Functions - - //- Write surface mesh components by proxy - static void write(const fileName&, const extendedEdgeMesh&); - - //- Read from file - virtual bool read(const fileName&); - - //- Write object file - virtual void write(const fileName& name) const - { - write(name, *this); - } -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace fileFormats -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/edgeMesh/extendedEdgeMesh/extendedEdgeMeshFormats/obj/OBJextendedEdgeFormatRunTime.C b/src/edgeMesh/extendedEdgeMesh/extendedEdgeMeshFormats/obj/OBJextendedEdgeFormatRunTime.C deleted file mode 100644 index c88513a104..0000000000 --- a/src/edgeMesh/extendedEdgeMesh/extendedEdgeMeshFormats/obj/OBJextendedEdgeFormatRunTime.C +++ /dev/null @@ -1,60 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "OBJextendedEdgeFormat.H" - -#include "addToRunTimeSelectionTable.H" -#include "addToMemberFunctionSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ -namespace fileFormats -{ - -// read extendedEdgeMesh -addNamedToRunTimeSelectionTable -( - extendedEdgeMesh, - OBJextendedEdgeFormat, - fileExtension, - obj -); - -//// write extendedEdgeMesh -//addNamedToMemberFunctionSelectionTable -//( -// extendedEdgeMesh, -// OBJextendedEdgeFormat, -// write, -// fileExtension, -// obj -//); - -} -} - -// ************************************************************************* // From fe4762ca58c7ee45e238a88a685a02ab3dfd8ba5 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 18 Dec 2013 12:11:49 +0000 Subject: [PATCH 4/9] ENH: surfaceLambdaMuSmooth: added reference --- .../surface/surfaceLambdaMuSmooth/surfaceLambdaMuSmooth.C | 3 +++ 1 file changed, 3 insertions(+) diff --git a/applications/utilities/surface/surfaceLambdaMuSmooth/surfaceLambdaMuSmooth.C b/applications/utilities/surface/surfaceLambdaMuSmooth/surfaceLambdaMuSmooth.C index c76e466f83..cc1981e1d5 100644 --- a/applications/utilities/surface/surfaceLambdaMuSmooth/surfaceLambdaMuSmooth.C +++ b/applications/utilities/surface/surfaceLambdaMuSmooth/surfaceLambdaMuSmooth.C @@ -33,6 +33,9 @@ Description Provide an edgeMesh file containing points that are not to be moved during smoothing in order to preserve features. + lambda/mu smoothing: G. Taubin, IBM Research report Rc-19923 (02/01/95) + "A signal processing approach to fair surface design" + \*---------------------------------------------------------------------------*/ #include "argList.H" From 64b6f921e806859896915a518206ebf312ebf7cf Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 19 Dec 2013 11:21:31 +0000 Subject: [PATCH 5/9] ENH: icoFoam tutorials: clean up script --- tutorials/incompressible/icoFoam/Allclean | 3 + tutorials/incompressible/icoFoam/Allrun | 18 +----- .../incompressible/icoFoam/elbow/Allclean | 11 ++++ tutorials/incompressible/icoFoam/elbow/Allrun | 15 +++++ .../icoFoam/elbow/constant/polyMesh/boundary | 58 ------------------- 5 files changed, 31 insertions(+), 74 deletions(-) create mode 100755 tutorials/incompressible/icoFoam/elbow/Allclean create mode 100755 tutorials/incompressible/icoFoam/elbow/Allrun delete mode 100644 tutorials/incompressible/icoFoam/elbow/constant/polyMesh/boundary diff --git a/tutorials/incompressible/icoFoam/Allclean b/tutorials/incompressible/icoFoam/Allclean index 79a05d40a4..587ffb1d53 100755 --- a/tutorials/incompressible/icoFoam/Allclean +++ b/tutorials/incompressible/icoFoam/Allclean @@ -30,4 +30,7 @@ do removeCase $caseName done + +(cd elbow && ./Allclean) + # ----------------------------------------------------------------- end-of-file diff --git a/tutorials/incompressible/icoFoam/Allrun b/tutorials/incompressible/icoFoam/Allrun index 44d04afe47..acdcaabaee 100755 --- a/tutorials/incompressible/icoFoam/Allrun +++ b/tutorials/incompressible/icoFoam/Allrun @@ -18,12 +18,6 @@ runMapFieldsConsistent() mapFieldsNew $1 -case $2 -sourceTime latestTime -consistent > $2/log.mapFields 2>&1 } -runFluentMeshToFoam() -{ - echo "fluentMeshToFoam: converting mesh $2" - fluentMeshToFoam $2 -case $1 > $1/log.fluentMeshToFoam 2>&1 -} - copySolutionDirs() { echo "Copying $2/0* directory to $1" @@ -95,16 +89,8 @@ do ( cd $caseName && runApplication `getApplication` ) done + # elbow case for testing Fluent-FOAM conversion tools - -runFluentMeshToFoam elbow elbow/elbow.msh - -( - cd elbow || exit - - runApplication `getApplication` - runApplication foamMeshToFluent - runApplication foamDataToFluent -) +(cd elbow && ./Allrun) # ----------------------------------------------------------------- end-of-file diff --git a/tutorials/incompressible/icoFoam/elbow/Allclean b/tutorials/incompressible/icoFoam/elbow/Allclean new file mode 100755 index 0000000000..02a68a6b17 --- /dev/null +++ b/tutorials/incompressible/icoFoam/elbow/Allclean @@ -0,0 +1,11 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial clean functions +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +rm -f constant/polyMesh/boundary +rm -rf fluentInterface +cleanCase + +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/incompressible/icoFoam/elbow/Allrun b/tutorials/incompressible/icoFoam/elbow/Allrun new file mode 100755 index 0000000000..07a1ffac39 --- /dev/null +++ b/tutorials/incompressible/icoFoam/elbow/Allrun @@ -0,0 +1,15 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +# Get application directory +application=`getApplication` + +runApplication fluentMeshToFoam elbow.msh +runApplication "$application" +runApplication foamMeshToFluent +runApplication foamDataToFluent + +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/incompressible/icoFoam/elbow/constant/polyMesh/boundary b/tutorials/incompressible/icoFoam/elbow/constant/polyMesh/boundary deleted file mode 100644 index fbdbc176b3..0000000000 --- a/tutorials/incompressible/icoFoam/elbow/constant/polyMesh/boundary +++ /dev/null @@ -1,58 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class polyBoundaryMesh; - location "constant/polyMesh"; - object boundary; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -6 -( - wall-4 - { - type wall; - nFaces 100; - startFace 1300; - } - velocity-inlet-5 - { - type patch; - nFaces 8; - startFace 1400; - } - velocity-inlet-6 - { - type patch; - nFaces 4; - startFace 1408; - } - pressure-outlet-7 - { - type patch; - nFaces 8; - startFace 1412; - } - wall-8 - { - type wall; - nFaces 34; - startFace 1420; - } - frontAndBackPlanes - { - type empty; - nFaces 1836; - startFace 1454; - } -) - -// ************************************************************************* // From 60e3467165a3695258cba394c15d53dd42a4633d Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 19 Dec 2013 11:24:02 +0000 Subject: [PATCH 6/9] BUG: autoSnapDriver: inplace re-ordering! --- .../autoHexMeshDriver/autoSnapDriver.H | 5 +- .../autoHexMeshDriver/autoSnapDriverFeature.C | 178 ++------- .../refinementFeatures/refinementFeatures.C | 377 +++++++++++++----- .../refinementFeatures/refinementFeatures.H | 61 +-- 4 files changed, 354 insertions(+), 267 deletions(-) diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.H b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.H index 496f980a11..4e0f1d160b 100644 --- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.H +++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.H @@ -310,14 +310,13 @@ class autoSnapDriver //- Find point on nearest feature edge (within searchDist). // Return point and feature // and store feature-edge to mesh-point and vice versa - pointIndexHit findNearFeatureEdge + Tuple2 findNearFeatureEdge ( const indirectPrimitivePatch& pp, const scalarField& snapDist, const label pointI, const point& estimatedPt, - label& featI, List > >&, List > >&, vectorField&, @@ -330,7 +329,7 @@ class autoSnapDriver // If another mesh point already referring to this feature // point and further away, reset that one to a near feature // edge (using findNearFeatureEdge above) - labelPair findNearFeaturePoint + Tuple2 findNearFeaturePoint ( const indirectPrimitivePatch& pp, const scalarField& snapDist, diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriverFeature.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriverFeature.C index 67fee3ef96..03615a76bd 100644 --- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriverFeature.C +++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriverFeature.C @@ -170,7 +170,7 @@ void Foam::autoSnapDriver::smoothAndConstrain if (isMasterEdge[meshEdges[edgeI]]) { - label nbrPointI = edges[pEdges[i]].otherVertex(pointI); + label nbrPointI = edges[edgeI].otherVertex(pointI); if (constraints[nbrPointI].first() >= nConstraints) { dispSum[pointI] += disp[nbrPointI]; @@ -213,80 +213,6 @@ void Foam::autoSnapDriver::smoothAndConstrain } } } -//XXXXXX -//TODO: make proper parallel so coupled edges don't have double influence -//void Foam::autoSnapDriver::smoothAndConstrain2 -//( -// const bool applyConstraints, -// const indirectPrimitivePatch& pp, -// const List& constraints, -// vectorField& disp -//) const -//{ -// const fvMesh& mesh = meshRefiner_.mesh(); -// -// for (label avgIter = 0; avgIter < 20; avgIter++) -// { -// vectorField dispSum(pp.nPoints(), vector::zero); -// labelList dispCount(pp.nPoints(), 0); -// -// const labelListList& pointEdges = pp.pointEdges(); -// const edgeList& edges = pp.edges(); -// -// forAll(pointEdges, pointI) -// { -// const labelList& pEdges = pointEdges[pointI]; -// -// forAll(pEdges, i) -// { -// label nbrPointI = edges[pEdges[i]].otherVertex(pointI); -// dispSum[pointI] += disp[nbrPointI]; -// dispCount[pointI]++; -// } -// } -// -// syncTools::syncPointList -// ( -// mesh, -// pp.meshPoints(), -// dispSum, -// plusEqOp(), -// vector::zero, -// mapDistribute::transform() -// ); -// syncTools::syncPointList -// ( -// mesh, -// pp.meshPoints(), -// dispCount, -// plusEqOp