mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
cuttingPlane constructor with plane/mesh instead of mesh/plane
This commit is contained in:
@ -341,11 +341,11 @@ Foam::cuttingPlane::cuttingPlane(const plane& pln)
|
||||
{}
|
||||
|
||||
|
||||
// Construct from mesh reference and plane, restricted to a list of cells
|
||||
// Construct from plane and mesh reference, restricted to a list of cells
|
||||
Foam::cuttingPlane::cuttingPlane
|
||||
(
|
||||
const primitiveMesh& mesh,
|
||||
const plane& pln,
|
||||
const primitiveMesh& mesh,
|
||||
const UList<label>& cellIdLabels
|
||||
)
|
||||
:
|
||||
|
||||
@ -61,11 +61,11 @@ class primitiveMesh;
|
||||
|
||||
class cuttingPlane
|
||||
:
|
||||
public PrimitiveMeshedSurface<face>,
|
||||
public plane
|
||||
public plane,
|
||||
public BasicMeshedSurface<face>
|
||||
{
|
||||
//- Private typedefs for convenience
|
||||
typedef PrimitiveMeshedSurface<face> MeshStorage;
|
||||
typedef BasicMeshedSurface<face> MeshStorage;
|
||||
|
||||
// Private data
|
||||
|
||||
@ -132,12 +132,12 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from mesh reference and plane,
|
||||
//- Construct from plane and mesh reference,
|
||||
// possibly restricted to a list of cells
|
||||
cuttingPlane
|
||||
(
|
||||
const primitiveMesh&,
|
||||
const plane&,
|
||||
const primitiveMesh&,
|
||||
const UList<label>& cellIdLabels = UList<label>::null()
|
||||
);
|
||||
|
||||
|
||||
@ -36,22 +36,22 @@ Description
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> > Foam::cuttingPlane::sample
|
||||
(
|
||||
const Field<Type>& sf
|
||||
const Field<Type>& fld
|
||||
) const
|
||||
{
|
||||
return tmp<Field<Type> >(new Field<Type>(sf, cutCells()));
|
||||
return tmp<Field<Type> >(new Field<Type>(fld, cutCells()));
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> > Foam::cuttingPlane::sample
|
||||
(
|
||||
const tmp<Field<Type> >& tsf
|
||||
const tmp<Field<Type> >& tfld
|
||||
) const
|
||||
{
|
||||
tmp<Field<Type> > tint = sample(tsf());
|
||||
tsf.clear();
|
||||
return tint;
|
||||
tmp<Field<Type> > tsf = sample(tfld());
|
||||
tfld.clear();
|
||||
return tsf;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -17,10 +17,10 @@ Switch planeMapping
|
||||
);
|
||||
|
||||
Info << "Constructing planePatch" << endl;
|
||||
cuttingPlane cut(mesh, plane(planeToPatchDict));
|
||||
cuttingPlane cut(plane(planeToPatchDict), mesh);
|
||||
|
||||
primitiveFacePatch planePatch
|
||||
(
|
||||
(
|
||||
cut.faces(),
|
||||
cut.points()
|
||||
);
|
||||
@ -38,24 +38,23 @@ label targetPatchNumber = -1;
|
||||
|
||||
forAll(patches, patchI)
|
||||
{
|
||||
if(patches[patchI].name() == toPatchName)
|
||||
if (patches[patchI].name() == toPatchName)
|
||||
{
|
||||
targetPatchNamePresent = true;
|
||||
targetPatchNumber = patchI;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const labelList& cutCells(cut.cells());
|
||||
|
||||
if(!targetPatchNamePresent)
|
||||
if (!targetPatchNamePresent)
|
||||
{
|
||||
targetPatchNumber = 1;
|
||||
Serr << "Target patch not present. " << endl;
|
||||
Serr<< "Target patch not present. " << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Serr << "Target patch name: " << patches[targetPatchNumber].name()
|
||||
<< endl;
|
||||
Serr<< "Target patch name: " << patches[targetPatchNumber].name() << endl;
|
||||
}
|
||||
|
||||
patchToPatchInterpolation interPatch
|
||||
@ -73,6 +72,7 @@ PrimitivePatchInterpolation
|
||||
planePatch
|
||||
);
|
||||
|
||||
|
||||
PrimitivePatchInterpolation
|
||||
<
|
||||
PrimitivePatch<face, List, const pointField&>
|
||||
|
||||
Reference in New Issue
Block a user