boundaryLayersWrapperLayer.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 
28 #include "boundaryLayers.H"
29 #include "meshSurfaceEngine.H"
30 #include "demandDrivenData.H"
31 
32 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36 
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 
40 {
42 
43  if( treatedPatch_[0] ) return;
44 
45  const meshSurfaceEngine& mse = surfaceEngine();
46 
47  const labelList& bPoints = mse.boundaryPoints();
48 
49  boolList treatPatches(mesh_.boundaries().size(), true);
50 
51  labelLongList newLabelForVertex(nPoints_, -1);
52 
54  points.setSize(points.size() + bPoints.size());
55  forAll(bPoints, bpI)
56  {
57  points[nPoints_] = points[bPoints[bpI]];
58  newLabelForVertex[bPoints[bpI]] = nPoints_++;
59  }
60 
61  createNewFacesAndCells(treatPatches);
62 
63  forAll(treatPatches, patchI)
64  if( treatPatches[patchI] )
65  treatedPatch_[patchI] = true;
66 
67  //- delete surface engine
68  clearOut();
69 }
70 
71 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
72 
73 } // End namespace Foam
74 
75 // ************************************************************************* //
Foam::boundaryLayers::surfaceEngine
const meshSurfaceEngine & surfaceEngine() const
Return const reference to meshSurfaceEngine.
Definition: boundaryLayers.C:54
Foam::boundaryLayers::nPoints_
label nPoints_
number of vertices in the mesh
Definition: boundaryLayers.H:105
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:406
Foam::boundaryLayers::mesh_
polyMeshGen & mesh_
Reference to the mesh.
Definition: boundaryLayers.H:63
demandDrivenData.H
Template functions to aid in the implementation of demand driven data.
Foam::polyMeshGenPoints::points
const pointFieldPMG & points() const
access to points
Definition: polyMeshGenPointsI.H:44
Foam::boundaryLayers::addWrapperLayer
void addWrapperLayer()
Definition: boundaryLayersWrapperLayer.C:39
Foam::LongList< label >
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
meshSurfaceEngine.H
Foam::boundaryLayers::clearOut
void clearOut()
delete meshSurfaceEngine
Definition: boundaryLayers.H:225
Foam::boundaryLayers::createOTopologyLayers
void createOTopologyLayers()
create O-topology layers (used as flag)
Definition: boundaryLayers.C:594
Foam::boundaryLayers::treatedPatch_
boolList treatedPatch_
Definition: boundaryLayers.H:89
Foam::polyMeshGenFaces::boundaries
const PtrList< boundaryPatch > & boundaries() const
ordinary boundaries
Definition: polyMeshGenFacesI.H:111
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::meshSurfaceEngine::boundaryPoints
const labelList & boundaryPoints() const
Definition: meshSurfaceEngineI.H:84
Foam::List::size
void size(const label)
Override size to be inconsistent with allocated storage.
Foam::boundaryLayers::createNewFacesAndCells
void createNewFacesAndCells(const boolList &treatPatches)
create a layer of cells
Definition: boundaryLayersFacesAndCells.C:45
Foam::pointFieldPMG
Definition: pointFieldPMG.H:50
boundaryLayers.H
Foam::meshSurfaceEngine
Definition: meshSurfaceEngine.H:54