STYLE: mark facePointPatch::patch() as virtual, remove unused functions

This commit is contained in:
Mark Olesen
2019-11-04 18:05:53 +01:00
committed by Andrew Heather
parent 7aa83ea939
commit e3b9bbab11
7 changed files with 39 additions and 75 deletions

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -28,22 +29,6 @@ License
#include "valuePointPatchField.H" #include "valuePointPatchField.H"
#include "pointPatchFieldMapper.H" #include "pointPatchFieldMapper.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class Type>
void Foam::valuePointPatchField<Type>::checkFieldSize() const
{
if (this->size() != this->patch().size())
{
FatalErrorInFunction
<< "field does not correspond to patch. " << endl
<< "Field size: " << size() << " patch size: "
<< this->patch().size()
<< abort(FatalError);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
template<class Type> template<class Type>
@ -84,7 +69,7 @@ Foam::valuePointPatchField<Type>::valuePointPatchField
else else
{ {
FatalIOErrorInFunction(dict) FatalIOErrorInFunction(dict)
<< "Essential entry 'value' missing" << "Essential entry 'value' missing on patch " << p.name()
<< exit(FatalIOError); << exit(FatalIOError);
} }
} }

View File

@ -54,11 +54,6 @@ class valuePointPatchField
public pointPatchField<Type>, public pointPatchField<Type>,
public Field<Type> public Field<Type>
{ {
// Private Member Functions
void checkFieldSize() const;
public: public:
//- Runtime type information //- Runtime type information

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -31,55 +32,54 @@ License
#include "demandDrivenData.H" #include "demandDrivenData.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
defineTypeNameAndDebug(facePointPatch, 0);
defineRunTimeSelectionTable(facePointPatch, polyPatch);
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // addToRunTimeSelectionTable
(
defineTypeNameAndDebug(facePointPatch, 0);
defineRunTimeSelectionTable(facePointPatch, polyPatch);
addToRunTimeSelectionTable
(
facePointPatch, facePointPatch,
facePointPatch, facePointPatch,
polyPatch polyPatch
); );
} // End namespace Foam
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
void facePointPatch::initGeometry(PstreamBuffers&) void Foam::facePointPatch::initGeometry(PstreamBuffers&)
{} {}
void facePointPatch::calcGeometry(PstreamBuffers&) void Foam::facePointPatch::calcGeometry(PstreamBuffers&)
{} {}
void facePointPatch::initMovePoints(PstreamBuffers&, const pointField&) void Foam::facePointPatch::initMovePoints(PstreamBuffers&, const pointField&)
{} {}
void facePointPatch::movePoints(PstreamBuffers&, const pointField&) void Foam::facePointPatch::movePoints(PstreamBuffers&, const pointField&)
{} {}
void facePointPatch::initUpdateMesh(PstreamBuffers& pBufs) void Foam::facePointPatch::initUpdateMesh(PstreamBuffers& pBufs)
{ {
facePointPatch::initGeometry(pBufs); facePointPatch::initGeometry(pBufs);
} }
void facePointPatch::updateMesh(PstreamBuffers&) void Foam::facePointPatch::updateMesh(PstreamBuffers&)
{} {}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
facePointPatch::facePointPatch Foam::facePointPatch::facePointPatch
( (
const polyPatch& p, const polyPatch& p,
const pointBoundaryMesh& bm const pointBoundaryMesh& bm
@ -90,8 +90,4 @@ facePointPatch::facePointPatch
{} {}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* // // ************************************************************************* //

View File

@ -88,10 +88,6 @@ protected:
virtual void updateMesh(PstreamBuffers&); virtual void updateMesh(PstreamBuffers&);
private:
// Private Member Functions
//- No copy construct //- No copy construct
facePointPatch(const facePointPatch&) = delete; facePointPatch(const facePointPatch&) = delete;
@ -125,11 +121,11 @@ public:
// Constructors // Constructors
//- Construct from polyPatch //- Construct from polyPatch and boundary mesh
facePointPatch facePointPatch
( (
const polyPatch&, const polyPatch& p,
const pointBoundaryMesh& const pointBoundaryMesh& pm
); );
@ -150,7 +146,7 @@ public:
// Member Functions // Member Functions
//- Return the polyPatch //- Return the polyPatch
const polyPatch& patch() const virtual const polyPatch& patch() const
{ {
return polyPatch_; return polyPatch_;
} }
@ -185,14 +181,12 @@ public:
return polyPatch_.meshPoints(); return polyPatch_.meshPoints();
} }
//- Return pointField of points in patch //- Return pointField of points in patch
virtual const pointField& localPoints() const virtual const pointField& localPoints() const
{ {
return polyPatch_.localPoints(); return polyPatch_.localPoints();
} }
//- Return point unit normals //- Return point unit normals
virtual const vectorField& pointNormals() const virtual const vectorField& pointNormals() const
{ {

View File

@ -47,8 +47,7 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward declaration of classes // Forward Declarations
class pointBoundaryMesh; class pointBoundaryMesh;
class pointConstraint; class pointConstraint;
class PstreamBuffers; class PstreamBuffers;
@ -59,26 +58,16 @@ class PstreamBuffers;
class pointPatch class pointPatch
{ {
// Private data // Private Data
//- Reference to boundary mesh //- Reference to boundary mesh
const pointBoundaryMesh& boundaryMesh_; const pointBoundaryMesh& boundaryMesh_;
// Private Member Functions
//- No copy construct
pointPatch(const pointPatch&) = delete;
//- No copy assignment
void operator=(const pointPatch&) = delete;
protected: protected:
// Protected Member Functions // Protected Member Functions
// The pointPatch geometry initialisation is called by pointBoundaryMesh // The geometry initialisation is called by pointBoundaryMesh
friend class pointBoundaryMesh; friend class pointBoundaryMesh;
//- Initialise the calculation of the patch geometry //- Initialise the calculation of the patch geometry
@ -106,6 +95,13 @@ protected:
{} {}
//- No copy construct
pointPatch(const pointPatch&) = delete;
//- No copy assignment
void operator=(const pointPatch&) = delete;
public: public:
//- Runtime type information //- Runtime type information
@ -114,10 +110,8 @@ public:
// Constructor // Constructor
pointPatch //- Construct from boundary mesh
( explicit pointPatch(const pointBoundaryMesh& bm)
const pointBoundaryMesh& bm
)
: :
boundaryMesh_(bm) boundaryMesh_(bm)
{} {}

View File

@ -129,7 +129,7 @@ Foam::fvPatchField<Type>::fvPatchField
else else
{ {
FatalIOErrorInFunction(dict) FatalIOErrorInFunction(dict)
<< "Essential entry 'value' missing" << "Essential entry 'value' missing on patch " << p.name() << nl
<< exit(FatalIOError); << exit(FatalIOError);
} }
} }

View File

@ -98,7 +98,7 @@ Foam::fvsPatchField<Type>::fvsPatchField
else else
{ {
FatalIOErrorInFunction(dict) FatalIOErrorInFunction(dict)
<< "essential 'value' entry not provided" << "Essential entry 'value' missing on patch " << p.name() << nl
<< exit(FatalIOError); << exit(FatalIOError);
} }
} }