diff --git a/src/foam/global/controlSwitches/constantsSwitch.H b/src/foam/global/controlSwitches/constantsSwitch.H index 01fafa035..dd6bb7f03 100644 --- a/src/foam/global/controlSwitches/constantsSwitch.H +++ b/src/foam/global/controlSwitches/constantsSwitch.H @@ -59,6 +59,15 @@ class constantsSwitch : public controlSwitches { + // Private member functions + + //- Disallow construct as copy + constantsSwitch(const constantsSwitch&); + + //- Disallow default bitwise assignment + void operator=(const constantsSwitch&); + + public: // Constructors diff --git a/src/foam/global/controlSwitches/controlSwitches.C b/src/foam/global/controlSwitches/controlSwitches.C index f107c8030..de28ac95c 100644 --- a/src/foam/global/controlSwitches/controlSwitches.C +++ b/src/foam/global/controlSwitches/controlSwitches.C @@ -39,20 +39,6 @@ namespace debug // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template -Foam::debug::controlSwitches::controlSwitches() -: - switchValue_(Type(0)), - switchDescription_("") -{} - -template -Foam::debug::controlSwitches::controlSwitches(const T& switchValue) -: - switchValue_(switchValue) -{} - - template Foam::debug::controlSwitches::controlSwitches ( @@ -101,19 +87,6 @@ Foam::debug::controlSwitches::controlSwitches } -template -Foam::debug::controlSwitches::controlSwitches -( - const debug::controlSwitches& csw -) -: - switchName_(csw.switchName_), - switchValue_(csw.switchValue_), - switchDescription_(csw.switchDescription_) -{} - - - // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // template @@ -137,37 +110,7 @@ Foam::debug::controlSwitches::~controlSwitches() } -// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * // - -template -void Foam::debug::controlSwitches::operator= -( - const debug::controlSwitches& rhs -) -{ - // Check for assignment to self - if (this == &rhs) - { - std::cerr - << "Foam::debug::controlSwitches::operator=" - << "(const Foam::controlSwitches&)" - << "--> FOAM FATAL ERROR: " - << "Attempted assignment to self" - << std::endl; - - std::abort(); - - exit(-1); - } - else - { - switchValue_ = rhs.switchValue_; - switchDescription_ = rhs.switchDescription_; - } -} - - -// * * * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * // +// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // template void printControlSwitches diff --git a/src/foam/global/controlSwitches/controlSwitches.H b/src/foam/global/controlSwitches/controlSwitches.H index 06e05bd5e..e6f144fa2 100644 --- a/src/foam/global/controlSwitches/controlSwitches.H +++ b/src/foam/global/controlSwitches/controlSwitches.H @@ -231,16 +231,19 @@ class controlSwitches switchValuesTable_; + // Private member functions + + //- Disallow construct as copy + controlSwitches(const controlSwitches&); + + //- Disallow default bitwise assignment + void operator=(const controlSwitches&); + + public: // Constructors - //- Construct null - controlSwitches(); - - //- Construct from components - explicit controlSwitches(const T& data); - controlSwitches ( const std::string& switchName, @@ -251,9 +254,6 @@ public: switchesValues ); - //- Construct as copy - controlSwitches(const controlSwitches&); - //- Destructor ~controlSwitches(); @@ -262,7 +262,7 @@ public: // Member Functions // Check - bool boolean_test() const + bool test() const { // Perform Boolean logic here return switchValue_ != 0; @@ -274,9 +274,6 @@ public: //- Assignement operator void operator=(const T&); - //- Assignement operator - void operator=(const controlSwitches&); - //- & operator const T operator&(const T&); diff --git a/src/foam/global/controlSwitches/debugSwitch.H b/src/foam/global/controlSwitches/debugSwitch.H index 671091afe..22c560b7a 100644 --- a/src/foam/global/controlSwitches/debugSwitch.H +++ b/src/foam/global/controlSwitches/debugSwitch.H @@ -58,6 +58,15 @@ class debugSwitch : public controlSwitches { + // Private member functions + + //- Disallow construct as copy + debugSwitch(const debugSwitch&); + + //- Disallow default bitwise assignment + void operator=(const debugSwitch&); + + public: // Constructors diff --git a/src/foam/global/controlSwitches/infoSwitch.H b/src/foam/global/controlSwitches/infoSwitch.H index 1f9200cac..5ae398d93 100644 --- a/src/foam/global/controlSwitches/infoSwitch.H +++ b/src/foam/global/controlSwitches/infoSwitch.H @@ -54,8 +54,18 @@ ListInfoControlSwitches; extern ListInfoControlSwitches* infoSwitchValues_; class infoSwitch - : public controlSwitches +: + public controlSwitches { + // Private member functions + + //- Disallow construct as copy + infoSwitch(const infoSwitch&); + + //- Disallow default bitwise assignment + void operator=(const infoSwitch&); + + public: // Constructors diff --git a/src/foam/global/controlSwitches/optimisationSwitch.H b/src/foam/global/controlSwitches/optimisationSwitch.H index afe9dea39..a66ee7498 100644 --- a/src/foam/global/controlSwitches/optimisationSwitch.H +++ b/src/foam/global/controlSwitches/optimisationSwitch.H @@ -59,6 +59,15 @@ class optimisationSwitch : public controlSwitches { + // Private member functions + + //- Disallow construct as copy + optimisationSwitch(const optimisationSwitch&); + + //- Disallow default bitwise assignment + void operator=(const optimisationSwitch&); + + public: // Constructors diff --git a/src/foam/global/controlSwitches/safeBool.H b/src/foam/global/controlSwitches/safeBool.H index 39e00a80e..1dd9eade0 100644 --- a/src/foam/global/controlSwitches/safeBool.H +++ b/src/foam/global/controlSwitches/safeBool.H @@ -78,7 +78,7 @@ public: operator boolType() const { - return (static_cast(this))->boolean_test() + return (static_cast(this))->test() ? &safeBoolBase::thisTypeDoesNotSupportComparisons : 0; } diff --git a/src/foam/global/controlSwitches/tolerancesSwitch.H b/src/foam/global/controlSwitches/tolerancesSwitch.H index 001f9b061..5f5f22bed 100644 --- a/src/foam/global/controlSwitches/tolerancesSwitch.H +++ b/src/foam/global/controlSwitches/tolerancesSwitch.H @@ -58,6 +58,15 @@ class tolerancesSwitch : public controlSwitches { + // Private member functions + + //- Disallow construct as copy + tolerancesSwitch(const tolerancesSwitch&); + + //- Disallow default bitwise assignment + void operator=(const tolerancesSwitch&); + + public: // Constructors diff --git a/src/foam/matrices/blockLduMatrix/BlockLduMatrix/BlockLduMatrix.C b/src/foam/matrices/blockLduMatrix/BlockLduMatrix/BlockLduMatrix.C index dad0bcbd3..86cf42339 100644 --- a/src/foam/matrices/blockLduMatrix/BlockLduMatrix/BlockLduMatrix.C +++ b/src/foam/matrices/blockLduMatrix/BlockLduMatrix/BlockLduMatrix.C @@ -351,35 +351,54 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const BlockLduMatrix& ldum) else { // Dummy write for consistency - os.writeKeyword("diagonal") << typename BlockLduMatrix::TypeCoeffField - (ldum.lduAddr().size()) << token::END_STATEMENT << nl; + os.writeKeyword("diagonal") + << typename BlockLduMatrix::TypeCoeffField + ( + ldum.lduAddr().size() + ) + << token::END_STATEMENT << nl; } if (ldum.upperPtr_) { - os.writeKeyword("upper") << *ldum.upperPtr_ << token::END_STATEMENT << nl; + os.writeKeyword("upper") + << *ldum.upperPtr_ + << token::END_STATEMENT << nl; } else { // Dummy write for consistency - os.writeKeyword("upper") << typename BlockLduMatrix::TypeCoeffField - (ldum.lduAddr().lowerAddr().size()) << token::END_STATEMENT << nl; + os.writeKeyword("upper") + << typename BlockLduMatrix::TypeCoeffField + ( + ldum.lduAddr().lowerAddr().size() + ) + << token::END_STATEMENT << nl; } if (ldum.lowerPtr_) { - os.writeKeyword("lower") << *ldum.lowerPtr_ << token::END_STATEMENT << nl; + os.writeKeyword("lower") + << *ldum.lowerPtr_ << token::END_STATEMENT << nl; } else { // Dummy write for consistency - os.writeKeyword("lower") << typename BlockLduMatrix::TypeCoeffField - (ldum.lduAddr().lowerAddr().size()) << token::END_STATEMENT << nl; + os.writeKeyword("lower") + << typename BlockLduMatrix::TypeCoeffField + ( + ldum.lduAddr().lowerAddr().size() + ) + << token::END_STATEMENT << nl; } - os.writeKeyword("coupleUpper") << ldum.coupleUpper_ << token::END_STATEMENT << endl; + os.writeKeyword("coupleUpper") + << ldum.coupleUpper_ + << token::END_STATEMENT << endl; - os.writeKeyword("coupleLower") << ldum.coupleLower_ << token::END_STATEMENT << endl; + os.writeKeyword("coupleLower") + << ldum.coupleLower_ + << token::END_STATEMENT << endl; os.check("Ostream& operator<<(Ostream&, const BlockLduMatrix&"); diff --git a/src/lduSolvers/amg/coarseAmgLevel.C b/src/lduSolvers/amg/coarseAmgLevel.C index 3e026cbe5..c4a9deda5 100644 --- a/src/lduSolvers/amg/coarseAmgLevel.C +++ b/src/lduSolvers/amg/coarseAmgLevel.C @@ -209,7 +209,7 @@ void Foam::coarseAmgLevel::solve } // Switch of debug in top-level direct solve - debug::debugSwitch oldDebug = lduMatrix::debug; + label oldDebug = lduMatrix::debug(); if (matrixPtr_->matrix().symmetric()) {