catalystCloud.H 4.48 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
    \\  /    A nd           | www.openfoam.com
6
     \\/     M anipulation  |
OpenFOAM bot's avatar
OpenFOAM bot committed
7 8
-------------------------------------------------------------------------------
    Copyright (C) 2018 OpenCFD Ltd.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
-------------------------------------------------------------------------------
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
27
    Foam::catalyst::cloudInput
28 29

Description
30
    An input (source) for Paraview Catalyst from clouds (lagrangian).
31

32 33
    Produces a multi-block dataset with one block per cloud with pieces
    from each processor.
34

35
    Example specification:
36
    \verbatim
37
    someName
38
    {
39 40 41
        type        cloud;
        cloud       myCloud;
        fields      (U T rho);
42 43 44 45 46
    }
    \endverbatim

Usage
    \table
47 48 49 50 51 52
        Property    | Description                           | Required | Default
        type        | input type: \c cloud                  | yes   |
        region      | name for a single region              | no    | region0
        cloud       | name for a single cloud               | no  | defaultCloud
        clouds      | wordRe list of clouds                 | no    |
        fields      | wordRe list of fields                 | yes   |
53 54
    \endtable

55 56 57 58 59 60 61 62 63 64 65 66 67 68
    The output block structure:
    \verbatim
    |-- cloud0
    |   |-- piece0
    |   |-- ...
    |   \-- pieceN
    |-- ...
    \-- cloudN
        \-- ...
    \endverbatim

Note
    The channel name is that of the defining dictionary.

69 70 71 72 73 74 75 76 77
See also
    Foam::vtk::cloudAdaptor

SourceFiles
    catalystCloud.C
    catalystCloudTemplates.C

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

78 79
#ifndef catalyst_cloudInput_H
#define catalyst_cloudInput_H
80 81

#include "wordRes.H"
82
#include "catalystInput.H"
83 84 85 86 87

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

namespace Foam
{
88
namespace catalyst
89 90 91
{

/*---------------------------------------------------------------------------*\
92
                    Class catalyst::cloudInput Declaration
93 94
\*---------------------------------------------------------------------------*/

95
class cloudInput
96
:
97
    public catalystInput
98 99 100 101 102
{
protected:

    // Protected data

103 104
        //- Reference to the time database
        const Time& time_;
105

106 107
        //- The region name for the clouds
        word regionName_;
108

109 110 111 112 113 114 115
        //- Requested names of clouds to process
        wordRes selectClouds_;

        //- Subset of cloud fields to process
        wordRes selectFields_;


116 117
    // Protected Member Functions

118
        //- No copy construct
119
        cloudInput(const cloudInput&) = delete;
120 121

        //- No copy assignment
122
        void operator=(const cloudInput&) = delete;
123 124 125 126

public:

    //- Runtime type information
127
    ClassName("catalyst::cloud");
128 129 130 131 132


    // Constructors

        //- Construct from Time and dictionary
133
        cloudInput
134 135 136 137 138 139 140 141
        (
            const word& name,
            const Time& runTime,
            const dictionary& dict
        );


    //- Destructor
142
    virtual ~cloudInput() = default;
143 144 145 146 147 148 149


    // Member Functions

        //- Read the specification
        virtual bool read(const dictionary& dict);

150 151
        //- Add available channels (with fields) to data query
        virtual label addChannels(dataQuery& dataq);
152

153 154
        //- Convert channels to vtkMultiBlockDataSet outputs
        virtual bool convert(dataQuery& dataq, outputChannels& outputs);
155

156 157
        //- Print information
        virtual Ostream& print(Ostream& os) const;
158 159 160 161 162
};


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

163
} // End namespace catalyst
164 165 166 167 168 169 170
} // End namespace Foam

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

#endif

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