56 "extendedFeatureEdgeMesh",
104void Foam::edgeSlipDisplacementPointPatchVectorField::calcProjection
110 const labelList& meshPoints = patch().meshPoints();
118 const scalar projectLen =
mesh.bounds().mag();
125 if (frozenPointsZone_.size() > 0)
129 zonePtr = &
pZones[frozenPointsZone_];
131 Info<<
"edgeSlipDisplacementPointPatchVectorField : Fixing all "
132 << zonePtr->
size() <<
" points in pointZone " << zonePtr->
name()
146 start[i] =
points0[meshPoints[i]] + displacement[i];
149 const auto&
tree = edgeTree();
151 label nNotProjected = 0;
154 const label meshPointi = meshPoints[i];
157 if (zonePtr && (zonePtr->
whichPoint(meshPointi) >= 0))
160 displacement[i] =
points0[meshPointi] - pt;
167 displacement[i] = nearest.point() -
points0[meshPointi];
175 Pout<<
" point:" << meshPointi
177 <<
" did not find any surface within " << projectLen
186 if (nNotProjected > 0)
188 Info<<
"edgeSlipDisplacement :"
189 <<
" on patch " <<
patch().name()
190 <<
" did not project " << nNotProjected
192 <<
" points." <<
endl;
222 frozenPointsZone_(
dict.getOrDefault(
"frozenPointsZone",
word::null))
238 velocity_(ppf.velocity_),
239 featFileName_(ppf.featFileName_),
240 frozenPointsZone_(ppf.frozenPointsZone_)
251 velocity_(ppf.velocity_),
252 featFileName_(ppf.featFileName_),
253 frozenPointsZone_(ppf.frozenPointsZone_)
265 velocity_(ppf.velocity_),
266 featFileName_(ppf.featFileName_),
267 frozenPointsZone_(ppf.frozenPointsZone_)
278 const Time& tm = this->
patch().boundaryMesh().mesh().time();
282 const edgeList& edges = eMesh.edges();
308 return edgeTreePtr_();
319 const vectorField currentDisplacement(this->patchInternalField());
323 calcProjection(displacement);
327 vectorField offset(displacement-currentDisplacement);
331 const Time& tm = this->patch().boundaryMesh().mesh().time();
332 const scalar deltaT = tm.deltaTValue();
333 const vector clipVelocity = velocity_*deltaT;
339 const scalar magD(
mag(d));
340 if (magD > ROOTVSMALL)
343 d *=
min(magD,
mag(clipVelocity));
350 <<
" on patch " <<
patch().name()
351 <<
" of field " << this->internalField().name()
353 <<
" min:" <<
gMin(displacement)
355 <<
" average:" <<
gAverage(displacement)
362 setInInternalField(iF, (currentDisplacement+offset)());
374 os.writeEntry(
"file", featFileName_);
375 os.writeEntryIfDifferent<
word>
381 os.writeEntry(
"velocity", velocity_);
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
@ REGISTER
Request registration (bool: true).
@ MUST_READ
Reading required.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
fileName typeFilePath(const bool search=true) const
Call localFilePath or globalFilePath for given type depending on its is_globalIOobject trait.
fileName objectRelPath() const
The object path relative to the case.
fileName objectPath() const
The complete path + object name.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
const word & constant() const noexcept
Return constant name.
scalar deltaTValue() const noexcept
Return time step value.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
void size(const label n)
Older name for setAddressableSize.
void inflate(const scalar factor)
Expand box by factor*mag(span) in all dimensions.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Mesh data needed to do the Finite Area discretisation.
Displacement follows an edgeMesh. Use in a displacementMotionSolver as a bc on the pointDisplacement ...
virtual void write(Ostream &) const
Write.
const indexedOctree< treeDataEdge > & edgeTree() const
static void read(const objectRegistry &obr, const dictionary &dict)
Read (& store) geometry. Exposed so point attraction can reuse it.
edgeSlipDisplacementPointPatchVectorField(const pointPatch &, const DimensionedField< vector, pointMesh > &)
Construct from patch and internal field.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
static bool canRead(const fileName &name, bool verbose=false)
Can we read this file format?
A class for handling file names.
Non-pointer based hierarchical recursive searching.
A class for handling keywords in dictionaries.
Registry of regIOobjects.
bool foundObject(const word &name, const bool recursive=false) const
Contains the named Type?
const Time & time() const noexcept
Return time registry.
const Type & lookupObject(const word &name, const bool recursive=false) const
Lookup and return const reference to the object of the given Type. Fatal if not found or the wrong ty...
const pointPatch & patch() const noexcept
Return the patch.
bool updated() const noexcept
True if the boundary condition has already been updated.
Foam::pointPatchFieldMapper.
void patchInternalField(const UList< Type1 > &internalData, const labelUList &addressing, UList< Type1 > &pfld) const
void setInInternalField(Field< Type1 > &iF, const Field< Type1 > &pF, const labelUList &meshPoints) const
const Field< vector > & primitiveField() const noexcept
virtual void write(Ostream &os) const
Write.
virtual void updateCoeffs()
const DimensionedField< vector, pointMesh > & internalField() const noexcept
Basic pointPatch represents a set of points from the mesh.
label whichPoint(const label meshPointID) const
The local index of the given mesh point, -1 if not in the zone.
Mesh consisting of general polyhedral cells.
virtual const pointField & points() const
Return raw points.
Standard boundBox with extra functionality for use in octree.
Holds data for octree to work on an edges subset.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
A class for handling words, derived from Foam::string.
static const word null
An empty word.
const word & name() const noexcept
The zone name.
IOporosityModelList pZones(mesh)
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
OBJstream os(runTime.globalPath()/outputName)
Namespace for handling debugging switches.
const std::string patch
OpenFOAM patch number as a std::string.
List< edge > edgeList
List of edge.
Type gAverage(const FieldField< Field, Type > &f, const label comm)
The global arithmetic average of a FieldField.
ZoneMesh< pointZone, polyMesh > pointZoneMesh
A ZoneMesh with pointZone content on a polyMesh.
bool read(const char *buf, int32_t &val)
Same as readInt32.
List< label > labelList
A List of labels.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
messageStream Info
Information stream (stdout output on master, null elsewhere).
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
T returnReduce(const T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
Type gMaxMagSqr(const UList< Type > &f, const label comm)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
void reduce(T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce).
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Field< vector > vectorField
Specialisation of Field<T> for vector.
pointPatchField< vector > pointPatchVectorField
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
vector point
Point is a vector.
static constexpr const zero Zero
Global zero (0).
Type gMin(const FieldField< Field, Type > &f)
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
vectorField pointField
pointField is a vectorField.
PointIndexHit< point > pointIndexHit
A PointIndexHit with a 3D point.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define makePointPatchTypeField(PatchTypeField, typePatchTypeField)
Define a concrete pointPatchField type and add to run-time tables Example, (pointPatchScalarField,...
Tree tree(triangles.begin(), triangles.end())
#define forAll(list, i)
Loop across all elements in list.
pointField points0(pointIOField(IOobject("points", mesh.time().constant(), polyMesh::meshSubDir, mesh, IOobject::MUST_READ, IOobject::NO_WRITE, IOobject::NO_REGISTER)))