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