createExternalCoupledPatchGeometry.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 Application
25  createExternalCoupledPatchGeometry.
26 
27 Description
28  Application to generate the patch geometry (points and faces) for use
29  with the externalCoupled boundary condition.
30 
31  Usage:
32 
33  createExternalCoupledPatchGeometry <fieldName>
34 
35  On execution, the field <fieldName> is read, and its boundary conditions
36  interrogated for the presence of an \c externalCoupled type. If found,
37  the patch geometry (points and faces) for the coupled patches are output
38  to the communications directory.
39 
40 Note:
41  The addressing is patch-local, i.e. point indices for each patch point
42  used for face addressing starts at index 0.
43 
44 See also
45  externalCoupledMixedFvPatchField
46 
47 \*---------------------------------------------------------------------------*/
48 
49 #include "fvCFD.H"
51 #include "IOobjectList.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 int main(int argc, char *argv[])
56 {
57  #include "addRegionOption.H"
58  argList::validArgs.append("fieldName");
59  #include "setRootCase.H"
60  #include "createTime.H"
61  #include "createNamedMesh.H"
62 
63  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 
65  const word fieldName = args[1];
66 
67  IOobjectList objects(IOobjectList(mesh, mesh.time().timeName()));
68 
69  label processed = -1;
70  processField<scalar>(mesh, objects, fieldName, processed);
71  processField<vector>(mesh, objects, fieldName, processed);
72  processField<sphericalTensor>(mesh, objects, fieldName, processed);
73  processField<symmTensor>(mesh, objects, fieldName, processed);
74  processField<tensor>(mesh, objects, fieldName, processed);
75 
76  if (processed == -1)
77  {
78  Info<< "Field " << fieldName << " not found" << endl;
79  }
80 
81  Info<< "\nEnd\n" << endl;
82 
83  return 0;
84 }
85 
86 
87 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
dynamicFvMesh & mesh
objects
messageStream Info
Foam::argList args(argc, argv)