triangulateNonPlanarBaseFaces.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 "dictionary.H"
30 #include "demandDrivenData.H"
31 
32 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36 
37 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
38 
40 (
42 )
43 :
44  mesh_(mesh),
45  invertedCell_(mesh_.cells().size(), false),
46  decomposeFace_(mesh_.faces().size(), false),
47  tol_(0.5)
48 {}
49 
50 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
51 
53 {}
54 
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 
58 {
59  tol_ = tol;
60 }
61 
63 {
65  {
66  Info << "Decomposing twisted boundary faces" << endl;
67 
69 
71  }
72  else
73  {
74  Info << "All boundary faces are flat" << endl;
75  }
76 }
77 
79 (
80  const dictionary& meshDict,
81  triangulateNonPlanarBaseFaces& triangulator
82 )
83 {
84  if( meshDict.found("boundaryLayers") )
85  {
86  const dictionary& layersDict = meshDict.subDict("boundaryLayers");
87 
88  if( layersDict.found("optimisationParameters") )
89  {
90  const dictionary& optLayerDict =
91  layersDict.subDict("optimisationParameters");
92 
93  if( optLayerDict.found("relFlatnessTol") )
94  {
95  const scalar relTol =
96  readScalar(optLayerDict.lookup("relFlatnessTol"));
97 
98  triangulator.setRelativeTolerance(relTol);
99  }
100  }
101  }
102 }
103 
104 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
105 
106 } // End namespace Foam
107 
108 // ************************************************************************* //
Foam::triangulateNonPlanarBaseFaces
Definition: triangulateNonPlanarBaseFaces.H:52
Foam::triangulateNonPlanarBaseFaces::~triangulateNonPlanarBaseFaces
~triangulateNonPlanarBaseFaces()
Definition: triangulateNonPlanarBaseFaces.C:52
demandDrivenData.H
Template functions to aid in the implementation of demand driven data.
Foam::dictionary::lookup
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Definition: dictionary.C:449
Foam::polyMeshGen
Definition: polyMeshGen.H:46
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::triangulateNonPlanarBaseFaces::triangulateNonPlanarBaseFaces
triangulateNonPlanarBaseFaces(const triangulateNonPlanarBaseFaces &)
Disallow bitwise copy construct.
Foam::triangulateNonPlanarBaseFaces::readSettings
static void readSettings(const dictionary &, triangulateNonPlanarBaseFaces &)
Definition: triangulateNonPlanarBaseFaces.C:79
Foam::triangulateNonPlanarBaseFaces::setRelativeTolerance
void setRelativeTolerance(const scalar tol)
Definition: triangulateNonPlanarBaseFaces.C:57
Foam::triangulateNonPlanarBaseFaces::tol_
scalar tol_
relative deviation compared to the layer thickness
Definition: triangulateNonPlanarBaseFaces.H:65
Foam::dictionary::found
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
Definition: dictionary.C:304
Foam::Info
messageStream Info
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::triangulateNonPlanarBaseFaces::decomposeCellsIntoPyramids
void decomposeCellsIntoPyramids()
decompose adjacent cells into pyramids
Definition: triangulateNonPlanarBaseFacesFunctions.C:123
Foam::readScalar
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
Definition: doubleScalar.H:63
Foam::triangulateNonPlanarBaseFaces::findNonPlanarBoundaryFaces
bool findNonPlanarBoundaryFaces()
Definition: triangulateNonPlanarBaseFacesFunctions.C:48
triangulateNonPlanarBaseFaces.H
dictionary.H
Foam::triangulateNonPlanarBaseFaces::decomposeBoundaryFaces
void decomposeBoundaryFaces()
decompose existing faces
Definition: triangulateNonPlanarBaseFacesFunctions.C:112
Foam::dictionary::subDict
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
Definition: dictionary.C:631
Foam::triangulateNonPlanarBaseFaces::triangulateLayers
void triangulateLayers()
splits inverted boundary layer prisms into triangular prisms
Definition: triangulateNonPlanarBaseFaces.C:62