MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / main

Function main

applications/utilities/surface/surfaceOrient/surfaceOrient.C:42–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40
41
42int main(int argc, char *argv[])
43{
44 argList::addNote
45 (
46 "set face normals consistent with a user-provided 'outside' point"
47 );
48
49 argList::noParallel();
50 argList::validArgs.append("surface file");
51 argList::validArgs.append("output surface file");
52 argList::validArgs.append("visiblePoint");
53 argList::addBoolOption
54 (
55 "inside",
56 "treat provided point as being inside"
57 );
58 argList::addBoolOption
59 (
60 "usePierceTest",
61 "determine orientation by counting number of intersections"
62 );
63
64 argList args(argc, argv);
65
66 const fileName surfFileName = args[1];
67 const fileName outFileName = args[2];
68 const point visiblePoint = args.argRead<point>(3);
69
70 const bool orientInside = args.optionFound("inside");
71 const bool usePierceTest = args.optionFound("usePierceTest");
72
73 Info<< "Reading surface from " << surfFileName << nl
74 << "Orienting surface such that visiblePoint " << visiblePoint
75 << " is ";
76
77 if (orientInside)
78 {
79 Info<< "inside" << endl;
80 }
81 else
82 {
83 Info<< "outside" << endl;
84 }
85
86
87
88 // Load surface
89 triSurface surf(surfFileName);
90
91
92 bool anyFlipped = false;
93
94 if (usePierceTest)
95 {
96 triSurfaceSearch surfSearches(surf);
97
98 anyFlipped = orientedSurface::orient
99 (

Callers

nothing calls this directly

Calls 7

addNoteFunction · 0.85
noParallelFunction · 0.85
addBoolOptionFunction · 0.85
optionFoundMethod · 0.80
orientFunction · 0.50
appendMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected