cuttingPlane constructor with plane/mesh instead of mesh/plane

This commit is contained in:
Mark Olesen
2008-12-31 15:17:18 +01:00
parent 1389f61287
commit 7f168dc93c
4 changed files with 21 additions and 21 deletions

View File

@ -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
)
:

View File

@ -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()
);

View File

@ -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;
}
// ************************************************************************* //

View File

@ -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&>