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

Function calcSamples

src/sampling/sampledSet/circle/circleSet.C:46–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
45
46void Foam::circleSet::calcSamples
47(
48 DynamicList<point>& samplingPts,
49 DynamicList<label>& samplingCells,
50 DynamicList<label>& samplingFaces,
51 DynamicList<label>& samplingSegments,
52 DynamicList<scalar>& samplingCurveDist
53) const
54{
55 static const string funcName =
56 (
57 "void circleSet::calcSamples"
58 "("
59 "DynamicList<point>&, "
60 "DynamicList<label>&, "
61 "DynamicList<label>&, "
62 "DynamicList<label>&, "
63 "DynamicList<scalar>&"
64 ") const"
65 );
66
67 // set start point
68 label celli = searchEngine().findCell(startPoint_);
69 if (celli != -1)
70 {
71 samplingPts.append(startPoint_);
72 samplingCells.append(celli);
73 samplingFaces.append(-1);
74 samplingSegments.append(0);
75 samplingCurveDist.append(0.0);
76 }
77 else
78 {
79 WarningInFunction
80 << "Unable to find cell at point id " << 0
81 << " at location " << startPoint_ << endl;
82 }
83
84 // add remaining points
85 const scalar alpha = constant::mathematical::pi/180.0*dTheta_;
86 const scalar sinAlpha = sin(alpha);
87 const scalar cosAlpha = cos(alpha);
88
89 // first axis
90 vector axis1 = startPoint_ - origin_;
91 const scalar radius = mag(axis1);
92
93 if (mag(axis1 & circleAxis_) > SMALL)
94 {
95 WarningInFunction
96 << "Vector defined by (startPoint - origin) not orthogonal to "
97 << "circleAxis:" << nl
98 << " startPoint - origin = " << axis1 << nl
99 << " circleAxis = " << circleAxis_ << nl
100 << endl;
101 }
102
103 axis1 /= mag(axis1);

Callers 1

genSamplesFunction · 0.70

Calls 2

magClass · 0.50
appendMethod · 0.45

Tested by

no test coverage detected