Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop

This commit is contained in:
sergio
2017-06-02 13:36:09 -07:00
167 changed files with 6533 additions and 3820 deletions

View File

@ -22,13 +22,13 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::constant
Foam::diameterModels::constant
Description
Constant dispersed-phase particle diameter model.
SourceFiles
constant.C
constantDiameter.C
\*---------------------------------------------------------------------------*/

View File

@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::constantSurfaceTensionCoefficient
Foam::surfaceTensionModels::constantSurfaceTensionCoefficient
Description
Constant value surface tension model.

View File

@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::constantAspectRatio
Foam::aspectRatioModels::constantAspectRatio
Description
Constant value aspect ratio model.

View File

@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::constantAspectRatio
Foam::aspectRatioModels::constantAspectRatio
Description
Constant value aspect ratio model.

View File

@ -42,13 +42,44 @@ Description
using namespace Foam;
void infoHashString
(
unsigned modulus,
std::initializer_list<std::string> lst
)
{
if (modulus)
{
Info<< "basic string hashing (mod " << label(modulus) << ")" << endl;
for (const auto& str : lst)
{
Info<<"hash(" << str.c_str() << ")="
<< (Hash<string>()(str) % modulus) << nl;
}
}
else
{
Info<< "basic string hashing" << nl;
for (const auto& str : lst)
{
Info<<"hash(" << str.c_str() << ")="
<< Hash<string>()(str) << nl;
}
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
IFstream is("hashingTests");
infoHashString(8, {"asdathis1", "adsxf", "hij", "klmpq"});
IFstream is("hashingTests");
while (is.good())
{

View File

@ -26,6 +26,7 @@ Description
\*---------------------------------------------------------------------------*/
#include "NamedEnum.H"
#include "Enum.H"
#include "IOstreams.H"
using namespace Foam;
@ -34,15 +35,27 @@ class namedEnumTest
{
public:
enum option
enum class option
{
a,
b,
c,
d
A,
B,
C,
D
};
static const Foam::NamedEnum<option, 4> namedEnum;
enum class otherOption
{
A,
B,
C,
D
};
static const Foam::NamedEnum<option, 4> optionNamed;
static const Foam::Enum<otherOption> optionEnum;
static const Foam::Enum<option> optionEnum2;
};
@ -52,10 +65,25 @@ const char* Foam::NamedEnum<namedEnumTest::option, 4>::names[] =
"a",
"b",
"c",
"d"
"d",
};
const Foam::NamedEnum<namedEnumTest::option, 4> namedEnumTest::namedEnum;
const Foam::NamedEnum<namedEnumTest::option, 4> namedEnumTest::optionNamed;
const Foam::Enum<namedEnumTest::otherOption> namedEnumTest::optionEnum
{
{ namedEnumTest::otherOption::A, "a" },
{ namedEnumTest::otherOption::B, "b" },
{ namedEnumTest::otherOption::C, "c" },
{ namedEnumTest::otherOption::D, "d" },
};
const Foam::Enum<namedEnumTest::option> namedEnumTest::optionEnum2
(
namedEnumTest::option::C,
{ "c", "d" }
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -63,62 +91,66 @@ const Foam::NamedEnum<namedEnumTest::option, 4> namedEnumTest::namedEnum;
int main(int argc, char *argv[])
{
const List<namedEnumTest::option> options
= namedEnumTest::namedEnum.enums();
Info<<"NamedEnum: " << namedEnumTest::optionNamed << nl;
Info<<"Enum: " << namedEnumTest::optionEnum << nl;
Info<<"Enum: " << namedEnumTest::optionEnum2 << nl;
dictionary testDict;
testDict.add("lookup1", "c");
Info<< "enums: " << options << nl;
Info<< "loop over enums (as list):" << nl;
forAll(options, i)
{
const namedEnumTest::option& opt = options[i];
Info<< "option[" << opt
<< "] = '" << namedEnumTest::namedEnum[opt] << "'" << nl;
}
Info<< "loop over enums (C++11 for range):" << nl;
for (const auto& opt : options)
{
Info<< "option[" << opt
<< "] = '" << namedEnumTest::namedEnum[opt] << "'" << nl;
}
Info<< nl
<< int(namedEnumTest::optionNamed["a"]) << nl
<< namedEnumTest::optionNamed[namedEnumTest::option::A] << nl;
Info<< nl
<< namedEnumTest::namedEnum["a"] << nl
<< namedEnumTest::namedEnum[namedEnumTest::a] << nl;
<< int(namedEnumTest::optionEnum["a"]) << nl
<< namedEnumTest::optionEnum[namedEnumTest::otherOption::A] << nl;
Info<< "--- test dictionary lookup ---" << endl;
{
Info<< "dict: " << testDict << endl;
namedEnumTest::option gotOpt =
namedEnumTest::namedEnum.lookupOrDefault
(
"test",
testDict,
namedEnumTest::option::a
);
Info<< "got: "
<< int
(
namedEnumTest::optionNamed.lookupOrDefault
(
"notFound",
testDict,
namedEnumTest::option::A
)
)
<< nl;
Info<< "got: " << gotOpt << endl;
Info<< "got: "
<< int
(
namedEnumTest::optionNamed.lookupOrDefault
(
"lookup1",
testDict,
namedEnumTest::option::A
)
)
<< nl;
gotOpt = namedEnumTest::namedEnum.lookupOrDefault
(
"lookup1",
testDict,
namedEnumTest::option::a
);
Info<< "got: " << gotOpt << endl;
Info<< "got: "
<< int
(
namedEnumTest::optionEnum2.lookupOrDefault
(
"lookup1",
testDict,
namedEnumTest::option::A
)
)
<< nl;
}
Info<< "--- test read construction ---" << endl;
Info<< "--- test read ---" << endl;
namedEnumTest::option dummy(namedEnumTest::namedEnum.read(Sin));
Info<< namedEnumTest::namedEnum[dummy] << endl;
namedEnumTest::option dummy(namedEnumTest::optionNamed.read(Sin));
Info<< namedEnumTest::optionNamed[dummy] << endl;
Info<< "End\n" << endl;

View File

@ -84,6 +84,12 @@ int main(int argc, char *argv[])
packed.resize(n, 1);
}
Info<< "resize/shrink/resize:" << timer.cpuTimeIncrement() << " s\n\n";
Info<< "packed bool size=" << packed.size() << nl;
// Neither of these should affect the size
packed.unset(2*n-1);
packed.set(2*n-1, 0);
Info<< "packed bool size=" << packed.size() << nl;
// set every other bit on:
Info<< "set every other bit on and count\n";
@ -99,8 +105,8 @@ int main(int argc, char *argv[])
}
}
Info<< "Counting brute-force:" << timer.cpuTimeIncrement()
<< " s" << endl;
Info<< " sum " << sum << endl;
<< " s" << nl
<< " sum " << sum << endl;
// Count packed
@ -110,8 +116,8 @@ int main(int argc, char *argv[])
sum += packed.count();
}
Info<< "Counting via count():" << timer.cpuTimeIncrement()
<< " s" << endl;
Info<< " sum " << sum << endl;
<< " s" << nl
<< " sum " << sum << endl;
// Dummy addition
@ -123,8 +129,8 @@ int main(int argc, char *argv[])
sum += i + 1;
}
}
Info<< "Dummy loop:" << timer.cpuTimeIncrement() << " s" << endl;
Info<< " sum " << sum << endl;
Info<< "Dummy loop:" << timer.cpuTimeIncrement() << " s" << nl
<< " sum " << sum << " (sum is meaningless)" << endl;
//
// Read
@ -139,8 +145,8 @@ int main(int argc, char *argv[])
sum += stlVector[i];
}
}
Info<< "Reading stl:" << timer.cpuTimeIncrement() << " s" << endl;
Info<< " sum " << sum << endl;
Info<< "Reading stl:" << timer.cpuTimeIncrement() << " s" << nl
<< " sum " << sum << endl;
// Read unpacked
@ -152,8 +158,8 @@ int main(int argc, char *argv[])
sum += unpacked[i];
}
}
Info<< "Reading unpacked:" << timer.cpuTimeIncrement() << " s" << endl;
Info<< " sum " << sum << endl;
Info<< "Reading unpacked:" << timer.cpuTimeIncrement() << " s" << nl
<< " sum " << sum << endl;
// Read packed
@ -166,8 +172,8 @@ int main(int argc, char *argv[])
}
}
Info<< "Reading packed using get:" << timer.cpuTimeIncrement()
<< " s" << endl;
Info<< " sum " << sum << endl;
<< " s" << nl
<< " sum " << sum << endl;
// Read packed
@ -180,8 +186,8 @@ int main(int argc, char *argv[])
}
}
Info<< "Reading packed using reference:" << timer.cpuTimeIncrement()
<< " s" << endl;
Info<< " sum " << sum << endl;
<< " s" << nl
<< " sum " << sum << endl;
// Read via iterator
@ -194,8 +200,8 @@ int main(int argc, char *argv[])
}
}
Info<< "Reading packed using iterator:" << timer.cpuTimeIncrement()
<< " s" << endl;
Info<< " sum " << sum << endl;
<< " s" << nl
<< " sum " << sum << endl;
// Read via iterator
@ -208,8 +214,8 @@ int main(int argc, char *argv[])
}
}
Info<< "Reading packed using const_iterator():" << timer.cpuTimeIncrement()
<< " s" << endl;
Info<< " sum " << sum << endl;
<< " s" << nl
<< " sum " << sum << endl;
// Read empty hash
@ -222,8 +228,8 @@ int main(int argc, char *argv[])
}
}
Info<< "Reading empty labelHashSet:" << timer.cpuTimeIncrement()
<< " s" << endl;
Info<< " sum " << sum << endl;
<< " s" << nl
<< " sum " << sum << endl;
// Read full hash
@ -236,8 +242,8 @@ int main(int argc, char *argv[])
}
}
Info<< "Reading full labelHashSet:" << timer.cpuTimeIncrement()
<< " s" << endl;
Info<< " sum " << sum << endl;
<< " s" << nl
<< " sum " << sum << endl;
// Read empty static hash
@ -250,8 +256,8 @@ int main(int argc, char *argv[])
}
}
Info<< "Reading empty StaticHash:" << timer.cpuTimeIncrement()
<< " s" << endl;
Info<< " sum " << sum << endl;
<< " s" << nl
<< " sum " << sum << endl;
#if 0
// we can skip this test - it is usually quite slow
@ -265,8 +271,8 @@ int main(int argc, char *argv[])
}
}
Info<< "Reading full StaticHash:" << timer.cpuTimeIncrement()
<< " s" << endl;
Info<< " sum " << sum << endl;
<< " s" << nl
<< " sum " << sum << endl;
#endif
Info<< "Starting write tests" << endl;
@ -319,7 +325,6 @@ int main(int argc, char *argv[])
Info<< "Writing packed using set:" << timer.cpuTimeIncrement()
<< " s" << endl;
// Write packed
for (label iter = 0; iter < nIters; ++iter)
{

View File

@ -0,0 +1,3 @@
Test-surfaceIntersection.C
EXE = $(FOAM_USER_APPBIN)/Test-surfaceIntersection

View File

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

View File

@ -0,0 +1,221 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\/ 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 <http://www.gnu.org/licenses/>.
Application
Test-surfaceIntersection
Description
Test surface-surface intersection
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "Time.H"
#include "triSurface.H"
#include "triSurfaceMesh.H"
#include "surfaceIntersection.H"
#include "OBJstream.H"
using namespace Foam;
autoPtr<triSurface> loadSurface
(
const Foam::Time& runTime,
const fileName& surfName
)
{
Info<< "Reading surface " << surfName << endl;
const fileName fallback =
runTime.constantPath()/triSurfaceMesh::meshSubDir/surfName;
autoPtr<triSurface> surfPtr;
if (isFile(surfName))
{
surfPtr.set(new triSurface(surfName));
}
else if (isFile(fallback))
{
surfPtr.set(new triSurface(fallback));
}
else
{
FatalErrorInFunction
<< "No such file:" << surfName << exit(FatalError);
}
return surfPtr;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
argList::addNote
(
"Intersection of two surfaces. Writes obj file"
);
argList::addBoolOption
(
"debug2",
"set surfaceIntersection debug=2"
);
argList::addBoolOption
(
"debug4",
"set surfaceIntersection debug=4"
);
argList::addBoolOption
(
"print",
"print information about cuts, etc"
);
argList::addBoolOption
(
"mergeEdges",
"merge duplicate edges"
);
argList::addOption
(
"mergePoints",
"mergeTol",
"merge points (and edges) using the specified tolerance"
);
#include "addDictOption.H"
argList::addNote
(
"test intersect of two surfaces. Writes obj file"
);
argList::noParallel();
argList::noFunctionObjects();
argList::validArgs.append("surface file");
argList::validArgs.append("surface file");
#include "setRootCase.H"
#include "createTime.H"
const word outputFile(args.executable() + ".obj");
const fileName surf1Name(args[1]);
triSurface surf1 = loadSurface(runTime, surf1Name)();
Info<< surf1Name << " statistics:" << endl;
surf1.writeStats(Info);
Info<< endl;
const fileName surf2Name(args[2]);
triSurface surf2 = loadSurface(runTime, surf2Name)();
Info<< surf2Name << " statistics:" << endl;
surf2.writeStats(Info);
Info<< endl;
if (args.optionFound("debug2"))
{
surfaceIntersection::debug |= 2;
}
if (args.optionFound("debug4"))
{
surfaceIntersection::debug |= 4;
}
const bool optPrint = args.optionFound("print");
dictionary intersectOptions;
if (args.optionFound("dict"))
{
intersectOptions = IOdictionary
(
IOobject
(
args["dict"],
runTime,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
}
intersectOptions.writeEntry("intersectOptions", Info);
Info<< endl;
triSurfaceSearch query1(surf1);
triSurfaceSearch query2(surf2);
surfaceIntersection cuts(query1, query2, intersectOptions);
Info<<"intersection "
<< cuts.cutPoints().size() << " points "
<< cuts.cutEdges().size() << " edges" << nl;
if (optPrint)
{
Info<< "surf1-cuts: " << cuts.surf1EdgeCuts() << nl
<< "surf2-cuts: " << cuts.surf2EdgeCuts() << nl
<< "face-pairs: " << cuts.facePairToEdgeId() << nl
<< "edges: " << cuts.cutEdges() << nl;
}
word mergeOp;
if (args.optionFound("mergePoints"))
{
cuts.mergePoints(args.optionRead<scalar>("mergePoints"));
mergeOp = "mergePoints";
}
else if (args.optionFound("mergeEdges"))
{
cuts.mergeEdges();
mergeOp = "mergeEdges";
}
if (!mergeOp.empty())
{
Info<< mergeOp << ": "
<< cuts.cutPoints().size() << " points "
<< cuts.cutEdges().size() << " edges" << nl;
if (optPrint)
{
Info<< "surf1-cuts: " << cuts.surf1EdgeCuts() << nl
<< "surf2-cuts: " << cuts.surf2EdgeCuts() << nl
<< "face-pairs: " << cuts.facePairToEdgeId() << nl
<< "edges: " << cuts.cutEdges() << nl;
}
}
const pointField& points = cuts.cutPoints();
const edgeList& edges = cuts.cutEdges();
if (points.size() || edges.size())
{
Info<<"write to " << outputFile << nl;
OBJstream(outputFile).write(edges, points);
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,3 @@
Test-unitConversion.C
EXE = $(FOAM_USER_APPBIN)/Test-unitConversion

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\/ 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 <http://www.gnu.org/licenses/>.
Application
Test-unitConversion
\*---------------------------------------------------------------------------*/
#include "IOstreams.H"
#include "unitConversion.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
Info<< "30_deg: " << 30_deg << nl;
Info<< "30.0_deg: " << 30.0_deg << nl;
Info<< "3e+1_deg: " << 3e+1_deg << nl;
Info<< "degToRad(30): " << degToRad(30) << nl;
Info<< "cos(30_deg): " << ::cos(30_deg) << nl;
return 0;
}
// ************************************************************************* //

View File

@ -125,12 +125,6 @@ int main(int argc, char *argv[])
"provide alternative base name when re-exporting (implies -export). "
"Default is <meshExport>."
);
// This often works, but is not entirely stable
// argList::addBoolOption
// (
// "combine",
// "combine identically named patches"
// );
argList::addBoolOption
(
"noBaffles",
@ -211,10 +205,6 @@ int main(int argc, char *argv[])
{
rOpts.useNumberedNames(true);
}
else if (args.optionFound("combine"))
{
rOpts.combineBoundaries(true);
}
if (args.optionFound("solids"))
{
@ -295,7 +285,7 @@ int main(int argc, char *argv[])
{
const fileName geomName = exportName + ".ccmg";
Info<< nl << "Re-exporting geometry as " << geomName << nl;
ccm::writer(geomName, mesh).writeGeometry();
ccm::writer(geomName, mesh()).writeGeometry();
}
}
else

View File

@ -44,22 +44,9 @@ void Foam::DelaunayMeshTools::writeOBJ
OFstream str(fName);
Pout<< nl
<< "Writing points of types:" << nl;
forAllConstIter
(
HashTable<int>,
indexedVertexEnum::vertexTypeNames_,
iter
)
{
if (iter() >= startPointType && iter() <= endPointType)
{
Pout<< " " << iter.key() << nl;
}
}
Pout<< "to " << str.name() << endl;
<< "Writing points of types ("
<< int(startPointType) << "-" << int(endPointType)
<< ") to " << str.name() << endl;
for
(
@ -265,7 +252,7 @@ void Foam::DelaunayMeshTools::drawDelaunayCell
<< "f " << 1 + offset << " " << 4 + offset << " " << 3 + offset << nl
<< "f " << 1 + offset << " " << 2 + offset << " " << 4 + offset << endl;
// os << "# cicumcentre " << endl;
// os << "# circumcentre " << endl;
// meshTools::writeOBJ(os, c->dual());

View File

@ -900,12 +900,10 @@ void Foam::conformalVoronoiMesh::writeMesh
mesh.addFvPatches(patches);
// Add zones to the mesh
addZones(mesh, cellCentres);
Info<< indent << "Add pointZones" << endl;
{
label sz = mesh.pointZones().size();
@ -914,6 +912,9 @@ void Foam::conformalVoronoiMesh::writeMesh
forAll(dualMeshPointTypeNames_, typeI)
{
const word& znName =
dualMeshPointTypeNames_[dualMeshPointType(typeI)];
forAll(boundaryPts, ptI)
{
const label& bPtType = boundaryPts[ptI];
@ -928,14 +929,14 @@ void Foam::conformalVoronoiMesh::writeMesh
Info<< incrIndent << indent
<< "Adding " << bPts.size()
<< " points of type " << dualMeshPointTypeNames_.words()[typeI]
<< " points of type " << znName
<< decrIndent << endl;
mesh.pointZones().append
(
new pointZone
(
dualMeshPointTypeNames_.words()[typeI],
znName,
bPts,
sz + typeI,
mesh.pointZones()

View File

@ -102,6 +102,8 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::noCheckProcessorDirectories();
#include "addDictOption.H"
#include "setRootCase.H"
#include "createTime.H"

View File

@ -229,7 +229,7 @@ int main(int argc, char *argv[])
word patchMapMethod;
if (meshToMesh::interpolationMethodNames_.found(mapMethod))
if (meshToMesh::interpolationMethodNames_.hasEnum(mapMethod))
{
// Lookup corresponding AMI method
meshToMesh::interpolationMethod method =

View File

@ -83,7 +83,7 @@ Description
#include "edgeIntersections.H"
#include "meshTools.H"
#include "DynamicField.H"
#include "Enum.H"
#ifndef NO_CGAL
@ -99,7 +99,7 @@ typedef CGAL::AABB_face_graph_triangle_primitive
typedef CGAL::AABB_traits<K, Primitive> Traits;
typedef CGAL::AABB_tree<Traits> Tree;
typedef boost::optional<Tree::Intersection_and_primitive_id<Segment>::Type >
typedef boost::optional<Tree::Intersection_and_primitive_id<Segment>::Type>
Segment_intersection;
#endif // NO_CGAL
@ -477,7 +477,6 @@ label dupNonManifoldPoints(triSurface& s, labelList& pointMap)
List<labelledTri> newFaces(s);
label nNonManifold = 0;
forAll(pf, pointI)
{
const labelList& pFaces = pf[pointI];
@ -1257,10 +1256,10 @@ autoPtr<extendedFeatureEdgeMesh> createEdgeMesh
const triSurface& s1 = surf1;
const triSurface& s2 = surf2;
forAllConstIter(labelPairLookup, inter.facePairToEdge(), iter)
forAllConstIters(inter.facePairToEdgeId(), iter)
{
const label& cutEdgeI = iter();
const labelPair& facePair = iter.key();
const label cutEdgeI = iter.object();
const edge& fE = inter.cutEdges()[cutEdgeI];
@ -1515,8 +1514,8 @@ int main(int argc, char *argv[])
{
argList::noParallel();
argList::validArgs.append("action");
argList::validArgs.append("surface file");
argList::validArgs.append("surface file");
argList::validArgs.append("surfaceFile1");
argList::validArgs.append("surfaceFile2");
argList::addBoolOption
(
@ -1554,24 +1553,30 @@ int main(int argc, char *argv[])
" 'mixed' (keep all)"
);
argList::addNote
(
"Valid actions: \"intersection\", \"union\", \"difference\""
);
#include "setRootCase.H"
#include "createTime.H"
const word action(args[1]);
const HashTable<booleanSurface::booleanOpType> validActions
const Enum<booleanSurface::booleanOpType> validActions
{
{"intersection", booleanSurface::INTERSECTION},
{"union", booleanSurface::UNION},
{"difference", booleanSurface::DIFFERENCE}
{ booleanSurface::INTERSECTION, "intersection" },
{ booleanSurface::UNION, "union" },
{ booleanSurface::DIFFERENCE, "difference" }
};
if (!validActions.found(action))
if (!validActions.hasEnum(action))
{
FatalErrorInFunction
<< "Unsupported action " << action << endl
<< "Supported actions:" << validActions.toc() << abort(FatalError);
<< "Supported actions:" << validActions << nl
<< abort(FatalError);
}

View File

@ -0,0 +1,7 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
wclean libso extractionMethod
wclean .
#------------------------------------------------------------------------------

View File

@ -0,0 +1,9 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
(wmake libso extractionMethod && wmake)
#------------------------------------------------------------------------------

View File

@ -1,9 +1,11 @@
EXE_INC = \
-IextractionMethod/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/surfMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
EXE_LIBS = \
-lsurfaceFeatureExtract \
-lmeshTools \
-lsampling

View File

@ -0,0 +1,7 @@
method = .
$(method)/surfaceFeaturesExtraction.C
$(method)/extractFromFile.C
$(method)/extractFromNone.C
$(method)/extractFromSurface.C
LIB = $(FOAM_LIBBIN)/libsurfaceFeatureExtract

View File

@ -0,0 +1,7 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/surfMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
LIB_LIBS = \
-lmeshTools

View File

@ -0,0 +1,103 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\/ 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "extractFromFile.H"
#include "edgeMesh.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace surfaceFeaturesExtraction
{
addNamedToRunTimeSelectionTable
(
method,
extractFromFile,
dictionary,
extractFromFile
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::surfaceFeaturesExtraction::extractFromFile::extractFromFile
(
const dictionary& dict
)
:
method()
{
const dictionary& coeffDict =
dict.optionalSubDict("extractFromFileCoeffs");
coeffDict.lookup("featureEdgeFile") >> featureEdgeFile_;
coeffDict.readIfPresent("geometricTestOnly", geometricTestOnly_);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::surfaceFeaturesExtraction::extractFromFile::~extractFromFile()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::autoPtr<Foam::surfaceFeatures>
Foam::surfaceFeaturesExtraction::extractFromFile::features
(
const triSurface& surf
) const
{
edgeMesh eMesh(featureEdgeFile_);
// Sometimes duplicate edges are present. Remove them.
eMesh.mergeEdges();
Info<< nl << "Reading existing feature edges from file "
<< featureEdgeFile_ << nl
<< "Selecting edges based purely on geometric tests: "
<< geometricTestOnly().asText() << endl;
return autoPtr<surfaceFeatures>
(
new surfaceFeatures
(
surf,
eMesh.points(),
eMesh.edges(),
1e-6, // mergeTol
geometricTestOnly()
)
);
}
// ************************************************************************* //

View File

@ -0,0 +1,88 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\/ 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 <http://www.gnu.org/licenses/>.
Class
Foam::surfaceFeaturesExtraction::extractFromFile
Description
Run-time selectable surface feature extraction.
Selectable as "extractFromFile".
Mandatory dictionary entries: "featureEdgeFile".
Optional dictionary entries: "geometricTestOnly".
SourceFiles
extractFromFile.C
\*---------------------------------------------------------------------------*/
#ifndef surfaceFeaturesExtraction_extractFromFile_H
#define surfaceFeaturesExtraction_extractFromFile_H
#include "surfaceFeaturesExtraction.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace surfaceFeaturesExtraction
{
/*---------------------------------------------------------------------------*\
Class surfaceFeaturesExtraction::extractFromFile Declaration
\*---------------------------------------------------------------------------*/
class extractFromFile
:
public method
{
fileName featureEdgeFile_;
public:
//- Construct from dictionary
extractFromFile(const dictionary& dict);
//- Destructor
virtual ~extractFromFile();
//- Features loaded (extracted) from featureEdgeFile
virtual autoPtr<surfaceFeatures> features
(
const triSurface& surf
) const override;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace surfaceFeaturesExtraction
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,80 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\/ 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "extractFromNone.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace surfaceFeaturesExtraction
{
addNamedToRunTimeSelectionTable
(
method,
extractFromNone,
dictionary,
none
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::surfaceFeaturesExtraction::extractFromNone::extractFromNone
(
const dictionary& dict
)
:
method()
{
// A "noneCoeffs" sub-dictionary doesn't make much sense.
dict.readIfPresent("includedAngle", includedAngle_);
dict.readIfPresent("geometricTestOnly", geometricTestOnly_);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::surfaceFeaturesExtraction::extractFromNone::~extractFromNone()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::autoPtr<Foam::surfaceFeatures>
Foam::surfaceFeaturesExtraction::extractFromNone::features
(
const triSurface& surf
) const
{
return autoPtr<surfaceFeatures>(new surfaceFeatures(surf));
}
// ************************************************************************* //

View File

@ -0,0 +1,87 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\/ 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 <http://www.gnu.org/licenses/>.
Class
Foam::surfaceFeaturesExtraction::extractFromNone
Description
Run-time selectable surface feature extraction - no extraction.
Primarily useful with self-intersection methods.
Selectable as "none".
Optional dictionary entries: "includedAngle", "geometricTestOnly".
SourceFiles
extractFromNone.C
\*---------------------------------------------------------------------------*/
#ifndef surfaceFeaturesExtraction_extractFromNone_H
#define surfaceFeaturesExtraction_extractFromNone_H
#include "surfaceFeaturesExtraction.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace surfaceFeaturesExtraction
{
/*---------------------------------------------------------------------------*\
Class surfaceFeaturesExtraction::extractFromNone Declaration
\*---------------------------------------------------------------------------*/
class extractFromNone
:
public method
{
public:
//- Construct from dictionary
extractFromNone(const dictionary& dict);
//- Destructor
virtual ~extractFromNone();
//- Extracted features from surface (no-op)
virtual autoPtr<surfaceFeatures> features
(
const triSurface& surf
) const override;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace surfaceFeaturesExtraction
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,97 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\/ 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "extractFromSurface.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace surfaceFeaturesExtraction
{
addNamedToRunTimeSelectionTable
(
method,
extractFromSurface,
dictionary,
extractFromSurface
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::surfaceFeaturesExtraction::extractFromSurface::extractFromSurface
(
const dictionary& dict
)
:
method()
{
const dictionary& coeffDict =
dict.optionalSubDict("extractFromSurfaceCoeffs");
coeffDict.lookup("includedAngle") >> includedAngle_;
coeffDict.readIfPresent("geometricTestOnly", geometricTestOnly_);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::surfaceFeaturesExtraction::extractFromSurface::~extractFromSurface()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::autoPtr<Foam::surfaceFeatures>
Foam::surfaceFeaturesExtraction::extractFromSurface::features
(
const triSurface& surf
) const
{
Info<< nl << "Constructing feature set from included angle "
<< includedAngle() << nl
<< "Selecting edges based purely on geometric tests: "
<< geometricTestOnly().asText() << endl;
return autoPtr<surfaceFeatures>
(
new surfaceFeatures
(
surf,
includedAngle(),
0, // minLen
0, // minElems
geometricTestOnly()
)
);
}
// ************************************************************************* //

View File

@ -0,0 +1,86 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\/ 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 <http://www.gnu.org/licenses/>.
Class
Foam::surfaceFeaturesExtraction::extractFromSurface
Description
Run-time selectable surface feature extraction - extract from surface.
Selectable as "extractFromSurface".
Mandatory dictionary entries: "includedAngle".
Optional dictionary entries: "geometricTestOnly".
SourceFiles
extractFromSurface.C
\*---------------------------------------------------------------------------*/
#ifndef surfaceFeaturesExtraction_extractFromSurface_H
#define surfaceFeaturesExtraction_extractFromSurface_H
#include "surfaceFeaturesExtraction.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace surfaceFeaturesExtraction
{
/*---------------------------------------------------------------------------*\
Class surfaceFeaturesExtraction::extractFromSurface Declaration
\*---------------------------------------------------------------------------*/
class extractFromSurface
:
public method
{
public:
//- Construct from dictionary
extractFromSurface(const dictionary& dict);
//- Destructor
virtual ~extractFromSurface();
//- Features extracted from surface
virtual autoPtr<surfaceFeatures> features
(
const triSurface& surf
) const override;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace surfaceFeaturesExtraction
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,90 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\/ 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "surfaceFeaturesExtraction.H"
#include "dictionary.H"
#include "ListOps.H"
#include "error.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace surfaceFeaturesExtraction
{
defineTypeName(method);
defineRunTimeSelectionTable
(
method,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::surfaceFeaturesExtraction::method::method()
:
includedAngle_(0),
geometricTestOnly_(Switch::NO)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::surfaceFeaturesExtraction::method::~method()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::autoPtr<Foam::surfaceFeaturesExtraction::method>
Foam::surfaceFeaturesExtraction::method::New
(
const dictionary& dict
)
{
const word methodName = dict.lookup("extractionMethod");
auto cstrIter = dictionaryConstructorTablePtr_->cfind(methodName);
if (!cstrIter.found())
{
FatalIOErrorInFunction
(
dict
) << "Unknown extractionMethod " << methodName << nl << nl
<< "Valid extraction methods:" << nl
<< flatOutput(dictionaryConstructorTablePtr_->sortedToc())
<< exit(FatalIOError);
}
return autoPtr<method>(cstrIter.object()(dict));
}
// ************************************************************************* //

View File

@ -0,0 +1,141 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\/ 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 <http://www.gnu.org/licenses/>.
Namespace
Foam::surfaceFeaturesExtraction
Description
Namespace for run-time selectable surface feature extraction methods.
Class
Foam::surfaceFeaturesExtraction::method
Description
Abstract base for run-time selectable surface feature extraction methods.
SourceFiles
surfaceFeaturesExtraction.C
\*---------------------------------------------------------------------------*/
#ifndef surfaceFeaturesExtraction_method_H
#define surfaceFeaturesExtraction_method_H
#include "surfaceFeatures.H"
#include "dictionary.H"
#include "Switch.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace surfaceFeaturesExtraction
{
/*---------------------------------------------------------------------------*\
Class surfaceFeaturesExtraction::method Declaration
\*---------------------------------------------------------------------------*/
class method
{
protected:
scalar includedAngle_;
Switch geometricTestOnly_;
//- Construct null
method();
public:
//- Runtime type information
ClassNameNoDebug("method");
// Constructors
//- Construct from dictionary
method(const dictionary& dict);
// Declare run-time constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
method,
dictionary,
(
const dictionary& dict
),
(dict)
);
// Selectors
//- Select constructed from dictionary
static autoPtr<method> New
(
const dictionary& dict
);
//- Destructor
virtual ~method();
// Member Functions
//- The included angle, if set
inline scalar includedAngle() const
{
return includedAngle_;
}
//- Use geometric test only
inline Switch geometricTestOnly() const
{
return geometricTestOnly_;
}
//- Extracted features
virtual autoPtr<surfaceFeatures> features
(
const triSurface& surf
) const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace surfaceFeaturesExtraction
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -16,38 +16,60 @@ FoamFile
surface1.stl
{
// How to obtain raw features (extractFromFile || extractFromSurface)
// Extract raw features (none | extractFromFile | extractFromSurface)
extractionMethod extractFromSurface;
extractFromSurfaceCoeffs
{
// Mark edges whose adjacent surface normals are at an angle less
// than includedAngle as features
// - 0 : selects no edges
// - 180: selects all edges
includedAngle 120;
// Mark edges whose adjacent surface normals are at an angle less
// than includedAngle as features
// - 0 : selects no edges
// - 180: selects all edges
includedAngle 120;
// Do not mark region edges
geometricTestOnly yes;
}
// Do not mark region edges
geometricTestOnly yes;
// Write options
// Generate additional intersection features (none | self | region)
intersectionMethod none;
// Write features to obj format for postprocessing
writeObj yes;
// Tolerance for surface intersections
// tolerance 1e-3;
// Output options:
// Write features to obj format for postprocessing
writeObj yes;
}
// Self intersection (single or multiple surfaces).
// - Use 'surfaces' entry (a wordRe list) if it exists.
// - If the dictionary name does not have an extension, 'surfaces' is mandatory.
outputName1
{
extractionMethod none;
surfaces (surface1.stl surface2.nas);
// Generate additional intersection features (none | self | region)
intersectionMethod self;
// Tolerance for surface intersections
// tolerance 1e-3;
// Output options:
// Write features to OBJ format for postprocessing
writeObj yes;
}
surface2.nas
{
// How to obtain raw features (extractFromFile || extractFromSurface)
// Extract raw features (none | extractFromFile | extractFromSurface)
extractionMethod extractFromFile;
extractFromFileCoeffs
{
// Load from an existing feature edge file
featureEdgeFile "constant/triSurface/featureEdges.nas";
}
// Load from an existing feature edge file
featureEdgeFile "constant/triSurface/featureEdges.nas";
trimFeatures
{
@ -60,57 +82,57 @@ surface2.nas
subsetFeatures
{
// Use a plane to select feature edges
// (normal)(basePoint)
// Keep only edges that intersect the plane will be included
plane (1 0 0)(0 0 0);
// Use a plane to select feature edges (normal)(basePoint)
// Only keep edges that intersect the plane
plane (1 0 0)(0 0 0);
// Select feature edges using a box
// (minPt)(maxPt)
// Keep edges inside the box:
insideBox (0 0 0)(1 1 1);
// Keep edges outside the box:
outsideBox (0 0 0)(1 1 1);
// Select feature edges using a box // (minPt)(maxPt)
// Only keep edges inside the box:
insideBox (0 0 0)(1 1 1);
// Only keep edges outside the box:
outsideBox (0 0 0)(1 1 1);
// Keep nonManifold edges (edges with >2 connected faces where
// the faces form more than two different normal planes)
nonManifoldEdges yes;
nonManifoldEdges yes;
// Keep open edges (edges with 1 connected face)
openEdges yes;
openEdges yes;
}
addFeatures
{
// Add (without merging) another extendedFeatureEdgeMesh
name axZ.extendedFeatureEdgeMesh;
// Optionally flip features (invert all normals, making
// convex<->concave etc)
//flip false;
name axZ.extendedFeatureEdgeMesh;
}
// Output the curvature of the surface
curvature no;
// Output the proximity of feature points and edges to each other
featureProximity no;
// Generate additional intersection features (none | self | region)
intersectionMethod none;
// The maximum search distance to use when looking for other feature
// points and edges
maxFeatureProximity 1;
// Tolerance for surface intersections
// tolerance 1e-3;
// Out put the closeness of surface elements to other surface elements.
closeness no;
// Output options:
// Write options
// Output the closeness of surface elements to other surface elements.
closeness no;
// Write features to obj format for postprocessing
writeObj yes;
// Output surface curvature
curvature no;
// Write surface proximity and curvature fields to vtk format
// for postprocessing
writeVTK no;
// Output the proximity of feature points and edges to another
featureProximity no;
// The maximum search distance when checking feature proximity
maxFeatureProximity 1;
// Write features to OBJ format for postprocessing
writeObj no;
// Write closeness/curvature/proximity fields as VTK for postprocessing
writeVTK no;
}

View File

@ -129,8 +129,7 @@ void dumpFaces
const Map<label>& connectedFaces
)
{
Info<< "Dumping connectedFaces as Lightwave .obj file to " << fName
<< "\nThis can be visualized with e.g. javaview (www.javaview.de)\n\n";
Info<< "Dumping connectedFaces as .obj file to " << fName << nl;
OFstream os(fName);