extrudeEdgesInto2DSurface.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"
33 #include "demandDrivenData.H"
34 
35 using namespace Foam;
36 
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 
39 int main(int argc, char *argv[])
40 {
42  argList::validArgs.clear();
43 
44  argList::validArgs.append("input surface file");
45  argList::validArgs.append("output surface file");
46 
47  argList args(argc, argv);
48 
49  fileName inFileName(args.args()[1]);
50  fileName outFileName(args.args()[2]);
51 
52  //- read the input surface
53  triSurf origSurf(inFileName);
54 
55  //- remove the selected facets
56  triSurfaceExtrude2DEdges extruder(origSurf);
57 
58  const triSurf* newSurfacePtr = extruder.extrudeSurface();
59 
60  if( !newSurfacePtr )
61  FatalError << "Extruding of the edge mesh failed!" << exit(FatalError);
62 
63  //- write the modified surface mesh
64  newSurfacePtr->writeSurface(outFileName);
65 
66  deleteDemandDrivenData(newSurfacePtr);
67 
68  Info << "End\n" << endl;
69 
70  return 0;
71 }
72 
73 // ************************************************************************* //
Foam::argList::validArgs
static SLList< string > validArgs
A list of valid (mandatory) arguments.
Definition: argList.H:143
triSurf.H
triSurfaceExtrude2DEdges.H
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
demandDrivenData.H
Template functions to aid in the implementation of demand driven data.
Foam::argList
Extract command arguments and options from the supplied argc and argv parameters.
Definition: argList.H:97
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::deleteDemandDrivenData
void deleteDemandDrivenData(DataPtr &dataPtr)
Definition: demandDrivenData.H:40
main
int main(int argc, char *argv[])
Definition: extrudeEdgesInto2DSurface.C:39
Foam::Info
messageStream Info
argList.H
Foam::FatalError
error FatalError
Foam::triSurfaceExtrude2DEdges::extrudeSurface
void extrudeSurface(triSurf &) const
extrudes edges into a triangulation
Definition: triSurfaceExtrude2DEdges.C:49
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
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
Foam::triSurfaceExtrude2DEdges
Definition: triSurfaceExtrude2DEdges.H:49