View Issue Details

IDProjectCategoryView StatusLast Update
0002138OpenFOAMPatchpublic2016-07-03 23:19
Reporterwyldckat Assigned Tohenry  
PrioritylowSeveritytextReproducibilityN/A
Status resolvedResolutionfixed 
Product Versiondev 
Summary0002138: Typos in "removeRegisteredObject.H" and "writeObjects.H"
DescriptionWhile studying how to solve report #2090, I stumbled upon a typo on both of the aforementioned header files, where the documentation states that the parameter name is "objectNames", when the code instead looks for "objects".

The attached files aim to update the documentation according to what the code is looking for, i.e. "objects":

  - src/functionObjects/utilities/removeRegisteredObject/removeRegisteredObject.H
  - src/functionObjects/utilities/writeObjects/writeObjects.H
Additional InformationI haven't double-checked, but this should also apply without problems in the repository for OpenFOAM 4.x as well.
TagsNo tags attached.

Activities

wyldckat

2016-07-03 23:11

updater  

removeRegisteredObject.H (3,873 bytes)   
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     |
    \\  /    A nd           | Copyright (C) 2013-2016 OpenFOAM Foundation
     \\/     M anipulation  |
-------------------------------------------------------------------------------
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/>.

Class
    Foam::functionObjects::removeRegisteredObject

Group
    grpUtilitiesFunctionObjects

Description
    Removes registered objects if present in the database.

    Example of function object specification:
    \verbatim
    removeRegisteredObject1
    {
        type        removeRegisteredObject;
        libs        ("libutilityFunctionObjects.so");
        ...
        objects     (obj1 obj2);
    }
    \endverbatim

Usage
    \table
        Property     | Description             | Required    | Default value
        type         | type name: removeRegisteredObject | yes |
        objects      | objects to remove       | yes         |
    \endtable

See also
    Foam::functionObject

SourceFiles
    removeRegisteredObject.C

\*---------------------------------------------------------------------------*/

#ifndef functionObjects_removeRegisteredObject_H
#define functionObjects_removeRegisteredObject_H

#include "functionObject.H"
#include "wordList.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

namespace Foam
{

// Forward declaration of classes
class objectRegistry;

namespace functionObjects
{

/*---------------------------------------------------------------------------*\
                   Class removeRegisteredObject Declaration
\*---------------------------------------------------------------------------*/

class removeRegisteredObject
:
    public functionObject
{
    // Private data

        //- Reference to the objectRegistry
        const objectRegistry& obr_;

        //- Names of objects to control
        wordList objectNames_;


    // Private member functions

        //- Disallow default bitwise copy construct
        removeRegisteredObject(const removeRegisteredObject&);

        //- Disallow default bitwise assignment
        void operator=(const removeRegisteredObject&);


public:

    //- Runtime type information
    TypeName("removeRegisteredObject");


    // Constructors

        //- Construct from Time and dictionary
        removeRegisteredObject
        (
            const word& name,
            const Time& runTime,
            const dictionary& dict
        );


    //- Destructor
    virtual ~removeRegisteredObject();


    // Member Functions

        //- Read the removeRegisteredObject data
        virtual bool read(const dictionary&);

        //- Remove the registered objects
        virtual bool execute();

        //- Do nothing
        virtual bool write();
};


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

} // End namespace functionObjects
} // End namespace Foam

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#endif

// ************************************************************************* //
removeRegisteredObject.H (3,873 bytes)   

wyldckat

2016-07-03 23:11

updater  

writeObjects.H (4,290 bytes)   
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     |
    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
     \\/     M anipulation  |
-------------------------------------------------------------------------------
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/>.

Class
    Foam::functionObjects::writeObjects

Group
    grpUtilitiesFunctionObjects

Description
    Allows specification of different writing frequency of objects registered to
    the database.

    It has similar functionality as the main time database through the
    writeControl setting:
      - timeStep
      - writeTime
      - adjustableRunTime
      - runTime
      - clockTime
      - cpuTime

    Example of function object specification:
    \verbatim
    writeObjects1
    {
        type        writeObjects;
        libs        ("libutilityFunctionObjects.so");
        exclusiveWriting     true;
        ...
        objects     (obj1 obj2);
    }
    \endverbatim

Usage
    \table
        Property     | Description             | Required    | Default value
        type         | type name: writeObjects | yes |
        objects      | objects to write        | yes         |
        exclusiveWriting    | Takes over object writing | no | yes
    \endtable

    \c exclusiveWriting disables automatic writing (i.e through database) of the
    objects to avoid duplicate writing.

See also
    Foam::functionObject
    Foam::functionObjects::timeControl

SourceFiles
    writeObjects.C

\*---------------------------------------------------------------------------*/

#ifndef functionObjects_writeObjects_H
#define functionObjects_writeObjects_H

#include "functionObject.H"
#include "wordReList.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

namespace Foam
{

// Forward declaration of classes
class objectRegistry;

namespace functionObjects
{

/*---------------------------------------------------------------------------*\
                   Class writeObjects Declaration
\*---------------------------------------------------------------------------*/

class writeObjects
:
    public functionObject
{
    // Private data

        //- Refererence to Db
        const objectRegistry& obr_;

        //- Takes over the writing from Db
        bool exclusiveWriting_;

        //- Names of objects to control
        wordReList objectNames_;


    // Private Member Functions

        //- Disallow default bitwise copy construct
        writeObjects(const writeObjects&);

        //- Disallow default bitwise assignment
        void operator=(const writeObjects&);


public:

    //- Runtime type information
    TypeName("writeObjects");


    // Constructors

        //- Construct from Time and dictionary
        writeObjects
        (
            const word& name,
            const Time& runTime,
            const dictionary& dict
        );


    //- Destructor
    virtual ~writeObjects();


    // Member Functions

        //- Read the writeObjects data
        virtual bool read(const dictionary&);

        //- Do nothing
        virtual bool execute();

        //- Write the registered objects
        virtual bool write();
};


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

} // End namespace functionObjects
} // End namespace Foam

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#endif

// ************************************************************************* //
writeObjects.H (4,290 bytes)   

henry

2016-07-03 23:19

manager   ~0006487

Resolved in OpenFOAM-4.x by commit da871b3bc575e4f676bcdde095635c81656e24ca
Resolved in OpenFOAM-dev by commit 8e900af6e30b320950a3a370b88f8a49a6703d70

Issue History

Date Modified Username Field Change
2016-07-03 23:11 wyldckat New Issue
2016-07-03 23:11 wyldckat Status new => assigned
2016-07-03 23:11 wyldckat Assigned To => henry
2016-07-03 23:11 wyldckat File Added: removeRegisteredObject.H
2016-07-03 23:11 wyldckat File Added: writeObjects.H
2016-07-03 23:19 henry Note Added: 0006487
2016-07-03 23:19 henry Status assigned => resolved
2016-07-03 23:19 henry Fixed in Version => 4.x
2016-07-03 23:19 henry Resolution open => fixed