ENH: make lduInterfaceField::updatedMatrix mutable

- simplifies code, consistent with other matrix transfer functions.
  Use a setter method.

STYLE: AMIInterpolation::upToDate(bool) setter method

ENH: add guards to avoid float-compressed transfer of integral types

STYLE: drop unused debug member from abstract interface classes
This commit is contained in:
Mark Olesen
2023-01-03 18:52:40 +01:00
parent 06f479fbd4
commit 94a7945be3
31 changed files with 179 additions and 195 deletions

View File

@ -499,7 +499,6 @@ DebugSwitches
cubicUpwindFit 0;
curve 0;
cyclic 0;
cyclicLduInterface 0;
cyclicLduInterfaceField 0;
cylinderToCell 0;
cylindrical 0;
@ -684,7 +683,6 @@ DebugSwitches
laplace 0;
layerAdditionRemoval 0;
layered 0;
lduInterface 0;
lduInterfaceField 0;
lduMatrix 1;
lduMesh 0;
@ -823,7 +821,6 @@ DebugSwitches
primitiveMeshGeometry 0;
probes 0;
processor 0;
processorLduInterface 0;
processorLduInterfaceField 0;
pureMixture<constTransport<thermo<hConstThermo<perfectGas>>>> 0;
pureMixture<sutherlandTransport<thermo<hConstThermo<perfectGas>>>> 0;

View File

@ -34,8 +34,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef procLduInterface_H
#define procLduInterface_H
#ifndef Foam_procLduInterface_H
#define Foam_procLduInterface_H
#include "labelList.H"
#include "scalarField.H"
@ -45,23 +45,19 @@ SourceFiles
namespace Foam
{
// Forward Declarations
class lduInterfaceField;
// Forward declaration of friend functions and operators
class procLduInterface;
Ostream& operator<<(Ostream&, const procLduInterface&);
/*---------------------------------------------------------------------------*\
Class procLduInterface Declaration
\*---------------------------------------------------------------------------*/
class procLduInterface
{
// Private data
// Private Data
labelList faceCells_;
scalarField coeffs_;
@ -70,18 +66,17 @@ class procLduInterface
label tag_;
label comm_;
// Private Member Functions
//- No copy construct
procLduInterface(const procLduInterface&) = delete;
public:
friend class LUscalarMatrix;
// Generated Methods
//- No copy construct
procLduInterface(const procLduInterface&) = delete;
// Constructors
procLduInterface
@ -104,7 +99,7 @@ public:
}
// Ostream operator
// Ostream Operator
friend Ostream& operator<<(Ostream&, const procLduInterface&);
};

View File

@ -31,7 +31,7 @@ License
namespace Foam
{
defineTypeNameAndDebug(cyclicLduInterface, 0);
defineTypeName(cyclicLduInterface);
}

View File

@ -35,8 +35,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef cyclicLduInterface_H
#define cyclicLduInterface_H
#ifndef Foam_cyclicLduInterface_H
#define Foam_cyclicLduInterface_H
#include "lduInterface.H"
#include "primitiveFieldsFwd.H"
@ -55,12 +55,13 @@ class cyclicLduInterface
public:
//- Runtime type information
TypeName("cyclicLduInterface");
TypeNameNoDebug("cyclicLduInterface");
// Constructors
//- Construct null
cyclicLduInterface() = default;
//- Default construct
cyclicLduInterface() noexcept = default;
//- Destructor

View File

@ -123,10 +123,7 @@ void Foam::lduCalculatedProcessorField<Type>::initInterfaceMatrixUpdate
procInterface_.comm()
);
const_cast<lduInterfaceField&>
(
static_cast<const lduInterfaceField&>(*this)
).updatedMatrix() = false;
this->updatedMatrix(false);
}
@ -185,10 +182,7 @@ void Foam::lduCalculatedProcessorField<Type>::updateInterfaceMatrix
// helper to avoid using fvPatch addressing
addToInternalField(result, !add, coeffs, scalarReceiveBuf_);
const_cast<lduInterfaceField&>
(
static_cast<const lduInterfaceField&>(*this)
).updatedMatrix() = true;
this->updatedMatrix(true);
}

View File

@ -32,7 +32,7 @@ License
namespace Foam
{
defineTypeNameAndDebug(lduInterface, 0);
defineTypeName(lduInterface);
}

View File

