43 const twoDPointCorrector* correct2DPtr
50 const vector& normal = correct2DPtr->planeNormal();
77 typeIOobject<IOdictionary> motionObj
80 mesh.time().constant(),
86 if (motionObj.headerOk())
88 Info<<
"Reading " << mesh.time().constant() /
"motionProperties" 91 IOdictionary motionProperties(motionObj);
93 Switch twoDMotion(motionProperties.lookup(
"twoDMotion"));
97 Info<<
"Correcting for 2D motion" << endl <<
endl;
99 autoPtr<twoDPointCorrector> correct2DPtr
101 new twoDPointCorrector(mesh)
104 normalDir_ = getNormalDir(&correct2DPtr());
113 const polyMesh& mesh,
114 const twoDPointCorrector* correct2DPtr
118 normalDir_(getNormalDir(correct2DPtr))
131 scalar maxX = -great;
135 scalar maxY = -great;
139 scalar maxZ = -great;
142 scalar minOther = great;
143 scalar maxOther = -great;
149 const edge& e = edges[edgeI];
153 scalar eMag =
mag(eVec);
157 if (
mag(eVec & x) > 1-edgeTol_)
159 minX =
min(minX, eMag);
160 maxX =
max(maxX, eMag);
163 else if (
mag(eVec & y) > 1-edgeTol_)
165 minY =
min(minY, eMag);
166 maxY =
max(maxY, eMag);
169 else if (
mag(eVec & z) > 1-edgeTol_)
171 minZ =
min(minZ, eMag);
172 maxZ =
max(maxZ, eMag);
177 minOther =
min(minOther, eMag);
178 maxOther =
max(maxOther, eMag);
182 os <<
"Mesh bounding box:" << boundBox(mesh_.
points()) <<
nl <<
nl 183 <<
"Mesh edge statistics:" <<
nl 184 <<
" x aligned : number:" << nX <<
"\tminLen:" << minX
185 <<
"\tmaxLen:" << maxX <<
nl 186 <<
" y aligned : number:" << nY <<
"\tminLen:" << minY
187 <<
"\tmaxLen:" << maxY <<
nl 188 <<
" z aligned : number:" << nZ <<
"\tminLen:" << minZ
189 <<
"\tmaxLen:" << maxZ <<
nl 190 <<
" other : number:" << mesh_.
nEdges() - nX - nY - nZ
191 <<
"\tminLen:" << minOther
192 <<
"\tmaxLen:" << maxOther <<
nl <<
endl;
196 return min(minY,
min(minZ, minOther));
198 else if (normalDir_ == 1)
200 return min(minX,
min(minZ, minOther));
202 else if (normalDir_ == 2)
204 return min(minX,
min(minY, minOther));
208 return min(minX,
min(minY,
min(minZ, minOther)));
#define forAll(list, i)
Loop across all elements in list.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
edgeStats(const polyMesh &mesh)
Construct from mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Vector< scalar > vector
A scalar version of the templated Vector.
static const scalar edgeTol_
virtual const pointField & points() const
Return raw points.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
dimensioned< scalar > mag(const dimensioned< Type > &)
scalar minLen(Ostream &os) const
Calculate minimum edge length and print.