STYLE: use default destructor for ldu interfaces

This commit is contained in:
Mark Olesen
2019-09-30 11:51:57 +02:00
committed by Andrew Heather
parent dcff32ea65
commit ba8f237b21
20 changed files with 55 additions and 161 deletions

View File

@ -1,35 +1 @@
/*---------------------------------------------------------------------------*\ #warning File removed - left for old dependency check only
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2012 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Type>
Foam::LduInterfaceField<Type>::~LduInterfaceField()
{}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | \\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation | Copyright (C) 2011-2016 OpenFOAM Foundation
@ -85,7 +85,7 @@ public:
//- Destructor //- Destructor
virtual ~LduInterfaceField(); virtual ~LduInterfaceField() = default;
// Member Functions // Member Functions
@ -127,12 +127,6 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "LduInterfaceField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif #endif
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | \\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
| Copyright (C) 2011-2012 OpenFOAM Foundation | Copyright (C) 2011-2012 OpenFOAM Foundation
@ -31,14 +31,8 @@ License
namespace Foam namespace Foam
{ {
defineTypeNameAndDebug(lduInterface, 0); defineTypeNameAndDebug(lduInterface, 0);
} }
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::lduInterface::~lduInterface()
{}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | \\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
| Copyright (C) 2011 OpenFOAM Foundation | Copyright (C) 2011 OpenFOAM Foundation
@ -47,23 +47,12 @@ SourceFiles
namespace Foam namespace Foam
{ {
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class lduInterface Declaration Class lduInterface Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class lduInterface class lduInterface
{ {
// Private Member Functions
//- No copy construct
lduInterface(const lduInterface&) = delete;
//- No copy assignment
void operator=(const lduInterface&) = delete;
public: public:
//- Runtime type information //- Runtime type information
@ -73,12 +62,11 @@ public:
// Constructors // Constructors
//- Construct null //- Construct null
lduInterface() lduInterface() = default;
{}
//- Destructor //- Destructor
virtual ~lduInterface(); virtual ~lduInterface() = default;
// Member Functions // Member Functions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | \\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
| Copyright (C) 2011-2012 OpenFOAM Foundation | Copyright (C) 2011-2012 OpenFOAM Foundation
@ -31,38 +31,19 @@ License
namespace Foam namespace Foam
{ {
defineTypeNameAndDebug(processorLduInterface, 0); defineTypeNameAndDebug(processorLduInterface, 0);
} }
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::processorLduInterface::resizeBuf void Foam::processorLduInterface::resizeBuf(List<char>& buf, const label size)
(
List<char>& buf,
const label size
) const
{ {
if (buf.size() < size) if (buf.size() < size)
{ {
buf.setSize(size); buf.resize(size);
} }
} }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::processorLduInterface::processorLduInterface()
:
sendBuf_(0),
receiveBuf_(0)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::processorLduInterface::~processorLduInterface()
{}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | \\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation | Copyright (C) 2011-2016 OpenFOAM Foundation
@ -52,7 +52,7 @@ namespace Foam
class processorLduInterface class processorLduInterface
{ {
// Private data // Private Data
//- Send buffer. //- Send buffer.
// Only sized and used when compressed or non-blocking comms used. // Only sized and used when compressed or non-blocking comms used.
@ -62,8 +62,11 @@ class processorLduInterface
// Only sized and used when compressed or non-blocking comms used. // Only sized and used when compressed or non-blocking comms used.
mutable List<char> receiveBuf_; mutable List<char> receiveBuf_;
//- Resize the buffer if required
void resizeBuf(List<char>& buf, const label size) const; // Private Member Functions
//- Increase buffer size if required
static void resizeBuf(List<char>& buf, const label size);
public: public:
@ -75,11 +78,11 @@ public:
// Constructors // Constructors
//- Construct null //- Construct null
processorLduInterface(); processorLduInterface() = default;
//- Destructor //- Destructor
virtual ~processorLduInterface(); virtual ~processorLduInterface() = default;
// Member Functions // Member Functions
@ -101,25 +104,26 @@ public:
//- Return message tag used for sending //- Return message tag used for sending
virtual int tag() const = 0; virtual int tag() const = 0;
// Transfer functions
// Transfer Functions
//- Raw send function //- Raw send function
template<class Type> template<class Type>
void send void send
( (
const Pstream::commsTypes commsType, const Pstream::commsTypes commsType,
const UList<Type>& const UList<Type>& f
) const; ) const;
//- Raw field receive function //- Raw receive function
template<class Type> template<class Type>
void receive void receive
( (
const Pstream::commsTypes commsType, const Pstream::commsTypes commsType,
UList<Type>& UList<Type>& f
) const; ) const;
//- Raw field receive function returning field //- Raw receive function returning field
template<class Type> template<class Type>
tmp<Field<Type>> receive tmp<Field<Type>> receive
( (
@ -128,23 +132,23 @@ public:
) const; ) const;
//- Raw field send function with data compression //- Raw send function with data compression
template<class Type> template<class Type>
void compressedSend void compressedSend
( (
const Pstream::commsTypes commsType, const Pstream::commsTypes commsType,
const UList<Type>& const UList<Type>& f
) const; ) const;
//- Raw field receive function with data compression //- Raw receive function with data compression
template<class Type> template<class Type>
void compressedReceive void compressedReceive
( (
const Pstream::commsTypes commsType, const Pstream::commsTypes commsType,
UList<Type>& UList<Type>& f
) const; ) const;
//- Raw field receive function with data compression returning field //- Raw receive function with data compression returning field
template<class Type> template<class Type>
tmp<Field<Type>> compressedReceive tmp<Field<Type>> compressedReceive
( (

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | \\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
| Copyright (C) 2011-2017 OpenFOAM Foundation | Copyright (C) 2011-2017 OpenFOAM Foundation
@ -135,9 +135,9 @@ Foam::tmp<Foam::Field<Type>> Foam::processorLduInterface::receive
const label size const label size
) const ) const
{ {
tmp<Field<Type>> tf(new Field<Type>(size)); auto tfld = tmp<Field<Type>>::New(size);
receive(commsType, tf.ref()); receive(commsType, tfld.ref());
return tf; return tfld;
} }
@ -221,6 +221,7 @@ void Foam::processorLduInterface::compressedSend
} }
} }
template<class Type> template<class Type>
void Foam::processorLduInterface::compressedReceive void Foam::processorLduInterface::compressedReceive
( (
@ -278,6 +279,7 @@ void Foam::processorLduInterface::compressedReceive
} }
} }
template<class Type> template<class Type>
Foam::tmp<Foam::Field<Type>> Foam::processorLduInterface::compressedReceive Foam::tmp<Foam::Field<Type>> Foam::processorLduInterface::compressedReceive
( (
@ -285,9 +287,9 @@ Foam::tmp<Foam::Field<Type>> Foam::processorLduInterface::compressedReceive
const label size const label size
) const ) const
{ {
tmp<Field<Type>> tf(new Field<Type>(size)); auto tfld = tmp<Field<Type>>::New(size);
compressedReceive(commsType, tf.ref()); compressedReceive(commsType, tfld.ref());
return tf; return tfld;
} }

View File

@ -133,8 +133,8 @@ public:
return true; return true;
} }
//- Initialise neighbour matrix update. Add //- Initialise neighbour matrix update.
// or subtract coupled contributions to matrix //- Add/subtract coupled contributions to matrix
virtual void initInterfaceMatrixUpdate virtual void initInterfaceMatrixUpdate
( (
solveScalarField& result, solveScalarField& result,
@ -146,8 +146,8 @@ public:
) const ) const
{} {}
//- Update result field based on interface functionality. Add //- Update result field based on interface functionality.
// or subtract coupled contributions to matrix //- Add/subtract coupled contributions to matrix
virtual void updateInterfaceMatrix virtual void updateInterfaceMatrix
( (
solveScalarField& result, solveScalarField& result,
@ -158,8 +158,7 @@ public:
const Pstream::commsTypes commsType const Pstream::commsTypes commsType
) const = 0; ) const = 0;
//- Helper: add (or subtract) weighted contributions to internal //- Add/subtract weighted contributions to internal field
// field
template<class Type> template<class Type>
void addToInternalField void addToInternalField
( (

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | \\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation | Copyright (C) 2011-2016 OpenFOAM Foundation
@ -205,10 +205,6 @@ protected:
); );
private:
// Private Member Functions
//- No copy construct //- No copy construct
GAMGAgglomeration(const GAMGAgglomeration&) = delete; GAMGAgglomeration(const GAMGAgglomeration&) = delete;

View File

@ -100,12 +100,6 @@ Foam::cyclicGAMGInterfaceField::cyclicGAMGInterfaceField
{} {}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::cyclicGAMGInterfaceField::~cyclicGAMGInterfaceField()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::cyclicGAMGInterfaceField::updateInterfaceMatrix void Foam::cyclicGAMGInterfaceField::updateInterfaceMatrix

View File

@ -101,7 +101,7 @@ public:
//- Destructor //- Destructor
virtual ~cyclicGAMGInterfaceField(); virtual ~cyclicGAMGInterfaceField() = default;
// Member Functions // Member Functions

View File

@ -84,12 +84,6 @@ Foam::processorGAMGInterfaceField::processorGAMGInterfaceField
{} {}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::processorGAMGInterfaceField::~processorGAMGInterfaceField()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::processorGAMGInterfaceField::initInterfaceMatrixUpdate void Foam::processorGAMGInterfaceField::initInterfaceMatrixUpdate

View File

@ -120,7 +120,7 @@ public:
//- Destructor //- Destructor
virtual ~processorGAMGInterfaceField(); virtual ~processorGAMGInterfaceField() = default;
// Member Functions // Member Functions

View File

@ -161,12 +161,6 @@ Foam::cyclicGAMGInterface::cyclicGAMGInterface
{} {}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::cyclicGAMGInterface::~cyclicGAMGInterface()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::labelField> Foam::cyclicGAMGInterface::internalFieldTransfer Foam::tmp<Foam::labelField> Foam::cyclicGAMGInterface::internalFieldTransfer

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | \\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
| Copyright (C) 2011-2013 OpenFOAM Foundation | Copyright (C) 2011-2013 OpenFOAM Foundation
@ -109,7 +109,7 @@ public:
//- Destructor //- Destructor
virtual ~cyclicGAMGInterface(); virtual ~cyclicGAMGInterface() = default;
// Member Functions // Member Functions

View File

@ -178,12 +178,6 @@ Foam::processorGAMGInterface::processorGAMGInterface
{} {}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::processorGAMGInterface::~processorGAMGInterface()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::processorGAMGInterface::initInternalFieldTransfer void Foam::processorGAMGInterface::initInternalFieldTransfer

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | \\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
| Copyright (C) 2011-2014 OpenFOAM Foundation | Copyright (C) 2011-2014 OpenFOAM Foundation
@ -125,7 +125,7 @@ public:
//- Destructor //- Destructor
virtual ~processorGAMGInterface(); virtual ~processorGAMGInterface() = default;
// Member Functions // Member Functions

View File

@ -176,12 +176,6 @@ Foam::calculatedProcessorGAMGInterface::calculatedProcessorGAMGInterface
{} {}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::calculatedProcessorGAMGInterface::~calculatedProcessorGAMGInterface()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::calculatedProcessorGAMGInterface::initInternalFieldTransfer void Foam::calculatedProcessorGAMGInterface::initInternalFieldTransfer

View File

@ -126,7 +126,7 @@ public:
//- Destructor //- Destructor
virtual ~calculatedProcessorGAMGInterface(); virtual ~calculatedProcessorGAMGInterface() = default;
// Member Functions // Member Functions

View File

@ -146,7 +146,7 @@ public:
) const; ) const;
//- Processor interface functions // Processor interface functions
//- Return communicator used for sending //- Return communicator used for sending
virtual label comm() const virtual label comm() const