From 2e558acf65d9978b17c48e6f267a091b89e5df5a Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 22 Sep 2009 15:24:59 +0100 Subject: [PATCH 1/7] TypeName instead of ClassName --- applications/test/dictionary/calcEntry/calcEntry.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/test/dictionary/calcEntry/calcEntry.H b/applications/test/dictionary/calcEntry/calcEntry.H index e8a0925f94..119f155643 100644 --- a/applications/test/dictionary/calcEntry/calcEntry.H +++ b/applications/test/dictionary/calcEntry/calcEntry.H @@ -64,7 +64,7 @@ class calcEntry public: //- Runtime type information - TypeName("calc"); + ClassName("calc"); // Member Functions From 859d727696e1acf30fcd48a34052756b1757f024 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 22 Sep 2009 15:25:16 +0100 Subject: [PATCH 2/7] added patch non-manifold edge dumping --- .../conversion/writeMeshObj/writeMeshObj.C | 77 ++++++++++++++++--- 1 file changed, 66 insertions(+), 11 deletions(-) diff --git a/applications/utilities/mesh/conversion/writeMeshObj/writeMeshObj.C b/applications/utilities/mesh/conversion/writeMeshObj/writeMeshObj.C index e1d571e081..d2b23fef16 100644 --- a/applications/utilities/mesh/conversion/writeMeshObj/writeMeshObj.C +++ b/applications/utilities/mesh/conversion/writeMeshObj/writeMeshObj.C @@ -32,7 +32,8 @@ Description patch_YYY_XXX.obj : all face centres of patch YYY - Optional: patch faces (as polygons) : patchFaces_YYY_XXX.obj + Optional: - patch faces (as polygons) : patchFaces_YYY_XXX.obj + - non-manifold edges : patchEdges_YYY_XXX.obj \*---------------------------------------------------------------------------*/ @@ -51,7 +52,7 @@ using namespace Foam; void writeOBJ(const point& pt, Ostream& os) { - os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl; + os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << nl; } // All edges of mesh @@ -75,8 +76,7 @@ void writePoints(const polyMesh& mesh, const fileName& timeName) { const edge& e = mesh.edges()[edgeI]; - pointStream << "l " << e.start() + 1 << ' ' << e.end() + 1 - << endl; + pointStream << "l " << e.start() + 1 << ' ' << e.end() + 1 << nl; } } @@ -277,7 +277,47 @@ void writePatchFaces { patchFaceStream << ' ' << f[fp]+1; } - patchFaceStream << endl; + patchFaceStream << nl; + } + } +} + + +void writePatchBoundaryEdges +( + const polyMesh& mesh, + const fileName& timeName +) +{ + const polyBoundaryMesh& patches = mesh.boundaryMesh(); + + forAll(patches, patchI) + { + const polyPatch& pp = patches[patchI]; + + fileName edgeFile + ( + mesh.time().path() + / "patchEdges_" + pp.name() + '_' + timeName + ".obj" + ); + + Info << "Writing patch edges to " << edgeFile << endl; + + OFstream patchEdgeStream(edgeFile); + + forAll(pp.localPoints(), pointI) + { + writeOBJ(pp.localPoints()[pointI], patchEdgeStream); + } + + for (label edgeI = pp.nInternalEdges(); edgeI < pp.nEdges(); edgeI++) + { + if (pp.edgeFaces()[edgeI].size() == 1) + { + const edge& e = pp.edges()[edgeI]; + + patchEdgeStream<< "l " << e[0]+1 << ' ' << e[1]+1 << nl; + } } } } @@ -339,6 +379,7 @@ int main(int argc, char *argv[]) { timeSelector::addOptions(); argList::validOptions.insert("patchFaces", ""); + argList::validOptions.insert("patchEdges", ""); argList::validOptions.insert("cell", "cellI"); argList::validOptions.insert("face", "faceI"); argList::validOptions.insert("point", "pointI"); @@ -351,6 +392,7 @@ int main(int argc, char *argv[]) runTime.functionObjects().off(); bool patchFaces = args.optionFound("patchFaces"); + bool patchEdges = args.optionFound("patchEdges"); bool doCell = args.optionFound("cell"); bool doPoint = args.optionFound("point"); bool doFace = args.optionFound("face"); @@ -381,19 +423,23 @@ int main(int argc, char *argv[]) { writePatchFaces(mesh, runTime.timeName()); } - else if (doCell) + if (patchEdges) + { + writePatchBoundaryEdges(mesh, runTime.timeName()); + } + if (doCell) { label cellI = args.optionRead