Go to the documentation of this file.
43 displacementInterpolationMotionSolver,
49 displacementMotionSolver,
50 displacementInterpolationMotionSolver,
55 const word IOList<Tuple2<scalar, vector> >::typeName(
"scalarVectorTable");
78 const word& zoneName = faceZoneToTable[i][0];
84 <<
"Cannot find zone " << zoneName <<
endl
85 <<
"Valid zones are " << fZones.
names()
89 const word& tableName = faceZoneToTable[i][1];
111 times_[zoneI][j] = table[j].first();
127 forAll(faceZoneToTable, i)
129 const word& zoneName = faceZoneToTable[i][0];
130 const faceZone& fz = fZones[zoneName];
132 scalar minCoord = VGREAT;
133 scalar maxCoord = -VGREAT;
135 forAll(fz().meshPoints(), localI)
137 label pointI = fz().meshPoints()[localI];
138 const scalar coord =
points0()[pointI][dir];
139 minCoord =
min(minCoord, coord);
140 maxCoord =
max(maxCoord, coord);
148 Pout<<
"direction " << dir <<
" : "
149 <<
"zone " << zoneName
150 <<
" ranges from coordinate " << zoneCoordinates[2*i]
151 <<
" to " << zoneCoordinates[2*i+1]
155 zoneCoordinates.
sort();
158 zoneCoordinates[0] -= SMALL;
159 zoneCoordinates.last() += SMALL;
164 scalar minCoord =
gMin(meshCoords);
165 scalar maxCoord =
gMax(meshCoords);
169 Pout<<
"direction " << dir <<
" : "
170 <<
"mesh ranges from coordinate " << minCoord <<
" to "
183 rangeZone.
setSize(zoneCoordinates.size());
186 if (minCoord < zoneCoordinates[0])
189 rangeToCoord.setSize(sz+1);
191 rangeToCoord[rangeI] = minCoord-SMALL;
192 rangeZone[rangeI] = -1;
196 Pout<<
"direction " << dir <<
" : "
197 <<
"range " << rangeI <<
" at coordinate "
198 << rangeToCoord[rangeI] <<
" from min of mesh "
199 << rangeZone[rangeI] <<
endl;
203 forAll(zoneCoordinates, i)
205 rangeToCoord[rangeI] = zoneCoordinates[i];
206 rangeZone[rangeI] = zoneCoordinates.
indices()[i]/2;
210 Pout<<
"direction " << dir <<
" : "
211 <<
"range " << rangeI <<
" at coordinate "
212 << rangeToCoord[rangeI]
213 <<
" from zone " << rangeZone[rangeI] <<
endl;
217 if (maxCoord > zoneCoordinates.last())
219 label sz = rangeToCoord.size();
220 rangeToCoord.setSize(sz+1);
222 rangeToCoord[sz] = maxCoord+SMALL;
227 Pout<<
"direction " << dir <<
" : "
228 <<
"range " << rangeI <<
" at coordinate "
229 << rangeToCoord[sz] <<
" from max of mesh "
230 << rangeZone[sz] <<
endl;
239 labelList nRangePoints(rangeToCoord.size(), 0);
241 forAll(meshCoords, pointI)
245 if (rangeI == -1 || rangeI == rangeToCoord.size()-1)
248 <<
"Did not find point " <<
points0()[pointI]
249 <<
" coordinate " << meshCoords[pointI]
250 <<
" in ranges " << rangeToCoord
253 nRangePoints[rangeI]++;
258 for (
label rangeI = 0; rangeI < rangeToCoord.size()-1; rangeI++)
261 Pout<<
"direction " << dir <<
" : "
262 <<
"range from " << rangeToCoord[rangeI]
263 <<
" to " << rangeToCoord[rangeI+1]
264 <<
" contains " << nRangePoints[rangeI]
265 <<
" points." <<
endl;
272 forAll(rangePoints, rangeI)
274 rangePoints[rangeI].
setSize(nRangePoints[rangeI]);
275 rangeWeights[rangeI].
setSize(nRangePoints[rangeI]);
278 forAll(meshCoords, pointI)
282 rangePoints[rangeI][
nPoints] = pointI;
283 rangeWeights[rangeI][
nPoints] =
284 (meshCoords[pointI]-rangeToCoord[rangeI])
285 / (rangeToCoord[rangeI+1]-rangeToCoord[rangeI]);
337 <<
"The number of points in the mesh seems to have changed." <<
endl
338 <<
"In constant/polyMesh there are " << points0().size()
339 <<
" points; in the current mesh there are " <<
mesh().
nPoints()
350 if (times_[zoneI].size())
354 mesh().time().value(),
356 displacements_[zoneI]
362 Pout<<
"Zone displacements:" << zoneDisp <<
endl;
369 const labelList& rangeZone = rangeToZone_[dir];
373 for (
label rangeI = 0; rangeI < rangeZone.
size()-1; rangeI++)
375 const labelList& rPoints = rangePoints[rangeI];
376 const scalarField& rWeights = rangeWeights[rangeI];
379 label minZoneI = rangeZone[rangeI];
382 scalar minDisp = (minZoneI == -1 ? 0.0 : zoneDisp[minZoneI][dir]);
383 label maxZoneI = rangeZone[rangeI+1];
386 scalar maxDisp = (maxZoneI == -1 ? 0.0 : zoneDisp[maxZoneI][dir]);
390 label pointI = rPoints[i];
391 scalar
w = rWeights[i];
393 curPoints[pointI][dir] += (1.0-
w)*minDisp+
w*maxDisp;
vectorField pointField
pointField is a vectorField.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
volScalarField w(IOobject("w", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE), mesh, dimensionedScalar("w", dimensionSet(0, 0, 0, 0, 0, 0, 0), 0.0))
A class for handling words, derived from string.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
void sort()
(stable) sort the list (if changed after construction time)
#define forAll(list, i)
Loop across all elements in list.
A class for managing temporary objects.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
List< vectorField > displacements_
Interpolation table. From faceZone to displacements.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
List< scalarField > times_
Interpolation table. From faceZone to times.
@ nComponents
Number of components in this vector space.
FixedList< labelListList, 3 > rangeToPoints_
Per direction, per range the points that are in it.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const Time & time() const
Return time.
Field< Type > interpolateXY(const scalarField &xNew, const scalarField &xOld, const Field< Type > &yOld)
Mesh consisting of general polyhedral cells.
Constant dispersed-phase particle diameter model.
FixedList< List< scalarField >, 3 > rangeToWeights_
Per direction, per range the weight of the points relative.
const faceZoneMesh & faceZones() const
Return face zone mesh.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
A subset of mesh faces organised as a primitive patch.
virtual tmp< pointField > curPoints() const
Return point location obtained from the current motion field.
Interpolates y values from one curve to another with a different x distribution.
label findLower(const ListType &, typename ListType::const_reference, const label start, const BinaryOp &bop)
Find last element < given value in sorted list and return index,.
void calcInterpolation()
Read settings.
const dictionary & coeffDict() const
Const access to the coefficients dictionary.
Virtual base class for displacement motion solver.
A list that is sorted upon construction or when explicitly requested with the sort() method.
Macros for easy insertion into run-time selection tables.
errorManip< error > abort(error &err)
label findZoneID(const word &zoneName) const
Find zone index given a name.
wordList names() const
Return a list of zone names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
pointField & points0()
Return reference to the reference field.
void setSize(const label)
Reset size of List.
FixedList< labelList, 3 > rangeToZone_
Per direction, per range the index of the lower.
~displacementInterpolationMotionSolver()
Destructor.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
prefixOSstream Pout(cout, "Pout")
displacementInterpolationMotionSolver(const displacementInterpolationMotionSolver &)
Disallow default bitwise copy construct.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A List of objects of type <T> with automated input and output.
const polyMesh & mesh() const
Return reference to mesh.
const labelList & indices() const
Return the list of sorted indices. Updated every sort.
void size(const label)
Override size to be inconsistent with allocated storage.
Type gMin(const FieldField< Field, Type > &f)
Generic GeometricField class.
defineTypeNameAndDebug(combustionModel, 0)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
Type gMax(const FieldField< Field, Type > &f)