BlockMesh: Implicit initialization of member overwrites previous initialization
in src/mesh/blockMesh/blockEdges/arcEdge/arcEdge.H the members are declared in the following order:
point p1_, p2_, p3_;
cylindricalCS cs_;
scalar angle_;
scalar radius_;
in the constructor calcAngle() is called which sets angle_ and radius_. If scalar is anything but a primitive type the default constructor of angle_ and radius_ will be called after calcAngle returns, thus overwriting its results.
Foam::blockEdges::arcEdge::arcEdge
(
const pointField& points,
const label start,
const label end,
const point& pMid
)
:
blockEdge(points, start, end),
p1_(points_[start_]),
p2_(pMid),
p3_(points_[end_]),
cs_(calcAngle())
{}
The easy fix is to switch the declaration of the members in the.H file. The more sane fix probably is to not alter any member variables before initialization is done.
Edited by Admin