45 const twoDPointCorrector* correct2DPtr
52 const vector& normal = correct2DPtr->planeNormal();
73 Foam::edgeStats::edgeStats(
const polyMesh&
mesh)
81 mesh.time().constant(),
87 if (motionObj.typeHeaderOk<IOdictionary>(
true))
89 Info<<
"Reading " <<
mesh.time().constant() /
"motionProperties" 92 IOdictionary motionProperties(motionObj);
94 if (motionProperties.get<
bool>(
"twoDMotion"))
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;
144 const edgeList& edges = mesh_.edges();
146 for (
const edge&
e : edges)
148 vector eVec(
e.vec(mesh_.points()));
150 scalar eMag =
mag(eVec);
154 if (
mag(eVec &
x) > 1-edgeTol_)
156 minX =
min(minX, eMag);
157 maxX =
max(maxX, eMag);
160 else if (
mag(eVec &
y) > 1-edgeTol_)
162 minY =
min(minY, eMag);
163 maxY =
max(maxY, eMag);
166 else if (
mag(eVec & z) > 1-edgeTol_)
168 minZ =
min(minZ, eMag);
169 maxZ =
max(maxZ, eMag);
174 minOther =
min(minOther, eMag);
175 maxOther =
max(maxOther, eMag);
179 os <<
"Mesh bounding box:" << boundBox(mesh_.points()) <<
nl <<
nl 180 <<
"Mesh edge statistics:" <<
nl 181 <<
" x aligned : number:" << nX <<
"\tminLen:" << minX
182 <<
"\tmaxLen:" << maxX <<
nl 183 <<
" y aligned : number:" << nY <<
"\tminLen:" << minY
184 <<
"\tmaxLen:" << maxY <<
nl 185 <<
" z aligned : number:" << nZ <<
"\tminLen:" << minZ
186 <<
"\tmaxLen:" << maxZ <<
nl 187 <<
" other : number:" << mesh_.nEdges() - nX - nY - nZ
188 <<
"\tminLen:" << minOther
189 <<
"\tmaxLen:" << maxOther <<
nl <<
endl;
193 return min(minY,
min(minZ, minOther));
195 else if (normalDir_ == 1)
197 return min(minX,
min(minZ, minOther));
199 else if (normalDir_ == 2)
201 return min(minX,
min(minY, minOther));
205 return min(minX,
min(minY,
min(minZ, minOther)));
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
List< edge > edgeList
List of edge.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Ignore writing from objectRegistry::writeObject()
static const scalar edgeTol_
const dimensionedScalar e
Elementary charge.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
OBJstream os(runTime.globalPath()/outputName)
messageStream Info
Information stream (stdout output on master, null elsewhere)
scalar minLen(Ostream &os) const
Calculate minimum edge length and print.