All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cyclicACMIFvPatchField.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) 2013-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 
26 #include "cyclicACMIFvPatchField.H"
27 #include "transformField.H"
28 
29 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
30 
31 template<class Type>
34 {
37  (
38  this->primitiveField()
39  );
40 
41  return fld.boundaryField()
42  [
43  cyclicACMIPatch().cyclicACMIPatch().nonOverlapPatchID()
44  ];
45 }
46 
47 
48 template<class Type>
50 (
51  fvMatrix<Type>& matrix
52 )
53 {
54  const scalarField& mask = cyclicACMIPatch().cyclicACMIPatch().mask();
55 
56  // nothing to be done by the AMI, but re-direct to non-overlap patch
57  // with non-overlap patch weights
58  const fvPatchField<Type>& npf = nonOverlapPatchField();
59 
60  const_cast<fvPatchField<Type>&>(npf).manipulateMatrix(matrix, 1.0 - mask);
61 }
62 
63 
64 template<class Type>
66 {
67  // Update non-overlap patch - some will implement updateCoeffs, and
68  // others will implement evaluate
69 
70  // Pass in (1 - mask) to give non-overlap patch the chance to do
71  // manipulation of non-face based data
72 
73  const scalarField& mask = cyclicACMIPatch().cyclicACMIPatch().mask();
74  const fvPatchField<Type>& npf = nonOverlapPatchField();
75  const_cast<fvPatchField<Type>&>(npf).updateWeightedCoeffs(1.0 - mask);
76 }
77 
78 
79 // ************************************************************************* //
const fvPatchField< Type > & nonOverlapPatchField() const
Return reference to non-overlapping patchField.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:66
Generic GeometricField class.
Spatial transformation functions for primitive fields.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< ' ';}gmvFile<< nl;forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
Definition: fvPatchField.H:72
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void manipulateMatrix(fvMatrix< Type > &matrix)
Manipulate matrix.