triSurfaceDetectFeatureEdges.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 
26 \*---------------------------------------------------------------------------*/
27 
29 #include "helperFunctions.H"
30 #include "demandDrivenData.H"
31 #include "triSurfModifier.H"
32 
33 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 
35 namespace Foam
36 {
37 
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 
41 (
43  const scalar angleDeviation
44 )
45 :
46  surf_(surface),
47  featureEdges_(surf_.edges().size(), direction(0)),
48  angleTolerance_(angleDeviation)
49 {
50  if( Pstream::parRun() )
51  FatalError << "Feature edges detection does not run in parallel"
52  << exit(FatalError);
53 
54  detectFeatureEdgesAngleCriterion();
55 }
56 
58 {}
59 
60 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
61 
63 {
64  const edgeLongList& edges = surf_.edges();
65  triSurfModifier surfMod(surf_);
66  edgeLongList& featureEdges = surfMod.featureEdgesAccess();
67  featureEdges.clear();
68 
70  {
71  if( featureEdges_[eI] )
72  featureEdges.append(edges[eI]);
73  }
74 }
75 
76 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
77 
78 } // End namespace Foam
79 
80 // ************************************************************************* //
Foam::LongList::append
void append(const T &e)
Append an element at the end of the list.
Definition: LongListI.H:265
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:406
Foam::triSurfaceDetectFeatureEdges::detectFeatureEdges
void detectFeatureEdges()
store regions in a graph
Definition: triSurfaceDetectFeatureEdges.C:62
demandDrivenData.H
Template functions to aid in the implementation of demand driven data.
Foam::LongList::clear
void clear()
Clear the list, i.e. set next free to zero.
Definition: LongListI.H:230
Foam::UPstream::parRun
static bool & parRun()
Is this a parallel run?
Definition: UPstream.H:377
triSurfaceDetectFeatureEdges.H
triSurfModifier.H
Foam::triSurfModifier
Definition: triSurfModifier.H:48
Foam::triSurfaceDetectFeatureEdges::featureEdges_
List< direction > featureEdges_
detected feature edges
Definition: triSurfaceDetectFeatureEdges.H:57
Foam::LongList< edge >
Foam::FatalError
error FatalError
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::triSurfaceDetectFeatureEdges::triSurfaceDetectFeatureEdges
triSurfaceDetectFeatureEdges(const triSurfaceDetectFeatureEdges &)
Disallow default bitwise copy construct.
Foam::triSurfModifier::featureEdgesAccess
edgeLongList & featureEdgesAccess()
non-const access to feature edges
Definition: triSurfModifierI.H:47
helperFunctions.H
Foam::surface
Definition: surface.H:55
Foam::triSurfAddressing::edges
const LongList< edge > & edges() const
return edges
Definition: triSurfAddressingI.H:61
Foam::direction
unsigned char direction
Definition: direction.H:43
Foam::triSurfaceDetectFeatureEdges::surf_
triSurf & surf_
reference to triSurf
Definition: triSurfaceDetectFeatureEdges.H:54
Foam::triSurf
Definition: triSurf.H:59
Foam::triSurfaceDetectFeatureEdges::~triSurfaceDetectFeatureEdges
~triSurfaceDetectFeatureEdges()
Definition: triSurfaceDetectFeatureEdges.C:57