Go to the documentation of this file.
61 file <<
"# vtk DataFile Version 3.0\n";
62 file <<
"vtk output\n";
64 file <<
"DATASET POLYDATA\n";
68 file <<
"POINTS " <<
points.size() <<
" float\n";
73 file <<
p.x() <<
' ' <<
p.y() <<
' ' <<
p.z() <<
' ';
81 file <<
"\nPOLYGONS " << surf.
size() <<
" " << 4*surf.
size() <<
endl;
85 file << 3 <<
" " << tri[0] <<
" " << tri[1] <<
" " << tri[2] <<
endl;
98 file <<
"# vtk DataFile Version 3.0\n";
99 file <<
"vtk output\n";
101 file <<
"DATASET POLYDATA\n";
104 std::map<label, label> newPointLabel;
109 for(
label pI=0;pI<3;++pI)
111 newPointLabel[tri[pI]];
116 newPointLabel[it.key()];
119 file <<
"POINTS " <<
label(newPointLabel.size()) <<
" float\n";
123 std::map<label, label>::iterator it=newPointLabel.begin();
124 it!=newPointLabel.end();
128 it->second = counter++;
132 file <<
p.x() <<
' ' <<
p.y() <<
' ' <<
p.z() <<
' ';
139 file <<
"\nPOLYGONS " << triangles.
size()
140 <<
" " << 4*triangles.
size() <<
endl;
146 <<
" " << newPointLabel[tri[0]]
147 <<
" " << newPointLabel[tri[1]]
148 <<
" " << newPointLabel[tri[2]] <<
endl;
166 file <<
"\nPOINT_DATA " <<
points.size() <<
"\n";
168 file <<
"SCALARS Values double\n";
169 file <<
"LOOKUP_TABLE default\n";
172 file <<
data[pI][0] <<
" ";
174 if( pI && pI % 5 == 0 )
193 file <<
"\nPOINT_DATA " <<
points.size() <<
"\n";
195 file <<
"VECTORS Values double\n";
196 file <<
"LOOKUP_TABLE default\n";
201 file << v[0] <<
" " << v[1] <<
" " << v[2] <<
" ";
203 if( pI && pI % 5 == 0 )
219 # pragma omp parallel
223 # pragma omp for schedule(static, 1)
230 # pragma omp for schedule(static, 1)
236 featureEdge[eI] =
false;
241 surface_[edgeFaces(eI, 0)].region() ==
245 featureEdge[eI] =
false;
249 featureEdge[eI] =
true;
260 # pragma omp for schedule(dynamic, 20)
267 const label edgeI = pointEdges(pI, peI);
268 if( featureEdge[edgeI] )
272 if( features.
size() == 2 )
276 const scalar d1 =
mag(e1) + VSMALL;
279 const scalar d2 =
mag(e2) + VSMALL;
286 const scalar curv =
Foam::acos(cs) / (0.5 * (d1+d2+VSMALL));
310 # pragma omp parallel for schedule(dynamic, 40)
312 forAll(pointTriangles, pointI)
314 std::map<label, DynList<label> > regionTriangles;
320 const label triI = pointTriangles(pointI, ptI);
323 if( !normals.found(regionI) )
325 if( regionTriangles.find(regionI) != regionTriangles.end() )
326 regionTriangles.insert
334 if( !otherLabels.found(regionI) )
337 regionTriangles[regionI].append(triI);
346 otherLabels[regionI].insert(pI);
355 if( otherLabels[it.key()].size() > 5 )
361 const label neiPointI = lit.key();
362 const constRow pTriangles = pointTriangles[neiPointI];
368 if( nTri.
region() != it.key() )
372 additionalPoints.
insert(nTri[pI]);
377 otherLabels[it.key()].insert(aIter.key());
387 const label regionI = it.key();
390 pointPatches[pointI].
append(regionI);
396 const label tI = rTriangles[i];
418 # ifdef DEBUGCurvatureEstimator
419 Info <<
"Point " << pointI <<
" in patch " << regionI
420 <<
" normal " << normals[it.key()]
421 <<
" evalution points " << labels
450 # pragma omp parallel
453 for(
label iteration=0;iteration<2;++iteration)
456 # pragma omp for schedule(static, 1)
458 forAll(pointTriangles, pointI)
460 const constRow pTriangles = pointTriangles[pointI];
464 forAll(pointPatches[pointI], ppI)
465 patchNeiPoints.insert
467 pointPatches[pointI][ppI],
475 if( !patchNeiPoints.found(tri.
region()) )
480 const label neiPointI = tri[pI];
482 if( neiPointI == pointI )
485 patchNeiPoints[tri.
region()].appendIfNotIn(neiPointI);
495 const label cPatch = pointPatches[pointI][patchI];
502 if( neiPoints.
size() == 0 )
504 smoothMinCurv[pointI][patchI] =
507 smoothMaxCurv[pointI][patchI] =
513 const label neiPointI = neiPoints[i];
516 pointPatches[neiPointI].containsAtPosition(cPatch);
522 minCurv /= neiPoints.
size();
523 maxCurv /= neiPoints.
size();
526 smoothMinCurv[pointI][patchI] =
529 smoothMaxCurv[pointI][patchI] =
537 # pragma omp for schedule(static, 1)
555 # pragma omp for schedule(static, 1)
570 # ifdef DEBUGCurvatureEstimator
scalar meanCurvature() const
Return mean curvature.
A class for handling words, derived from string.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
#define forAll(list, i)
Loop across all elements in list.
vector minCurvatureVector() const
Return min curvature vector.
const pointField & points() const
access to points
word scalarToText(const scalar s)
convert the scalar value into text
void calculateEdgeCurvature()
calculate curvature of feature edges
A HashTable to objects of type <T> with a label key.
Ostream & endl(Ostream &os)
Add newline and flush stream.
label size() const
Size of the active part of the list.
dimensioned< scalar > mag(const dimensioned< Type > &)
scalar gaussianCurvature() const
Return Gaussian curvature.
void setSize(const label)
Reset the number of rows.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
List< DynList< scalar, 1 > > maxCurvature_
const typedef graphRow< const VRWGraph > constRow
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
List< DynList< vector, 1 > > maxCurvatureVector_
Pre-declare SubField and related Field type.
void append(const T &)
Append an element at the end of the list.
const triSurf & surface_
reference to triSurface
#define forAllRow(graph, rowI, index)
const VRWGraph & pointFacets() const
return point-facets addressing
FRWGraph< label, 3 > patchPositions_
curvatures of other points
label sizeOfRow(const label rowI) const
Returns the number of elements in the given row.
List< DynList< scalar, 1 > > meanCurvature_
scalar minCurvature() const
Return min curvature.
List< DynList< scalar, 1 > > gaussianCurvature_
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
void setSize(const label)
Reset size of List.
void calculateSurfaceCurvatures()
calculate curvatures of other surface points
label region() const
Return region label.
label size() const
return the number of triangles
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
dimensionedScalar acos(const dimensionedScalar &ds)
bool insert(const Key &key)
Insert a new entry.
const LongList< edge > & edges() const
return edges
Triangle with additional region number.
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
scalarField edgePointCurvature_
curvature of points at feature edges
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
const VRWGraph & edgeFacets() const
return edge-facets addressing
const VRWGraph & pointEdges() const
return point-edges addressing
vector maxCurvatureVector() const
Return max curvature vector.
scalar maxCurvature() const
Return max curvature.
void writeSurfaceToVTK(OFstream &file, const triSurf &surf)
List< DynList< vector, 1 > > minCurvatureVector_
Database for solution data, solver performance and other reduced data.
word name(const complex &)
Return a string representation of a complex.
void append(const T &e)
Append an element at the end of the list.
List< DynList< scalar, 1 > > minCurvature_
dimensionedScalar pos(const dimensionedScalar &ds)