| 44 | // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // |
| 45 | |
| 46 | void 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); |
no test coverage detected