ENH: [sampled]DistanceSurface - added construct from searchableSurface

This commit is contained in:
Andrew Heather
2021-12-03 13:47:19 +00:00
parent 9cf26ac7c5
commit b96cef1339
4 changed files with 69 additions and 4 deletions

View File

@ -64,6 +64,30 @@ Foam::sampledDistanceSurface::sampledDistanceSurface
{}
Foam::sampledDistanceSurface::sampledDistanceSurface
(
const word name,
const polyMesh& mesh,
const bool interpolate,
autoPtr<searchableSurface>&& surface,
const scalar distance,
const bool useSignedDistance
)
:
sampledSurface(name, mesh, interpolate),
distanceSurface
(
mesh,
interpolate,
std::move(surface),
distance,
useSignedDistance
),
average_(false), // pass as param?
needsUpdate_(true)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::sampledDistanceSurface::needsUpdate() const

View File

@ -141,6 +141,18 @@ public:
);
sampledDistanceSurface
(
const word name,
const polyMesh& mesh,
const bool interpolate,
autoPtr<searchableSurface>&& surface,
const scalar distance,
const bool useSignedDistance
//const isoSurfaceParams& params = isoSurfaceParams()
);
//- Destructor
virtual ~sampledDistanceSurface() = default;

View File

@ -349,9 +349,10 @@ Foam::distanceSurface::distanceSurface
const isoSurfaceParams& params
)
:
mesh_(mesh),
geometryPtr_
distanceSurface
(
mesh,
interpolate,
searchableSurface::New
(
surfaceType,
@ -365,8 +366,26 @@ Foam::distanceSurface::distanceSurface
IOobject::NO_WRITE
),
dictionary()
)
),
),
distance,
useSignedDistance,
params
)
{}
Foam::distanceSurface::distanceSurface
(
const polyMesh& mesh,
const bool interpolate,
autoPtr<searchableSurface>&& surface,
const scalar distance,
const bool useSignedDistance,
const isoSurfaceParams& params
)
:
mesh_(mesh),
geometryPtr_(surface),
distance_(distance),
withZeroDistance_(equal(distance_, 0)),
withSignDistance_

View File

@ -326,6 +326,16 @@ public:
const isoSurfaceParams& params = isoSurfaceParams()
);
distanceSurface
(
const polyMesh& mesh,
const bool interpolate,
autoPtr<searchableSurface>&& surface,
const scalar distance,
const bool useSignedDistance,
const isoSurfaceParams& params = isoSurfaceParams()
);
//- Destructor
virtual ~distanceSurface() = default;