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