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 Foam::cuttingPlane::cuttingPlane
( (
const primitiveMesh& mesh,
const plane& pln, const plane& pln,
const primitiveMesh& mesh,
const UList<label>& cellIdLabels const UList<label>& cellIdLabels
) )
: :

View File

@ -61,11 +61,11 @@ class primitiveMesh;
class cuttingPlane class cuttingPlane
: :
public PrimitiveMeshedSurface<face>, public plane,
public plane public BasicMeshedSurface<face>
{ {
//- Private typedefs for convenience //- Private typedefs for convenience
typedef PrimitiveMeshedSurface<face> MeshStorage; typedef BasicMeshedSurface<face> MeshStorage;
// Private data // Private data
@ -132,12 +132,12 @@ public:
// Constructors // Constructors
//- Construct from mesh reference and plane, //- Construct from plane and mesh reference,
// possibly restricted to a list of cells // possibly restricted to a list of cells
cuttingPlane cuttingPlane
( (
const primitiveMesh&,
const plane&, const plane&,
const primitiveMesh&,
const UList<label>& cellIdLabels = UList<label>::null() const UList<label>& cellIdLabels = UList<label>::null()
); );

View File

@ -36,22 +36,22 @@ Description
template<class Type> template<class Type>
Foam::tmp<Foam::Field<Type> > Foam::cuttingPlane::sample Foam::tmp<Foam::Field<Type> > Foam::cuttingPlane::sample
( (
const Field<Type>& sf const Field<Type>& fld
) const ) const
{ {
return tmp<Field<Type> >(new Field<Type>(sf, cutCells())); return tmp<Field<Type> >(new Field<Type>(fld, cutCells()));
} }
template<class Type> template<class Type>
Foam::tmp<Foam::Field<Type> > Foam::cuttingPlane::sample Foam::tmp<Foam::Field<Type> > Foam::cuttingPlane::sample
( (
const tmp<Field<Type> >& tsf const tmp<Field<Type> >& tfld
) const ) const
{ {
tmp<Field<Type> > tint = sample(tsf()); tmp<Field<Type> > tsf = sample(tfld());
tsf.clear(); tfld.clear();
return tint; return tsf;
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -17,10 +17,10 @@ Switch planeMapping
); );
Info << "Constructing planePatch" << endl; Info << "Constructing planePatch" << endl;
cuttingPlane cut(mesh, plane(planeToPatchDict)); cuttingPlane cut(plane(planeToPatchDict), mesh);
primitiveFacePatch planePatch primitiveFacePatch planePatch
( (
cut.faces(), cut.faces(),
cut.points() cut.points()
); );
@ -38,24 +38,23 @@ label targetPatchNumber = -1;
forAll(patches, patchI) forAll(patches, patchI)
{ {
if(patches[patchI].name() == toPatchName) if (patches[patchI].name() == toPatchName)
{ {
targetPatchNamePresent = true; targetPatchNamePresent = true;
targetPatchNumber = patchI; targetPatchNumber = patchI;
} }
} }
const labelList& cutCells(cut.cells()); const labelList& cutCells(cut.cells());
if(!targetPatchNamePresent) if (!targetPatchNamePresent)
{ {
targetPatchNumber = 1; targetPatchNumber = 1;
Serr << "Target patch not present. " << endl; Serr<< "Target patch not present. " << endl;
} }
else else
{ {
Serr << "Target patch name: " << patches[targetPatchNumber].name() Serr<< "Target patch name: " << patches[targetPatchNumber].name() << endl;
<< endl;
} }
patchToPatchInterpolation interPatch patchToPatchInterpolation interPatch
@ -73,6 +72,7 @@ PrimitivePatchInterpolation
planePatch planePatch
); );
PrimitivePatchInterpolation PrimitivePatchInterpolation
< <
PrimitivePatch<face, List, const pointField&> PrimitivePatch<face, List, const pointField&>