@ -60,13 +60,13 @@ class lduInterface
public:
//- Runtime type information
TypeName("lduInterface");
TypeNameNoDebug("lduInterface");
// Constructors
//- Construct null
lduInterface() = default;
//- Default construct
lduInterface() noexcept = default;
//- Destructor
@ -75,7 +75,6 @@ public:
// Member Functions
// Access
//- Return faceCell addressing
@ -123,7 +122,6 @@ public:
const Pstream::commsTypes commsType,
const labelUList& iF
) const = 0;
};

View File

@ -36,8 +36,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef lduPrimitiveProcessorInterface_H
#define lduPrimitiveProcessorInterface_H
#ifndef Foam_lduPrimitiveProcessorInterface_H
#define Foam_lduPrimitiveProcessorInterface_H
#include "GAMGInterface.H"
#include "processorLduInterface.H"
@ -86,7 +86,7 @@ class lduPrimitiveProcessorInterface
public:
//- Runtime type information
TypeName("calculatedProcessor");
TypeNameNoDebug("processorInterface");
// Constructors
@ -108,6 +108,7 @@ public:
const lduPrimitiveProcessorInterface&
);
//- Destructor
virtual ~lduPrimitiveProcessorInterface() = default;

View File

@ -5,8 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2012 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2011 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -32,19 +31,7 @@ License
namespace Foam
{
defineTypeNameAndDebug(processorLduInterface, 0);
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::processorLduInterface::resizeBuf(List<char>& buf, const label len)
{
if (buf.size() < len)
{
// Use nocopy variant since it will be overwritten
buf.resize_nocopy(len);
}
defineTypeName(processorLduInterface);
}

View File

@ -67,19 +67,25 @@ class processorLduInterface
// Private Member Functions
//- Increase buffer size if required
static void resizeBuf(List<char>& buf, const label len);
// Uses the nocopy variant since it will be overwritten
static void resizeBuf(List<char>& buf, const label len)
{
if (buf.size() < len)
{
buf.resize_nocopy(len);
}
}
public:
//- Runtime type information
TypeName("processorLduInterface");
TypeNameNoDebug("processorLduInterface");
// Constructors
//- Default construct
processorLduInterface() = default;
processorLduInterface() noexcept = default;
//- Destructor

View File

@ -155,7 +155,12 @@ void Foam::processorLduInterface::compressedSend
const UList<Type>& f
) const
{
if (sizeof(scalar) != sizeof(float) && Pstream::floatTransfer && f.size())
if
(
f.size()
&& UPstream::floatTransfer
&& (!std::is_integral<Type>::value && sizeof(scalar) != sizeof(float))
)
{
static const label nCmpts = sizeof(Type)/sizeof(scalar);
label nm1 = (f.size() - 1)*nCmpts;
@ -236,7 +241,12 @@ void Foam::processorLduInterface::compressedReceive
UList<Type>& f
) const
{
if (sizeof(scalar) != sizeof(float) && Pstream::floatTransfer && f.size())
if
(
f.size()
&& UPstream::floatTransfer
&& (!std::is_integral<Type>::value && sizeof(scalar) != sizeof(float))
)
{
static const label nCmpts = sizeof(Type)/sizeof(scalar);
label nm1 = (f.size() - 1)*nCmpts;

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2013 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -36,8 +36,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef lduInterfaceField_H
#define lduInterfaceField_H
#ifndef Foam_lduInterfaceField_H
#define Foam_lduInterfaceField_H
#include "lduInterface.H"
#include "primitiveFieldsFwd.H"
@ -49,8 +49,9 @@ SourceFiles
namespace Foam
{
// Forward declarations
// Forward Declarations
class lduMatrix;
class lduInterfaceField;
/*---------------------------------------------------------------------------*\
Class lduInterfaceField Declaration
@ -64,17 +65,8 @@ class lduInterfaceField
const lduInterface& interface_;
//- Update index used so that updateInterfaceMatrix is called only once
// during the construction of the matrix
bool updatedMatrix_;
// Private Member Functions
//- No copy construct
lduInterfaceField(const lduInterfaceField&) = delete;
//- No copy assignment
void operator=(const lduInterfaceField&) = delete;
//- during the construction of the matrix
mutable bool updatedMatrix_;
public:
@ -83,6 +75,15 @@ public:
TypeName("lduInterfaceField");
// Generated Methods
//- No copy construct
lduInterfaceField(const lduInterfaceField&) = delete;
//- No copy assignment
void operator=(const lduInterfaceField&) = delete;
// Constructors
//- Construct given coupled patch
@ -102,7 +103,7 @@ public:
// Access
//- Return the interface
const lduInterface& interface() const
const lduInterface& interface() const noexcept
{
return interface_;
}
@ -117,15 +118,17 @@ public:
// Coupled interface matrix update
//- Whether matrix has been updated
bool updatedMatrix() const
bool updatedMatrix() const noexcept
{
return updatedMatrix_;
}
//- Whether matrix has been updated
bool& updatedMatrix()
//- Set matrix as update-to-date, return the previous value
bool updatedMatrix(bool flag) const noexcept
{
return updatedMatrix_;
bool old(updatedMatrix_);
updatedMatrix_ = flag;
return old;
}
//- Is all data available
@ -173,6 +176,16 @@ public:
const scalarField& coeffs,
const Field<Type>& vals
) const;
// Housekeeping
//- Adjust whether matrix has been updated.
// \deprecated Prefer the updatedMatrix(bool) setter (JAN-2023)
bool& updatedMatrix() noexcept
{
return updatedMatrix_;
}
};

View File

@ -52,7 +52,6 @@ namespace Foam
class processorLduInterfaceField
{
public:
//- Runtime type information
@ -61,7 +60,7 @@ public:
// Constructors
//- Construct null
//- Default construct
processorLduInterfaceField() = default;

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -149,28 +149,29 @@ void Foam::lduMatrix::updateMatrixInterfaces
forAll(interfaces, interfacei)
{
if (interfaces.set(interfacei))
if
(
interfaces.set(interfacei)
&& !interfaces[interfacei].updatedMatrix()
)
{
if (!interfaces[interfacei].updatedMatrix())
if (interfaces[interfacei].ready())
{
if (interfaces[interfacei].ready())
{
interfaces[interfacei].updateInterfaceMatrix
(
result,
add,
mesh().lduAddr(),
interfacei,
psiif,
coupleCoeffs[interfacei],
cmpt,
commsType
);
}
else
{
allUpdated = false;
}
interfaces[interfacei].updateInterfaceMatrix
(
result,
add,
mesh().lduAddr(),
interfacei,
psiif,
coupleCoeffs[interfacei],
cmpt,
commsType
);
}
else
{
allUpdated = false;
}
}
}

View File

@ -107,7 +107,7 @@ void Foam::processorGAMGInterfaceField::initInterfaceMatrixUpdate
if
(
commsType == Pstream::commsTypes::nonBlocking
&& !Pstream::floatTransfer
&& !UPstream::floatTransfer
)
{
// Fast path.
@ -140,7 +140,7 @@ void Foam::processorGAMGInterfaceField::initInterfaceMatrixUpdate
procInterface_.compressedSend(commsType, scalarSendBuf_);
}
const_cast<processorGAMGInterfaceField&>(*this).updatedMatrix() = false;
this->updatedMatrix(false);
}
@ -156,7 +156,7 @@ void Foam::processorGAMGInterfaceField::updateInterfaceMatrix
const Pstream::commsTypes commsType
) const
{
if (updatedMatrix())
if (this->updatedMatrix())
{
return;
}
@ -166,7 +166,7 @@ void Foam::processorGAMGInterfaceField::updateInterfaceMatrix
if
(
commsType == Pstream::commsTypes::nonBlocking
&& !Pstream::floatTransfer
&& !UPstream::floatTransfer
)
{
// Fast path: consume straight from receive buffer
@ -197,7 +197,7 @@ void Foam::processorGAMGInterfaceField::updateInterfaceMatrix
addToInternalField(result, !add, faceCells, coeffs, pnf);
}
const_cast<processorGAMGInterfaceField&>(*this).updatedMatrix() = true;
this->updatedMatrix(true);
}

View File

@ -197,7 +197,7 @@ void Foam::processorFaPatchField<Type>::initInterfaceMatrixUpdate
this->patch().patchInternalField(psiInternal)()
);
const_cast<processorFaPatchField<Type>&>(*this).updatedMatrix() = false;
this->updatedMatrix(false);
}
@ -235,7 +235,7 @@ void Foam::processorFaPatchField<Type>::updateInterfaceMatrix
// Multiply the field by coefficients and add into the result
this->addToInternalField(result, !add, faceCells, coeffs, pnf);
const_cast<processorFaPatchField<Type>&>(*this).updatedMatrix() = true;
this->updatedMatrix(true);
}
@ -257,7 +257,7 @@ void Foam::processorFaPatchField<Type>::initInterfaceMatrixUpdate
this->patch().patchInternalField(psiInternal)()
);
const_cast<processorFaPatchField<Type>&>(*this).updatedMatrix() = false;
this->updatedMatrix(false);
}
@ -291,7 +291,7 @@ void Foam::processorFaPatchField<Type>::updateInterfaceMatrix
// Multiply the field by coefficients and add into the result
this->addToInternalField(result, !add, faceCells, coeffs, pnf);
const_cast<processorFaPatchField<Type>&>(*this).updatedMatrix() = true;
this->updatedMatrix(true);
}

View File

@ -228,10 +228,7 @@ void Foam::calculatedProcessorFvPatchField<Type>::initInterfaceMatrixUpdate
procInterface_.comm()
);
const_cast<lduInterfaceField&>
(
static_cast<const lduInterfaceField&>(*this)
).updatedMatrix() = false;
this->updatedMatrix(false);
}
@ -293,10 +290,7 @@ void Foam::calculatedProcessorFvPatchField<Type>::updateInterfaceMatrix
// helper to avoid using fvPatch addressing
addToInternalField(result, !add, coeffs, scalarReceiveBuf_);
const_cast<lduInterfaceField&>
(
static_cast<const lduInterfaceField&>(*this)
).updatedMatrix() = true;
this->updatedMatrix(true);
}

View File

@ -215,7 +215,7 @@ void Foam::processorFvPatchField<Type>::initEvaluate
if
(
commsType == Pstream::commsTypes::nonBlocking
&& !Pstream::floatTransfer
&& (std::is_integral<Type>::value || !UPstream::floatTransfer)
)
{
if (!is_contiguous<Type>::value)
@ -269,7 +269,7 @@ void Foam::processorFvPatchField<Type>::evaluate
if
(
commsType == Pstream::commsTypes::nonBlocking
&& !Pstream::floatTransfer
&& (std::is_integral<Type>::value || !UPstream::floatTransfer)
)
{
// Fast path: received into *this
@ -329,7 +329,7 @@ void Foam::processorFvPatchField<Type>::initInterfaceMatrixUpdate
if
(
commsType == Pstream::commsTypes::nonBlocking
&& !Pstream::floatTransfer
&& !UPstream::floatTransfer
)
{
// Fast path.
@ -371,7 +371,7 @@ void Foam::processorFvPatchField<Type>::initInterfaceMatrixUpdate
procPatch_.compressedSend(commsType, scalarSendBuf_);
}
const_cast<processorFvPatchField<Type>&>(*this).updatedMatrix() = false;
this->updatedMatrix(false);
}
@ -398,7 +398,7 @@ void Foam::processorFvPatchField<Type>::updateInterfaceMatrix
if
(
commsType == Pstream::commsTypes::nonBlocking
&& !Pstream::floatTransfer
&& !UPstream::floatTransfer
)
{
// Fast path: consume straight from receive buffer
@ -445,7 +445,7 @@ void Foam::processorFvPatchField<Type>::updateInterfaceMatrix
this->addToInternalField(result, !add, faceCells, coeffs, pnf);
}
const_cast<processorFvPatchField<Type>&>(*this).updatedMatrix() = true;
this->updatedMatrix(true);
}
@ -473,7 +473,7 @@ void Foam::processorFvPatchField<Type>::initInterfaceMatrixUpdate
if
(
commsType == Pstream::commsTypes::nonBlocking
&& !Pstream::floatTransfer
&& (std::is_integral<Type>::value || !UPstream::floatTransfer)
)
{
// Fast path.
@ -515,7 +515,7 @@ void Foam::processorFvPatchField<Type>::initInterfaceMatrixUpdate
procPatch_.compressedSend(commsType, sendBuf_);
}
const_cast<processorFvPatchField<Type>&>(*this).updatedMatrix() = false;
this->updatedMatrix(false);
}
@ -541,7 +541,7 @@ void Foam::processorFvPatchField<Type>::updateInterfaceMatrix
if
(
commsType == Pstream::commsTypes::nonBlocking
&& !Pstream::floatTransfer
&& (std::is_integral<Type>::value || !UPstream::floatTransfer)
)
{
// Fast path: consume straight from receive buffer
@ -571,7 +571,7 @@ void Foam::processorFvPatchField<Type>::updateInterfaceMatrix
this->addToInternalField(result, !add, faceCells, coeffs, pnf);
}
const_cast<processorFvPatchField<Type>&>(*this).updatedMatrix() = true;
this->updatedMatrix(true);
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2016-2021 OpenCFD Ltd.
Copyright (C) 2016-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -48,8 +48,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef AMIInterpolation_H
#define AMIInterpolation_H
#ifndef Foam_AMIInterpolation_H
#define Foam_AMIInterpolation_H
#include "className.H"
#include "searchableSurface.H"
@ -81,7 +81,7 @@ class AMIInterpolation
{
public:
// Public data types
// Public Data Types
static bool cacheIntersections_;
@ -350,11 +350,20 @@ public:
// Access
//- Access to the up-to-date flag
inline bool upToDate() const;
//- Is up-to-date?
bool upToDate() const noexcept { return upToDate_; }
//- Set as up-to-date, return the previous value
bool upToDate(bool flag) noexcept
{
bool old(upToDate_);
upToDate_ = flag;
return old;
}
//- Access to the up-to-date flag
inline bool& upToDate();
// \deprecated Prefer the upToDate(bool) setter (JAN-2023)
bool upToDate() noexcept { return upToDate_; }
//- Access to the distributed flag
inline bool distributed() const;

View File

@ -53,18 +53,6 @@ inline const Foam::primitivePatch& Foam::AMIInterpolation::tgtPatch0() const
}
inline bool Foam::AMIInterpolation::upToDate() const
{
return upToDate_;
}
inline bool& Foam::AMIInterpolation::upToDate()
{
return upToDate_;
}
inline bool Foam::AMIInterpolation::distributed() const
{
return singlePatchProc_ == -1;

View File

@ -34,8 +34,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef cyclicAMIGAMGInterface_H
#define cyclicAMIGAMGInterface_H
#ifndef Foam_cyclicAMIGAMGInterface_H
#define Foam_cyclicAMIGAMGInterface_H
#include "GAMGInterface.H"
#include "cyclicAMILduInterface.H"

View File

@ -31,7 +31,7 @@ License
namespace Foam
{
defineTypeNameAndDebug(cyclicACMILduInterface, 0);
defineTypeName(cyclicACMILduInterface);
}

View File

@ -35,8 +35,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef cyclicACMILduInterface_H
#define cyclicACMILduInterface_H
#ifndef Foam_cyclicACMILduInterface_H
#define Foam_cyclicACMILduInterface_H
#include "cyclicAMILduInterface.H"
@ -56,13 +56,13 @@ class cyclicACMILduInterface
public:
//- Runtime type information
TypeName("cyclicACMILduInterface");
TypeNameNoDebug("cyclicACMILduInterface");
// Constructors
//- Construct null
cyclicACMILduInterface() = default;
//- Default construct
cyclicACMILduInterface() noexcept = default;
//- Destructor

View File

@ -31,7 +31,7 @@ License
namespace Foam
{
defineTypeNameAndDebug(cyclicAMILduInterface, 0);
defineTypeName(cyclicAMILduInterface);
}

View File

@ -35,8 +35,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef cyclicAMILduInterface_H
#define cyclicAMILduInterface_H
#ifndef Foam_cyclicAMILduInterface_H
#define Foam_cyclicAMILduInterface_H
#include "primitiveFieldsFwd.H"
#include "AMIPatchToPatchInterpolation.H"
@ -52,17 +52,16 @@ namespace Foam
class cyclicAMILduInterface
{
public:
//- Runtime type information
TypeName("cyclicAMILduInterface");
TypeNameNoDebug("cyclicAMILduInterface");
// Constructors
//- Construct null
cyclicAMILduInterface() = default;
//- Default construct
cyclicAMILduInterface() noexcept = default;
//- Destructor

View File

@ -434,7 +434,7 @@ void Foam::cyclicAMIPolyPatch::resetAMI(const UList<point>& points) const
}
// Construct/apply AMI interpolation to determine addressing and weights
AMIPtr_->upToDate() = false;
AMIPtr_->upToDate(false);
AMIPtr_->calculate(patch0, nbrPatch0, surfPtr());
if (debug)
@ -485,7 +485,7 @@ void Foam::cyclicAMIPolyPatch::initGeometry(PstreamBuffers& pBufs)
DebugInFunction << endl;
// Flag AMI as needing update
AMIPtr_->upToDate() = false;
AMIPtr_->upToDate(false);
polyPatch::initGeometry(pBufs);
@ -531,7 +531,7 @@ void Foam::cyclicAMIPolyPatch::initMovePoints
}
else
{
AMIPtr_->upToDate() = false;
AMIPtr_->upToDate(false);
}
// Early calculation of transforms. See above.
@ -591,7 +591,7 @@ void Foam::cyclicAMIPolyPatch::clearGeom()
if (!updatingAMI_)
{
AMIPtr_->upToDate() = false;
AMIPtr_->upToDate(false);
}
polyPatch::clearGeom();

View File

@ -1571,7 +1571,7 @@ void Foam::mappedPatchBase::clearOut()
{
mapPtr_.reset(nullptr);
surfPtr_.reset(nullptr);
AMIPtr_->upToDate() = false;
AMIPtr_->upToDate(false);
}

View File

@ -275,7 +275,7 @@ inline const Foam::mapDistribute& Foam::mappedPatchBase::map() const
if (AMIPtr_)
{
AMIPtr_->upToDate() = false;
AMIPtr_->upToDate(false);
}
}
@ -296,12 +296,12 @@ inline const Foam::AMIPatchToPatchInterpolation& Foam::mappedPatchBase::AMI
if (!upToDate())
{
mapPtr_.reset(nullptr);
AMIPtr_->upToDate() = false;
AMIPtr_->upToDate(false);
}
if (forceUpdate)
{
AMIPtr_->upToDate() = false;
AMIPtr_->upToDate(false);
}
calcAMI();

View File

@ -108,7 +108,7 @@ void Foam::calculatedProcessorGAMGInterfaceField::initInterfaceMatrixUpdate
if
(
commsType == Pstream::commsTypes::nonBlocking
&& !Pstream::floatTransfer
&& !UPstream::floatTransfer
)
{
// Fast path.
@ -141,8 +141,7 @@ void Foam::calculatedProcessorGAMGInterfaceField::initInterfaceMatrixUpdate
procInterface_.compressedSend(commsType, scalarSendBuf_);
}
const_cast<calculatedProcessorGAMGInterfaceField&>(*this).updatedMatrix()
= false;
this->updatedMatrix(false);
}
@ -158,7 +157,7 @@ void Foam::calculatedProcessorGAMGInterfaceField::updateInterfaceMatrix
const Pstream::commsTypes commsType
) const
{
if (updatedMatrix())
if (this->updatedMatrix())
{
return;
}
@ -168,7 +167,7 @@ void Foam::calculatedProcessorGAMGInterfaceField::updateInterfaceMatrix
if
(
commsType == Pstream::commsTypes::nonBlocking
&& !Pstream::floatTransfer
&& !UPstream::floatTransfer
)
{
// Fast path: consume straight from receive buffer
@ -199,8 +198,7 @@ void Foam::calculatedProcessorGAMGInterfaceField::updateInterfaceMatrix
addToInternalField(result, !add, faceCells, coeffs, pnf);
}
const_cast<calculatedProcessorGAMGInterfaceField&>(*this).updatedMatrix()
= true;
this->updatedMatrix(true);
}

View File

@ -32,13 +32,8 @@ License
namespace Foam
{
defineTypeNameAndDebug(oversetLduInterface, 0);
defineTypeName(oversetLduInterface);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::oversetLduInterface::~oversetLduInterface()
{}
// ************************************************************************* //

View File

@ -34,8 +34,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef oversetLduInterface_H
#define oversetLduInterface_H
#ifndef Foam_oversetLduInterface_H
#define Foam_oversetLduInterface_H
#include "typeInfo.H"
@ -53,18 +53,17 @@ class oversetLduInterface
public:
//- Runtime type information
TypeName("oversetLduInterface");
TypeNameNoDebug("oversetLduInterface");
// Constructors
//- Construct null
oversetLduInterface()
{}
//- Default construct
oversetLduInterface() noexcept = default;
//- Destructor
virtual ~oversetLduInterface();
virtual ~oversetLduInterface() = default;
};