faceAreaPairGAMGAgglomeration.C
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) 2011-2018 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 \*---------------------------------------------------------------------------*/
25 
27 #include "fvMesh.H"
28 #include "surfaceFields.H"
30 
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
36 
38  (
41  lduMesh
42  );
43 
45  (
48  geometry
49  );
50 }
51 
52 
53 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
54 
56 (
57  const lduMesh& mesh,
58  const dictionary& controlDict
59 )
60 :
62 {
63  const fvMesh& fvmesh = refCast<const fvMesh>(mesh);
64 
65  // agglomerate(mesh, sqrt(fvmesh.magSf().primitiveField()));
67  (
68  mesh,
69  mag
70  (
72  (
73  fvmesh.Sf().primitiveField()
74  /sqrt(fvmesh.magSf().primitiveField()),
75  vector(1, 1.01, 1.02)
76  // vector::one
77  )
78  )
79  );
80 }
81 
82 
84 (
85  const lduMesh& mesh,
86  const scalarField& cellVolumes,
87  const vectorField& faceAreas,
88  const dictionary& controlDict
89 )
90 :
92 {
93  // agglomerate(mesh, sqrt(mag(faceAreas)));
95  (
96  mesh,
97  mag
98  (
100  (
101  faceAreas
102  /sqrt(mag(faceAreas)),
103  vector(1, 1.01, 1.02)
104  // vector::one
105  )
106  )
107  );
108 }
109 
110 
111 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
Geometric agglomerated algebraic multigrid agglomeration class.
const Internal::FieldType & primitiveField() const
Return a const-reference to the primitive field.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Agglomerate using the pair algorithm.
faceAreaPairGAMGAgglomeration(const lduMesh &mesh, const dictionary &controlDict)
Construct given mesh and controls.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:99
const surfaceVectorField & Sf() const
Return cell face area vectors.
const surfaceScalarField & magSf() const
Return cell face area magnitudes.
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Definition: lduMesh.H:60
Agglomerate using the pair algorithm.
void agglomerate(const lduMesh &mesh, const scalarField &faceWeights)
Agglomerate all levels starting from the given face weights.
Namespace for OpenFOAM.
addToRunTimeSelectionTable(polyPatch, mergedCyclicPolyPatch, word)
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< scalar > mag(const dimensioned< Type > &)
defineTypeNameAndDebug(combustionModel, 0)
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
runTime controlDict().lookup("adjustTimeStep") >> adjustTimeStep
Foam::surfaceFields.