meshOctreeCreatorLoadDistribution.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 "meshOctreeCreator.H"
29 #include "triSurf.H"
30 #include "IOdictionary.H"
31 
32 //#define DEBUGBalancing
33 
34 # ifdef DEBUGBalancing
35 #include <sstream>
36 # endif
37 
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 
40 namespace Foam
41 {
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 // Private member functions
45 
46 void meshOctreeCreator::loadDistribution(const bool distributeUsed)
47 {
48  if( octree_.neiProcs().size() == 0 || !meshDictPtr_ )
49  return;
50 
51  direction usedType(0);
52  if( distributeUsed )
53  {
54  usedType |= meshOctreeCubeBasic::INSIDE;
55  if( meshDictPtr_->found("keepCellsIntersectingBoundary") )
56  usedType |= meshOctreeCubeBasic::DATA;
57  }
58 
60 }
61 
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 
64 } // End namespace Foam
65 
66 // ************************************************************************* //
triSurf.H
Foam::meshOctree::neiProcs
const labelList & neiProcs() const
neighbour processors of the current one
Definition: meshOctreeI.H:152
Foam::meshOctreeModifier
Definition: meshOctreeModifier.H:48
Foam::meshOctreeCreator::octree_
meshOctree & octree_
Reference to meshOctree.
Definition: meshOctreeCreator.H:63
Foam::dictionary::found
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
Definition: dictionary.C:304
Foam::meshOctreeModifier::loadDistribution
void loadDistribution(const direction usedType=0)
move octree cubes from one processor to another
Definition: meshOctreeModifierLoadDistribution.C:51
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::meshOctreeCreator::loadDistribution
void loadDistribution(const bool distributeUsed=false)
Definition: meshOctreeCreatorLoadDistribution.C:46
Foam::meshOctreeCubeBasic::INSIDE
@ INSIDE
Definition: meshOctreeCubeBasic.H:91
IOdictionary.H
Foam::meshOctreeCreator::meshDictPtr_
const IOdictionary * meshDictPtr_
Dictionary containing information necessary to perform refinement.
Definition: meshOctreeCreator.H:69
Foam::direction
unsigned char direction
Definition: direction.H:43
meshOctreeCreator.H
Foam::List::size
void size(const label)
Override size to be inconsistent with allocated storage.
Foam::meshOctreeCubeBasic::DATA
@ DATA
Definition: meshOctreeCubeBasic.H:90