ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / src / lagrangian / intermediate / submodels / Kinematic / PatchInteractionModel / MultiInteraction / MultiInteraction.H
blob673cd325ed3aff32b16a0bf17cd358c90ba2f860
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software: you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by
13     the Free Software Foundation, either version 3 of the License, or
14     (at your option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::MultiInteraction
27 Description
28     Runs multiple patch interaction models in turn. Takes dictionary
29     where all the subdictionaries are the interaction models.
31         // Exit upon first successful interaction or continue doing other
32         // models. Returned nteraction status will be true if there has been any
33         // interaction (so logical or)
34         oneInteractionOnly true;
36         model1
37         {
38             patchInteractionModel coincidentBaffleInteraction;
39             coincidentBaffleInteractionCoeffs
40             {
41                 coincidentPatches
42                 (
43                     (pipetteWall_A pipetteCyclic_half0)
44                     (pipetteWall_B pipetteCyclic_half1)
45                 );
46             }
47         }
48         model2
49         {
50             patchInteractionModel localInteraction;
51             localInteractionCoeffs
52             {
53                 patches
54                 (
55                     cWall
56                     {
57                         type rebound;
58                     }
59                     pipetteWall_A
60                     {
61                         type rebound;
62                     }
63                     pipetteWall_B
64                     {
65                         type rebound;
66                     }
67                 );
68             }
69         }
72 \*---------------------------------------------------------------------------*/
74 #ifndef MultiInteraction_H
75 #define MultiInteraction_H
77 #include "PatchInteractionModel.H"
79 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
81 namespace Foam
83 /*---------------------------------------------------------------------------*\
84                       Class MultiInteraction Declaration
85 \*---------------------------------------------------------------------------*/
87 template<class CloudType>
88 class MultiInteraction
90     public PatchInteractionModel<CloudType>
92     // Private data
94         Switch oneInteractionOnly_;
96         //- Submodels
97         PtrList<PatchInteractionModel<CloudType> > models_;
100     // Private Member Functions
102         //- Read settings
103         bool read(const dictionary&);
105 public:
107     //- Runtime type information
108     TypeName("multiInteraction");
111     // Constructors
113         //- Construct from dictionary
114         MultiInteraction(const dictionary& dict, CloudType& cloud);
116         //- Construct copy from owner cloud and patch interaction model
117         MultiInteraction(const MultiInteraction<CloudType>& pim);
119         //- Construct and return a clone using supplied owner cloud
120         virtual autoPtr<PatchInteractionModel<CloudType> > clone() const
121         {
122             return autoPtr<PatchInteractionModel<CloudType> >
123             (
124                 new MultiInteraction<CloudType>(*this)
125             );
126         }
129     //- Destructor
130     virtual ~MultiInteraction();
133     // Member Functions
135         //- Flag to indicate whether model activates patch interaction model
136         virtual bool active() const;
138         //- Apply velocity correction
139         //  Returns true if particle remains in same cell
140         virtual bool correct
141         (
142             typename CloudType::parcelType& p,
143             const polyPatch& pp,
144             bool& keepParticle,
145             const scalar trackFraction,
146             const tetIndices& tetIs
147         );
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 } // End namespace Foam
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 #ifdef NoRepository
158 #   include "MultiInteraction.C"
159 #endif
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 #endif
165 // ************************************************************************* //