mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
COMP: improvements to selection table helper classes
- make constructors explicit, delete unused constructors
This commit is contained in:
committed by
Andrew Heather
parent
3238a63a10
commit
cb53ce3678
@ -58,7 +58,11 @@ struct addstopAtWriteNowSignalToOpt
|
|||||||
:
|
:
|
||||||
public ::Foam::simpleRegIOobject
|
public ::Foam::simpleRegIOobject
|
||||||
{
|
{
|
||||||
addstopAtWriteNowSignalToOpt(const char* name)
|
addstopAtWriteNowSignalToOpt(const addstopAtWriteNowSignalToOpt&) = delete;
|
||||||
|
|
||||||
|
void operator=(const addstopAtWriteNowSignalToOpt&) = delete;
|
||||||
|
|
||||||
|
explicit addstopAtWriteNowSignalToOpt(const char* name)
|
||||||
:
|
:
|
||||||
::Foam::simpleRegIOobject(Foam::debug::addOptimisationObject, name)
|
::Foam::simpleRegIOobject(Foam::debug::addOptimisationObject, name)
|
||||||
{}
|
{}
|
||||||
@ -67,7 +71,7 @@ struct addstopAtWriteNowSignalToOpt
|
|||||||
|
|
||||||
virtual void readData(Foam::Istream& is)
|
virtual void readData(Foam::Istream& is)
|
||||||
{
|
{
|
||||||
sigStopAtWriteNow::signal_ = readLabel(is);
|
is >> sigStopAtWriteNow::signal_;
|
||||||
sigStopAtWriteNow::set(true);
|
sigStopAtWriteNow::set(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -58,7 +58,11 @@ struct addwriteNowSignalToOpt
|
|||||||
:
|
:
|
||||||
public ::Foam::simpleRegIOobject
|
public ::Foam::simpleRegIOobject
|
||||||
{
|
{
|
||||||
addwriteNowSignalToOpt(const char* name)
|
addwriteNowSignalToOpt(const addwriteNowSignalToOpt&) = delete;
|
||||||
|
|
||||||
|
void operator=(const addwriteNowSignalToOpt&) = delete;
|
||||||
|
|
||||||
|
explicit addwriteNowSignalToOpt(const char* name)
|
||||||
:
|
:
|
||||||
::Foam::simpleRegIOobject(Foam::debug::addOptimisationObject, name)
|
::Foam::simpleRegIOobject(Foam::debug::addOptimisationObject, name)
|
||||||
{}
|
{}
|
||||||
@ -67,7 +71,7 @@ struct addwriteNowSignalToOpt
|
|||||||
|
|
||||||
virtual void readData(Foam::Istream& is)
|
virtual void readData(Foam::Istream& is)
|
||||||
{
|
{
|
||||||
sigWriteNow::signal_ = readLabel(is);
|
is >> sigWriteNow::signal_;
|
||||||
sigWriteNow::set(true);
|
sigWriteNow::set(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -60,7 +60,11 @@ class addstopAtWriteNowSignalToOpt
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
addstopAtWriteNowSignalToOpt(const char* name)
|
addstopAtWriteNowSignalToOpt(const addstopAtWriteNowSignalToOpt&) = delete;
|
||||||
|
|
||||||
|
void operator=(const addstopAtWriteNowSignalToOpt&) = delete;
|
||||||
|
|
||||||
|
explicit addstopAtWriteNowSignalToOpt(const char* name)
|
||||||
:
|
:
|
||||||
::Foam::simpleRegIOobject(Foam::debug::addOptimisationObject, name)
|
::Foam::simpleRegIOobject(Foam::debug::addOptimisationObject, name)
|
||||||
{}
|
{}
|
||||||
@ -69,7 +73,7 @@ public:
|
|||||||
|
|
||||||
virtual void readData(Foam::Istream& is)
|
virtual void readData(Foam::Istream& is)
|
||||||
{
|
{
|
||||||
sigStopAtWriteNow::signal_ = readLabel(is);
|
is >> sigStopAtWriteNow::signal_;
|
||||||
sigStopAtWriteNow::set(true);
|
sigStopAtWriteNow::set(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -60,7 +60,11 @@ class addwriteNowSignalToOpt
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
addwriteNowSignalToOpt(const char* name)
|
addwriteNowSignalToOpt(const addwriteNowSignalToOpt&) = delete;
|
||||||
|
|
||||||
|
void operator=(const addwriteNowSignalToOpt&) = delete;
|
||||||
|
|
||||||
|
explicit addwriteNowSignalToOpt(const char* name)
|
||||||
:
|
:
|
||||||
::Foam::simpleRegIOobject(Foam::debug::addOptimisationObject, name)
|
::Foam::simpleRegIOobject(Foam::debug::addOptimisationObject, name)
|
||||||
{}
|
{}
|
||||||
@ -69,7 +73,7 @@ public:
|
|||||||
|
|
||||||
virtual void readData(Foam::Istream& is)
|
virtual void readData(Foam::Istream& is)
|
||||||
{
|
{
|
||||||
sigWriteNow::signal_ = readLabel(is);
|
is >> sigWriteNow::signal_;
|
||||||
sigWriteNow::set(true);
|
sigWriteNow::set(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -61,6 +61,7 @@ Foam::IOobject::fileCheckTypes Foam::IOobject::fileModificationChecking
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
//! \cond file-scope
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
// Register re-reader
|
// Register re-reader
|
||||||
@ -70,7 +71,13 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
addfileModificationCheckingToOpt(const char* name)
|
addfileModificationCheckingToOpt
|
||||||
|
(const addfileModificationCheckingToOpt&) = delete;
|
||||||
|
|
||||||
|
void operator=
|
||||||
|
(const addfileModificationCheckingToOpt&) = delete;
|
||||||
|
|
||||||
|
explicit addfileModificationCheckingToOpt(const char* name)
|
||||||
:
|
:
|
||||||
::Foam::simpleRegIOobject(Foam::debug::addOptimisationObject, name)
|
::Foam::simpleRegIOobject(Foam::debug::addOptimisationObject, name)
|
||||||
{}
|
{}
|
||||||
@ -94,7 +101,9 @@ namespace Foam
|
|||||||
(
|
(
|
||||||
"fileModificationChecking"
|
"fileModificationChecking"
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
} // End namespace Foam
|
||||||
|
//! \endcond
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -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.
|
||||||
@ -74,7 +75,7 @@ Description
|
|||||||
return autoPtr<baseType>(new baseType##Type parList); \
|
return autoPtr<baseType>(new baseType##Type parList); \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
add##argNames##ConstructorToTable \
|
explicit add##argNames##ConstructorToTable \
|
||||||
( \
|
( \
|
||||||
const word& lookup = baseType##Type::typeName \
|
const word& lookup = baseType##Type::typeName \
|
||||||
) \
|
) \
|
||||||
@ -93,6 +94,12 @@ Description
|
|||||||
{ \
|
{ \
|
||||||
destroy##argNames##ConstructorTables(); \
|
destroy##argNames##ConstructorTables(); \
|
||||||
} \
|
} \
|
||||||
|
\
|
||||||
|
add##argNames##ConstructorToTable \
|
||||||
|
(const add##argNames##ConstructorToTable&) = delete; \
|
||||||
|
\
|
||||||
|
void operator= \
|
||||||
|
(const add##argNames##ConstructorToTable&) = delete; \
|
||||||
}; \
|
}; \
|
||||||
\
|
\
|
||||||
/* Class to add constructor from argList to table */ \
|
/* Class to add constructor from argList to table */ \
|
||||||
@ -100,22 +107,21 @@ Description
|
|||||||
template<class baseType##Type> \
|
template<class baseType##Type> \
|
||||||
class addRemovable##argNames##ConstructorToTable \
|
class addRemovable##argNames##ConstructorToTable \
|
||||||
{ \
|
{ \
|
||||||
/* retain lookup name for later removal */ \
|
|
||||||
const word& lookup_; \
|
|
||||||
\
|
|
||||||
public: \
|
public: \
|
||||||
\
|
\
|
||||||
|
const word name; /* Lookup name for later removal */ \
|
||||||
|
\
|
||||||
static autoPtr<baseType> New argList \
|
static autoPtr<baseType> New argList \
|
||||||
{ \
|
{ \
|
||||||
return autoPtr<baseType>(new baseType##Type parList); \
|
return autoPtr<baseType>(new baseType##Type parList); \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
addRemovable##argNames##ConstructorToTable \
|
explicit addRemovable##argNames##ConstructorToTable \
|
||||||
( \
|
( \
|
||||||
const word& lookup = baseType##Type::typeName \
|
const word& lookup = baseType##Type::typeName \
|
||||||
) \
|
) \
|
||||||
: \
|
: \
|
||||||
lookup_(lookup) \
|
name(lookup) \
|
||||||
{ \
|
{ \
|
||||||
construct##argNames##ConstructorTables(); \
|
construct##argNames##ConstructorTables(); \
|
||||||
argNames##ConstructorTablePtr_->set(lookup, New); \
|
argNames##ConstructorTablePtr_->set(lookup, New); \
|
||||||
@ -125,9 +131,15 @@ Description
|
|||||||
{ \
|
{ \
|
||||||
if (argNames##ConstructorTablePtr_) \
|
if (argNames##ConstructorTablePtr_) \
|
||||||
{ \
|
{ \
|
||||||
argNames##ConstructorTablePtr_->erase(lookup_); \
|
argNames##ConstructorTablePtr_->erase(name); \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
|
\
|
||||||
|
addRemovable##argNames##ConstructorToTable \
|
||||||
|
(const addRemovable##argNames##ConstructorToTable&) = delete; \
|
||||||
|
\
|
||||||
|
void operator= \
|
||||||
|
(const addRemovable##argNames##ConstructorToTable&) = delete; \
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -163,7 +175,7 @@ Description
|
|||||||
return autoPtr<baseType>(baseType##Type::New parList.ptr()); \
|
return autoPtr<baseType>(baseType##Type::New parList.ptr()); \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
add##argNames##ConstructorToTable \
|
explicit add##argNames##ConstructorToTable \
|
||||||
( \
|
( \
|
||||||
const word& lookup = baseType##Type::typeName \
|
const word& lookup = baseType##Type::typeName \
|
||||||
) \
|
) \
|
||||||
@ -189,28 +201,33 @@ Description
|
|||||||
{ \
|
{ \
|
||||||
destroy##argNames##ConstructorTables(); \
|
destroy##argNames##ConstructorTables(); \
|
||||||
} \
|
} \
|
||||||
|
\
|
||||||
|
add##argNames##ConstructorToTable \
|
||||||
|
(const add##argNames##ConstructorToTable&) = delete; \
|
||||||
|
\
|
||||||
|
void operator= \
|
||||||
|
(const add##argNames##ConstructorToTable&) = delete; \
|
||||||
}; \
|
}; \
|
||||||
\
|
\
|
||||||
/* Class to add constructor from argList to table */ \
|
/* Class to add constructor from argList to table */ \
|
||||||
template<class baseType##Type> \
|
template<class baseType##Type> \
|
||||||
class addRemovable##argNames##ConstructorToTable \
|
class addRemovable##argNames##ConstructorToTable \
|
||||||
{ \
|
{ \
|
||||||
/* retain lookup name for later removal */ \
|
|
||||||
const word& lookup_; \
|
|
||||||
\
|
|
||||||
public: \
|
public: \
|
||||||
\
|
\
|
||||||
|
const word name; /* Lookup name for later removal */ \
|
||||||
|
\
|
||||||
static autoPtr<baseType> New##baseType argList \
|
static autoPtr<baseType> New##baseType argList \
|
||||||
{ \
|
{ \
|
||||||
return autoPtr<baseType>(baseType##Type::New parList.ptr()); \
|
return autoPtr<baseType>(baseType##Type::New parList.ptr()); \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
addRemovable##argNames##ConstructorToTable \
|
explicit addRemovable##argNames##ConstructorToTable \
|
||||||
( \
|
( \
|
||||||
const word& lookup = baseType##Type::typeName \
|
const word& lookup = baseType##Type::typeName \
|
||||||
) \
|
) \
|
||||||
: \
|
: \
|
||||||
lookup_(lookup) \
|
name(lookup) \
|
||||||
{ \
|
{ \
|
||||||
construct##argNames##ConstructorTables(); \
|
construct##argNames##ConstructorTables(); \
|
||||||
argNames##ConstructorTablePtr_->set \
|
argNames##ConstructorTablePtr_->set \
|
||||||
@ -224,9 +241,15 @@ Description
|
|||||||
{ \
|
{ \
|
||||||
if (argNames##ConstructorTablePtr_) \
|
if (argNames##ConstructorTablePtr_) \
|
||||||
{ \
|
{ \
|
||||||
argNames##ConstructorTablePtr_->erase(lookup_); \
|
argNames##ConstructorTablePtr_->erase(name); \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
|
\
|
||||||
|
addRemovable##argNames##ConstructorToTable \
|
||||||
|
(const addRemovable##argNames##ConstructorToTable&) = delete; \
|
||||||
|
\
|
||||||
|
void operator= \
|
||||||
|
(const addRemovable##argNames##ConstructorToTable&) = delete; \
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -265,7 +288,7 @@ Description
|
|||||||
\
|
\
|
||||||
/* Define the constructor function table */ \
|
/* Define the constructor function table */ \
|
||||||
baseType::argNames##ConstructorTable* \
|
baseType::argNames##ConstructorTable* \
|
||||||
baseType::argNames##ConstructorTablePtr_ = nullptr
|
baseType::argNames##ConstructorTablePtr_(nullptr)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -329,7 +352,7 @@ Description
|
|||||||
\
|
\
|
||||||
/* Define the constructor function table */ \
|
/* Define the constructor function table */ \
|
||||||
baseType<Targ>::argNames##ConstructorTable* \
|
baseType<Targ>::argNames##ConstructorTable* \
|
||||||
baseType<Targ>::argNames##ConstructorTablePtr_ = nullptr
|
baseType<Targ>::argNames##ConstructorTablePtr_(nullptr)
|
||||||
|
|
||||||
|
|
||||||
//- Define run-time selection table for template classes
|
//- Define run-time selection table for template classes
|
||||||
|
|||||||
@ -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.
|
||||||
@ -23,9 +24,6 @@ License
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::memberFunctionSelectionTables
|
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Macros to enable the easy declaration of member function selection tables.
|
Macros to enable the easy declaration of member function selection tables.
|
||||||
|
|
||||||
@ -62,7 +60,7 @@ Description
|
|||||||
{ \
|
{ \
|
||||||
public: \
|
public: \
|
||||||
\
|
\
|
||||||
add##memberFunction##argNames##MemberFunctionToTable \
|
explicit add##memberFunction##argNames##MemberFunctionToTable \
|
||||||
( \
|
( \
|
||||||
const word& lookup = baseType##Type::typeName \
|
const word& lookup = baseType##Type::typeName \
|
||||||
) \
|
) \
|
||||||
@ -114,9 +112,10 @@ Description
|
|||||||
{ \
|
{ \
|
||||||
if (baseType::memberFunction##argNames##MemberFunctionTablePtr_) \
|
if (baseType::memberFunction##argNames##MemberFunctionTablePtr_) \
|
||||||
{ \
|
{ \
|
||||||
delete baseType::memberFunction##argNames##MemberFunctionTablePtr_;\
|
delete baseType::memberFunction##argNames## \
|
||||||
baseType::memberFunction##argNames##MemberFunctionTablePtr_ = \
|
MemberFunctionTablePtr_; \
|
||||||
nullptr; \
|
baseType::memberFunction##argNames## \
|
||||||
|
MemberFunctionTablePtr_ = nullptr; \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,8 +125,7 @@ Description
|
|||||||
\
|
\
|
||||||
/* Define the memberFunction table */ \
|
/* Define the memberFunction table */ \
|
||||||
baseType::memberFunction##argNames##MemberFunctionTable* \
|
baseType::memberFunction##argNames##MemberFunctionTable* \
|
||||||
baseType::memberFunction##argNames##MemberFunctionTablePtr_ = nullptr
|
baseType::memberFunction##argNames##MemberFunctionTablePtr_(nullptr)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -189,10 +187,7 @@ Description
|
|||||||
void baseType<Targ>::destroy##memberFunction##argNames## \
|
void baseType<Targ>::destroy##memberFunction##argNames## \
|
||||||
MemberFunctionTables() \
|
MemberFunctionTables() \
|
||||||
{ \
|
{ \
|
||||||
if \
|
if (baseType<Targ>::memberFunction##argNames##MemberFunctionTablePtr_) \
|
||||||
( \
|
|
||||||
baseType<Targ>::memberFunction##argNames##MemberFunctionTablePtr_ \
|
|
||||||
) \
|
|
||||||
{ \
|
{ \
|
||||||
delete baseType<Targ>::memberFunction##argNames## \
|
delete baseType<Targ>::memberFunction##argNames## \
|
||||||
MemberFunctionTablePtr_; \
|
MemberFunctionTablePtr_; \
|
||||||
@ -209,8 +204,8 @@ Description
|
|||||||
\
|
\
|
||||||
/* Define the memberFunction table */ \
|
/* Define the memberFunction table */ \
|
||||||
baseType<Targ>::memberFunction##argNames##MemberFunctionTable* \
|
baseType<Targ>::memberFunction##argNames##MemberFunctionTable* \
|
||||||
baseType<Targ>::memberFunction##argNames##MemberFunctionTablePtr_ = \
|
baseType<Targ>::memberFunction##argNames## \
|
||||||
nullptr
|
MemberFunctionTablePtr_(nullptr)
|
||||||
|
|
||||||
|
|
||||||
//- Define run-time selection table for template classes
|
//- Define run-time selection table for template classes
|
||||||
|
|||||||
@ -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.
|
||||||
@ -44,6 +45,8 @@ dictionary* dimensionSystemsPtr_(nullptr);
|
|||||||
HashTable<dimensionedScalar>* unitSetPtr_(nullptr);
|
HashTable<dimensionedScalar>* unitSetPtr_(nullptr);
|
||||||
dimensionSets* writeUnitSetPtr_(nullptr);
|
dimensionSets* writeUnitSetPtr_(nullptr);
|
||||||
|
|
||||||
|
//! \cond file-scope
|
||||||
|
|
||||||
// Helper class to
|
// Helper class to
|
||||||
// register re-reader
|
// register re-reader
|
||||||
// deallocate demand-driven data
|
// deallocate demand-driven data
|
||||||
@ -52,17 +55,22 @@ class addDimensionSetsToDebug
|
|||||||
public ::Foam::simpleRegIOobject
|
public ::Foam::simpleRegIOobject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
addDimensionSetsToDebug(const char* name)
|
|
||||||
|
addDimensionSetsToDebug(const addDimensionSetsToDebug&) = delete;
|
||||||
|
void operator=(const addDimensionSetsToDebug&) = delete;
|
||||||
|
|
||||||
|
explicit addDimensionSetsToDebug(const char* name)
|
||||||
:
|
:
|
||||||
::Foam::simpleRegIOobject(Foam::debug::addDimensionSetObject, name)
|
::Foam::simpleRegIOobject(Foam::debug::addDimensionSetObject, name)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
virtual ~addDimensionSetsToDebug()
|
virtual ~addDimensionSetsToDebug()
|
||||||
{
|
{
|
||||||
deleteDemandDrivenData(dimensionSystemsPtr_);
|
deleteDemandDrivenData(dimensionSystemsPtr_);
|
||||||
deleteDemandDrivenData(unitSetPtr_);
|
deleteDemandDrivenData(unitSetPtr_);
|
||||||
deleteDemandDrivenData(writeUnitSetPtr_);
|
deleteDemandDrivenData(writeUnitSetPtr_);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void readData(Foam::Istream& is)
|
virtual void readData(Foam::Istream& is)
|
||||||
{
|
{
|
||||||
deleteDemandDrivenData(dimensionSystemsPtr_);
|
deleteDemandDrivenData(dimensionSystemsPtr_);
|
||||||
@ -70,19 +78,23 @@ public:
|
|||||||
deleteDemandDrivenData(writeUnitSetPtr_);
|
deleteDemandDrivenData(writeUnitSetPtr_);
|
||||||
dimensionSystemsPtr_ = new dictionary(is);
|
dimensionSystemsPtr_ = new dictionary(is);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void writeData(Foam::Ostream& os) const
|
virtual void writeData(Foam::Ostream& os) const
|
||||||
{
|
{
|
||||||
os << dimensionSystems();
|
os << dimensionSystems();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
addDimensionSetsToDebug addDimensionSetsToDebug_("DimensionSets");
|
addDimensionSetsToDebug addDimensionSetsToDebug_("DimensionSets");
|
||||||
|
|
||||||
|
//! \endcond
|
||||||
|
|
||||||
|
|
||||||
dictionary& dimensionSystems()
|
dictionary& dimensionSystems()
|
||||||
{
|
{
|
||||||
if (!dimensionSystemsPtr_)
|
if (!dimensionSystemsPtr_)
|
||||||
{
|
{
|
||||||
dictionary* cachedPtr = nullptr;
|
dictionary* cachedPtr(nullptr);
|
||||||
dimensionSystemsPtr_ = new dictionary
|
dimensionSystemsPtr_ = new dictionary
|
||||||
(
|
(
|
||||||
debug::switchSet
|
debug::switchSet
|
||||||
@ -158,8 +170,8 @@ const HashTable<dimensionedScalar>& unitSet()
|
|||||||
}
|
}
|
||||||
|
|
||||||
writeUnitSetPtr_ = new dimensionSets(*unitSetPtr_, writeUnitNames);
|
writeUnitSetPtr_ = new dimensionSets(*unitSetPtr_, writeUnitNames);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return *unitSetPtr_;
|
return *unitSetPtr_;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,6 +220,7 @@ const dimensionSet dimDynamicViscosity(dimDensity*dimViscosity);
|
|||||||
|
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::dimensionSets::dimensionSets
|
Foam::dimensionSets::dimensionSets
|
||||||
|
|||||||
@ -52,9 +52,15 @@ public:
|
|||||||
//- The unique RegisterDebugSwitch object
|
//- The unique RegisterDebugSwitch object
|
||||||
static const RegisterDebugSwitch registerDebugSwitch;
|
static const RegisterDebugSwitch registerDebugSwitch;
|
||||||
|
|
||||||
RegisterDebugSwitch(const char* name)
|
//- No copy construct
|
||||||
|
RegisterDebugSwitch(const RegisterDebugSwitch<Type>&) = delete;
|
||||||
|
|
||||||
|
//- No copy assignment
|
||||||
|
void operator=(const RegisterDebugSwitch<Type>&) = delete;
|
||||||
|
|
||||||
|
explicit RegisterDebugSwitch(const char* name)
|
||||||
:
|
:
|
||||||
::Foam::simpleRegIOobject(Foam::debug::addDebugObject, name)
|
::Foam::simpleRegIOobject(::Foam::debug::addDebugObject, name)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
virtual ~RegisterDebugSwitch() = default;
|
virtual ~RegisterDebugSwitch() = default;
|
||||||
@ -72,6 +78,7 @@ public:
|
|||||||
|
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#define registerTemplateDebugSwitchWithName(Type,Name) \
|
#define registerTemplateDebugSwitchWithName(Type,Name) \
|
||||||
@ -87,19 +94,26 @@ public:
|
|||||||
public ::Foam::simpleRegIOobject \
|
public ::Foam::simpleRegIOobject \
|
||||||
{ \
|
{ \
|
||||||
public: \
|
public: \
|
||||||
add##Tag##ToDebug(const char* name) \
|
\
|
||||||
|
explicit add##Tag##ToDebug(const char* name) \
|
||||||
: \
|
: \
|
||||||
::Foam::simpleRegIOobject(::Foam::debug::addDebugObject, name) \
|
::Foam::simpleRegIOobject(::Foam::debug::addDebugObject, name) \
|
||||||
{} \
|
{} \
|
||||||
|
\
|
||||||
virtual ~add##Tag##ToDebug() = default; \
|
virtual ~add##Tag##ToDebug() = default; \
|
||||||
|
\
|
||||||
virtual void readData(::Foam::Istream& is) \
|
virtual void readData(::Foam::Istream& is) \
|
||||||
{ \
|
{ \
|
||||||
is >> Type::debug; \
|
is >> Type::debug; \
|
||||||
} \
|
} \
|
||||||
|
\
|
||||||
virtual void writeData(::Foam::Ostream& os) const \
|
virtual void writeData(::Foam::Ostream& os) const \
|
||||||
{ \
|
{ \
|
||||||
os << Type::debug; \
|
os << Type::debug; \
|
||||||
} \
|
} \
|
||||||
|
\
|
||||||
|
add##Tag##ToDebug(const add##Tag##ToDebug&) = delete; \
|
||||||
|
void operator=(const add##Tag##ToDebug&) = delete; \
|
||||||
}; \
|
}; \
|
||||||
add##Tag##ToDebug add##Tag##ToDebug_(Name)
|
add##Tag##ToDebug add##Tag##ToDebug_(Name)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user