Replace a few uses of triSurface with the more general meshedSurface.

This commit is contained in:
Mark Olesen
2010-01-15 17:27:03 +01:00
parent 7a200e81b4
commit a694f6e374
19 changed files with 72 additions and 106 deletions

View File

@ -15,8 +15,7 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \ -I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude
-I$(LIB_SRC)/triSurface/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lengine \ -lengine \

View File

@ -1,9 +1,7 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude -I$(LIB_SRC)/dynamicMesh/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-ltriSurface \
-lmeshTools \ -lmeshTools \
-ldynamicMesh -ldynamicMesh

View File

@ -1,9 +1,7 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude -I$(LIB_SRC)/dynamicMesh/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-ldynamicMesh \ -ldynamicMesh \
-ltriSurface \
-lmeshTools -lmeshTools

View File

@ -1,10 +1,7 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude -I$(LIB_SRC)/dynamicMesh/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-ltriSurface \
-ldynamicMesh \ -ldynamicMesh \
-lmeshTools -lmeshTools

View File

@ -1,8 +1 @@
/* /* */
EXE_INC = \
-I$(LIB_SRC)/triSurface/lnInclude
EXE_LIBS = \
-lmeshTools \
-ltriSurface
*/

View File

@ -1,9 +1,7 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude -I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-ldynamicMesh \ -ldynamicMesh \
-lmeshTools -lmeshTools

View File

@ -2,7 +2,6 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude -I$(LIB_SRC)/lagrangian/basic/lnInclude
EXE_LIBS = \ EXE_LIBS = \
@ -10,5 +9,4 @@ EXE_LIBS = \
-lgenericPatchFields \ -lgenericPatchFields \
-lmeshTools \ -lmeshTools \
-lsampling \ -lsampling \
-ltriSurface \
-llagrangian -llagrangian

View File

@ -3,7 +3,6 @@ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/surfMesh/lnInclude \ -I$(LIB_SRC)/surfMesh/lnInclude \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude -I$(LIB_SRC)/lagrangian/basic/lnInclude
EXE_LIBS = \ EXE_LIBS = \
@ -12,5 +11,4 @@ EXE_LIBS = \
-lmeshTools \ -lmeshTools \
-lsampling \ -lsampling \
-lsurfMesh \ -lsurfMesh \
-ltriSurface \
-llagrangian -llagrangian

View File

@ -1,5 +1,4 @@
EXE_INC = \ EXE_INC = \
/* -I$(LIB_SRC)/cfdTools/general/lnInclude */ \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/triSurface/lnInclude -I$(LIB_SRC)/triSurface/lnInclude

View File

@ -1,9 +1,7 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/edgeMesh/lnInclude \ -I$(LIB_SRC)/edgeMesh/lnInclude
-I$(LIB_SRC)/triSurface/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lmeshTools \ -lmeshTools \
-ledgeMesh \ -ledgeMesh
-ltriSurface

View File

