faceAreaPairGAMGAgglomeration.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
29 #include "fvMesh.H"
30 #include "surfaceFields.H"
32 
33 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34 
35 namespace Foam
36 {
37  defineTypeNameAndDebug(faceAreaPairGAMGAgglomeration, 0);
38 
40  (
41  GAMGAgglomeration,
42  faceAreaPairGAMGAgglomeration,
43  lduMesh
44  );
45 
47  (
48  GAMGAgglomeration,
49  faceAreaPairGAMGAgglomeration,
50  geometry
51  );
52 }
53 
54 
55 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
56 
58 (
59  const lduMesh& mesh,
60  const dictionary& controlDict
61 )
62 :
64 {
65  const fvMesh& fvmesh = refCast<const fvMesh>(mesh);
66 
67  //agglomerate(mesh, sqrt(fvmesh.magSf().primitiveField()));
68  agglomerate
69  (
70  mesh,
71  mag
72  (
74  (
75  fvmesh.Sf().primitiveField()
76  /sqrt(fvmesh.magSf().primitiveField()),
77  vector(1, 1.01, 1.02)
78  //vector::one
79  )
80  )
81  );
82 }
83 
84 
86 (
87  const lduMesh& mesh,
88  const scalarField& cellVolumes,
89  const vectorField& faceAreas,
90  const dictionary& controlDict
91 )
92 :
94 {
95  //agglomerate(mesh, sqrt(mag(faceAreas)));
96  agglomerate
97  (
98  mesh,
99  mag
100  (
102  (
103  faceAreas
104  /sqrt(mag(faceAreas)),
105  vector(1, 1.01, 1.02)
106  //vector::one
107  )
108  )
109  );
110 }
111 
112 
113 // ************************************************************************* //
Foam::addToRunTimeSelectionTable
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
Foam::faceAreaPairGAMGAgglomeration::faceAreaPairGAMGAgglomeration
faceAreaPairGAMGAgglomeration(const lduMesh &mesh, const dictionary &controlDict)
Construct given mesh and controls.
Definition: faceAreaPairGAMGAgglomeration.C:58
Foam::cmptMultiply
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
Foam::GeometricField::primitiveField
const Internal::FieldType & primitiveField() const
Return a const-reference to the internal field.
Definition: GeometricFieldI.H:53
surfaceFields.H
Foam::surfaceFields.
Foam::Field< scalar >
Foam::fvMesh::magSf
const surfaceScalarField & magSf() const
Return cell face area magnitudes.
Definition: fvMeshGeometry.C:330
controlDict
runTime controlDict().readEntry("adjustTimeStep"
Definition: debug.C:143
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
fvMesh.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:51
faceAreaPairGAMGAgglomeration.H
Foam::sqrt
dimensionedScalar sqrt(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:144
Foam::mag
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Foam::pairGAMGAgglomeration
Agglomerate using the pair algorithm.
Definition: pairGAMGAgglomeration.H:51
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
Foam::lduMesh
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Definition: lduMesh.H:62
Foam::fvMesh::Sf
const surfaceVectorField & Sf() const
Return cell face area vectors.
Definition: fvMeshGeometry.C:319