meshSurfaceOptimizerI.H
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"
29 #include "meshSurfaceOptimizer.H"
30 #include "plane.H"
31 #include "Map.H"
32 #include "surfaceOptimizer.H"
33 #include "helperFunctions.H"
34 #include "partTriMeshSimplex.H"
35 
36 //#define DEBUGSmooth
37 
38 # ifdef DEBUGSmooth
39 #include "triSurf.H"
40 #include "triSurfModifier.H"
41 #include "helperFunctions.H"
42 # endif
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
52 {
53  if( !triMeshPtr_ )
55 
56  return *triMeshPtr_;
57 }
58 
60 {
61  if( !triMeshPtr_ )
63  (
64  "inline void meshSurfaceOptimizer::updateTriMesh"
65  "(const labelLongList&)"
66  ) << "triMeshPtr_ is not allocated " << abort(FatalError);
67 
68  triMeshPtr_->updateVertices(selPoints);
69 }
70 
72 {
73  if( !triMeshPtr_ )
75  (
76  "inline void meshSurfaceOptimizer::updateTriMesh()"
77  ) << "triMeshPtr_ is not allocated " << abort(FatalError);
78 
80 }
81 
83 (
84  const label bpI,
85  const plane& pl,
86  vector& vecX,
87  vector& vecY,
88  DynList<point>& pts,
89  DynList<triFace>& trias
90 ) const
91 {
92  # ifdef DEBUGSmooth
93  Pout << "Transforming boundary node " << bpI << endl;
94  # endif
95 
96  const partTriMesh& triMesh = this->triMesh();
97  const label triPointI = triMesh.meshSurfacePointLabelInTriMesh()[bpI];
98  if( triPointI < 0 )
99  return false;
100 
101  partTriMeshSimplex simplex(triMesh, triPointI);
102 
103  const DynList<point, 32>& sPts = simplex.pts();
104 
105  //- create vecX and vecY
106  const point& p = simplex.centrePoint();
107  pts.setSize(0);
108  bool found(false);
109  forAll(sPts, pI)
110  {
111  const point sp = pl.nearestPoint(sPts[pI]);
112  const scalar d = mag(sp - p);
113  if( d > VSMALL )
114  {
115  vecX = sp - p;
116  vecX /= d;
117  vecY = pl.normal() ^ vecX;
118  vecY /= mag(vecY);
119  found = true;
120  break;
121  }
122  }
123 
124  if( !found )
125  return false;
126 
127  trias = simplex.triangles();
128 
129  # ifdef DEBUGSmooth
130  Pout << "VecX " << vecX << endl;
131  Pout << "vecY " << vecY << endl;
132  # endif
133 
134  //- transform the vertices
135  pts.setSize(sPts.size());
136 
137  forAll(sPts, pI)
138  {
139  const point pt
140  (
141  ((sPts[pI] - p) & vecX),
142  ((sPts[pI] - p) & vecY),
143  0.0
144  );
145 
146  pts[pI] = pt;
147  }
148 
149  # ifdef DEBUGSmooth
150  Info << "Original triangles " << endl;
151  forAll(simplex.triangles(), triI)
152  Info << "Tri " << triI << " is " << simplex.triangles()[triI] << endl;
153  Info << "Transformed triangles are " << trias << endl;
154  Info << "Transformed vertices " << pts << endl;
155 
156  triSurf surf;
157  triSurfModifier sMod(surf);
158  pointField& sPoints = sMod.pointsAccess();
159  sPoints.setSize(pts.size());
160  forAll(sPoints, i)
161  sPoints[i] = pts[i];
162  LongList<labelledTri>& sTrias = sMod.facetsAccess();
163  sTrias.setSize(trias.size());
164  forAll(sTrias, i)
165  {
166  labelledTri& tf = sTrias[i];
167  tf[0] = trias[i][0];
168  tf[1] = trias[i][1];
169  tf[2] = trias[i][2];
170 
171  tf.region() = 0;
172  }
173  sMod.patchesAccess().setSize(1);
174  sMod.patchesAccess()[0].name() = "bnd";
175  sMod.patchesAccess()[0].geometricType() = "patch";
176 
177  fileName sName("bndSimplex_");
178  sName += help::scalarToText(bpI);
179  sName += ".stl";
180  surf.writeSurface(sName);
181  # endif
182 
183  return found;
184 }
185 
187 (
188  const label bpI,
189  const bool transformIntoPlane
190 ) const
191 {
192  const VRWGraph& pPoints = surfaceEngine_.pointPoints();
193  const pointFieldPMG& points = surfaceEngine_.points();
194  const labelList& bPoints = surfaceEngine_.boundaryPoints();
195 
196  if( vertexType_[bpI] & LOCKED )
197  return points[bPoints[bpI]];
198 
199  vector newP(vector::zero);
200  if( transformIntoPlane )
201  {
202  const vector& pNormal = surfaceEngine_.pointNormals()[bpI];
203 
204  if( magSqr(pNormal) < VSMALL )
205  return points[bPoints[bpI]];
206 
207  plane pl(points[bPoints[bpI]], pNormal);
208 
209  DynList<point> projectedPoints;
210  projectedPoints.setSize(pPoints.sizeOfRow(bpI));
211  forAllRow(pPoints, bpI, pI)
212  projectedPoints[pI] =
213  pl.nearestPoint(points[bPoints[pPoints(bpI, pI)]]);
214 
215  forAll(projectedPoints, pI)
216  newP += projectedPoints[pI];
217 
218  newP /= projectedPoints.size();
219  }
220  else
221  {
222  forAllRow(pPoints, bpI, pI)
223  newP += points[bPoints[pPoints(bpI, pI)]];
224 
225  newP /= pPoints.sizeOfRow(bpI);
226  }
227 
228  return newP;
229 }
230 
232 (
233  const label bpI,
234  const bool transformIntoPlane
235 ) const
236 {
237  const VRWGraph& pointFaces = surfaceEngine_.pointFaces();
238  const pointFieldPMG& points = surfaceEngine_.points();
239  const vectorField& faceCentres = surfaceEngine_.faceCentres();
240  const labelList& bPoints = surfaceEngine_.boundaryPoints();
241 
242  if( vertexType_[bpI] & LOCKED )
243  return points[bPoints[bpI]];
244 
245  vector newP(vector::zero);
246 
247  if( transformIntoPlane )
248  {
249  const vector& pNormal = surfaceEngine_.pointNormals()[bpI];
250 
251  if( magSqr(pNormal) < VSMALL )
252  return points[bPoints[bpI]];
253 
254  plane pl(points[bPoints[bpI]], pNormal);
255 
256  DynList<point> projectedPoints;
257  projectedPoints.setSize(pointFaces.sizeOfRow(bpI));
258  forAllRow(pointFaces, bpI, pfI)
259  projectedPoints[pfI] =
260  pl.nearestPoint(faceCentres[pointFaces(bpI, pfI)]);
261 
262  forAll(projectedPoints, pI)
263  newP += projectedPoints[pI];
264 
265  newP /= projectedPoints.size();
266  }
267  else
268  {
269  forAllRow(pointFaces, bpI, pfI)
270  newP += faceCentres[pointFaces(bpI, pfI)];
271 
272  newP /= pointFaces.sizeOfRow(bpI);
273  }
274 
275  return newP;
276 }
277 
279 (
280  const label bpI,
281  const bool transformIntoPlane
282 ) const
283 {
284  const VRWGraph& pointFaces = surfaceEngine_.pointFaces();
285  const pointFieldPMG& points = surfaceEngine_.points();
286  const vectorField& faceAreas = surfaceEngine_.faceNormals();
287  const vectorField& faceCentres = surfaceEngine_.faceCentres();
288  const labelList& bPoints = surfaceEngine_.boundaryPoints();
289 
290  if( vertexType_[bpI] & LOCKED )
291  return points[bPoints[bpI]];
292 
293  vector newP(vector::zero);
294 
295  if( transformIntoPlane )
296  {
297  const vector& pNormal = surfaceEngine_.pointNormals()[bpI];
298 
299  if( magSqr(pNormal) < VSMALL )
300  return points[bPoints[bpI]];
301 
302  plane pl(points[bPoints[bpI]], pNormal);
303 
304  DynList<point> projectedPoints;
305  projectedPoints.setSize(pointFaces.sizeOfRow(bpI));
306  forAllRow(pointFaces, bpI, pfI)
307  projectedPoints[pfI] =
308  pl.nearestPoint(faceCentres[pointFaces(bpI, pfI)]);
309 
310  scalar sumW(0.0);
311  forAll(projectedPoints, pI)
312  {
313  const label bfI = pointFaces(bpI, pI);
314  const scalar w = (faceAreas[bfI] & faceAreas[bfI]);
315  newP += w * projectedPoints[pI];
316  sumW += w;
317  }
318 
319  newP /= Foam::max(sumW, VSMALL);
320  }
321  else
322  {
323  scalar sumW(0.0);
324  forAllRow(pointFaces, bpI, pfI)
325  {
326  const label bfI = pointFaces(bpI, pfI);
327  const scalar w = (faceAreas[bfI] & faceAreas[bfI]);
328  newP += w * faceCentres[pointFaces(bpI, pfI)];
329  sumW += w;
330  }
331 
332  newP /= Foam::max(sumW, VSMALL);
333  }
334 
335  return newP;
336 }
337 
339 (
340  const label bpI,
341  const scalar tol
342 ) const
343 {
344  const pointFieldPMG& points = surfaceEngine_.points();
345  const labelList& bPoints = surfaceEngine_.boundaryPoints();
346 
347  if( vertexType_[bpI] & LOCKED )
348  return points[bPoints[bpI]];
349 
350  # ifdef DEBUGSmooth
351  Pout << "Smoothing boundary node " << bpI << endl;
352  Pout << "Node label in the mesh is " << bPoints[bpI] << endl;
353  Pout << "Point coordinates " << points[bPoints[bpI]] << endl;
354  # endif
355 
356  //- project vertices onto the plane
357  const vector& pNormal = surfaceEngine_.pointNormals()[bpI];
358  if( magSqr(pNormal) < VSMALL )
359  return points[bPoints[bpI]];
360 
361  const plane pl(points[bPoints[bpI]], pNormal);
362 
363  DynList<point> pts;
364  DynList<triFace> trias;
365  vector vecX, vecY;
366  bool success = this->transformIntoPlane(bpI, pl, vecX, vecY, pts, trias);
367  if( !success )
368  {
369  //Warning << "Cannot transform to plane" << endl;
370  return points[bPoints[bpI]];
371  }
372 
373  surfaceOptimizer so(pts, trias);
374  const point newPoint = so.optimizePoint(tol);
375 
376  const point newP
377  (
378  points[bPoints[bpI]] +
379  vecX * newPoint.x() +
380  vecY * newPoint.y()
381  );
382 
383  if( help::isnan(newP) || help::isinf(newP) )
384  {
385  WarningIn
386  (
387  "inline point meshSurfaceOptimizer::newPositionSurfaceOptimizer"
388  "(const label, const scalar) const"
389  ) << "Cannot move point " << bpI << endl;
390 
391  return points[bPoints[bpI]];
392  }
393 
394  return newP;
395 }
396 
398 (
399  const label bpI
400 ) const
401 {
402  const labelList& bPoints = surfaceEngine_.boundaryPoints();
403  const edgeList& edges = surfaceEngine_.edges();
404  const VRWGraph& bpEdges = surfaceEngine_.boundaryPointEdges();
405  const pointFieldPMG& points = surfaceEngine_.points();
406 
407  if( vertexType_[bpI] & LOCKED )
408  return points[bPoints[bpI]];
409 
410  const labelHashSet& featureEdges = partitionerPtr_->featureEdges();
411 
412  DynList<label> edgePoints;
413 
414  forAllRow(bpEdges, bpI, i)
415  {
416  const label beI = bpEdges(bpI, i);
417 
418  if( featureEdges.found(beI) )
419  {
420  edgePoints.append(edges[beI].otherVertex(bPoints[bpI]));
421  }
422  }
423 
424  if( edgePoints.size() != 2 )
425  return points[bPoints[bpI]];
426 
427  # ifdef DEBUGSearch
428  Info << "Edge points " << edgePoints << endl;
429  # endif
430 
432  forAll(edgePoints, epI)
433  pos += points[edgePoints[epI]];
434 
435  pos /= edgePoints.size();
436 
437  return pos;
438 }
439 
440 template<class labelListType>
441 inline void meshSurfaceOptimizer::lockBoundaryFaces(const labelListType& l)
442 {
444 
446  const labelList& bp = surfaceEngine_.bp();
447 
448  # ifdef USE_OMP
449  # pragma omp parallel for schedule(dynamic, 20)
450  # endif
452  {
453  const face& bf = bFaces[lockedSurfaceFaces_[lfI]];
454 
455  forAll(bf, pI)
456  vertexType_[bp[bf[pI]]] |= LOCKED;
457  }
458 
459  if( Pstream::parRun() )
460  {
461  const Map<label>& globalToLocal =
463  const VRWGraph& bpAtProcs = surfaceEngine_.bpAtProcs();
464  const DynList<label>& bpNeiProcs = surfaceEngine_.bpNeiProcs();
465 
466  std::map<label, labelLongList> exchangeData;
467  forAll(bpNeiProcs, i)
468  exchangeData[bpNeiProcs[i]].clear();
469 
470  //- prepare data which will be sent to other processors
471  forAllConstIter(Map<label>, globalToLocal, it)
472  {
473  const label bpI = it();
474 
475  if( vertexType_[bpI] & LOCKED )
476  {
477  forAllRow(bpAtProcs, bpI, i)
478  {
479  const label neiProc = bpAtProcs(bpI, i);
480 
481  if( neiProc == Pstream::myProcNo() )
482  continue;
483 
484  exchangeData[neiProc].append(it.key());
485  }
486  }
487  }
488 
489  labelLongList receivedData;
490  help::exchangeMap(exchangeData, receivedData);
491 
492  forAll(receivedData, i)
493  {
494  const label bpI = globalToLocal[receivedData[i]];
495 
496  vertexType_[bpI] |= LOCKED;
497  }
498  }
499 }
500 
501 template<class labelListType>
502 inline void meshSurfaceOptimizer::lockBoundaryPoints(const labelListType& l)
503 {
504  # ifdef USE_OMP
505  # pragma omp parallel for schedule(dynamic, 50)
506  # endif
507  forAll(l, i)
508  {
509  const label bpI = l[i];
510 
511  vertexType_[bpI] |= LOCKED;
512  }
513 
514  if( Pstream::parRun() )
515  {
516  const Map<label>& globalToLocal =
518  const VRWGraph& bpAtProcs = surfaceEngine_.bpAtProcs();
519  const DynList<label>& bpNeiProcs = surfaceEngine_.bpNeiProcs();
520 
521  std::map<label, labelLongList> exchangeData;
522  forAll(bpNeiProcs, i)
523  exchangeData[bpNeiProcs[i]].clear();
524 
525  //- prepare data which will be sent to other processors
526  forAllConstIter(Map<label>, globalToLocal, it)
527  {
528  const label bpI = it();
529 
530  if( vertexType_[bpI] & LOCKED )
531  {
532  forAllRow(bpAtProcs, bpI, i)
533  {
534  const label neiProc = bpAtProcs(bpI, i);
535 
536  if( neiProc == Pstream::myProcNo() )
537  continue;
538 
539  exchangeData[neiProc].append(it.key());
540  }
541  }
542  }
543 
544  labelLongList receivedData;
545  help::exchangeMap(exchangeData, receivedData);
546 
547  forAll(receivedData, i)
548  {
549  const label bpI = globalToLocal[receivedData[i]];
550 
551  vertexType_[bpI] |= LOCKED;
552  }
553  }
554 }
555 
556 //- lock edge points
558 {
559  # ifdef USE_OMP
560  # pragma omp parallel for schedule(dynamic, 50)
561  # endif
562  forAll(vertexType_, bpI)
563  if( vertexType_[bpI] & (EDGE | CORNER) )
564  vertexType_[bpI] |= LOCKED;
565 }
566 
567 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
568 
569 } // End namespace Foam
570 
571 // ************************************************************************* //
Foam::meshSurfaceOptimizer::updateTriMesh
void updateTriMesh()
Definition: meshSurfaceOptimizerI.H:71
Foam::meshSurfaceEngine::bpAtProcs
const VRWGraph & bpAtProcs() const
processors which contain the vertex
Definition: meshSurfaceEngineI.H:451
Foam::plane::normal
const vector & normal() const
Return plane normal.
Definition: plane.C:248
Foam::meshSurfaceEngine::bp
const labelList & bp() const
Definition: meshSurfaceEngineI.H:64
Foam::plane::nearestPoint
point nearestPoint(const point &p) const
Return nearest point in the plane for the given point.
Definition: plane.C:310
triSurf.H
w
volScalarField w(IOobject("w", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE), mesh, dimensionedScalar("w", dimensionSet(0, 0, 0, 0, 0, 0, 0), 0.0))
Foam::Vector< scalar >::zero
static const Vector zero
Definition: Vector.H:80
p
p
Definition: pEqn.H:62
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::meshSurfaceOptimizer::newPositionLaplacian
point newPositionLaplacian(const label bpI, const bool transformIntoPlane=true) const
Definition: meshSurfaceOptimizerI.H:187
Foam::meshSurfaceOptimizer::lockedSurfaceFaces_
labelLongList lockedSurfaceFaces_
locked faces which shall not be changed
Definition: meshSurfaceOptimizer.H:73
Foam::surfaceOptimizer::optimizePoint
point optimizePoint(const scalar tol=0.1)
optimizes position of a central point in the simplex
Definition: surfaceOptimizer.C:382
Foam::meshSurfaceOptimizer::triMeshPtr_
partTriMesh * triMeshPtr_
mesh of surface triangles needed for some smoothers
Definition: meshSurfaceOptimizer.H:83
Foam::help::isnan
bool isnan(const ListType &)
check if a list has nan entries
Definition: helperFunctionsGeometryQueriesI.H:53
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:406
Foam::meshSurfaceOptimizer::lockBoundaryPoints
void lockBoundaryPoints(const labelListType &)
lock boundary points. They are not be moved.
Definition: meshSurfaceOptimizerI.H:502
success
bool success
Definition: LISASMDCalcMethod1.H:16
Foam::partTriMeshSimplex
Definition: partTriMeshSimplex.H:52
demandDrivenData.H
Template functions to aid in the implementation of demand driven data.
Foam::SubList
A List obtained as a section of another List.
Definition: SubList.H:53
Foam::partTriMesh::meshSurfacePointLabelInTriMesh
const labelList & meshSurfacePointLabelInTriMesh() const
Definition: partTriMesh.H:180
Foam::help::scalarToText
word scalarToText(const scalar s)
convert the scalar value into text
Definition: helperFunctionsStringConversion.C:61
Foam::UPstream::parRun
static bool & parRun()
Is this a parallel run?
Definition: UPstream.H:377
Foam::meshSurfaceEngine::bpNeiProcs
const DynList< label > & bpNeiProcs() const
communication matrix for sending point data
Definition: meshSurfaceEngineI.H:470
Foam::meshSurfaceOptimizer::LOCKED
@ LOCKED
Definition: meshSurfaceOptimizer.H:248
Foam::meshSurfaceOptimizer::exchangeData
void exchangeData(const labelLongList &nodesToSmooth, std::map< label, DynList< parTriFace > > &m) const
transfer data between processors
Definition: meshSurfaceOptimizerOptimizePointParallel.C:427
Foam::Map< label >
Foam::meshSurfaceOptimizer::newEdgePositionLaplacian
point newEdgePositionLaplacian(const label bpI) const
Definition: meshSurfaceOptimizerI.H:398
triSurfModifier.H
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::triSurfModifier
Definition: triSurfModifier.H:48
Foam::meshSurfaceOptimizer::triMesh
const partTriMesh & triMesh() const
Definition: meshSurfaceOptimizerI.H:51
Foam::mag
dimensioned< scalar > mag(const dimensioned< Type > &)
Foam::meshSurfaceOptimizer::transformIntoPlane
bool transformIntoPlane(const label bpI, const plane &pl, vector &vecX, vector &vecY, DynList< point > &pts, DynList< triFace > &trias) const
transform into a 2D space in plane
Definition: meshSurfaceOptimizerI.H:83
Foam::HashSet< label, Hash< label > >
Foam::triSurfModifier::patchesAccess
geometricSurfacePatchList & patchesAccess()
access to patches
Definition: triSurfModifierI.H:52
forAllConstIter
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Definition: pEqn.H:39
Foam::help::isinf
bool isinf(const ListType &)
check if a list has inf entries
Definition: helperFunctionsGeometryQueriesI.H:63
Foam::LongList::setSize
void setSize(const label)
Reset size of List.
Definition: LongListI.H:223
Foam::plane
Geometric class that creates a 2D plane and can return the intersection point between a line and the ...
Definition: plane.H:60
Foam::LongList< label >
tf
const tensorField & tf
Definition: getPatchFieldTensor.H:36
Map.H
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::partTriMeshSimplex::centrePoint
const point & centrePoint() const
return centre point coordinates
Definition: partTriMeshSimplex.H:90
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
plane.H
Foam::Info
messageStream Info
Foam::triSurfModifier::pointsAccess
pointField & pointsAccess()
non-const access to points
Definition: triSurfModifierI.H:37
Foam::partTriMeshSimplex::pts
DynList< point, 32 > & pts()
return points
Definition: partTriMeshSimplex.H:72
Foam::meshSurfaceOptimizer::vertexType_
List< direction > vertexType_
type of surface vertex
Definition: meshSurfaceOptimizer.H:70
Foam::triSurfModifier::facetsAccess
LongList< labelledTri > & facetsAccess()
access to facets
Definition: triSurfModifierI.H:42
Foam::partTriMesh::updateVertices
void updateVertices()
Definition: partTriMesh.C:370
forAllRow
#define forAllRow(graph, rowI, index)
Definition: VRWGraph.H:277
Foam::meshSurfaceOptimizer::CORNER
@ CORNER
Definition: meshSurfaceOptimizer.H:246
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::HashTable::found
bool found(const Key &) const
Return true if hashedEntry is found in table.
Definition: HashTable.C:109
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::abort
errorManip< error > abort(error &err)
Definition: errorManip.H:131
Foam::DynList
Definition: DynList.H:53
Foam::meshSurfaceOptimizer::newPositionSurfaceOptimizer
point newPositionSurfaceOptimizer(const label bpI, const scalar tol=0.001) const
new position of a node after using surfaceOptimizer
Definition: meshSurfaceOptimizerI.H:339
Foam::meshSurfaceOptimizer::surfaceEngine_
const meshSurfaceEngine & surfaceEngine_
const reference to the mesh surface
Definition: meshSurfaceOptimizer.H:67
Foam::partTriMesh
Definition: partTriMesh.H:59
Foam::meshSurfaceOptimizer::calculateTrianglesAndAddressing
void calculateTrianglesAndAddressing() const
calculate surface triangulation
Definition: meshSurfaceOptimizerCalculateTrianglesAndAddressing.C:47
Foam::UPstream::myProcNo
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
Definition: UPstream.H:405
Foam::max
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
found
bool found
Definition: TABSMDCalcMethod2.H:32
surfaceOptimizer.H
Foam::meshSurfaceOptimizer::newPositionLaplacianFC
point newPositionLaplacianFC(const label bpI, const bool transformIntoPlane=true) const
Definition: meshSurfaceOptimizerI.H:232
Foam::List::setSize
void setSize(const label)
Reset size of List.
Foam::Pout
prefixOSstream Pout(cout, "Pout")
Definition: IOstreams.H:53
helperFunctions.H
Foam::surfaceOptimizer
Definition: surfaceOptimizer.H:50
Foam::Vector< scalar >
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::DynList::setSize
void setSize(const label)
Reset size of List.
Definition: DynListI.H:263
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::meshSurfaceOptimizer::lockBoundaryFaces
void lockBoundaryFaces(const labelListType &)
lock the boundary faces which shall not be modified
Definition: meshSurfaceOptimizerI.H:441
Foam::help::exchangeMap
void exchangeMap(const std::map< label, ListType > &m, LongList< T > &data, const Pstream::commsTypes commsType)
Definition: helperFunctionsPar.C:129
Foam::labelledTri
Triangle with additional region number.
Definition: labelledTri.H:49
Foam::triSurf::writeSurface
void writeSurface(const fileName &) const
Definition: triSurf.C:430
Foam::Vector::y
const Cmpt & y() const
Definition: VectorI.H:71
Foam::partTriMeshSimplex::triangles
const DynList< triFace, 32 > & triangles() const
return triangles
Definition: partTriMeshSimplex.H:84
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
Foam::DynList::size
label size() const
Definition: DynListI.H:235
WarningIn
#define WarningIn(functionName)
Report a warning using Foam::Warning.
Definition: messageStream.H:254
Foam::meshSurfaceEngine::globalToLocalBndPointAddressing
const Map< label > & globalToLocalBndPointAddressing() const
global point label to local label. Only for processors points
Definition: meshSurfaceEngineI.H:431
Foam::meshSurfaceOptimizer::lockFeatureEdges
void lockFeatureEdges()
lock edge points
Definition: meshSurfaceOptimizerI.H:557
Foam::meshSurfaceOptimizer::newPositionLaplacianWFC
point newPositionLaplacianWFC(const label bpI, const bool transformIntoPlane=true) const
Definition: meshSurfaceOptimizerI.H:279
Foam::pointFieldPMG
Definition: pointFieldPMG.H:50
Foam::VRWGraph
Definition: VRWGraph.H:101
Foam::triSurf
Definition: triSurf.H:59
meshSurfaceOptimizer.H
Foam::magSqr
dimensioned< scalar > magSqr(const dimensioned< Type > &)
Foam::meshSurfaceOptimizer::EDGE
@ EDGE
Definition: meshSurfaceOptimizer.H:245
partTriMeshSimplex.H
Foam::DynList::append
void append(const T &e)
Append an element at the end of the list.
Definition: DynListI.H:304
Foam::pos
dimensionedScalar pos(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:190