createBlockMesh.H
Go to the documentation of this file.
1 const cellModel& hex = cellModel::ref(cellModel::HEX);
2 
6 {
7  Info<< "Creating block" << endl;
8 
9  block b
10  (
11  cellShape(hex, identity(8)),
13  (
14  {
15  point(0, 0, 0),
16  point(L.x(), 0, 0),
17  point(L.x(), L.y(), 0),
18  point(0, L.y(), 0),
19  point(0, 0, L.z()),
20  point(L.x(), 0, L.z()),
21  point(L.x(), L.y(), L.z()),
22  point(0, L.y(), L.z())
23  }
24  ),
25  blockEdgeList(),
26  blockFaceList(),
27  N
28  );
29 
30  Info<< "Creating cells" << endl;
31  cellShapes = b.shapes();
32 
33  Info<< "Creating boundary faces" << endl;
34 
35  boundary.setSize(b.boundaryPatches().size());
36  forAll(boundary, patchi)
37  {
38  faceList faces(b.boundaryPatches()[patchi].size());
39  forAll(faces, facei)
40  {
41  faces[facei] = face(b.boundaryPatches()[patchi][facei]);
42  }
43  boundary[patchi].transfer(faces);
44  }
45 
46  points.transfer(const_cast<pointField&>(b.points()));
47 }
48 
49 Info<< "Creating patch dictionaries" << endl;
51 forAll(patchNames, patchi)
52 {
53  patchNames[patchi] = polyPatch::defaultName(patchi);
54 }
55 
56 PtrList<dictionary> boundaryDicts(boundary.size());
58 {
59  boundaryDicts.set(patchi, new dictionary());
60  dictionary& patchDict = boundaryDicts[patchi];
61  word nbrPatchName;
62  if (patchi % 2 == 0)
63  {
64  nbrPatchName = polyPatch::defaultName(patchi + 1);
65  }
66  else
67  {
68  nbrPatchName = polyPatch::defaultName(patchi - 1);
69  }
70 
71  patchDict.add("type", cyclicPolyPatch::typeName);
72  patchDict.add("neighbourPatch", nbrPatchName);
73 }
74 
75 Info<< "Creating polyMesh" << endl;
76 polyMesh mesh
77 (
78  IOobject
79  (
80  polyMesh::defaultRegion,
81  runTime.constant(),
82  runTime,
83  IOobject::NO_READ
84  ),
85  std::move(points),
86  cellShapes,
87  boundary,
88  patchNames,
90  "defaultFaces",
91  cyclicPolyPatch::typeName,
92  false
93 );
94 
95 Info<< "Writing polyMesh" << endl;
96 mesh.write();
hex
const cellModel & hex
Definition: createBlockMesh.H:1
Foam::pointField
vectorField pointField
pointField is a vectorField.
Definition: pointFieldFwd.H:44
runTime
engineTime & runTime
Definition: createEngineTime.H:13
L
const vector L(dict.get< vector >("L"))
points
pointField points
Definition: createBlockMesh.H:5
Foam::cellShapeList
List< cellShape > cellShapeList
List of cellShapes and PtrList of List of cellShape.
Definition: cellShapeList.H:45
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
ref
rDeltaT ref()
Foam::wordList
List< word > wordList
A List of words.
Definition: fileName.H:62
Foam::blockEdgeList
PtrList< blockEdge > blockEdgeList
A PtrList of blockEdges.
Definition: blockEdgeList.H:47
b
block b(cellShape(hex, identity(8)), pointField({ point(0, 0, 0), point(L.x(), 0, 0), point(L.x(), L.y(), 0), point(0, L.y(), 0), point(0, 0, L.z()), point(L.x(), 0, L.z()), point(L.x(), L.y(), L.z()), point(0, L.y(), L.z()) }), blockEdgeList(), blockFaceList(), N)
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
forAll
forAll(boundaryDicts, patchi)
Definition: createBlockMesh.H:57
patchNames
wordList patchNames(nPatches)
boundaryDicts
Info<< "Creating cells"<< endl;cellShapes=b.shapes();Info<< "Creating boundary faces"<< endl;boundary.setSize(b.boundaryPatches().size());forAll(boundary, patchi) { faceList faces(b.boundaryPatches()[patchi].size());forAll(faces, facei) { faces[facei]=face(b.boundaryPatches()[patchi][facei]);} boundary[patchi].transfer(faces);} points.transfer(const_cast< pointField & >b.points()));}Info<< "Creating patch dictionaries"<< endl;wordList patchNames(boundary.size());forAll(patchNames, patchi){ patchNames[patchi]=polyPatch::defaultName(patchi);}PtrList< dictionary > boundaryDicts(boundary.size())
Definition: createBlockMesh.H:56
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::blockFaceList
PtrList< blockFace > blockFaceList
A PtrList of blockFaces.
Definition: blockFaceList.H:47
Foam::faceListList
List< faceList > faceListList
A List of faceList.
Definition: faceListFwd.H:49
Foam::faceList
List< face > faceList
A List of faces.
Definition: faceListFwd.H:47
Foam::identity
labelList identity(const label len, label start=0)
Create identity map of the given length with (map[i] == i)
Definition: labelList.C:38
cellShapes
cellShapeList cellShapes
Definition: createBlockMesh.H:3
N
const Vector< label > N(dict.get< Vector< label >>("N"))
Foam::point
vector point
Point is a vector.
Definition: point.H:43
boundary
faceListList boundary
Definition: createBlockMesh.H:4