void Foam::fluidStructureInterface::calcFluid2ToSolidInterpolator() const
{
// Find global face zones
if (fluid2ToSolidPtr_)
{
FatalErrorIn
(
"void fluidStructureInterface::"
"calcFluid2ToSolidInterpolator() const"
)
<< "Fluid2 to solid interpolator already exists"
<< abort(FatalError);
}
fluid2ToSolidPtr_ =
new zoneToZoneInterpolation
(
fluidMesh2().faceZones()[fluid2ZoneIndex_](),
solidMesh().faceZones()[solidZoneIndex_](),
intersection::VISIBLE
);
Info << "Checking fluid2-to-solid interpolator" << endl;
{
vectorField fluid2PatchFaceCentres =
vectorField
(
fluidMesh2().boundaryMesh()[fluid2PatchIndex_].faceCentres()
);
vectorField fluid2ZoneFaceCentres
(
fluidMesh2().faceZones()[fluid2ZoneIndex_].size(),
vector::zero
);
const label fluid2PatchStart =
fluidMesh2().boundaryMesh()[fluid2PatchIndex_].start();
forAll (fluid2PatchFaceCentres, i)
{
fluid2ZoneFaceCentres
[
fluidMesh2().faceZones()[fluid2ZoneIndex_].whichFace
(
fluid2PatchStart + i
)
] =
fluid2PatchFaceCentres[i];
}
// Parallel data exchange: collect faceCentres field on all processors
reduce(fluid2ZoneFaceCentres, sumOp<vectorField>());
vectorField solidZoneFaceCentres =
fluid2ToSolidPtr_->faceInterpolate
(
fluid2ZoneFaceCentres
);
vectorField solidPatchFaceCentres
(
solidMesh().boundaryMesh()[solidPatchIndex_].size(),
vector::zero
);
const label solidPatchStart =
solidMesh().boundaryMesh()[solidPatchIndex_].start();
forAll(solidPatchFaceCentres, i)
{
solidPatchFaceCentres[i] =
solidZoneFaceCentres
[
solidMesh().faceZones()[solidZoneIndex_]
.whichFace(solidPatchStart + i)
];
}
scalar maxDist = gMax
(
mag
(
solidPatchFaceCentres
- solidMesh().boundaryMesh()[solidPatchIndex_].faceCentres()
)
);
Info << "Fluid2-to-solid face interpolation error: " << maxDist
<< endl;
}
}
这是我复制流体一其中的一个私有成员函数,我认为这个函数是有必要加的,
fluidMesh2().boundaryMesh()[fluid2PatchIndex_].faceCentres()
,
类似这样的长句有些看不懂