meshSurfaceMapper.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 "meshSurfaceMapper.H"
29 #include "meshSurfaceEngine.H"
30 #include "meshSurfacePartitioner.H"
31 #include "triSurf.H"
32 #include "triSurfacePartitioner.H"
33 #include "demandDrivenData.H"
34 #include "meshOctree.H"
35 
36 // #define DEBUGSearch
37 
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 
40 namespace Foam
41 {
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
46 {
48 }
49 
51 {
53 }
54 
56 {
57  if( deletePartitioner_ )
60 }
61 
62 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
63 
65 (
66  const meshSurfaceEngine& mse,
67  const meshOctree& octree
68 )
69 :
70  surfaceEngine_(mse),
71  meshOctree_(octree),
72  surfaceEnginePartitionerPtr_(NULL),
73  deletePartitioner_(true),
74  surfPartitionerPtr_(NULL)
75 {
76  if( Pstream::parRun() )
77  {
78  //- allocate bpAtProcs and other addressing
79  //- this is done here to prevent possible deadlocks
80  surfaceEngine_.bpAtProcs();
81  }
82 }
83 
85 (
86  const meshSurfacePartitioner& mPart,
87  const meshOctree& octree
88 )
89 :
90  surfaceEngine_(mPart.surfaceEngine()),
91  meshOctree_(octree),
92  surfaceEnginePartitionerPtr_(&mPart),
93  deletePartitioner_(false),
94  surfPartitionerPtr_(NULL)
95 {
96  if( Pstream::parRun() )
97  {
98  //- allocate bpAtProcs and other addressing
99  //- this is done here to prevent possible deadlocks
100  surfaceEngine_.bpAtProcs();
101  }
102 }
103 
104 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
105 
107 {
108  clearOut();
109 }
110 
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112 
113 } // End namespace Foam
114 
115 // ************************************************************************* //
Foam::triSurfacePartitioner
Definition: triSurfacePartitioner.H:53
Foam::meshSurfaceMapper::surfaceEngine_
const meshSurfaceEngine & surfaceEngine_
mesh surface
Definition: meshSurfaceMapper.H:63
triSurf.H
meshSurfaceMapper.H
triSurfacePartitioner.H
Foam::meshSurfaceMapper::meshSurfaceMapper
meshSurfaceMapper(const meshSurfaceMapper &)
Disallow default bitwise copy construct.
demandDrivenData.H
Template functions to aid in the implementation of demand driven data.
Foam::UPstream::parRun
static bool & parRun()
Is this a parallel run?
Definition: UPstream.H:377
Foam::meshSurfacePartitioner::surfaceEngine
const meshSurfaceEngine & surfaceEngine() const
return const reference to meshSurfaceEngine
Definition: meshSurfacePartitioner.H:109
meshOctree.H
Foam::deleteDemandDrivenData
void deleteDemandDrivenData(DataPtr &dataPtr)
Definition: demandDrivenData.H:40
Foam::meshSurfaceMapper::deletePartitioner_
const bool deletePartitioner_
Definition: meshSurfaceMapper.H:70
Foam::meshSurfaceMapper::createTriSurfacePartitioner
void createTriSurfacePartitioner() const
create and return triSurfacePartitioner
Definition: meshSurfaceMapper.C:50
Foam::meshSurfaceMapper::surfaceEnginePartitionerPtr_
const meshSurfacePartitioner * surfaceEnginePartitionerPtr_
mesh surface partitioner
Definition: meshSurfaceMapper.H:69
Foam::meshSurfaceMapper::clearOut
void clearOut()
delete surfaceEnginePartitionerPtr_ and surfPartitionerPtr_
Definition: meshSurfaceMapper.C:55
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
meshSurfaceEngine.H
Foam::meshSurfacePartitioner
Definition: meshSurfacePartitioner.H:52
Foam::meshSurfaceMapper::createMeshSurfacePartitioner
void createMeshSurfacePartitioner() const
create and return mesh surface partitioner
Definition: meshSurfaceMapper.C:45
Foam::meshOctree
Definition: meshOctree.H:55
Foam::meshOctree::surface
const triSurf & surface() const
return a reference to the surface
Definition: meshOctreeI.H:130
Foam::meshSurfaceMapper::surfPartitionerPtr_
triSurfacePartitioner * surfPartitionerPtr_
triSurface partitioner
Definition: meshSurfaceMapper.H:73
Foam::meshSurfaceMapper::meshOctree_
const meshOctree & meshOctree_
reference to the octree
Definition: meshSurfaceMapper.H:66
Foam::meshSurfaceEngine
Definition: meshSurfaceEngine.H:54
Foam::meshSurfaceMapper::~meshSurfaceMapper
~meshSurfaceMapper()
Definition: meshSurfaceMapper.C:106
meshSurfacePartitioner.H