42 const twoDPointCorrector* correct2DPtr
49 const vector& normal = correct2DPtr->planeNormal();
71 Foam::edgeStats::edgeStats(
const polyMesh& mesh)
79 mesh.time().constant(),
85 if (motionObj.headerOk())
87 Info<<
"Reading " << mesh.time().constant() /
"motionProperties" 90 IOdictionary motionProperties(motionObj);
92 Switch twoDMotion(motionProperties.lookup(
"twoDMotion"));
96 Info<<
"Correcting for 2D motion" << endl <<
endl;
98 autoPtr<twoDPointCorrector> correct2DPtr
100 new twoDPointCorrector(mesh)
103 normalDir_ = getNormalDir(&correct2DPtr());
110 Foam::edgeStats::edgeStats
112 const polyMesh& mesh,
113 const twoDPointCorrector* correct2DPtr
117 normalDir_(getNormalDir(correct2DPtr))
130 scalar maxX = -GREAT;
134 scalar maxY = -GREAT;
138 scalar maxZ = -GREAT;
141 scalar minOther = GREAT;
142 scalar maxOther = -GREAT;
148 const edge& e = edges[edgeI];
152 scalar eMag =
mag(eVec);
156 if (
mag(eVec & x) > 1-edgeTol_)
158 minX =
min(minX, eMag);
159 maxX =
max(maxX, eMag);
162 else if (
mag(eVec & y) > 1-edgeTol_)
164 minY =
min(minY, eMag);
165 maxY =
max(maxY, eMag);
168 else if (
mag(eVec & z) > 1-edgeTol_)
170 minZ =
min(minZ, eMag);
171 maxZ =
max(maxZ, eMag);
176 minOther =
min(minOther, eMag);
177 maxOther =
max(maxOther, eMag);
181 os <<
"Mesh bounding box:" << boundBox(mesh_.
points()) <<
nl <<
nl 182 <<
"Mesh edge statistics:" <<
nl 183 <<
" x aligned : number:" << nX <<
"\tminLen:" << minX
184 <<
"\tmaxLen:" << maxX <<
nl 185 <<
" y aligned : number:" << nY <<
"\tminLen:" << minY
186 <<
"\tmaxLen:" << maxY <<
nl 187 <<
" z aligned : number:" << nZ <<
"\tminLen:" << minZ
188 <<
"\tmaxLen:" << maxZ <<
nl 189 <<
" other : number:" << mesh_.
nEdges() - nX - nY - nZ
190 <<
"\tminLen:" << minOther
191 <<
"\tmaxLen:" << maxOther <<
nl <<
endl;
195 return min(minY,
min(minZ, minOther));
197 else if (normalDir_ == 1)
199 return min(minX,
min(minZ, minOther));
201 else if (normalDir_ == 2)
203 return min(minX,
min(minY, minOther));
207 return min(minX,
min(minY,
min(minZ, minOther)));
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
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.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
scalar minLen(Ostream &os) const
Calculate minimum edge length and print.
dimensioned< scalar > mag(const dimensioned< Type > &)