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 fvMeshMovers::motionSolver>
100 refCast<const fvMesh>(
mesh).mover()
105 refCast<const displacementMotionSolver>(motion).points0();
110 start[i] = points0[meshPoints[i]] + displacement[i];
113 label nNotProjected = 0;
129 if (zonePtr && (zonePtr->
whichPoint(meshPoints[i]) >= 0))
132 displacement[i] = points0[meshPoints[i]] - localPoints[i];
134 else if (nearest[i].hit())
137 nearest[i].hitPoint()
138 - points0[meshPoints[i]];
146 Pout<<
" point:" << meshPoints[i]
147 <<
" coord:" << localPoints[i]
148 <<
" did not find any surface within " << projectLen
186 offset[i] = start[i][wedgePlane_];
187 start[i][wedgePlane_] = 0;
188 projectVecs[i][wedgePlane_] = 0;
219 if (zonePtr && (zonePtr->
whichPoint(meshPoints[i]) >= 0))
222 displacement[i] = points0[meshPoints[i]] - localPoints[i];
224 else if (nearest[i].hit())
228 nearest[i].hitPoint()
229 - points0[meshPoints[i]];
235 if (rightHit[i].hit())
237 if (leftHit[i].hit())
241 magSqr(rightHit[i].hitPoint()-start[i])
242 <
magSqr(leftHit[i].hitPoint()-start[i])
245 interPt = rightHit[i];
249 interPt = leftHit[i];
254 interPt = rightHit[i];
259 if (leftHit[i].hit())
261 interPt = leftHit[i];
270 interPt.
rawPoint()[wedgePlane_] += offset[i];
272 displacement[i] = interPt.
rawPoint()-points0[meshPoints[i]];
280 Pout<<
" point:" << meshPoints[i]
281 <<
" coord:" << localPoints[i]
282 <<
" did not find any intersection between" 283 <<
" ray from " << start[i]-projectVecs[i]
284 <<
" to " << start[i]+projectVecs[i] <<
endl;
293 if (nNotProjected > 0)
295 Info<<
"surfaceSlipDisplacement :" 297 <<
" did not project " << nNotProjected
299 <<
" points." <<
endl;
329 surfacesDict_(dict.
subDict(
"geometry")),
330 projectMode_(projectModeNames_.
read(dict.
lookup(
"projectMode"))),
331 projectDir_(dict.
lookup(
"projectDirection")),
347 surfacesDict_(ppf.surfacesDict_),
348 projectMode_(ppf.projectMode_),
349 projectDir_(ppf.projectDir_),
350 wedgePlane_(ppf.wedgePlane_),
351 frozenPointsZone_(ppf.frozenPointsZone_)
363 surfacesDict_(ppf.surfacesDict_),
364 projectMode_(ppf.projectMode_),
365 projectDir_(ppf.projectDir_),
366 wedgePlane_(ppf.wedgePlane_),
367 frozenPointsZone_(ppf.frozenPointsZone_)
376 if (surfacesPtr_.empty())
385 db().time().constant(),
396 return surfacesPtr_();
408 calcProjection(displacement);
424 writeEntry(os,
"projectMode", projectModeNames_[projectMode_]);
425 writeEntry(os,
"projectDirection", projectDir_);
429 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.
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.
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 point defining 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...
void setInternalField(Field< Type1 > &iF, const Field< Type1 > &pF, const labelList &meshPoints) const
Given the internal field and a patch field,.
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 point defining 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.