56 "extendedFeatureEdgeMesh",
68 Info<<
"Reading edgeMesh from " << extFeatObj.objectRelPath() <<
endl;
87 Info<<
"Reading edgeMesh from " << featObj.objectRelPath() <<
endl;
93 <<
"Could not open " << featObj.objectPath()
104 void Foam::edgeSlipDisplacementPointPatchVectorField::calcProjection
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
184 reduce(nNotProjected, sumOp<label>());
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)
360 Field<vector>& iF =
const_cast<Field<vector>&
>(this->primitiveField());
362 setInInternalField(iF, (currentDisplacement+offset)());
393 edgeSlipDisplacementPointPatchVectorField
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
A class for handling keywords in dictionaries.
void size(const label n)
Older name for setAddressableSize.
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...
A class for handling file names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
const pointPatch & patch() const noexcept
Return the patch.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Type gMin(const FieldField< Field, Type > &f)
void inflate(const scalar factor)
Expand box by factor*mag(span) in all dimensions.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface...
Foam::pointPatchFieldMapper.
Ostream & endl(Ostream &os)
Add newline and flush stream.
PointIndexHit< point > pointIndexHit
A PointIndexHit with a 3D point.
Holds data for octree to work on an edges subset.
virtual void write(Ostream &os) const
Write.
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
Ignore writing from objectRegistry::writeObject()
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Macros for easy insertion into run-time selection tables.
void reduce(T &value, [[maybe_unused]] BinaryOp bop, [[maybe_unused]] const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce)
virtual const pointField & points() const
Return raw points.
#define forAll(list, i)
Loop across all elements in list.
Type gMaxMagSqr(const UList< Type > &f, const label comm)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
vectorField pointField
pointField is a vectorField.
const dimensionedScalar e
Elementary charge.
A class for handling words, derived from Foam::string.
const Time & time() const noexcept
Return time registry.
scalar mag() const
The magnitude/length of the bounding box diagonal.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Tree tree(triangles.begin(), triangles.end())
edgeSlipDisplacementPointPatchVectorField(const pointPatch &, const DimensionedField< vector, pointMesh > &)
Construct from patch and internal field.
static const word null
An empty word.
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.
static bool canRead(const fileName &name, bool verbose=false)
Can we read this file format?
label whichPoint(const label globalPointID) const
Helper function to re-direct to zone::localID(...)
static void read(const objectRegistry &obr, const dictionary &dict)
Read (& store) geometry. Exposed so point attraction can reuse it.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Ostream & writeEntryIfDifferent(const word &key, const T &value1, const T &value2)
Write a keyword/value entry only when the two values differ.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
const word & constant() const noexcept
Return constant name.
int debug
Static debugging option.
Type gAverage(const FieldField< Field, Type > &f, const label comm)
The global arithmetic average of a FieldField.
OBJstream os(runTime.globalPath()/outputName)
Mesh data needed to do the Finite Area discretisation.
pointPatchField< vector > pointPatchVectorField
const indexedOctree< treeDataEdge > & edgeTree() const
const pointZoneMesh & pointZones() const noexcept
Return point zone mesh.
pointField points0(pointIOField(IOobject("points", mesh.time().constant(), polyMesh::meshSubDir, mesh, IOobject::MUST_READ, IOobject::NO_WRITE, IOobject::NO_REGISTER)))
vector point
Point is a vector.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Basic pointPatch represents a set of points from the mesh.
virtual void write(Ostream &) const
Write.
const word & name() const noexcept
The zone name.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const std::string patch
OpenFOAM patch number as a std::string.
Standard boundBox with extra functionality for use in octree.
messageStream Info
Information stream (stdout output on master, null elsewhere)
makePointPatchTypeField(pointPatchVectorField, solidBodyMotionDisplacementPointPatchVectorField)
const boundBox & bounds() const noexcept
Return mesh bounding box.
Field< vector > vectorField
Specialisation of Field<T> for vector.
bool foundObject(const word &name, const bool recursive=false) const
Is the named Type found?
Mesh consisting of general polyhedral cells.
Displacement follows an edgeMesh. Use in a displacementMotionSolver as a bc on the pointDisplacement ...
Registry of regIOobjects.
Defines the attributes of an object for which implicit objectRegistry management is supported...
Request registration (bool: true)
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
IOporosityModelList pZones(mesh)
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
static constexpr const zero Zero
Global zero (0)