35void Foam::cuttingSurface::calcCellCuts
38 scalarField& pointDist,
45 const label nCells = fvm.nCells();
46 const label
nPoints = fvm.nPoints();
50 List<pointIndexHit> nearest;
51 surfPtr_().findNearest
59 surfPtr_().getNormal(nearest, norms);
63 for (label i=0; i <
nPoints; ++i)
65 const point diff(pts[i] - nearest[i].hitPoint());
68 pointDist[i] = (
diff & norms[i]);
74 cellCuts.resize(nCells);
78 cellCuts.resize(nCells,
true);
84 surfPtr_().findNearest
94 for (
const label celli : cellCuts)
97 cellBb.add(pts, fvm.cellPoints(celli));
99 if (!cellBb.contains(nearest[celli].hitPoint()))
101 cellCuts.unset(celli);
112 "cuttingSurface.cellCuts",
113 fvm.time().timeName(),
123 for (
const label celli : cellCuts)
128 Pout<<
"Writing cellCuts:" << cCuts.objectPath() <<
endl;
135 "cuttingSurface.pointDistance",
136 fvm.time().timeName(),
145 pDist.primitiveFieldRef() = pointDist;
147 Pout<<
"Writing point distance:" << pDist.objectPath() <<
endl;
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
label nPoints() const
Number of points supporting patch faces.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
static int debug
Debug information.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const dimensionSet dimless
Dimensionless.
GeometricField< scalar, pointPatchField, pointMesh > pointScalarField
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
vectorField pointField
pointField is a vectorField.
vector point
Point is a vector.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
scalar diff(const triad &A, const triad &B)
Return a quantity of the difference between two triads.
Field< vector > vectorField
Specialisation of Field<T> for vector.
static constexpr const zero Zero
Global zero (0)
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.