cellsToCellsStabilisation.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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.
20 
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/>.
23 
24 Class
25  Foam::cellsToCellsStabilisation
26 
27 Description
28  Stabilisation data and routines for cell-to-cell interpolations
29 
30 SourceFiles
31  cellsToCellsStabilisation.C
32  cellsToCellsStabilisationTemplates.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef cellsToCellsStabilisation_H
37 #define cellsToCellsStabilisation_H
38 
39 #include "cellsToCells.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class cellsToCellsStabilisation Declaration
48 \*---------------------------------------------------------------------------*/
49 
51 {
52  // Private Data
53 
54  //- Is stabilisation occurring?
55  bool stabilisation_;
56 
57  //- For each cell, the local cell used to stabilise the interpolation
58  labelList localStabilisationCells_;
59 
60  //- Map from cells to local stabilisation cells
61  autoPtr<distributionMap> stabilisationMapPtr_;
62 
63 
64 public:
65 
66  //- Run-time type information
67  TypeName("cellsToCellsStabilisation");
68 
69 
70  // Constructors
71 
72  //- Construct null
74 
75 
76  //- Destructor
78 
79 
80  // Member Functions
81 
82  //- Compute the stabilisation addressing if necessary
83  void update
84  (
85  const polyMesh& mesh,
86  const PackedBoolList& cellCoupleds
87  );
88 
89  //- Stabilise the given field if necessary
90  template<class Type>
91  void stabilise(Field<Type>& fld) const;
92 };
93 
94 
95 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
96 
97 } // End namespace Foam
98 
99 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
100 
101 #ifdef NoRepository
103 #endif
104 
105 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
106 
107 #endif
108 
109 // ************************************************************************* //
Pre-declare SubField and related Field type.
Definition: Field.H:82
A bit-packed bool list.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Stabilisation data and routines for cell-to-cell interpolations.
void update(const polyMesh &mesh, const PackedBoolList &cellCoupleds)
Compute the stabilisation addressing if necessary.
TypeName("cellsToCellsStabilisation")
Run-time type information.
void stabilise(Field< Type > &fld) const
Stabilise the given field if necessary.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
gmvFile<< "tracers "<< particles.size()<< nl;{ pointField positions(particles.size());label particlei=0;forAllConstIter(Cloud< passiveParticle >, particles, iter) { positions[particlei++]=iter().position(mesh);} for(i=0;i< pTraits< point >::nComponents;i++) { forAll(positions, particlei) { gmvFile<< component(positions[particlei], i)<< ' ';} gmvFile<< nl;}}forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Namespace for OpenFOAM.