diff --git a/applications/solvers/combustion/PDRFoam/Make/options b/applications/solvers/combustion/PDRFoam/Make/options index 4e5b8fb9a0..a1469d0ef0 100644 --- a/applications/solvers/combustion/PDRFoam/Make/options +++ b/applications/solvers/combustion/PDRFoam/Make/options @@ -15,8 +15,7 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/triSurface/lnInclude + -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ -lengine \ diff --git a/applications/utilities/mesh/advanced/modifyMesh/Make/options b/applications/utilities/mesh/advanced/modifyMesh/Make/options index 39929ff890..70c838b774 100644 --- a/applications/utilities/mesh/advanced/modifyMesh/Make/options +++ b/applications/utilities/mesh/advanced/modifyMesh/Make/options @@ -1,9 +1,7 @@ EXE_INC = \ - -I$(LIB_SRC)/triSurface/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude EXE_LIBS = \ - -ltriSurface \ -lmeshTools \ -ldynamicMesh diff --git a/applications/utilities/mesh/advanced/splitCells/Make/options b/applications/utilities/mesh/advanced/splitCells/Make/options index ca424359cf..7349856cab 100644 --- a/applications/utilities/mesh/advanced/splitCells/Make/options +++ b/applications/utilities/mesh/advanced/splitCells/Make/options @@ -1,9 +1,7 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/triSurface/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude EXE_LIBS = \ -ldynamicMesh \ - -ltriSurface \ -lmeshTools diff --git a/applications/utilities/mesh/manipulation/autoPatch/Make/options b/applications/utilities/mesh/manipulation/autoPatch/Make/options index d002df8030..7349856cab 100644 --- a/applications/utilities/mesh/manipulation/autoPatch/Make/options +++ b/applications/utilities/mesh/manipulation/autoPatch/Make/options @@ -1,10 +1,7 @@ EXE_INC = \ - -I$(LIB_SRC)/triSurface/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude - EXE_LIBS = \ - -ltriSurface \ -ldynamicMesh \ -lmeshTools diff --git a/applications/utilities/mesh/manipulation/objToVTK/Make/options b/applications/utilities/mesh/manipulation/objToVTK/Make/options index 0548bdd022..79a9626b55 100644 --- a/applications/utilities/mesh/manipulation/objToVTK/Make/options +++ b/applications/utilities/mesh/manipulation/objToVTK/Make/options @@ -1,8 +1 @@ -/* -EXE_INC = \ - -I$(LIB_SRC)/triSurface/lnInclude - -EXE_LIBS = \ - -lmeshTools \ - -ltriSurface -*/ +/* */ diff --git a/applications/utilities/mesh/manipulation/refineMesh/Make/options b/applications/utilities/mesh/manipulation/refineMesh/Make/options index 5c9c1c2b87..73f34b0f85 100644 --- a/applications/utilities/mesh/manipulation/refineMesh/Make/options +++ b/applications/utilities/mesh/manipulation/refineMesh/Make/options @@ -1,9 +1,7 @@ EXE_INC = \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ - -I$(LIB_SRC)/triSurface/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude - EXE_LIBS = \ -ldynamicMesh \ -lmeshTools diff --git a/applications/utilities/postProcessing/sampling/probeLocations/Make/options b/applications/utilities/postProcessing/sampling/probeLocations/Make/options index 44392ffc44..ec8bc31179 100644 --- a/applications/utilities/postProcessing/sampling/probeLocations/Make/options +++ b/applications/utilities/postProcessing/sampling/probeLocations/Make/options @@ -2,7 +2,6 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \ - -I$(LIB_SRC)/triSurface/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude EXE_LIBS = \ @@ -10,5 +9,4 @@ EXE_LIBS = \ -lgenericPatchFields \ -lmeshTools \ -lsampling \ - -ltriSurface \ -llagrangian diff --git a/applications/utilities/postProcessing/sampling/sample/Make/options b/applications/utilities/postProcessing/sampling/sample/Make/options index 4877a53003..88c6039b4e 100644 --- a/applications/utilities/postProcessing/sampling/sample/Make/options +++ b/applications/utilities/postProcessing/sampling/sample/Make/options @@ -3,7 +3,6 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/surfMesh/lnInclude \ - -I$(LIB_SRC)/triSurface/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude EXE_LIBS = \ @@ -12,5 +11,4 @@ EXE_LIBS = \ -lmeshTools \ -lsampling \ -lsurfMesh \ - -ltriSurface \ -llagrangian diff --git a/applications/utilities/surface/surfaceAutoPatch/Make/options b/applications/utilities/surface/surfaceAutoPatch/Make/options index e4751082e1..9f08e8d2a8 100644 --- a/applications/utilities/surface/surfaceAutoPatch/Make/options +++ b/applications/utilities/surface/surfaceAutoPatch/Make/options @@ -1,5 +1,4 @@ EXE_INC = \ - /* -I$(LIB_SRC)/cfdTools/general/lnInclude */ \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/triSurface/lnInclude diff --git a/applications/utilities/surface/surfaceFeatureConvert/Make/options b/applications/utilities/surface/surfaceFeatureConvert/Make/options index f87dafaa5d..e71834f99e 100644 --- a/applications/utilities/surface/surfaceFeatureConvert/Make/options +++ b/applications/utilities/surface/surfaceFeatureConvert/Make/options @@ -1,9 +1,7 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/edgeMesh/lnInclude \ - -I$(LIB_SRC)/triSurface/lnInclude + -I$(LIB_SRC)/edgeMesh/lnInclude EXE_LIBS = \ -lmeshTools \ - -ledgeMesh \ - -ltriSurface + -ledgeMesh diff --git a/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C b/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C index f38bf13cc5..71eda554fa 100644 --- a/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C +++ b/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C @@ -79,11 +79,7 @@ void deleteBox { const point eMid = surf.edges()[edgeI].centre(surf.localPoints()); - if - ( - (removeInside && bb.contains(eMid)) - || (!removeInside && !bb.contains(eMid)) - ) + if (removeInside ? bb.contains(eMid) : !bb.contains(eMid)) { edgeStat[edgeI] = surfaceFeatures::NONE; } @@ -133,7 +129,6 @@ int main(int argc, char *argv[]) - // Either construct features from surface&featureangle or read set. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/applications/utilities/surface/surfaceFind/Make/options b/applications/utilities/surface/surfaceFind/Make/options index 4c41bc1a49..946b16a9ad 100644 --- a/applications/utilities/surface/surfaceFind/Make/options +++ b/applications/utilities/surface/surfaceFind/Make/options @@ -1,6 +1,6 @@ EXE_INC = \ - -I$(LIB_SRC)/triSurface/lnInclude + -I$(LIB_SRC)/surfMesh/lnInclude EXE_LIBS = \ -lmeshTools \ - -ltriSurface + -lsurfMesh diff --git a/applications/utilities/surface/surfaceFind/surfaceFind.C b/applications/utilities/surface/surfaceFind/surfaceFind.C index dcaccc04c2..8e36fc25ec 100644 --- a/applications/utilities/surface/surfaceFind/surfaceFind.C +++ b/applications/utilities/surface/surfaceFind/surfaceFind.C @@ -23,18 +23,16 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Description - Finds nearest triangle and vertex. + Finds nearest face and vertex. \*---------------------------------------------------------------------------*/ -#include "triSurface.H" #include "argList.H" #include "OFstream.H" -#ifndef namespaceFoam -#define namespaceFoam - using namespace Foam; -#endif +#include "MeshedSurfaces.H" + +using namespace Foam; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -44,9 +42,9 @@ int main(int argc, char *argv[]) { argList::noParallel(); argList::validArgs.clear(); - argList::addOption("x", "X"); - argList::addOption("y", "Y"); - argList::addOption("z", "Z"); + argList::addOption("x", "X", "The point x-coordinate (if non-zero)"); + argList::addOption("y", "Y", "The point y-coordinate (if non-zero)"); + argList::addOption("z", "Z", "The point y-coordinate (if non-zero)"); argList::validArgs.append("surface file"); @@ -54,15 +52,15 @@ int main(int argc, char *argv[]) point samplePt ( - args.optionRead("x"), - args.optionRead("y"), - args.optionRead("z") + args.optionLookupOrDefault("x", 0), + args.optionLookupOrDefault("y", 0), + args.optionLookupOrDefault("z", 0) ); Info<< "Looking for nearest face/vertex to " << samplePt << endl; - Info<< "Reading surf1 ..." << endl; - triSurface surf1(args.additionalArgs()[0]); + Info<< "Reading surf ..." << endl; + meshedSurface surf1(args.additionalArgs()[0]); // // Nearest vertex @@ -83,11 +81,11 @@ int main(int argc, char *argv[]) } } - Info<< "Nearest vertex:" << endl - << " index :" << minIndex << " (in localPoints)" << endl + Info<< "Nearest vertex:" << nl + << " index :" << minIndex << " (in localPoints)" << nl << " index :" << surf1.meshPoints()[minIndex] - << " (in points)" << endl - << " coordinates:" << localPoints[minIndex] << endl + << " (in points)" << nl + << " coordinates:" << localPoints[minIndex] << nl << endl; // @@ -101,8 +99,7 @@ int main(int argc, char *argv[]) forAll(surf1, faceI) { - const labelledTri& f = surf1[faceI]; - const point centre = f.centre(points); + const point centre = surf1[faceI].centre(points); const scalar dist = mag(centre - samplePt); if (dist < minDist) @@ -112,16 +109,19 @@ int main(int argc, char *argv[]) } } - const labelledTri& f = surf1[minIndex]; + const face& f = surf1[minIndex]; - Info<< "Face with nearest centre:" << endl - << " index :" << minIndex << endl - << " centre :" << f.centre(points) << endl - << " face :" << f << endl - << " vertex coords:" << points[f[0]] << " " - << points[f[1]] << " " << points[f[2]] << endl - << endl; + Info<< "Face with nearest centre:" << nl + << " index :" << minIndex << nl + << " centre :" << f.centre(points) << nl + << " face :" << f << nl + << " vertex coords:\n"; + forAll(f, fp) + { + Info<< " " << points[f[fp]] << "\n"; + } + Info<< endl; Info<< "End\n" << endl; diff --git a/applications/utilities/surface/surfaceSmooth/Make/options b/applications/utilities/surface/surfaceSmooth/Make/options index 4c41bc1a49..946b16a9ad 100644 --- a/applications/utilities/surface/surfaceSmooth/Make/options +++ b/applications/utilities/surface/surfaceSmooth/Make/options @@ -1,6 +1,6 @@ EXE_INC = \ - -I$(LIB_SRC)/triSurface/lnInclude + -I$(LIB_SRC)/surfMesh/lnInclude EXE_LIBS = \ -lmeshTools \ - -ltriSurface + -lsurfMesh diff --git a/applications/utilities/surface/surfaceSmooth/surfaceSmooth.C b/applications/utilities/surface/surfaceSmooth/surfaceSmooth.C index bce23c9846..e68f6ab20b 100644 --- a/applications/utilities/surface/surfaceSmooth/surfaceSmooth.C +++ b/applications/utilities/surface/surfaceSmooth/surfaceSmooth.C @@ -23,15 +23,16 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Description - Example of simple laplacian smoother + Example of a simple laplacian smoother \*---------------------------------------------------------------------------*/ -#include "triSurface.H" #include "argList.H" #include "OFstream.H" #include "boundBox.H" +#include "MeshedSurfaces.H" + using namespace Foam; @@ -61,23 +62,20 @@ int main(int argc, char *argv[]) label iters(readLabel(IStringStream(args.additionalArgs()[2])())); fileName outFileName(args.additionalArgs()[3]); - Info<< "Relax:" << relax << endl; - Info<< "Iters:" << iters << endl; + Info<< "Relax:" << relax << nl + << "Iters:" << iters << nl + << "Reading surface from " << surfFileName << " ..." << endl; + meshedSurface surf1(surfFileName); - Info<< "Reading surface from " << surfFileName << " ..." << endl; - - triSurface surf1(surfFileName); - - Info<< "Triangles : " << surf1.size() << endl; - Info<< "Vertices : " << surf1.nPoints() << endl; - Info<< "Bounding Box : " << boundBox(surf1.localPoints()) << endl; + Info<< "Faces : " << surf1.size() << nl + << "Vertices : " << surf1.nPoints() << nl + << "Bounding Box : " << boundBox(surf1.localPoints()) << endl; pointField newPoints(surf1.localPoints()); const labelListList& pointEdges = surf1.pointEdges(); - for (label iter = 0; iter < iters; iter++) { forAll(pointEdges, vertI) @@ -100,16 +98,14 @@ int main(int argc, char *argv[]) } } - triSurface surf2 - ( - surf1.localFaces(), - surf1.patches(), - newPoints - ); - Info<< "Writing surface to " << outFileName << " ..." << endl; - surf2.write(outFileName); + meshedSurface + ( + xferMove(newPoints), + xferCopy(surf1.localFaces()), + xferCopy(surf1.surfZones()) + ).write(outFileName); Info<< "End\n" << endl; diff --git a/applications/utilities/surface/surfaceTransformPoints/Make/options b/applications/utilities/surface/surfaceTransformPoints/Make/options index 4c41bc1a49..a504dd8617 100644 --- a/applications/utilities/surface/surfaceTransformPoints/Make/options +++ b/applications/utilities/surface/surfaceTransformPoints/Make/options @@ -1,6 +1,5 @@ EXE_INC = \ - -I$(LIB_SRC)/triSurface/lnInclude + -I$(LIB_SRC)/surfMesh/lnInclude EXE_LIBS = \ - -lmeshTools \ - -ltriSurface + -lsurfMesh diff --git a/applications/utilities/surface/surfaceTransformPoints/surfaceTransformPoints.C b/applications/utilities/surface/surfaceTransformPoints/surfaceTransformPoints.C index 8bb87d3ee9..387471521e 100644 --- a/applications/utilities/surface/surfaceTransformPoints/surfaceTransformPoints.C +++ b/applications/utilities/surface/surfaceTransformPoints/surfaceTransformPoints.C @@ -35,7 +35,6 @@ Description \*---------------------------------------------------------------------------*/ -#include "triSurface.H" #include "argList.H" #include "OFstream.H" #include "IFstream.H" @@ -45,6 +44,8 @@ Description #include "quaternion.H" #include "mathematicalConstants.H" +#include "MeshedSurfaces.H" + using namespace Foam; using namespace Foam::constant::mathematical; @@ -114,7 +115,7 @@ int main(int argc, char *argv[]) << exit(FatalError); } - triSurface surf1(surfFileName); + meshedSurface surf1(surfFileName); pointField points(surf1.points()); @@ -193,9 +194,8 @@ int main(int argc, char *argv[]) points.replace(vector::Z, scaleVector.z()*points.component(vector::Z)); } - triSurface surf2(surf1, surf1.patches(), points); - - surf2.write(outFileName); + surf1.movePoints(points); + surf1.write(outFileName); Info<< "End\n" << endl; diff --git a/src/meshTools/Make/files b/src/meshTools/Make/files index ada844b5a5..30e68c56a7 100644 --- a/src/meshTools/Make/files +++ b/src/meshTools/Make/files @@ -9,16 +9,17 @@ cellDist/wallPoint/wallPoint.C cellFeatures/cellFeatures.C -coordinateSystems/coordinateSystem.C -coordinateSystems/coordinateSystemNew.C -coordinateSystems/coordinateSystems.C -coordinateSystems/cylindricalCS.C -coordinateSystems/sphericalCS.C -coordinateSystems/parabolicCylindricalCS.C -coordinateSystems/toroidalCS.C -coordinateSystems/coordinateRotation/coordinateRotation.C -coordinateSystems/coordinateRotation/EulerCoordinateRotation.C -coordinateSystems/coordinateRotation/STARCDCoordinateRotation.C +csys = coordinateSystems +$(csys)/coordinateSystem.C +$(csys)/coordinateSystemNew.C +$(csys)/coordinateSystems.C +$(csys)/cylindricalCS.C +$(csys)/sphericalCS.C +$(csys)/parabolicCylindricalCS.C +$(csys)/toroidalCS.C +$(csys)/coordinateRotation/coordinateRotation.C +$(csys)/coordinateRotation/EulerCoordinateRotation.C +$(csys)/coordinateRotation/STARCDCoordinateRotation.C edgeFaceCirculator/edgeFaceCirculator.C diff --git a/src/meshTools/indexedOctree/indexedOctree.H b/src/meshTools/indexedOctree/indexedOctree.H index 6c2bfa3c6e..b653dc3e79 100644 --- a/src/meshTools/indexedOctree/indexedOctree.H +++ b/src/meshTools/indexedOctree/indexedOctree.H @@ -85,8 +85,7 @@ public: }; - // Tree node. Has up pointer and down pointers. - + //- Tree node. Has up pointer and down pointers. class node { public: