getPatchFieldScalar.H
Go to the documentation of this file.
1 label patchi = which_part - 2;
2 
4 {
5  return Z_UNDEF;
6 }
7 
8 IOobject fieldObjectPtr
9 (
11  runTime.timeName(),
12  mesh,
13  IOobject::NO_READ
14 );
15 
16 if (!fieldObjectPtr.headerOk())
17 {
18  return Z_UNDEF;
19 }
20 
21 IOobject fieldObject
22 (
24  runTime.timeName(),
25  mesh,
26  IOobject::MUST_READ,
27  IOobject::NO_WRITE
28 );
29 
31 (
33  mesh
34 );
35 
36 const scalarField& sfb = sf.boundaryField()[patchi];
37 const polyBoundaryMesh& bMesh = meshPtr->boundaryMesh();
38 
39 if (which_type == Z_TRI03)
40 {
41  label counter = 1;
42  forAll(sfb, facei)
43  {
44  label nPoints = bMesh[patchi][facei].size();
45  if (nPoints == 3)
46  {
47  var_array[counter++] = sfb[facei];
48  }
49  }
50 }
51 
52 if (which_type == Z_QUA04)
53 {
54  label counter = 1;
55  forAll(sfb, facei)
56  {
57  label nPoints = bMesh[patchi][facei].size();
58  if (nPoints == 4)
59  {
60  var_array[counter++] = sfb[facei];
61  }
62  }
63 }
64 
65 if (which_type == Z_NSIDED)
66 {
67  label counter = 1;
68  forAll(sfb, facei)
69  {
70  label nPoints = bMesh[patchi][facei].size();
71  if (nPoints != 3 && nPoints != 4)
72  {
73  var_array[counter++] = sfb[facei];
74  }
75  }
76 }
sfb
const scalarField & sfb
Definition: getPatchFieldScalar.H:36
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:406
nVar
nVar
Definition: getLagrangianScalar.H:3
Num_variables
static int Num_variables
Definition: globalFoam.H:20
fieldObject
IOobject fieldObject(fieldNames[var2field[nVar]], runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE)
nPoints
label nPoints
Definition: gmvOutputHeader.H:2
Foam::label
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
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
meshPtr
static fvMesh * meshPtr
Definition: globalFoam.H:52
fieldNames
static List< word > fieldNames
Definition: globalFoam.H:46
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
sf
volScalarField sf(fieldObject, mesh)
bMesh
const polyBoundaryMesh & bMesh
Definition: getPatchFieldScalar.H:37
scalarField
volScalarField scalarField(fieldObject, mesh)
patchi
label patchi
Definition: getPatchFieldScalar.H:1
var2field
static label var2field[maxNames]
Definition: globalFoam.H:49
fieldObjectPtr
IOobject fieldObjectPtr(fieldNames[var2field[nVar]], runTime.timeName(), mesh, IOobject::NO_READ)
nSprayVariables
static label nSprayVariables
Definition: globalFoam.H:24