cloud.H 3.94 KB
Newer Older
1 2 3 4
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     |
OpenFOAM bot's avatar
OpenFOAM bot committed
5 6 7 8
    \\  /    A nd           | Copyright (C) 2016-2018 OpenCFD Ltd.
     \\/     M anipulation  |
-------------------------------------------------------------------------------
                            | Copyright (C) 2011-2016 OpenFOAM Foundation
9 10 11 12
-------------------------------------------------------------------------------
License
    This file is part of OpenFOAM.

13 14 15 16
    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.
17 18 19 20 21 22 23

    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
24
    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
25 26 27 28 29

Class
    Foam::cloud

Description
30
    A cloud is a registry collection of lagrangian particles.
31 32 33 34 35 36 37 38 39 40

SourceFiles
    cloud.C

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

#ifndef cloud_H
#define cloud_H

#include "objectRegistry.H"
41
#include "Enum.H"
42
#include "IOField.H"
43 44 45 46 47 48 49 50 51 52

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

namespace Foam
{

// Forward declaration of classes
class mapPolyMesh;

/*---------------------------------------------------------------------------*\
Mark Olesen's avatar
Mark Olesen committed
53
                            Class cloud Declaration
54 55 56 57 58 59 60 61 62
\*---------------------------------------------------------------------------*/

class cloud
:
    public objectRegistry
{

    // Private Member Functions

63
        //- No copy construct
64
        cloud(const cloud&) = delete;
65

66
        //- No copy assignment
67
        void operator=(const cloud&) = delete;
68 69 70 71


public:

72 73 74 75 76 77 78 79 80 81
    //- Cloud geometry type (internal or IO representations)
    enum class geometryType
    {
        COORDINATES,    //!< barycentric coordinates
        POSITIONS       //!< positions
    };

    static const Enum<geometryType> geometryTypeNames;


82 83 84
    //- Runtime type information
    TypeName("cloud");

85 86
        //- The prefix to local: %lagrangian
        static const word prefix;
Mark Olesen's avatar
Mark Olesen committed
87 88 89

        //- The default cloud name: %defaultCloud
        static word defaultName;
90

Andrew Heather's avatar
Andrew Heather committed
91

92 93 94
    // Constructors

        //- Construct for the given objectRegistry and named cloud instance
95
        cloud(const objectRegistry&, const word& cloudName = defaultName);
96 97


Andrew Heather's avatar
Andrew Heather committed
98
    //- Destructor
99
    virtual ~cloud() = default;
100 101 102 103 104 105 106 107


    // Member Functions

        // Edit

            //- Remap the cells of particles corresponding to the
            //  mesh topology change
108
            virtual void autoMap(const mapPolyMesh&);
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126


        // I-O

            //- Read particle fields from objects in the obr registry
            //virtual void readObjects(objectRegistry& obr);

            //- Write particle fields as objects into the obr registry
            virtual void writeObjects(objectRegistry& obr) const;

            //- Helper to construct IOField on a supplied object registry
            template<class Type>
            static IOField<Type>& createIOField
            (
                const word& fieldName,
                const label nParticle,
                objectRegistry& obr
            );
127 128 129 130 131 132 133 134 135
};


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

} // End namespace Foam

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

136 137 138 139 140 141
#ifdef NoRepository
    #include "cloudTemplates.C"
#endif

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

142 143 144
#endif

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