@ -79,11 +79,7 @@ void deleteBox
{ {
const point eMid = surf.edges()[edgeI].centre(surf.localPoints()); const point eMid = surf.edges()[edgeI].centre(surf.localPoints());
if if (removeInside ? bb.contains(eMid) : !bb.contains(eMid))
(
(removeInside && bb.contains(eMid))
|| (!removeInside && !bb.contains(eMid))
)
{ {
edgeStat[edgeI] = surfaceFeatures::NONE; edgeStat[edgeI] = surfaceFeatures::NONE;
} }
@ -133,7 +129,6 @@ int main(int argc, char *argv[])
// Either construct features from surface&featureangle or read set. // Either construct features from surface&featureangle or read set.
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -1,6 +1,6 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/triSurface/lnInclude -I$(LIB_SRC)/surfMesh/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lmeshTools \ -lmeshTools \
-ltriSurface -lsurfMesh

View File

@ -23,18 +23,16 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description Description
Finds nearest triangle and vertex. Finds nearest face and vertex.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "triSurface.H"
#include "argList.H" #include "argList.H"
#include "OFstream.H" #include "OFstream.H"
#ifndef namespaceFoam #include "MeshedSurfaces.H"
#define namespaceFoam
using namespace Foam; using namespace Foam;
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -44,9 +42,9 @@ int main(int argc, char *argv[])
{ {
argList::noParallel(); argList::noParallel();
argList::validArgs.clear(); argList::validArgs.clear();
argList::addOption("x", "X"); argList::addOption("x", "X", "The point x-coordinate (if non-zero)");
argList::addOption("y", "Y"); argList::addOption("y", "Y", "The point y-coordinate (if non-zero)");
argList::addOption("z", "Z"); argList::addOption("z", "Z", "The point y-coordinate (if non-zero)");
argList::validArgs.append("surface file"); argList::validArgs.append("surface file");
@ -54,15 +52,15 @@ int main(int argc, char *argv[])
point samplePt point samplePt
( (
args.optionRead<scalar>("x"), args.optionLookupOrDefault<scalar>("x", 0),
args.optionRead<scalar>("y"), args.optionLookupOrDefault<scalar>("y", 0),
args.optionRead<scalar>("z") args.optionLookupOrDefault<scalar>("z", 0)
); );
Info<< "Looking for nearest face/vertex to " << samplePt << endl; Info<< "Looking for nearest face/vertex to " << samplePt << endl;
Info<< "Reading surf1 ..." << endl; Info<< "Reading surf ..." << endl;
triSurface surf1(args.additionalArgs()[0]); meshedSurface surf1(args.additionalArgs()[0]);
// //
// Nearest vertex // Nearest vertex
@ -83,11 +81,11 @@ int main(int argc, char *argv[])
} }
} }
Info<< "Nearest vertex:" << endl Info<< "Nearest vertex:" << nl
<< " index :" << minIndex << " (in localPoints)" << endl << " index :" << minIndex << " (in localPoints)" << nl
<< " index :" << surf1.meshPoints()[minIndex] << " index :" << surf1.meshPoints()[minIndex]
<< " (in points)" << endl << " (in points)" << nl
<< " coordinates:" << localPoints[minIndex] << endl << " coordinates:" << localPoints[minIndex] << nl
<< endl; << endl;
// //
@ -101,8 +99,7 @@ int main(int argc, char *argv[])
forAll(surf1, faceI) forAll(surf1, faceI)
{ {
const labelledTri& f = surf1[faceI]; const point centre = surf1[faceI].centre(points);
const point centre = f.centre(points);
const scalar dist = mag(centre - samplePt); const scalar dist = mag(centre - samplePt);
if (dist < minDist) 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 Info<< "Face with nearest centre:" << nl
<< " index :" << minIndex << endl << " index :" << minIndex << nl
<< " centre :" << f.centre(points) << endl << " centre :" << f.centre(points) << nl
<< " face :" << f << endl << " face :" << f << nl
<< " vertex coords:" << points[f[0]] << " " << " vertex coords:\n";
<< points[f[1]] << " " << points[f[2]] << endl forAll(f, fp)
<< endl; {
Info<< " " << points[f[fp]] << "\n";
}
Info<< endl;
Info<< "End\n" << endl; Info<< "End\n" << endl;

View File

@ -1,6 +1,6 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/triSurface/lnInclude -I$(LIB_SRC)/surfMesh/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lmeshTools \ -lmeshTools \
-ltriSurface -lsurfMesh

View File

@ -23,15 +23,16 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description Description
Example of simple laplacian smoother Example of a simple laplacian smoother
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "triSurface.H"
#include "argList.H" #include "argList.H"
#include "OFstream.H" #include "OFstream.H"
#include "boundBox.H" #include "boundBox.H"
#include "MeshedSurfaces.H"
using namespace Foam; using namespace Foam;
@ -61,23 +62,20 @@ int main(int argc, char *argv[])
label iters(readLabel(IStringStream(args.additionalArgs()[2])())); label iters(readLabel(IStringStream(args.additionalArgs()[2])()));
fileName outFileName(args.additionalArgs()[3]); fileName outFileName(args.additionalArgs()[3]);
Info<< "Relax:" << relax << endl; Info<< "Relax:" << relax << nl
Info<< "Iters:" << iters << endl; << "Iters:" << iters << nl
<< "Reading surface from " << surfFileName << " ..." << endl;
meshedSurface surf1(surfFileName);
Info<< "Reading surface from " << surfFileName << " ..." << endl; Info<< "Faces : " << surf1.size() << nl
<< "Vertices : " << surf1.nPoints() << nl
triSurface surf1(surfFileName); << "Bounding Box : " << boundBox(surf1.localPoints()) << endl;
Info<< "Triangles : " << surf1.size() << endl;
Info<< "Vertices : " << surf1.nPoints() << endl;
Info<< "Bounding Box : " << boundBox(surf1.localPoints()) << endl;
pointField newPoints(surf1.localPoints()); pointField newPoints(surf1.localPoints());
const labelListList& pointEdges = surf1.pointEdges(); const labelListList& pointEdges = surf1.pointEdges();
for (label iter = 0; iter < iters; iter++) for (label iter = 0; iter < iters; iter++)
{ {
forAll(pointEdges, vertI) 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; Info<< "Writing surface to " << outFileName << " ..." << endl;
surf2.write(outFileName); meshedSurface
(
xferMove(newPoints),
xferCopy(surf1.localFaces()),
xferCopy(surf1.surfZones())
).write(outFileName);
Info<< "End\n" << endl; Info<< "End\n" << endl;

View File

@ -1,6 +1,5 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/triSurface/lnInclude -I$(LIB_SRC)/surfMesh/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lmeshTools \ -lsurfMesh
-ltriSurface

View File

@ -35,7 +35,6 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "triSurface.H"
#include "argList.H" #include "argList.H"
#include "OFstream.H" #include "OFstream.H"
#include "IFstream.H" #include "IFstream.H"
@ -45,6 +44,8 @@ Description
#include "quaternion.H" #include "quaternion.H"
#include "mathematicalConstants.H" #include "mathematicalConstants.H"
#include "MeshedSurfaces.H"
using namespace Foam; using namespace Foam;
using namespace Foam::constant::mathematical; using namespace Foam::constant::mathematical;
@ -114,7 +115,7 @@ int main(int argc, char *argv[])
<< exit(FatalError); << exit(FatalError);
} }
triSurface surf1(surfFileName); meshedSurface surf1(surfFileName);
pointField points(surf1.points()); pointField points(surf1.points());
@ -193,9 +194,8 @@ int main(int argc, char *argv[])
points.replace(vector::Z, scaleVector.z()*points.component(vector::Z)); points.replace(vector::Z, scaleVector.z()*points.component(vector::Z));
} }
triSurface surf2(surf1, surf1.patches(), points); surf1.movePoints(points);
surf1.write(outFileName);
surf2.write(outFileName);
Info<< "End\n" << endl; Info<< "End\n" << endl;

