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 {
35  defineTypeNameAndDebug(faceAreaPairGAMGAgglomeration, 0);
36 
38  (
39  GAMGAgglomeration,
40  faceAreaPairGAMGAgglomeration,
41  lduMesh
42  );
43 
45  (
46  GAMGAgglomeration,
47  faceAreaPairGAMGAgglomeration,
48  geometry
49  );
50 }
51 
52 
53 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
54 
56 (
57  const lduMesh& mesh,
58  const dictionary& controlDict
59 )
60 :
61  pairGAMGAgglomeration(mesh, controlDict)
62 {
63  const fvMesh& fvmesh = refCast<const fvMesh>(mesh);
64 
65  // agglomerate(mesh, sqrt(fvmesh.magSf().primitiveField()));
66  agglomerate
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 :
91  pairGAMGAgglomeration(mesh, controlDict)
92 {
93  // agglomerate(mesh, sqrt(mag(faceAreas)));
94  agglomerate
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 // ************************************************************************* //
Foam::surfaceFields.
const surfaceVectorField & Sf() const
Return cell face area vectors.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
Agglomerate using the pair algorithm.
dimensionedScalar sqrt(const dimensionedScalar &ds)
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Definition: lduMesh.H:59
const Internal::FieldType & primitiveField() const
Return a const-reference to the internal field.
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
Macros for easy insertion into run-time selection tables.
faceAreaPairGAMGAgglomeration(const lduMesh &mesh, const dictionary &controlDict)
Construct given mesh and controls.
dynamicFvMesh & mesh
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
const surfaceScalarField & magSf() const
Return cell face area magnitudes.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
dimensioned< scalar > mag(const dimensioned< Type > &)
Namespace for OpenFOAM.