createSingleCellMesh.H
Go to the documentation of this file.
1 Info<< "Constructing single cell mesh" << nl << endl;
2 
3 labelList owner(6, label(0));
4 labelList neighbour(0);
5 
7 points[0] = vector(0, 0, 0);
8 points[1] = vector(1, 0, 0);
9 points[2] = vector(1, 1, 0);
10 points[3] = vector(0, 1, 0);
11 points[4] = vector(0, 0, 1);
12 points[5] = vector(1, 0, 1);
13 points[6] = vector(1, 1, 1);
14 points[7] = vector(0, 1, 1);
15 
16 const cellModel& hexa = *(cellModeller::lookup("hex"));
17 faceList faces = hexa.modelFaces();
18 
19 fvMesh mesh
20 (
21  IOobject
22  (
23  fvMesh::defaultRegion,
24  runTime.timeName(),
25  runTime,
26  IOobject::READ_IF_PRESENT
27  ),
28  xferMove<Field<vector>>(points),
29  faces.xfer(),
30  owner.xfer(),
31  neighbour.xfer()
32 );
33 
34 List<polyPatch*> patches(1);
35 
36 patches[0] = new emptyPolyPatch
37 (
38  "boundary",
39  6,
40  0,
41  0,
42  mesh.boundaryMesh(),
43  emptyPolyPatch::typeName
44 );
45 
46 mesh.addFvPatches(patches);
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
List< face > faceList
Definition: faceListFwd.H:43
engineTime & runTime
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:256
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
patches[0]
vectorField pointField
pointField is a vectorField.
Definition: pointFieldFwd.H:42
stressControl lookup("compactNormalStress") >> compactNormalStress
dynamicFvMesh & mesh
const pointField & points
Xfer< T > xferMove(T &)
Construct by transferring the contents of the arg.
List< label > labelList
A List of labels.
Definition: labelList.H:56
static const char nl
Definition: Ostream.H:265
messageStream Info