sampledCuttingPlane: Rationalized
This commit is contained in:
parent
939376a844
commit
c224d19c83
@ -71,13 +71,11 @@ void Foam::sampledCuttingPlane::createGeometry()
|
||||
// Patch to put exposed internal faces into
|
||||
const label exposedPatchi = patches.findPatchID(exposedPatchName_);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Allocating subset of size "
|
||||
<< mesh().cellZones()[zoneID_.index()].size()
|
||||
<< " with exposed faces into patch "
|
||||
<< patches[exposedPatchi].name() << endl;
|
||||
}
|
||||
DebugInfo
|
||||
<< "Allocating subset of size "
|
||||
<< mesh().cellZones()[zoneID_.index()].size()
|
||||
<< " with exposed faces into patch "
|
||||
<< patches[exposedPatchi].name() << endl;
|
||||
|
||||
subMeshPtr_.reset
|
||||
(
|
||||
@ -92,11 +90,11 @@ void Foam::sampledCuttingPlane::createGeometry()
|
||||
|
||||
|
||||
// Select either the submesh or the underlying mesh
|
||||
const fvMesh& fvm =
|
||||
const fvMesh& mesh =
|
||||
(
|
||||
subMeshPtr_.valid()
|
||||
? subMeshPtr_().subMesh()
|
||||
: static_cast<const fvMesh&>(mesh())
|
||||
: static_cast<const fvMesh&>(this->mesh())
|
||||
);
|
||||
|
||||
|
||||
@ -110,13 +108,13 @@ void Foam::sampledCuttingPlane::createGeometry()
|
||||
IOobject
|
||||
(
|
||||
"cellDistance",
|
||||
fvm.time().timeName(),
|
||||
fvm.time(),
|
||||
mesh.time().timeName(),
|
||||
mesh.time(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
fvm,
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimLength, 0)
|
||||
)
|
||||
);
|
||||
@ -124,7 +122,7 @@ void Foam::sampledCuttingPlane::createGeometry()
|
||||
|
||||
// Internal field
|
||||
{
|
||||
const pointField& cc = fvm.cellCentres();
|
||||
const pointField& cc = mesh.cellCentres();
|
||||
scalarField& fld = cellDistance.primitiveFieldRef();
|
||||
|
||||
forAll(cc, i)
|
||||
@ -154,13 +152,13 @@ void Foam::sampledCuttingPlane::createGeometry()
|
||||
patchi,
|
||||
new calculatedFvPatchScalarField
|
||||
(
|
||||
fvm.boundary()[patchi],
|
||||
mesh.boundary()[patchi],
|
||||
cellDistance
|
||||
)
|
||||
);
|
||||
|
||||
const polyPatch& pp = fvm.boundary()[patchi].patch();
|
||||
pointField::subField cc = pp.patchSlice(fvm.faceCentres());
|
||||
const polyPatch& pp = mesh.boundary()[patchi].patch();
|
||||
pointField::subField cc = pp.patchSlice(mesh.faceCentres());
|
||||
|
||||
fvPatchScalarField& fld = cellDistanceBf[patchi];
|
||||
fld.setSize(pp.size());
|
||||
@ -171,7 +169,7 @@ void Foam::sampledCuttingPlane::createGeometry()
|
||||
}
|
||||
else
|
||||
{
|
||||
const pointField& cc = fvm.C().boundaryField()[patchi];
|
||||
const pointField& cc = mesh.C().boundaryField()[patchi];
|
||||
fvPatchScalarField& fld = cellDistanceBf[patchi];
|
||||
|
||||
forAll(fld, i)
|
||||
@ -188,9 +186,9 @@ void Foam::sampledCuttingPlane::createGeometry()
|
||||
|
||||
|
||||
// Distance to points
|
||||
pointDistance_.setSize(fvm.nPoints());
|
||||
pointDistance_.setSize(mesh.nPoints());
|
||||
{
|
||||
const pointField& pts = fvm.points();
|
||||
const pointField& pts = mesh.points();
|
||||
|
||||
forAll(pointDistance_, i)
|
||||
{
|
||||
@ -208,13 +206,13 @@ void Foam::sampledCuttingPlane::createGeometry()
|
||||
IOobject
|
||||
(
|
||||
"pointDistance",
|
||||
fvm.time().timeName(),
|
||||
fvm.time(),
|
||||
mesh.time().timeName(),
|
||||
mesh.time(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
pointMesh::New(fvm),
|
||||
pointMesh::New(mesh),
|
||||
dimensionedScalar("zero", dimLength, 0)
|
||||
);
|
||||
pDist.primitiveFieldRef() = pointDistance_;
|
||||
@ -237,7 +235,7 @@ void Foam::sampledCuttingPlane::createGeometry()
|
||||
)
|
||||
//new isoSurfaceCell
|
||||
//(
|
||||
// fvm,
|
||||
// mesh,
|
||||
// cellDistance,
|
||||
// pointDistance_,
|
||||
// 0.0,
|
||||
@ -328,7 +326,7 @@ bool Foam::sampledCuttingPlane::expire()
|
||||
// Clear derived data
|
||||
clearGeom();
|
||||
|
||||
// already marked as expired
|
||||
// Already marked as expired
|
||||
if (needsUpdate_)
|
||||
{
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user