diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertex.H b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertex.H index 17eae124f7..22271ebe6a 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertex.H +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertex.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -107,7 +107,7 @@ class indexedVertex public Foam::indexedVertexEnum, public Vb { - // Private data + // Private Data //- Type of pair-point vertexType type_; @@ -144,6 +144,13 @@ public: typedef indexedVertex Other; }; + + // Generated Methods + + //- Copy construct + indexedVertex(const indexedVertex&) = default; + + // Constructors inline indexedVertex(); @@ -261,6 +268,10 @@ public: //- Fix the vertex so that it can't be moved inline bool& fixed(); + + // Member Operators + + //- Copy assignment inline void operator=(const indexedVertex& rhs) { Vb::operator=(rhs); @@ -291,10 +302,9 @@ public: } - // Info + // IOstream Operators - //- Return info proxy. - // Used to print indexedVertex information to a stream + //- Info proxy, to print information to a stream Foam::InfoProxy> info() const { return *this; diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.H index 23336a4fe3..ee6e119341 100644 --- a/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -56,10 +57,16 @@ class valuePointPatchField { public: - //- Runtime type information + //- Declare type-name, virtual type (with debug switch) TypeName("value"); + // Generated Methods + + //- Copy construct + valuePointPatchField(const valuePointPatchField&) = default; + + // Constructors //- Construct from patch and internal field @@ -123,7 +130,7 @@ public: } - // Member functions + // Member Functions // Access @@ -168,7 +175,7 @@ public: virtual void write(Ostream&) const; - // Member operators + // Member Operators // Assignment operators diff --git a/src/OpenFOAM/primitives/random/Random/Rand48.H b/src/OpenFOAM/primitives/random/Random/Rand48.H index d862e06a70..3069bd0228 100644 --- a/src/OpenFOAM/primitives/random/Random/Rand48.H +++ b/src/OpenFOAM/primitives/random/Random/Rand48.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -95,7 +95,7 @@ public: // Constructors //- Construct with specified or default seed - Rand48(uint32_t val = default_seed) + explicit Rand48(uint32_t val = default_seed) : engine_(convert(val)) {} diff --git a/src/OpenFOAM/primitives/random/Random/Random.C b/src/OpenFOAM/primitives/random/Random/Random.C index 795522aa6c..2094b06340 100644 --- a/src/OpenFOAM/primitives/random/Random/Random.C +++ b/src/OpenFOAM/primitives/random/Random/Random.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2017-2018 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -40,13 +40,9 @@ Foam::Random::Random(const label seedValue) {} -Foam::Random::Random(const Random& r, const bool reset) +Foam::Random::Random(const Random& rnd, const bool reset) : - seed_(r.seed_), - generator_(r.generator_), - uniform01_(), - hasGaussSample_(r.hasGaussSample_), - gaussSample_(r.gaussSample_) + Random(rnd) { if (reset) { diff --git a/src/OpenFOAM/primitives/random/Random/Random.H b/src/OpenFOAM/primitives/random/Random/Random.H index c09fd3ac58..98fbfe092c 100644 --- a/src/OpenFOAM/primitives/random/Random/Random.H +++ b/src/OpenFOAM/primitives/random/Random/Random.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2015 OpenFOAM Foundation - Copyright (C) 2017-2019 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -50,7 +50,7 @@ SourceFiles namespace Foam { -// Forward declarations +// Forward Declarations template class UList; /*---------------------------------------------------------------------------*\ @@ -85,7 +85,7 @@ class Random public: - // Forward declarations - generator classes + // Forward Declarations - generator classes template class uniformGeneratorOp; template class gaussianGeneratorOp; @@ -101,12 +101,8 @@ public: //- Construct with seed value explicit Random(const label seedValue = defaultSeed); - //- Copy construct with optional reset of seed - Random(const Random& r, const bool reset = false); - - - //- Destructor - ~Random() = default; + //- Copy construct with possible reset of seed + Random(const Random& rnd, const bool reset); // Member Functions @@ -221,7 +217,7 @@ class Random::uniformGeneratorOp : public Random { - // Private data + // Private Data //- The interval const T min_; @@ -242,7 +238,7 @@ public: // Constructors - //- Construct null or with seed value. Uses default [0,1] interval + //- Default construct or with seed value. Uses default [0,1] interval explicit uniformGeneratorOp(const label seed = Random::defaultSeed) : uniformGeneratorOp(seed, pTraits::zero, pTraits::one) @@ -293,7 +289,6 @@ class Random::gaussianGeneratorOp : public Random { - // Private Member Functions //- Generate a random number. Treat as mutable. @@ -308,7 +303,7 @@ public: // Constructors - //- Construct null or with seed value. Uses default [0,1] interval + //- Default construct or with seed value. Uses default [0,1] interval explicit gaussianGeneratorOp(const label seed = Random::defaultSeed) : Random(seed) diff --git a/src/engine/ignition/ignitionSite.C b/src/engine/ignition/ignitionSite.C index 564b000578..24f60ac3e7 100644 --- a/src/engine/ignition/ignitionSite.C +++ b/src/engine/ignition/ignitionSite.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -124,6 +125,11 @@ bool Foam::ignitionSite::ignited() const void Foam::ignitionSite::operator=(const ignitionSite& is) { + if (this == &is) + { + return; + } + location_ = is.location_; diameter_ = is.diameter_; time_ = is.time_; diff --git a/src/engine/ignition/ignitionSite.H b/src/engine/ignition/ignitionSite.H index 3f3f0f0484..630fc960ae 100644 --- a/src/engine/ignition/ignitionSite.H +++ b/src/engine/ignition/ignitionSite.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -50,6 +51,7 @@ SourceFiles namespace Foam { +// Forward Declarations class Time; class engineTime; class fvMesh; @@ -60,7 +62,7 @@ class fvMesh; class ignitionSite { - // Private data + // Private Data const Time& db_; const fvMesh& mesh_; @@ -88,10 +90,9 @@ class ignitionSite public: - // Public classes + // Public Classes - //- Class used for the read-construction of - // PtrLists of ignitionSite + //- Read-construction of PtrLists of ignitionSite class iNew { const Time& db_; @@ -112,6 +113,12 @@ public: }; + // Generated Methods + + //- Copy construct + ignitionSite(const ignitionSite&) = default; + + // Constructors //- Construct from Istream and database diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionState.C b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionState.C index 74604f9447..a4d1d6e966 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionState.C +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionState.C @@ -61,24 +61,4 @@ Foam::sixDoFRigidBodyMotionState::sixDoFRigidBodyMotionState {} -Foam::sixDoFRigidBodyMotionState::sixDoFRigidBodyMotionState -( - const sixDoFRigidBodyMotionState& sDoFRBMS -) -: - centreOfRotation_(sDoFRBMS.centreOfRotation()), - Q_(sDoFRBMS.Q()), - v_(sDoFRBMS.v()), - a_(sDoFRBMS.a()), - pi_(sDoFRBMS.pi()), - tau_(sDoFRBMS.tau()) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::sixDoFRigidBodyMotionState::~sixDoFRigidBodyMotionState() -{} - - // ************************************************************************* // diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionState.H b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionState.H index 0711471a3c..2194c43ec1 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionState.H +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionState.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2014 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -52,11 +53,9 @@ SourceFiles namespace Foam { -// Forward declaration of classes +// Forward Declarations class Istream; class Ostream; - -// Forward declaration of friend functions and operators class sixDoFRigidBodyMotionState; Istream& operator>>(Istream&, sixDoFRigidBodyMotionState&); Ostream& operator<<(Ostream&, const sixDoFRigidBodyMotionState&); @@ -68,21 +67,22 @@ Ostream& operator<<(Ostream&, const sixDoFRigidBodyMotionState&); class sixDoFRigidBodyMotionState { - // Private data + // Private Data //- Current position of the centre of mass of the body point centreOfRotation_; //- Orientation, stored as the rotation tensor to transform - // from the body to the global reference frame, i.e.: + //- from the body to the global reference frame + // i.e.: // globalVector = Q_ & bodyLocalVector // bodyLocalVector = Q_.T() & globalVector tensor Q_; - // Linear velocity of body + //- Linear velocity of body vector v_; - // Total linear acceleration of body + //- Total linear acceleration of body vector a_; //- Angular momentum of body, in body local reference frame @@ -96,19 +96,12 @@ public: // Constructors - //- Construct null + //- Default construct, zero-initialized with identity transformation sixDoFRigidBodyMotionState(); //- Construct from dictionary sixDoFRigidBodyMotionState(const dictionary& dict); - //- Construct as copy - sixDoFRigidBodyMotionState(const sixDoFRigidBodyMotionState&); - - - //- Destructor - ~sixDoFRigidBodyMotionState(); - // Member Functions @@ -158,7 +151,7 @@ public: void write(dictionary& dict) const; //- Write to stream - void write(Ostream&) const; + void write(Ostream& os) const; // IOstream Operators