From fee6383c5489586eb5afbb4353ebb37db95214ec Mon Sep 17 00:00:00 2001 From: Franjo Juretic Date: Sat, 8 Nov 2014 23:10:28 -0100 Subject: [PATCH 1/2] Updated cfMesh to v1.0.1 --- .../mesh/cfMesh/FMSToSurface/FMSToSurface.C | 166 + .../mesh/cfMesh/FMSToSurface/Make/files | 3 + .../mesh/cfMesh/FMSToSurface/Make/options | 9 + .../utilities/mesh/cfMesh/FMSToVTK/FMSToVTK.C | 545 + .../utilities/mesh/cfMesh/FMSToVTK/Make/files | 3 + .../mesh/cfMesh/FMSToVTK/Make/options | 9 + .../utilities/mesh/cfMesh/FMSToVTK/xmlTag.H | 297 + .../cfMesh/importSurfaceAsSubset/Make/files | 3 + .../cfMesh/importSurfaceAsSubset/Make/options | 9 + .../importSurfaceAsSubset.C | 84 + .../cfMesh/improveSymmetryPlanes/Make/files | 3 + .../cfMesh/improveSymmetryPlanes/Make/options | 7 + .../improveSymmetryPlanes.C | 57 + .../cfMesh/mergeSurfacePatches/Make/files | 3 + .../cfMesh/mergeSurfacePatches/Make/options | 9 + .../mergeSurfacePatches/mergeSurfacePatches.C | 403 + .../python/Salome/extractFeatureEdges.py | 131 + .../cfMesh/python/Salome/salomeTriSurf.py | 363 + .../mesh/cfMesh/surfaceToFMS/Make/files | 3 + .../mesh/cfMesh/surfaceToFMS/Make/options | 9 + .../mesh/cfMesh/surfaceToFMS/surfaceToFMS.C | 63 + doc/cfMesh/User Guide - cfMesh v1.0.1.pdf | Bin 0 -> 1728882 bytes doc/cfMesh/User Guide - cfMesh v1.0.pdf | Bin 689483 -> 0 bytes src/mesh/cfMesh/meshLibrary/Make/files | 18 + .../cartesian2DMeshGenerator.C | 45 +- .../cartesianMeshGenerator.C | 54 +- .../tetMeshExtractorOctree.C | 2 - .../tetMeshGenerator/tetMeshGenerator.C | 39 +- .../boundaryLayers/boundaryLayerCells.C | 17 +- .../utilities/boundaryLayers/boundaryLayers.C | 118 +- .../utilities/boundaryLayers/boundaryLayers.H | 5 +- .../boundaryLayersCreateVertices.C | 86 +- .../boundaryLayers/boundaryLayersI.H | 52 +- .../utilities/boundaryLayers/extrudeLayer.H | 2 - .../boundaryLayers/refineBoundaryLayers.C | 31 +- .../boundaryLayers/refineBoundaryLayers.H | 2 - .../utilities/checkMeshDict/checkMeshDict.C | 248 +- .../utilities/checkMeshDict/checkMeshDict.H | 8 +- .../utilities/containers/LongList/LongList.C | 2 + .../utilities/containers/LongList/LongList.H | 1 - .../helperFunctionsGeometryQueries.H | 16 +- .../helperFunctionsGeometryQueriesI.H | 133 +- .../meshes/partTriMesh/partTriMesh.C | 9 + .../partTriMeshParallelAddressing.C | 232 +- .../polyMeshGen/boundaryPatch/boundaryPatch.C | 9 +- .../meshes/polyMeshGen/polyMeshGenFaces.C | 142 +- .../meshes/polyMeshGen/polyMeshGenFaces.H | 61 +- .../meshes/polyMeshGen/polyMeshGenPoints.H | 1 - .../utilities/meshes/triSurf/triSurf.C | 3 + .../utilities/meshes/triSurf/triSurfFacets.C | 30 + .../utilities/meshes/triSurf/triSurfFacets.H | 7 + .../meshOctreeAddressingCreation.C | 42 +- .../meshOctreeAutomaticRefinement.H | 3 +- .../meshOctreeCreator/meshOctreeCreator.C | 9 +- .../meshOctreeCreator/meshOctreeCreator.H | 18 +- .../meshOctreeCreatorAdjustOctreeToSurface.C | 338 +- .../meshOctreeCreatorCreateOctreeBoxes.C | 60 +- .../meshOctreeCube/meshOctreeCube.H | 6 +- .../meshOctreeCube/meshOctreeCubeI.H | 10 + .../meshOctreeCubeRecursiveFunctions.C | 11 +- .../meshOctreeFindNearestSurfacePoint.C | 15 +- .../meshOctreeModifier/meshOctreeModifier.H | 10 + .../meshOctreeModifierRefineSelectedBoxes.C | 200 + .../objectRefinement/objectRefinement.C | 105 +- .../objectRefinement/objectRefinement.H | 15 + .../geometry/meshOptimizer/meshOptimizer.C | 13 +- .../geometry/meshOptimizer/meshOptimizer.H | 58 +- .../meshOptimizerOptimizeSurface.C | 9 +- .../geometry/meshOptimizer/optimizeMeshFV.C | 31 + .../symmetryPlaneOptimisation.C | 251 + .../symmetryPlaneOptimisation.H | 99 + .../meshSurfaceOptimizer.C | 14 +- .../meshSurfaceOptimizer.H | 30 +- .../meshSurfaceOptimizerI.H | 146 +- ...eshSurfaceOptimizerOptimizePointParallel.C | 79 - .../meshSurfaceOptimizerOptimizeSurface.C | 43 +- .../edgeExtractor/edgeExtractor.C | 17 +- .../edgeExtractor/edgeExtractor.H | 2 - .../edgeExtractor/edgeExtractorCorners.C | 6 +- .../meshSurfaceCheckEdgeTypes.H | 2 - .../meshSurfaceCheckInvertedVertices.H | 2 - .../meshSurfaceEngine/meshSurfaceEngine.H | 2 - .../meshSurfaceMapper/meshSurfaceMapper.H | 40 +- .../meshSurfaceMapperCornersAndEdges.C | 77 +- .../meshSurfaceMapperMapVertices.C | 20 +- .../meshSurfaceMapper2DMapVertices.C | 4 +- .../renameBoundaryPatches.C | 69 +- .../triSurface2DCheck/triSurface2DCheck.C | 171 + .../triSurface2DCheck/triSurface2DCheck.H | 98 + .../triSurfaceCleanupDuplicateTriangles.C | 56 + .../triSurfaceCleanupDuplicateTriangles.H | 98 + ...urfaceCleanupDuplicateTrianglesFunctions.C | 100 + .../triSurfaceCurvatureEstimatorCalculate.C | 135 +- .../triSurfaceImportSurfaceAsSubset.C | 240 + .../triSurfaceImportSurfaceAsSubset.H | 103 + .../triSurfacePatchManipulator.H | 1 - .../cartesianMesh/elbow_90degree/0/.ignore | 0 .../cartesianMesh/elbow_90degree/Allclean | 12 + .../cartesianMesh/elbow_90degree/Allrun | 6 + .../elbow_90degree/constant/.ignore | 0 .../elbow_90degree/elbow_90degree.stl | 36068 ++ .../cartesianMesh/elbow_90degree/readme.txt | 28 + .../elbow_90degree/system/controlDict | 53 + .../elbow_90degree/system/fvSchemes | 59 + .../elbow_90degree/system/fvSolution | 45 + .../elbow_90degree/system/meshDict | 71 + .../cartesianMesh/multipleOrifices/0/.ignore | 0 .../cartesianMesh/multipleOrifices/Allclean | 12 + .../cartesianMesh/multipleOrifices/Allrun | 6 + .../multipleOrifices/constant/.ignore | 0 .../multipleOrifices/multipleOrifices.stl | 83296 +++++ .../cartesianMesh/multipleOrifices/readme.txt | 56 + .../multipleOrifices/system/controlDict | 53 + .../multipleOrifices/system/fvSchemes | 59 + .../multipleOrifices/system/fvSolution | 45 + .../multipleOrifices/system/meshDict | 113 + .../cartesianMesh/ship5415Octree/0/.gitignore | 0 .../ship5415Octree/5415Joined1.stl | 253892 ++++++++++++++ .../ship5415Octree/5415Joined2.stl | 253976 +++++++++++++++ .../cartesianMesh/ship5415Octree/Allclean | 12 + .../cartesianMesh/ship5415Octree/Allrun | 8 + .../cartesianMesh/ship5415Octree/README | 1 + .../ship5415Octree/constant/.gitignore | 0 .../ship5415Octree/ship5415Octree.foam | 0 .../ship5415Octree/system/controlDict | 52 + .../ship5415Octree/system/fvSchemes | 66 + .../ship5415Octree/system/fvSolution | 49 + .../ship5415Octree/system/meshDict | 37 + .../cartesianMesh/singleOrifice/0/.ignore | 0 .../cartesianMesh/singleOrifice/Allclean | 12 + .../cfMesh/cartesianMesh/singleOrifice/Allrun | 6 + .../singleOrifice/constant/.ignore | 0 .../cartesianMesh/singleOrifice/readme.txt | 27 + .../singleOrifice/singleOrifice.stl | 19646 ++ .../singleOrifice/system/controlDict | 53 + .../singleOrifice/system/fvSchemes | 59 + .../singleOrifice/system/fvSolution | 45 + .../singleOrifice/system/meshDict | 98 + 138 files changed, 653487 insertions(+), 944 deletions(-) create mode 100644 applications/utilities/mesh/cfMesh/FMSToSurface/FMSToSurface.C create mode 100644 applications/utilities/mesh/cfMesh/FMSToSurface/Make/files create mode 100644 applications/utilities/mesh/cfMesh/FMSToSurface/Make/options create mode 100644 applications/utilities/mesh/cfMesh/FMSToVTK/FMSToVTK.C create mode 100644 applications/utilities/mesh/cfMesh/FMSToVTK/Make/files create mode 100644 applications/utilities/mesh/cfMesh/FMSToVTK/Make/options create mode 100644 applications/utilities/mesh/cfMesh/FMSToVTK/xmlTag.H create mode 100644 applications/utilities/mesh/cfMesh/importSurfaceAsSubset/Make/files create mode 100644 applications/utilities/mesh/cfMesh/importSurfaceAsSubset/Make/options create mode 100644 applications/utilities/mesh/cfMesh/importSurfaceAsSubset/importSurfaceAsSubset.C create mode 100644 applications/utilities/mesh/cfMesh/improveSymmetryPlanes/Make/files create mode 100644 applications/utilities/mesh/cfMesh/improveSymmetryPlanes/Make/options create mode 100644 applications/utilities/mesh/cfMesh/improveSymmetryPlanes/improveSymmetryPlanes.C create mode 100644 applications/utilities/mesh/cfMesh/mergeSurfacePatches/Make/files create mode 100644 applications/utilities/mesh/cfMesh/mergeSurfacePatches/Make/options create mode 100644 applications/utilities/mesh/cfMesh/mergeSurfacePatches/mergeSurfacePatches.C create mode 100644 applications/utilities/mesh/cfMesh/python/Salome/extractFeatureEdges.py create mode 100644 applications/utilities/mesh/cfMesh/python/Salome/salomeTriSurf.py create mode 100644 applications/utilities/mesh/cfMesh/surfaceToFMS/Make/files create mode 100644 applications/utilities/mesh/cfMesh/surfaceToFMS/Make/options create mode 100644 applications/utilities/mesh/cfMesh/surfaceToFMS/surfaceToFMS.C create mode 100644 doc/cfMesh/User Guide - cfMesh v1.0.1.pdf delete mode 100644 doc/cfMesh/User Guide - cfMesh v1.0.pdf create mode 100644 src/mesh/cfMesh/meshLibrary/utilities/smoothers/geometry/meshOptimizer/symmetryPlaneOptimisation/symmetryPlaneOptimisation.C create mode 100644 src/mesh/cfMesh/meshLibrary/utilities/smoothers/geometry/meshOptimizer/symmetryPlaneOptimisation/symmetryPlaneOptimisation.H create mode 100644 src/mesh/cfMesh/meshLibrary/utilities/triSurfaceTools/triSurface2DCheck/triSurface2DCheck.C create mode 100644 src/mesh/cfMesh/meshLibrary/utilities/triSurfaceTools/triSurface2DCheck/triSurface2DCheck.H create mode 100644 src/mesh/cfMesh/meshLibrary/utilities/triSurfaceTools/triSurfaceCleanupDuplicateTriangles/triSurfaceCleanupDuplicateTriangles.C create mode 100644 src/mesh/cfMesh/meshLibrary/utilities/triSurfaceTools/triSurfaceCleanupDuplicateTriangles/triSurfaceCleanupDuplicateTriangles.H create mode 100644 src/mesh/cfMesh/meshLibrary/utilities/triSurfaceTools/triSurfaceCleanupDuplicateTriangles/triSurfaceCleanupDuplicateTrianglesFunctions.C create mode 100644 src/mesh/cfMesh/meshLibrary/utilities/triSurfaceTools/triSurfaceImportSurfaceAsSubset/triSurfaceImportSurfaceAsSubset.C create mode 100644 src/mesh/cfMesh/meshLibrary/utilities/triSurfaceTools/triSurfaceImportSurfaceAsSubset/triSurfaceImportSurfaceAsSubset.H create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/elbow_90degree/0/.ignore create mode 100755 tutorials/mesh/cfMesh/cartesianMesh/elbow_90degree/Allclean create mode 100755 tutorials/mesh/cfMesh/cartesianMesh/elbow_90degree/Allrun create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/elbow_90degree/constant/.ignore create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/elbow_90degree/elbow_90degree.stl create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/elbow_90degree/readme.txt create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/elbow_90degree/system/controlDict create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/elbow_90degree/system/fvSchemes create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/elbow_90degree/system/fvSolution create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/elbow_90degree/system/meshDict create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/multipleOrifices/0/.ignore create mode 100755 tutorials/mesh/cfMesh/cartesianMesh/multipleOrifices/Allclean create mode 100755 tutorials/mesh/cfMesh/cartesianMesh/multipleOrifices/Allrun create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/multipleOrifices/constant/.ignore create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/multipleOrifices/multipleOrifices.stl create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/multipleOrifices/readme.txt create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/multipleOrifices/system/controlDict create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/multipleOrifices/system/fvSchemes create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/multipleOrifices/system/fvSolution create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/multipleOrifices/system/meshDict create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/ship5415Octree/0/.gitignore create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/ship5415Octree/5415Joined1.stl create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/ship5415Octree/5415Joined2.stl create mode 100755 tutorials/mesh/cfMesh/cartesianMesh/ship5415Octree/Allclean create mode 100755 tutorials/mesh/cfMesh/cartesianMesh/ship5415Octree/Allrun create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/ship5415Octree/README create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/ship5415Octree/constant/.gitignore create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/ship5415Octree/ship5415Octree.foam create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/ship5415Octree/system/controlDict create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/ship5415Octree/system/fvSchemes create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/ship5415Octree/system/fvSolution create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/ship5415Octree/system/meshDict create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/singleOrifice/0/.ignore create mode 100755 tutorials/mesh/cfMesh/cartesianMesh/singleOrifice/Allclean create mode 100755 tutorials/mesh/cfMesh/cartesianMesh/singleOrifice/Allrun create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/singleOrifice/constant/.ignore create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/singleOrifice/readme.txt create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/singleOrifice/singleOrifice.stl create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/singleOrifice/system/controlDict create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/singleOrifice/system/fvSchemes create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/singleOrifice/system/fvSolution create mode 100644 tutorials/mesh/cfMesh/cartesianMesh/singleOrifice/system/meshDict diff --git a/applications/utilities/mesh/cfMesh/FMSToSurface/FMSToSurface.C b/applications/utilities/mesh/cfMesh/FMSToSurface/FMSToSurface.C new file mode 100644 index 000000000..bd4ad4fde --- /dev/null +++ b/applications/utilities/mesh/cfMesh/FMSToSurface/FMSToSurface.C @@ -0,0 +1,166 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | cfMesh: A library for mesh generation + \\ / O peration | + \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com) + \\/ M anipulation | Copyright (C) Creative Fields, Ltd. +------------------------------------------------------------------------------- +License + This file is part of cfMesh. + + cfMesh 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. + + cfMesh 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 cfMesh. If not, see . + +Description + Creates surface patches from surface subsets + +\*---------------------------------------------------------------------------*/ + +#include "argList.H" +#include "Time.H" +#include "triSurf.H" +#include "triSurfaceCopyParts.H" +#include "demandDrivenData.H" +#include "OFstream.H" + +using namespace Foam; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +void exportFeatureEdges +( + const triSurf& origSurf, + const fileName& edgeFileName +) +{ + OFstream file(edgeFileName); + + const pointField& points = origSurf.points(); + labelList newPointLabel(points.size(), -1); + label nPoints(0); + + const edgeLongList& featureEdges = origSurf.featureEdges(); + forAll(featureEdges, feI) + { + const edge& e = featureEdges[feI]; + + if( newPointLabel[e[0]] == -1 ) + newPointLabel[e[0]] = nPoints++; + if( newPointLabel[e[1]] == -1 ) + newPointLabel[e[1]] = nPoints++; + } + + pointField pCopy(nPoints); + forAll(newPointLabel, pI) + { + if( newPointLabel[pI] < 0 ) + continue; + + pCopy[newPointLabel[pI]] = points[pI]; + } + + //- write the header + file << "# vtk DataFile Version 3.0\n"; + file << "vtk output\n"; + file << "ASCII\n"; + file << "DATASET POLYDATA\n"; + + //- write points + file << "POINTS " << pCopy.size() << " float\n"; + forAll(pCopy, pI) + { + const point& p = pCopy[pI]; + file << p.x() << ' ' << p.y() << ' ' << p.z() << '\n'; + } + + file << "\nLINES " << featureEdges.size() + << ' ' << 3*featureEdges.size() << nl; + forAll(featureEdges, edgeI) + { + const edge& e = featureEdges[edgeI]; + file << "2 " << newPointLabel[e[0]] + << token::SPACE << newPointLabel[e[1]] << nl; + } + file << nl; + + if( !file ) + FatalErrorIn + ( + "void exportFeatureEdges(const triSurf&, const fileName&)" + ) << "Writting of feature edges failed!" << exit(FatalError); +} + +int main(int argc, char *argv[]) +{ + argList::noParallel(); + argList::validArgs.clear(); + + argList::validArgs.append("input surface file"); + argList::validArgs.append("output surface file"); + argList::validOptions.insert("exportSubsets", ""); + argList::validOptions.insert("exportFeatureEdges", ""); + argList args(argc, argv); + + fileName inFileName(args.args()[1]); + fileName outFileName(args.args()[2]); + + fileName outFileNoExt = outFileName.lessExt(); + fileName outExtension = outFileName.ext(); + + Info << "Out file no ext " << outFileNoExt << endl; + Info << "Extension " << outExtension << endl; + + //- read the inout surface + triSurf origSurf(inFileName); + + //- write the surface in the requated format + origSurf.writeSurface(outFileName); + + //- export surface subsets as separate surface meshes + if( args.options().found("exportSubsets") ) + { + DynList