removeSurfaceFacets.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | cfMesh: A library for mesh generation
4  \\ / O peration |
5  \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6  \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
8 License
9  This file is part of cfMesh.
10 
11  cfMesh is free software; you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by the
13  Free Software Foundation; either version 3 of the License, or (at your
14  option) any later version.
15 
16  cfMesh is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with cfMesh. If not, see <http://www.gnu.org/licenses/>.
23 
24 Description
25  Reads the surface mesh, remove the selected facets
26  and writes the modified mesh into a new file
27 
28 \*---------------------------------------------------------------------------*/
29 
30 #include "argList.H"
31 #include "triSurf.H"
32 #include "triSurfaceRemoveFacets.H"
33 
34 using namespace Foam;
35 
36 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
37 
38 int main(int argc, char *argv[])
39 {
41  argList::validArgs.clear();
42 
43  argList::validArgs.append("input surface file");
44  argList::validArgs.append("output surface file");
45  argList::validArgs.append("Subset/patch name");
46 
47  argList args(argc, argv);
48 
49  fileName inFileName(args.args()[1]);
50  fileName outFileName(args.args()[2]);
51  word patchName(args.args()[3]);
52 
53  //- read the input surface
54  triSurf origSurf(inFileName);
55 
56  //- remove the selected facets
57  triSurfaceRemoveFacets rsf(origSurf);
58 
59  rsf.selectFacetsInPatch(patchName);
60 
61  rsf.removeFacets();
62 
63  //- write the modified surface mesh
64  origSurf.writeSurface(outFileName);
65 
66  Info << "End\n" << endl;
67 
68  return 0;
69 }
70 
71 // ************************************************************************* //
Foam::argList::validArgs
static SLList< string > validArgs
A list of valid (mandatory) arguments.
Definition: argList.H:143
triSurf.H
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::argList::args
const stringList & args() const
Return arguments.
Definition: argListI.H:66
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
main
int main(int argc, char *argv[])
Definition: removeSurfaceFacets.C:38
Foam::argList
Extract command arguments and options from the supplied argc and argv parameters.
Definition: argList.H:97
Foam::triSurfaceRemoveFacets
Definition: triSurfaceRemoveFacets.H:50
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::Info
messageStream Info
argList.H
Foam::triSurfaceRemoveFacets::selectFacetsInPatch
void selectFacetsInPatch(const word &)
add patch for removal
Definition: triSurfaceRemoveFacets.C:48
Foam::triSurfaceRemoveFacets::removeFacets
void removeFacets()
perform removal of selected facets
Definition: triSurfaceRemoveFacetsFunctions.C:80
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
triSurfaceRemoveFacets.H
Foam::triSurf::writeSurface
void writeSurface(const fileName &) const
Definition: triSurf.C:430
Foam::argList::noParallel
static void noParallel()
Remove the parallel options.
Definition: argList.C:161
args
Foam::argList args(argc, argv)
Foam::triSurf
Definition: triSurf.H:59