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()
98 refCast<const dynamicMotionSolverFvMesh>(
mesh).motion();
102 refCast<const displacementMotionSolver>(motion).points0();
107 start[i] = points0[meshPoints[i]] + displacement[i];
110 label nNotProjected = 0;
126 if (zonePtr && (zonePtr->
whichPoint(meshPoints[i]) >= 0))
129 displacement[i] = points0[meshPoints[i]] - localPoints[i];
131 else if (nearest[i].hit())
134 nearest[i].hitPoint()
135 - points0[meshPoints[i]];
143 Pout<<
" point:" << meshPoints[i]
144 <<
" coord:" << localPoints[i]
145 <<
" did not find any surface within " << projectLen
183 offset[i] = start[i][wedgePlane_];
184 start[i][wedgePlane_] = 0;
185 projectVecs[i][wedgePlane_] = 0;
216 if (zonePtr && (zonePtr->
whichPoint(meshPoints[i]) >= 0))
219 displacement[i] = points0[meshPoints[i]] - localPoints[i];
221 else if (nearest[i].hit())
225 nearest[i].hitPoint()
226 - points0[meshPoints[i]];
232 if (rightHit[i].hit())
234 if (leftHit[i].hit())
238 magSqr(rightHit[i].hitPoint()-start[i])
239 <
magSqr(leftHit[i].hitPoint()-start[i])
242 interPt = rightHit[i];
246 interPt = leftHit[i];
251 interPt = rightHit[i];
256 if (leftHit[i].hit())
258 interPt = leftHit[i];
267 interPt.
rawPoint()[wedgePlane_] += offset[i];
269 displacement[i] = interPt.
rawPoint()-points0[meshPoints[i]];
277 Pout<<
" point:" << meshPoints[i]
278 <<
" coord:" << localPoints[i]
279 <<
" did not find any intersection between" 280 <<
" ray from " << start[i]-projectVecs[i]
281 <<
" to " << start[i]+projectVecs[i] <<
endl;
290 if (nNotProjected > 0)
292 Info<<
"surfaceSlipDisplacement :" 294 <<
" did not project " << nNotProjected
296 <<
" points." <<
endl;
326 surfacesDict_(dict.
subDict(
"geometry")),
327 projectMode_(projectModeNames_.
read(dict.
lookup(
"projectMode"))),
328 projectDir_(dict.
lookup(
"projectDirection")),
344 surfacesDict_(ppf.surfacesDict_),
345 projectMode_(ppf.projectMode_),
346 projectDir_(ppf.projectDir_),
347 wedgePlane_(ppf.wedgePlane_),
348 frozenPointsZone_(ppf.frozenPointsZone_)
360 surfacesDict_(ppf.surfacesDict_),
361 projectMode_(ppf.projectMode_),
362 projectDir_(ppf.projectDir_),
363 wedgePlane_(ppf.wedgePlane_),
364 frozenPointsZone_(ppf.frozenPointsZone_)
373 if (surfacesPtr_.empty())
382 db().time().constant(),
393 return surfacesPtr_();
405 calcProjection(displacement);
421 writeEntry(os,
"projectMode", projectModeNames_[projectMode_]);
422 writeEntry(os,
"projectDirection", projectDir_);
426 writeEntry(os,
"frozenPointsZone", frozenPointsZone_);
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
#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...
A list of keyword definitions, which are a keyword followed by any number of values (e...
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Update the patch field.
commsTypes
Types of communications.
void findAnyIntersection(const pointField &start, const pointField &end, labelList &surfaces, List< pointIndexHit > &) const
Find any intersection. Return hit point information and.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
void size(const label)
Override size to be inconsistent with allocated storage.
Foam::pointPatchFieldMapper.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Virtual base class for mesh motion solver.
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.
const Field< vector > & primitiveField() const
Return internal field reference.
Macros for easy insertion into run-time selection tables.
const meshPointZones & pointZones() const
Return point zones.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
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.
const objectRegistry & db() const
Return local objectRegistry.
static const word & geometryDir()
Return the geometry directory name.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const pointPatch & patch() const
Return patch.
bool hit() const
Is there a hit.
static const word null
An empty word.
Container for searchableSurfaces.
virtual const word & name() const =0
Return name.
const word & name() const
Return name.
void setInInternalField(Field< Type1 > &iF, const Field< Type1 > &pF, const labelList &meshPoints) const
Given the internal field and a patch field,.
label whichPoint(const label globalPointID) const
Helper function to re-direct to zone::localID(...)
tmp< Field< vector > > patchInternalField() const
Return field created from appropriate internal field values.
const Point & rawPoint() const
Return point with no checking.
const pointMesh & mesh() const
Return the mesh reference.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
const searchableSurfaces & surfaces() const
Surface to follow. Demand loads surfaceNames.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
pointPatchField< vector > pointPatchVectorField
virtual const vectorField & pointNormals() const =0
Return point normals.
const pointBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
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.
virtual void write(Ostream &) const
Write.
virtual void write(Ostream &) const
Write.
const point & max() const
Maximum describing the bounding box.
const boundBox & bounds() const
Return mesh bounding box.
A subset of mesh points. The labels of points in the zone can be obtained from the addressing() list...
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
Basic pointPatch represents a set of points from the mesh.
prefixOSstream Pout(cout, "Pout")
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
makePointPatchTypeField(pointPatchVectorField, solidBodyMotionDisplacementPointPatchVectorField)
dimensioned< scalar > mag(const dimensioned< Type > &)
Enum read(Istream &) const
Read a word from Istream and return the corresponding.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
Mesh consisting of general polyhedral cells.
const point & min() const
Minimum describing the bounding box.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
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.