42 NamedEnum<surfaceSlipDisplacementPointPatchVectorField::projectMode, 3>::
51 surfaceSlipDisplacementPointPatchVectorField::projectModeNames_;
56 void surfaceSlipDisplacementPointPatchVectorField::calcProjection
74 vector projectVec(0, 0, 0);
78 projectVec = projectLen*
n;
85 if (frozenPointsZone_.size() > 0)
89 zonePtr = &pZones[frozenPointsZone_];
91 Pout<<
"surfaceSlipDisplacementPointPatchVectorField : Fixing all " 92 << zonePtr->
size() <<
" points in pointZone " << zonePtr->
name()
106 start[i] = points0[meshPoints[i]] + displacement[i];
109 label nNotProjected = 0;
125 if (zonePtr && (zonePtr->
whichPoint(meshPoints[i]) >= 0))
128 displacement[i] = points0[meshPoints[i]] - localPoints[i];
130 else if (nearest[i].hit())
133 nearest[i].hitPoint()
134 - points0[meshPoints[i]];
142 Pout<<
" point:" << meshPoints[i]
143 <<
" coord:" << localPoints[i]
144 <<
" did not find any surface within " << projectLen
182 offset[i] = start[i][wedgePlane_];
183 start[i][wedgePlane_] = 0;
184 projectVecs[i][wedgePlane_] = 0;
215 if (zonePtr && (zonePtr->
whichPoint(meshPoints[i]) >= 0))
218 displacement[i] = points0[meshPoints[i]] - localPoints[i];
220 else if (nearest[i].hit())
224 nearest[i].hitPoint()
225 - points0[meshPoints[i]];
231 if (rightHit[i].hit())
233 if (leftHit[i].hit())
237 magSqr(rightHit[i].hitPoint()-start[i])
238 <
magSqr(leftHit[i].hitPoint()-start[i])
241 interPt = rightHit[i];
245 interPt = leftHit[i];
250 interPt = rightHit[i];
255 if (leftHit[i].hit())
257 interPt = leftHit[i];
266 interPt.
rawPoint()[wedgePlane_] += offset[i];
268 displacement[i] = interPt.
rawPoint()-points0[meshPoints[i]];
276 Pout<<
" point:" << meshPoints[i]
277 <<
" coord:" << localPoints[i]
278 <<
" did not find any intersection between" 279 <<
" ray from " << start[i]-projectVecs[i]
280 <<
" to " << start[i]+projectVecs[i] <<
endl;
289 if (nNotProjected > 0)
291 Info<<
"surfaceSlipDisplacement :" 293 <<
" did not project " << nNotProjected
295 <<
" points." <<
endl;
325 surfacesDict_(dict.
subDict(
"geometry")),
326 projectMode_(projectModeNames_.
read(dict.
lookup(
"projectMode"))),
327 projectDir_(dict.
lookup(
"projectDirection")),
343 surfacesDict_(ppf.surfacesDict_),
344 projectMode_(ppf.projectMode_),
345 projectDir_(ppf.projectDir_),
346 wedgePlane_(ppf.wedgePlane_),
347 frozenPointsZone_(ppf.frozenPointsZone_)
358 surfacesDict_(ppf.surfacesDict_),
359 projectMode_(ppf.projectMode_),
360 projectDir_(ppf.projectDir_),
361 wedgePlane_(ppf.wedgePlane_),
362 frozenPointsZone_(ppf.frozenPointsZone_)
374 surfacesDict_(ppf.surfacesDict_),
375 projectMode_(ppf.projectMode_),
376 projectDir_(ppf.projectDir_),
377 wedgePlane_(ppf.wedgePlane_),
378 frozenPointsZone_(ppf.frozenPointsZone_)
387 if (surfacesPtr_.empty())
407 return surfacesPtr_();
419 calcProjection(displacement);
436 os.
writeKeyword(
"projectMode") << projectModeNames_[projectMode_]
444 os.
writeKeyword(
"frozenPointsZone") << frozenPointsZone_
Virtual base class for displacement motion solver.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Displacement follows a triSurface. Use in a displacementMotionSolver as a bc on the pointDisplacement...
const boundBox & bounds() const
Return mesh bounding box.
const point & min() const
Minimum describing the bounding box.
A list of keyword definitions, which are a keyword followed by any number of values (e...
commsTypes
Types of communications.
bool hit() const
Is there a hit.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
void size(const label)
Override size to be inconsistent with allocated storage.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::blocking)
Update the patch field.
Foam::pointPatchFieldMapper.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void setInInternalField(Field< Type1 > &iF, const Field< Type1 > &pF, const labelList &meshPoints) const
Given the internal field and a patch field,.
const point & max() const
Maximum describing the bounding box.
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
Initialise the NamedEnum HashTable from the static list of names.
Macros for easy insertion into run-time selection tables.
const searchableSurfaces & surfaces() const
Surface to follow. Demand loads surfaceNames.
const objectRegistry & db() const
Return local objectRegistry.
const pointMesh & mesh() const
Return the mesh reference.
const word & name() const
Return name.
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
static const direction nComponents
Number of components in this vector space.
void findNearest(const pointField &, const scalarField &nearestDistSqr, labelList &surfaces, List< pointIndexHit > &) const
Find nearest. Return -1 (and a miss()) or surface and nearest.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
virtual void write(Ostream &) const
Write.
static const word null
An empty word.
Container for searchableSurfaces.
const pointBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
virtual const word & name() const =0
Return name.
const Point & rawPoint() const
Return point with no checking.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
prefixOSstream Pout(cout,"Pout")
void findAnyIntersection(const pointField &start, const pointField &end, labelList &surfaces, List< pointIndexHit > &) const
Find any intersection. Return hit point information and.
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
label whichPoint(const label globalPointID) const
Helper function to re-direct to zone::localID(...)
const pointZoneMesh & pointZones() const
Return point zone mesh.
pointPatchField< vector > pointPatchVectorField
virtual const vectorField & pointNormals() const =0
Return point normals.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
virtual const vectorField & localPoints() const =0
Return mesh points.
const pointPatch & patch() const
Return patch.
A subset of mesh points. The labels of points in the zone can be obtained from the addressing() list...
Constant dispersed-phase particle diameter model.
Basic pointPatch represents a set of points from the mesh.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const Field< Type > & primitiveField() const
Return internal field reference.
makePointPatchTypeField(pointPatchVectorField, solidBodyMotionDisplacementPointPatchVectorField)
dimensioned< scalar > mag(const dimensioned< Type > &)
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
Mesh consisting of general polyhedral cells.
virtual void write(Ostream &) const
Write.
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::blocking)
Evaluate the patch field.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
Enum read(Istream &) const
Read a word from Istream and return the corresponding.
tmp< Field< Type > > patchInternalField() const
Return field created from appropriate internal field values.
surfaceSlipDisplacementPointPatchVectorField(const pointPatch &, const DimensionedField< vector, pointMesh > &)
Construct from patch and internal field.
virtual const labelList & meshPoints() const =0
Return mesh points.
IOporosityModelList pZones(mesh)
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.