getFieldVector.H
Go to the documentation of this file.
2 {
3  return Z_UNDEF;
4 }
5 
6 
7 typeIOobject<volVectorField> fieldObjectPtr
8 (
9  fieldNames[var2field[nVar]],
10  runTime.timeName(),
11  mesh,
12  IOobject::NO_READ
13 );
14 
15 if (!fieldObjectPtr.headerOk())
16 {
17  return Z_UNDEF;
18 }
19 
20 IOobject fieldObject
21 (
22  fieldNames[var2field[nVar]],
23  runTime.timeName(),
24  mesh,
25  IOobject::MUST_READ,
26  IOobject::NO_WRITE
27 );
28 
30 (
32  mesh
33 );
34 
35 const cellShapeList& cellShapes = meshPtr->cellShapes();
36 
37 // hexa's
38 if (which_type == Z_HEX08)
39 {
40  const cellModel& hex = *(cellModeller::lookup("hex"));
41  // const cellModel& wedge = *(cellModeller::lookup("wedge"));
42 
43  label counter = 1;
44  for (label n=0; n<nCells; n++)
45  {
46  const cellShape& cellShape = cellShapes[n];
47  const cellModel& cellModel = cellShape.model();
48 
49  if (cellModel == hex) // || (cellModel == wedge))
50  {
51  var_array[counter++] = vectorField[n][component];
52  }
53  }
54 }
55 
56 // penta's
57 if (which_type == Z_PEN06)
58 {
59  const cellModel& prism = *(cellModeller::lookup("prism"));
60 
61  label counter = 1;
62  for (label n=0; n<nCells; n++)
63  {
64  const cellShape& cellShape = cellShapes[n];
65  const cellModel& cellModel = cellShape.model();
66 
67  if (cellModel == prism)
68  {
69  var_array[counter++] = vectorField[n][component];
70  }
71  }
72 }
73 
74 // pyramids's
75 if (which_type == Z_PYR05)
76 {
77  const cellModel& pyr = *(cellModeller::lookup("pyr"));
78 
79  label counter = 1;
80  for (label n=0; n<nCells; n++)
81  {
82  const cellShape& cellShape = cellShapes[n];
83  const cellModel& cellModel = cellShape.model();
84 
85  if (cellModel == pyr)
86  {
87  var_array[counter++] = vectorField[n][component];
88  }
89  }
90 }
91 
92 
93 // tet's
94 if (which_type == Z_TET04)
95 {
96  const cellModel& tet = *(cellModeller::lookup("tet"));
97 
98  label counter = 1;
99  for (label n=0; n<nCells; n++)
100  {
101  const cellShape& cellShape = cellShapes[n];
102  const cellModel& cellModel = cellShape.model();
103 
104  if (cellModel == tet)
105  {
106  var_array[counter++] = vectorField[n][component];
107  }
108  }
109 }
110 
111 if (which_type == Z_NFACED)
112 {
113  const cellList& cells = meshPtr->cells();
114 
115  label counter = 1;
116  for (label n=0; n<nCells; n++)
117  {
118  const labelList& points = cellShapes[n];
119  label nFacesInCell = cells[n].size();
120 
121  if ((nFacesInCell == 6) && (points.size() == 8))
122  {}
123  else if ((nFacesInCell == 4) && (points.size() == 4))
124  {}
125  else if (nFacesInCell == 5)
126  {
127  if (points.size() == 6)
128  {}
129  else if (points.size() == 5)
130  {}
131  else
132  {
133  var_array[counter++] = vectorField[n][component];
134  }
135  }
136  else
137  {
138  var_array[counter++] = vectorField[n][component];
139  }
140  }
141 }
static int Num_variables
Definition: globalFoam.H:20
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
typeIOobject< volVectorField > fieldObjectPtr(fieldNames[var2field[nVar]], runTime.timeName(), mesh, IOobject::NO_READ)
IOstream & hex(IOstream &io)
Definition: IOstream.H:561
static fvMesh * meshPtr
Definition: globalFoam.H:52
volVectorField vectorField(fieldObject, mesh)
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:59
fvMesh & mesh
static List< word > fieldNames
Definition: globalFoam.H:46
stressControl lookup("compactNormalStress") >> compactNormalStress
List< cellShape > cellShapeList
List of cellShapes and PtrList of List of cellShape.
Definition: cellShapeList.H:43
static label nSprayVariables
Definition: globalFoam.H:24
const cellShapeList & cells
const pointField & points
List< label > labelList
A List of labels.
Definition: labelList.H:56
IOobject fieldObject(fieldNames[var2field[nVar]], runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE)
label n
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
List< cell > cellList
list of cells
Definition: cellList.H:42
static label var2field[maxNames]
Definition: globalFoam.H:49