MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / calcSamples

Function calcSamples

src/sampling/sampledSet/face/faceOnlySet.C:92–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90
91
92void Foam::faceOnlySet::calcSamples
93(
94 DynamicList<point>& samplingPts,
95 DynamicList<label>& samplingCells,
96 DynamicList<label>& samplingFaces,
97 DynamicList<label>& samplingSegments,
98 DynamicList<scalar>& samplingCurveDist
99) const
100{
101 // Distance vector between sampling points
102 if (mag(end_ - start_) < SMALL)
103 {
104 FatalErrorInFunction
105 << "Incorrect sample specification :"
106 << " start equals end point." << endl
107 << " start:" << start_
108 << " end:" << end_
109 << exit(FatalError);
110 }
111
112 const vector offset = (end_ - start_);
113 const vector normOffset = offset/mag(offset);
114 const vector smallVec = tol*offset;
115 const scalar smallDist = mag(smallVec);
116
117 // Force calculation of cloud addressing on all processors
118 const bool oldMoving = const_cast<polyMesh&>(mesh()).moving(false);
119 passiveParticleCloud particleCloud(mesh());
120
121 // Get all boundary intersections
122 List<pointIndexHit> bHits = searchEngine().intersections
123 (
124 start_ - smallVec,
125 end_ + smallVec
126 );
127
128 point bPoint(GREAT, GREAT, GREAT);
129 label bFacei = -1;
130
131 if (bHits.size())
132 {
133 bPoint = bHits[0].hitPoint();
134 bFacei = bHits[0].index();
135 }
136
137 // Get first tracking point. Use bPoint, bFacei if provided.
138 point trackPt;
139 label trackCelli = -1;
140 label trackFacei = -1;
141
142 // Pout<< "before getTrackingPoint : bPoint:" << bPoint
143 // << " bFacei:" << bFacei << endl;
144
145 getTrackingPoint
146 (
147 start_,
148 bPoint,
149 bFacei,

Callers 1

genSamplesFunction · 0.70

Calls 10

meshFunction · 0.85
getTrackingPointFunction · 0.85
movingMethod · 0.80
trackToBoundaryFunction · 0.70
magClass · 0.50
exitFunction · 0.50
sizeMethod · 0.45
indexMethod · 0.45
appendMethod · 0.45
positionMethod · 0.45

Tested by

no test coverage detected