View File

@ -9,16 +9,17 @@ cellDist/wallPoint/wallPoint.C
cellFeatures/cellFeatures.C cellFeatures/cellFeatures.C
coordinateSystems/coordinateSystem.C csys = coordinateSystems
coordinateSystems/coordinateSystemNew.C $(csys)/coordinateSystem.C
coordinateSystems/coordinateSystems.C $(csys)/coordinateSystemNew.C
coordinateSystems/cylindricalCS.C $(csys)/coordinateSystems.C
coordinateSystems/sphericalCS.C $(csys)/cylindricalCS.C
coordinateSystems/parabolicCylindricalCS.C $(csys)/sphericalCS.C
coordinateSystems/toroidalCS.C $(csys)/parabolicCylindricalCS.C
coordinateSystems/coordinateRotation/coordinateRotation.C $(csys)/toroidalCS.C
coordinateSystems/coordinateRotation/EulerCoordinateRotation.C $(csys)/coordinateRotation/coordinateRotation.C
coordinateSystems/coordinateRotation/STARCDCoordinateRotation.C $(csys)/coordinateRotation/EulerCoordinateRotation.C
$(csys)/coordinateRotation/STARCDCoordinateRotation.C
edgeFaceCirculator/edgeFaceCirculator.C edgeFaceCirculator/edgeFaceCirculator.C

View File

@ -85,8 +85,7 @@ public:
}; };
// Tree node. Has up pointer and down pointers. //- Tree node. Has up pointer and down pointers.
class node class node
{ {
public: public: