boundaryLayerOptimisationFunctions.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 "demandDrivenData.H"
30 #include "meshSurfacePartitioner.H"
31 #include "meshSurfaceEngine.H"
32 #include "detectBoundaryLayers.H"
33 //#include "helperFunctions.H"
34 //#include "labelledScalar.H"
35 //#include "refLabelledPoint.H"
36 //#include "refLabelledPointScalar.H"
37 #include "polyMeshGenAddressing.H"
38 #include "meshSurfaceOptimizer.H"
40 //#include "partTetMeshSimplex.H"
41 //#include "volumeOptimizer.H"
42 #include "OFstream.H"
43 
44 //#define DEBUGLayer
45 
46 # ifdef USE_OMP
47 #include <omp.h>
48 # endif
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 
58 (
59  const fileName& fName,
60  const pointField& origin,
61  const vectorField& vecs
62 )
63 {
64  if( origin.size() != vecs.size() )
66  (
67  "void boundaryLayerOptimisation::writeVTK(const fileName&,"
68  " const pointField&, const vectorField&)"
69  ) << "Sizes do not match" << abort(FatalError);
70 
71  OFstream file(fName);
72 
73  //- write the header
74  file << "# vtk DataFile Version 3.0\n";
75  file << "vtk output\n";
76  file << "ASCII\n";
77  file << "DATASET POLYDATA\n";
78 
79  //- write points
80  file << "POINTS " << 2*origin.size() << " float\n";
81  forAll(origin, pI)
82  {
83  const point& p = origin[pI];
84 
85  file << p.x() << ' ' << p.y() << ' ' << p.z() << nl;
86 
87  const point op = p + vecs[pI];
88 
89  file << op.x() << ' ' << op.y() << ' ' << op.z() << nl;
90  }
91 
92  //- write lines
93  file << "\nLINES " << vecs.size()
94  << " " << 3*vecs.size() << nl;
95  forAll(vecs, eI)
96  {
97  file << 2 << " " << 2*eI << " " << (2*eI+1) << nl;
98  }
99 
100  file << "\n";
101 }
102 
104 (
105  const fileName& fName,
106  const direction eType,
107  const vectorField& vecs
108 ) const
109 {
110  if( vecs.size() != hairEdges_.size() )
112  (
113  "void boundaryLayerOptimisation::writeHairEdges"
114  "(const fileName&, const direction, const vectorField&) const"
115  ) << "Sizes do not match" << abort(FatalError);
116 
117  //- count the number of hair edges matching this criteria
118  label counter(0);
119 
120  forAll(hairEdgeType_, heI)
121  if( hairEdgeType_[heI] & eType )
122  ++counter;
123 
124  //- copy edge vector
125  vectorField copyVecs(counter);
126  pointField pts(counter);
127 
128  counter = 0;
129 
130  const pointFieldPMG& points = mesh_.points();
131 
132  forAll(hairEdgeType_, heI)
133  {
134  if( hairEdgeType_[heI] & eType )
135  {
136  const edge& he = hairEdges_[heI];
137 
138  pts[counter] = points[he.start()];
139  copyVecs[counter] = vecs[heI] * he.mag(points);
140 
141  ++counter;
142  }
143  }
144 
145  //- write data to file
146  writeVTK(fName, pts, copyVecs);
147 }
148 
150 (
151  const fileName& fName,
152  const direction eType
153 ) const
154 {
155  //- count the number of hair edges matching this criteria
156  label counter(0);
157 
158  forAll(hairEdgeType_, heI)
159  if( hairEdgeType_[heI] & eType )
160  ++counter;
161 
162  //- copy edge vector
163  vectorField vecs(counter);
164  pointField pts(counter);
165 
166  counter = 0;
167 
168  const pointFieldPMG& points = mesh_.points();
169 
170  forAll(hairEdgeType_, heI)
171  {
172  if( hairEdgeType_[heI] & eType )
173  {
174  const edge& he = hairEdges_[heI];
175 
176  pts[counter] = points[he.start()];
177  vecs[counter] = he.vec(points);
178 
179  ++counter;
180  }
181  }
182 
183  //- write data to file
184  writeVTK(fName,pts, vecs);
185 }
186 
188 {
189  if( !meshSurfacePtr_ )
190  {
191  # ifdef USE_OMP
192  if( omp_in_parallel() )
194  (
195  "const meshSurfaceEngine&"
196  " boundaryLayerOptimisation::meshSurface()"
197  ) << "Cannot generate meshSurfaceEngine" << abort(FatalError);
198  # endif
199 
201  }
202 
203  return *meshSurfacePtr_;
204 }
205 
208 {
209  if( !partitionerPtr_ )
210  {
211  # ifdef USE_OMP
212  if( omp_in_parallel() )
214  (
215  "const meshSurfacePartitioner& "
216  "boundaryLayerOptimisation::surfacePartitioner()"
217  ) << "Cannot generate meshSurfacePartitioner" << abort(FatalError);
218  # endif
219 
221  }
222 
223  return *partitionerPtr_;
224 }
225 
227 {
228  const meshSurfaceEngine& mse = meshSurface();
229  const edgeList& edges = mse.edges();
230  const VRWGraph& edgeFaces = mse.edgeFaces();
231  const VRWGraph& bpEdges = mse.boundaryPointEdges();
232  const labelList& faceOwner = mse.faceOwners();
233  const faceList::subList& bFaces = mse.boundaryFaces();
234  const labelList& bp = mse.bp();
235 
237 
238  //- detect layers in the mesh
239  const detectBoundaryLayers detectLayers(mPart);
240 
241  hairEdges_ = detectLayers.hairEdges();
242  hairEdgesAtBndPoint_ = detectLayers.hairEdgesAtBndPoint();
243 
244  //- mark boundary faces which are base face for the boundary layer
245  const labelList& layerAtBndFace = detectLayers.faceInLayer();
246  isBndLayerBase_.setSize(bFaces.size());
247  # ifdef USE_OMP
248  # pragma omp parallel for schedule(dynamic, 100)
249  # endif
250  forAll(layerAtBndFace, bfI)
251  {
252  if( layerAtBndFace[bfI] < 0 )
253  {
254  isBndLayerBase_[bfI] = false;
255  }
256  else
257  {
258  isBndLayerBase_[bfI] = true;
259  }
260  }
261 
262  # ifdef DEBUGLayer
263  const label bndLayerFaceId = mesh_.addFaceSubset("bndLayerFaces");
264  const label startBndFaceI = mesh_.boundaries()[0].patchStart();
265  forAll(isBndLayerBase_, bfI)
266  if( isBndLayerBase_[bfI] )
267  mesh_.addFaceToSubset(bndLayerFaceId, startBndFaceI+bfI);
268  # endif
269 
270  //- check if a face is an exiting face for a bnd layer
272  isExitFace_ = false;
273 
274  # ifdef USE_OMP
275  # pragma omp parallel for schedule(dynamic, 100)
276  # endif
277  forAll(edgeFaces, edgeI)
278  {
279  //- avoid edges at inter-processor boundaries
280  if( edgeFaces.sizeOfRow(edgeI) != 2 )
281  continue;
282 
283  const label f0 = edgeFaces(edgeI, 0);
284  const label f1 = edgeFaces(edgeI, 1);
285 
286  //- both faces have to be part of the same cell
287  if( faceOwner[f0] != faceOwner[f1] )
288  continue;
289 
290  //- check if the feature edge is attachd to exittin faces
291  if
292  (
293  (isBndLayerBase_[f0] && (bFaces[f1].size() == 4)) &&
294  (isBndLayerBase_[f1] && (bFaces[f0].size() == 4))
295  )
296  {
297  isExitFace_[f0] = true;
298  isExitFace_[f1] = true;
299  }
300  }
301 
302  # ifdef DEBUGLayer
303  const label exittingFaceId = mesh_.addFaceSubset("exittingFaces");
304  forAll(isExitFace_, bfI)
305  if( isExitFace_[bfI] )
306  mesh_.addFaceToSubset(exittingFaceId, startBndFaceI+bfI);
307  # endif
308 
309  //- classify hair edges as they require different tretment
310  //- in the smoothing procedure
312 
313  const labelHashSet& corners = mPart.corners();
314  const labelHashSet& edgePoints = mPart.edgePoints();
315  const labelHashSet& featureEdges = mPart.featureEdges();
316 
317  # ifdef USE_OMP
318  # pragma omp parallel for schedule(dynamic, 100)
319  # endif
320  forAll(hairEdges_, hairEdgeI)
321  {
322  hairEdgeType_[hairEdgeI] = NONE;
323 
324  const edge& e = hairEdges_[hairEdgeI];
325  const label bpI = bp[e.start()];
326 
327  //- check if it is a boundary edge
328  forAllRow(bpEdges, bpI, peI)
329  {
330  const label beI = bpEdges(bpI, peI);
331 
332  const edge& be = edges[bpEdges(bpI, peI)];
333 
334  if( be == e )
335  {
336  hairEdgeType_[hairEdgeI] |= BOUNDARY;
337 
338  if( featureEdges.found(beI) )
339  hairEdgeType_[hairEdgeI] |= FEATUREEDGE;
340  }
341 
342  if( corners.found(bpI) )
343  {
344  hairEdgeType_[hairEdgeI] |= ATCORNER;
345  }
346  else if( edgePoints.found(bpI) )
347  {
348  hairEdgeType_[hairEdgeI] |= ATEDGE;
349  }
350  }
351 
352  if( !(hairEdgeType_[hairEdgeI] & BOUNDARY) )
353  hairEdgeType_[hairEdgeI] |= INSIDE;
354  }
355 
357 
358  //- calculate which other hair edges influence a hair edges
359  //- and store it in a graph
361 
362  const cellListPMG& cells = mesh_.cells();
363  const faceList& faces = mesh_.faces();
364 
365  VRWGraph bpFacesHelper(bpEdges.size());
366  forAll(faceOwner, bfI)
367  {
368  const label cellI = faceOwner[bfI];
369 
370  const cell& c = cells[cellI];
371 
372  forAll(c, fI)
373  {
374  const face& f = faces[c[fI]];
375 
376  forAll(f, pI)
377  {
378  const label bpI = bp[f[pI]];
379  if( bpI < 0 )
380  continue;
381 
382  bpFacesHelper.appendIfNotIn(bpI, c[fI]);
383  }
384  }
385  }
386 
387  forAll(hairEdges_, hairEdgeI)
388  {
389  const edge& e = hairEdges_[hairEdgeI];
390  const label bpI = bp[e.start()];
391 
392  DynList<label> neiHairEdges;
393 
394  //- find mesh faces comprising of the current hair edge
395  forAllRow(bpFacesHelper, bpI, pfI)
396  {
397  const face& f = faces[bpFacesHelper(bpI, pfI)];
398 
399  //- face must be a quad
400  if( f.size() != 4 )
401  continue;
402 
403  //- check if the current face comprises of the hair edge
404  label faceEdge(-1);
405  forAll(f, eI)
406  if( f.faceEdge(eI) == e )
407  {
408  faceEdge = eI;
409  break;
410  }
411 
412  if( faceEdge != -1 )
413  {
414  //- check if the opposite edge is also a hair edge
415  const label eJ = (faceEdge+2) % 4;
416 
417  const edge fe = f.faceEdge(eJ);
418 
419  for(label i=0;i<2;++i)
420  {
421  const label bpJ = bp[fe[i]];
422 
423  if( bpJ >= 0 )
424  {
426  {
427  const label heJ = hairEdgesAtBndPoint_(bpJ, pI);
428  if( hairEdges_[heJ] == fe )
429  neiHairEdges.append(heJ);
430  }
431  }
432  }
433  }
434  }
435 
436  hairEdgesNearHairEdge_.setRow(hairEdgeI, neiHairEdges);
437  }
438 
439  # ifdef DEBUGLayer
440  const label hairEdgesId = mesh_.addPointSubset("hairEdgePoints");
441  const label bndHairEdgeId = mesh_.addPointSubset("bndHairEdgePoints");
442  const label featureHairEdgeId = mesh_.addPointSubset("featureEdgePoints");
443  const label cornerHairEdgeId = mesh_.addPointSubset("cornerHairEdgePoints");
444  const label hairEdgeAtEdgeId = mesh_.addPointSubset("hairEdgeAtEdgePoints");
445 
446  forAll(hairEdgeType_, heI)
447  {
448  const edge& e = hairEdges_[heI];
449 
450  mesh_.addPointToSubset(hairEdgesId, e.start());
451  mesh_.addPointToSubset(hairEdgesId, e.end());
452  if( hairEdgeType_[heI] & FEATUREEDGE)
453  {
454  mesh_.addPointToSubset(featureHairEdgeId, e.start());
455  mesh_.addPointToSubset(featureHairEdgeId, e.end());
456  }
457 
458  if( hairEdgeType_[heI] & BOUNDARY)
459  {
460  mesh_.addPointToSubset(bndHairEdgeId, e.start());
461  mesh_.addPointToSubset(bndHairEdgeId, e.end());
462  }
463 
464  if( hairEdgeType_[heI] & ATCORNER)
465  {
466  mesh_.addPointToSubset(cornerHairEdgeId, e.start());
467  mesh_.addPointToSubset(cornerHairEdgeId, e.end());
468  }
469 
470  if( hairEdgeType_[heI] & ATEDGE)
471  {
472  mesh_.addPointToSubset(hairEdgeAtEdgeId, e.start());
473  mesh_.addPointToSubset(hairEdgeAtEdgeId, e.end());
474  }
475  }
476 
477  mesh_.write();
478  # endif
479 }
480 
482 {
483  bool modified(false);
484 
485  //- find edge points inside the mesh with more than one hair edge
486  //- attached to it
487  labelList nEdgesAtPoint(mesh_.points().size(), 0);
488 
489  # ifdef USE_OMP
490  # pragma omp parallel for schedule(dynamic, 50)
491  # endif
492  forAll(hairEdges_, heI)
493  {
494  # ifdef USE_OMP
495  # pragma omp atomic
496  # endif
497  ++nEdgesAtPoint[hairEdges_[heI].end()];
498  }
499 
500  //- find the points with more than one hair edge which was modified
501  //- in the previous procedure
502  boolList thinnedPoints(mesh_.points().size(), false);
503 
504  # ifdef USE_OMP
505  # pragma omp parallel for schedule(dynamic, 50)
506  # endif
508  {
509  if
510  (
511  thinnedHairEdge_[heI] &&
512  (nEdgesAtPoint[hairEdges_[heI].end()] > 2)
513  )
514  {
515  modified = true;
516  thinnedPoints[hairEdges_[heI].end()] = true;
517  }
518  }
519 
520  reduce(modified, maxOp<bool>());
521 
522  if( !modified )
523  return false;
524 
525  Info << "Hair edges at exitting faces shall "
526  << "be modified due to inner constraints" << endl;
527 
528  return true;
529 }
530 
531 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
532 
534 {
535  //- create surface smoother
537 
538  //- lock exitting faces and feature edges
539  labelLongList lockedFaces;
540  forAll(isExitFace_, bfI)
541  if( isExitFace_[bfI] )
542  lockedFaces.append(bfI);
543  surfOpt.lockBoundaryFaces(lockedFaces);
544  surfOpt.lockFeatureEdges();
545 
546  label nIter(0);
547  do
548  {
549  thinnedHairEdge_ = false;
550 
551  //- calculate normals at the boundary
553 
554  //- smoothing thickness variation of boundary hairs
556 
557  if( true )
558  {
560  bMod.updateGeometry();
561 
562  surfOpt.optimizeSurface(2);
563  bMod.updateGeometry();
564  }
565 
566  # ifdef DEBUGLayer
567  label counter(0);
569  if( thinnedHairEdge_[heI] )
570  ++counter;
571  reduce(counter, sumOp<label>());
572  Info << "Thinned " << counter << " bnd hair edges" << endl;
573  # endif
574 
575  //- optimise normals inside the mesh
577 
578  //- optimise thickness variation inside the mesh
580 
581  # ifdef DEBUGLayer
582  label intCounter = 0;
584  if( thinnedHairEdge_[heI] )
585  ++intCounter;
586  Info << "Thinned " << (intCounter - counter)
587  << " inner hair edges" << endl;
588  # endif
589  } while( optimiseLayersAtExittingFaces() && (++nIter < maxNumIterations_) );
590 }
591 
592 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
593 
594 } // End namespace Foam
595 
596 // ************************************************************************* //
Foam::meshSurfaceEngine::boundaryPointEdges
const VRWGraph & boundaryPointEdges() const
Definition: meshSurfaceEngineI.H:315
Foam::maxOp
Definition: ops.H:172
Foam::meshSurfaceEngine::bp
const labelList & bp() const
Definition: meshSurfaceEngineI.H:64
Foam::boundaryLayerOptimisation::ATEDGE
@ ATEDGE
Definition: boundaryLayerOptimisation.H:213
Foam::boundaryLayerOptimisation::ATCORNER
@ ATCORNER
Definition: boundaryLayerOptimisation.H:214
Foam::LongList::append
void append(const T &e)
Append an element at the end of the list.
Definition: LongListI.H:265
p
p
Definition: pEqn.H:62
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::boundaryLayerOptimisation::isExitFace_
boolList isExitFace_
is boundary face part of a layer where a layer exits
Definition: boundaryLayerOptimisation.H:88
Foam::boundaryLayerOptimisation::FEATUREEDGE
@ FEATUREEDGE
Definition: boundaryLayerOptimisation.H:217
Foam::VRWGraph::setRow
void setRow(const label rowI, const ListType &l)
Set row with the list.
Definition: VRWGraphI.H:354
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:406
Foam::boundaryLayerOptimisation::optimiseHairNormalsInside
void optimiseHairNormalsInside()
optimise hair normals inside the mesh
Definition: boundaryLayerOptimisationNormals.C:825
demandDrivenData.H
Template functions to aid in the implementation of demand driven data.
Foam::boundaryLayerOptimisation::optimiseHairNormalsAtTheBoundary
void optimiseHairNormalsAtTheBoundary()
Definition: boundaryLayerOptimisationNormals.C:552
Foam::SubList
A List obtained as a section of another List.
Definition: SubList.H:53
Foam::polyMeshGenFaces::addFaceSubset
label addFaceSubset(const word &)
Definition: polyMeshGenFaces.C:262
Foam::edge
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Definition: edge.H:58
Foam::boundaryLayerOptimisation::calculateHairEdges
void calculateHairEdges()
calculate hairEdges
Definition: boundaryLayerOptimisationFunctions.C:226
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::polyMeshGenPoints::points
const pointFieldPMG & points() const
access to points
Definition: polyMeshGenPointsI.H:44
Foam::LongList::size
label size() const
Size of the active part of the list.
Definition: LongListI.H:203
Foam::cellListPMG
Definition: cellListPMG.H:49
Foam::boundaryLayerOptimisation::BOUNDARY
@ BOUNDARY
Definition: boundaryLayerOptimisation.H:215
Foam::HashSet< label, Hash< label > >
Foam::VRWGraph::appendIfNotIn
void appendIfNotIn(const label rowI, const label)
Append an element to the given row if it does not exist there.
Definition: VRWGraphI.H:346
Foam::boundaryLayerOptimisation::thinnedHairEdge_
boolList thinnedHairEdge_
stores information where boundary hairs are made thinner
Definition: boundaryLayerOptimisation.H:94
Foam::polyMeshGenFaces::faces
const faceListPMG & faces() const
access to faces
Definition: polyMeshGenFacesI.H:43
Foam::writeVTK
void writeVTK(OFstream &os, const Type &value)
OFstream.H
Foam::LongList< label >
Foam::boundaryLayerOptimisation::NONE
@ NONE
Definition: boundaryLayerOptimisation.H:212
Foam::boundaryLayerOptimisation::writeVTK
static void writeVTK(const fileName &fName, const pointField &origin, const vectorField &vecs)
write vectors into a VTK file. Helper for debugging
Definition: boundaryLayerOptimisationFunctions.C:58
Foam::boundaryLayerOptimisation::hairEdgesNearHairEdge_
VRWGraph hairEdgesNearHairEdge_
hair edge to other hair edges
Definition: boundaryLayerOptimisation.H:82
Foam::meshSurfaceEngineModifier
Definition: meshSurfaceEngineModifier.H:48
Foam::boundaryLayerOptimisation::hairEdgesAtBndPoint_
VRWGraph hairEdgesAtBndPoint_
hair edges attached to a boundary point
Definition: boundaryLayerOptimisation.H:79
Foam::reduce
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
Definition: PstreamReduceOps.H:43
Foam::meshSurfaceEngine::boundaryFaces
const faceList::subList & boundaryFaces() const
Definition: meshSurfaceEngineI.H:103
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::boundaryLayerOptimisation::meshSurfacePtr_
const meshSurfaceEngine * meshSurfacePtr_
const pointer to meshSurfaceEngine
Definition: boundaryLayerOptimisation.H:69
Foam::nl
static const char nl
Definition: Ostream.H:260
Foam::Info
messageStream Info
Foam::detectBoundaryLayers::hairEdges
const edgeLongList & hairEdges() const
return hair edges found in the detection process
Definition: detectBoundaryLayers.H:116
Foam::polyMeshGenCells::cells
const cellListPMG & cells() const
access to cells
Definition: polyMeshGenCellsI.H:39
boundaryLayerOptimisation.H
Foam::VRWGraph::size
label size() const
Returns the number of rows.
Definition: VRWGraphI.H:122
f1
scalar f1
Definition: createFields.H:28
Foam::VRWGraph::setSize
void setSize(const label)
Reset the number of rows.
Definition: VRWGraphI.H:132
forAllRow
#define forAllRow(graph, rowI, index)
Definition: VRWGraph.H:277
Foam::pointFieldPMG::size
label size() const
return the number of used elements
Definition: pointFieldPMGI.H:71
Foam::boundaryLayerOptimisation::optimiseLayer
void optimiseLayer()
performs boundary layer optimisation
Definition: boundaryLayerOptimisationFunctions.C:533
Foam::VRWGraph::sizeOfRow
label sizeOfRow(const label rowI) const
Returns the number of elements in the given row.
Definition: VRWGraphI.H:127
Foam::Vector::x
const Cmpt & x() const
Definition: VectorI.H:65
Foam::FatalError
error FatalError
Foam::polyMeshGenPoints::addPointToSubset
void addPointToSubset(const label, const label)
Definition: polyMeshGenPointsI.H:60
Foam::detectBoundaryLayers::hairEdgesAtBndPoint
const VRWGraph & hairEdgesAtBndPoint() const
hair edges attached to a boundary point
Definition: detectBoundaryLayers.H:122
Foam::boundaryLayerOptimisation::optimiseLayersAtExittingFaces
bool optimiseLayersAtExittingFaces()
optimise layers at exitting faces due to requests from the inside
Definition: boundaryLayerOptimisationFunctions.C:481
Foam::HashTable::found
bool found(const Key &) const
Return true if hashedEntry is found in table.
Definition: HashTable.C:109
Foam::meshSurfaceEngine::edgeFaces
const VRWGraph & edgeFaces() const
Definition: meshSurfaceEngineI.H:334
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::meshSurfaceEngineModifier::updateGeometry
void updateGeometry(const labelLongList &)
Definition: meshSurfaceEngineModifier.C:234
Foam::Vector::z
const Cmpt & z() const
Definition: VectorI.H:77
meshSurfaceEngine.H
Foam::abort
errorManip< error > abort(error &err)
Definition: errorManip.H:131
Foam::e
const double e
Elementary charge.
Definition: doubleFloat.H:94
Foam::DynList< label >
Foam::boundaryLayerOptimisation::meshSurface
const meshSurfaceEngine & meshSurface() const
access to mesh surface
Definition: boundaryLayerOptimisationFunctions.C:187
Foam::meshSurfacePartitioner
Definition: meshSurfacePartitioner.H:52
Foam::meshSurfaceEngine::edges
const edgeList & edges() const
Definition: meshSurfaceEngineI.H:296
Foam::OFstream
Output to file stream.
Definition: OFstream.H:81
Foam::boundaryLayerOptimisation::mesh_
polyMeshGen & mesh_
reference to polyMeshGen
Definition: boundaryLayerOptimisation.H:66
Foam::meshSurfaceOptimizer::optimizeSurface
void optimizeSurface(const label nIterations=5)
optimize boundary nodes after boundary regions are created
Definition: meshSurfaceOptimizerOptimizeSurface.C:581
Foam::List::setSize
void setSize(const label)
Reset size of List.
Foam::meshSurfacePartitioner::edgePoints
const labelHashSet & edgePoints() const
return labels of edge points (from the list of boundary points)
Definition: meshSurfacePartitioner.H:135
Foam::boundaryLayerOptimisation::optimiseThicknessVariation
void optimiseThicknessVariation(const direction edgeType=(INSIDE|BOUNDARY))
optimise thickness variation
Definition: boundaryLayerOptimisationThickness.C:287
Foam::boundaryLayerOptimisation::hairEdges_
edgeLongList hairEdges_
boundary layer hairs
Definition: boundaryLayerOptimisation.H:76
he
volScalarField & he
Definition: YEEqn.H:56
Foam::sumOp
Definition: ops.H:162
f
labelList f(nPoints)
Foam::Vector< scalar >
Foam::meshSurfaceOptimizer
Definition: meshSurfaceOptimizer.H:63
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
Foam::polyMeshGen::write
void write() const
Definition: polyMeshGen.C:126
Foam::boundaryLayerOptimisation::partitionerPtr_
const meshSurfacePartitioner * partitionerPtr_
mesh surface partitioner
Definition: boundaryLayerOptimisation.H:73
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::boundaryLayerOptimisation::isBndLayerBase_
boolList isBndLayerBase_
is boundary face a base for a prism in the bnd layer
Definition: boundaryLayerOptimisation.H:85
Foam::meshSurfaceOptimizer::lockBoundaryFaces
void lockBoundaryFaces(const labelListType &)
lock the boundary faces which shall not be modified
Definition: meshSurfaceOptimizerI.H:441
Foam::direction
unsigned char direction
Definition: direction.H:43
meshSurfaceEngineModifier.H
Foam::boundaryLayerOptimisation::surfacePartitioner
const meshSurfacePartitioner & surfacePartitioner() const
access to meshSurfacePartitioner
Definition: boundaryLayerOptimisationFunctions.C:207
Foam::boundaryLayerOptimisation::INSIDE
@ INSIDE
Definition: boundaryLayerOptimisation.H:216
Foam::constant::universal::c
const dimensionedScalar c
Speed of light in a vacuum.
Foam::boundaryLayerOptimisation::writeHairEdges
void writeHairEdges(const fileName &fName, const direction eType, const vectorField &vecs) const
write vector correcposing to hair edges. Helper for debugging
Definition: boundaryLayerOptimisationFunctions.C:104
Foam::polyMeshGenFaces::addFaceToSubset
void addFaceToSubset(const label, const label)
Definition: polyMeshGenFacesI.H:117
Foam::Vector::y
const Cmpt & y() const
Definition: VectorI.H:71
FatalErrorIn
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
Definition: error.H:313
Foam::face
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:75
detectBoundaryLayers.H
cells
const cellShapeList & cells
Definition: gmvOutputHeader.H:3
Foam::boundaryLayerOptimisation::hairEdgeType_
List< direction > hairEdgeType_
classification of hair edges
Definition: boundaryLayerOptimisation.H:91
Foam::detectBoundaryLayers::faceInLayer
const labelList & faceInLayer() const
index of a layer to which a boundary faces belong to
Definition: detectBoundaryLayers.H:134
Foam::List::size
void size(const label)
Override size to be inconsistent with allocated storage.
Foam::meshSurfaceOptimizer::lockFeatureEdges
void lockFeatureEdges()
lock edge points
Definition: meshSurfaceOptimizerI.H:557
Foam::boundaryLayerOptimisation::maxNumIterations_
label maxNumIterations_
maximum number of iterations
Definition: boundaryLayerOptimisation.H:97
Foam::UList::size
label size() const
Return the number of elements in the UList.
Definition: UListI.H:299
Foam::detectBoundaryLayers
Definition: detectBoundaryLayers.H:59
Foam::meshSurfacePartitioner::corners
const labelHashSet & corners() const
return labels of corner points (from the list of boundary points)
Definition: meshSurfacePartitioner.H:129
Foam::pointFieldPMG
Definition: pointFieldPMG.H:50
Foam::VRWGraph
Definition: VRWGraph.H:101
polyMeshGenAddressing.H
Foam::polyMeshGenPoints::addPointSubset
label addPointSubset(const word &)
point subsets
Definition: polyMeshGenPoints.C:88
Foam::cell
A cell is defined as a list of faces with extra functionality.
Definition: cell.H:56
meshSurfaceOptimizer.H
Foam::meshSurfaceEngine
Definition: meshSurfaceEngine.H:54
Foam::meshSurfacePartitioner::featureEdges
const labelHashSet & featureEdges() const
return labels of boundary edges which are feature edges
Definition: meshSurfacePartitioner.H:153
meshSurfacePartitioner.H
Foam::DynList::append
void append(const T &e)
Append an element at the end of the list.
Definition: DynListI.H:304
Foam::meshSurfaceEngine::faceOwners
const labelList & faceOwners() const
Definition: meshSurfaceEngineI.H:143