Go to the documentation of this file.
70 int main(
int argc,
char *argv[])
74 "A mesh generator for finiteArea mesh"
100 faMeshDefinition.get<
wordList>(
"polyMeshPatches")
109 forAll(faPatchNames, patchI)
113 faPatches[patchI].name_ = faPatchNames[patchI];
115 faPatches[patchI].type_ = curPatchDict.
get<
word>(
"type");
117 const word ownName(curPatchDict.
get<
word>(
"ownerPolyPatch"));
119 faPatches[patchI].ownPolyPatchID_ =
122 if (faPatches[patchI].ownPolyPatchID_ < 0)
125 <<
"neighbourPolyPatch " << ownName <<
" does not exist"
129 const word neiName(curPatchDict.
get<
word>(
"neighbourPolyPatch"));
131 faPatches[patchI].ngbPolyPatchID_ =
134 if (faPatches[patchI].ngbPolyPatchID_ < 0)
137 <<
"neighbourPolyPatch " << neiName <<
" does not exist"
145 labelList patchIDs(polyMeshPatches.size(), -1);
147 forAll(polyMeshPatches, patchI)
152 if (patchIDs[patchI] < 0)
155 <<
"Patch " << polyMeshPatches[patchI] <<
" does not exist"
170 forAll(polyMeshPatches, patchI)
176 for (label i = 0; i < size; ++i)
178 faceLabels[++faceI] = start + i;
183 Info <<
"Create faMesh ... ";
201 label faceID = faceLabels[faceI];
216 const label nTotalEdges =
patch.nEdges();
217 const label nInternalEdges =
patch.nInternalEdges();
219 labelList bndEdgeFaPatchIDs(nTotalEdges - nInternalEdges, -1);
221 for (label edgeI = nInternalEdges; edgeI < nTotalEdges; ++edgeI)
223 label curMeshEdge = meshEdges[edgeI];
229 forAll(edgeFaces[curMeshEdge], faceI)
231 label curFace = edgeFaces[curMeshEdge][faceI];
235 if (curPatchID != -1)
237 curEdgePatchIDs[++patchI] = curPatchID;
241 for (label pI = 0; pI < faPatches.size() - 1; ++pI)
246 curEdgePatchIDs[0] == faPatches[pI].ownPolyPatchID_
247 && curEdgePatchIDs[1] == faPatches[pI].ngbPolyPatchID_
251 curEdgePatchIDs[1] == faPatches[pI].ownPolyPatchID_
252 && curEdgePatchIDs[0] == faPatches[pI].ngbPolyPatchID_
256 bndEdgeFaPatchIDs[edgeI - nInternalEdges] = pI;
264 for (label pI=0; pI<(faPatches.size()-1); ++pI)
268 forAll(bndEdgeFaPatchIDs, eI)
270 if (bndEdgeFaPatchIDs[eI] == pI)
272 tmpList.
append(nInternalEdges + eI);
276 faPatches[pI].edgeLabels_ = tmpList;
282 forAll(bndEdgeFaPatchIDs, eI)
284 if (bndEdgeFaPatchIDs[eI] == -1)
286 tmpList.
append(nInternalEdges + eI);
290 if (tmpList.size() > 0)
292 label pI = faPatches.size()-1;
294 faPatches[pI].name_ =
"undefined";
295 faPatches[pI].type_ =
"patch";
296 faPatches[pI].edgeLabels_ = tmpList;
302 for (label pI = 0; pI < faPatches.size(); ++pI)
304 faPatches[pI].dict_.add(
"type", faPatches[pI].type_);
305 faPatches[pI].dict_.add(
"edgeLabels", faPatches[pI].edgeLabels_);
306 faPatches[pI].dict_.add
309 faPatches[pI].ngbPolyPatchID_
312 if(faPatches[pI].edgeLabels_.size() > 0)
331 emptyPatchDict.
add(
"type",
"empty");
333 emptyPatchDict.
add(
"ngbPolyPatchIndex", -1);
347 Info <<
"Add faPatches ... ";
352 Info <<
"Write finite area mesh ... ";
void append(const T &item)
Add copy at tail of list.
List< label > labelList
A List of labels.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
A class for handling words, derived from Foam::string.
const labelListList & edgeFaces() const
static void addNote(const string ¬e)
Add extra notes for the usage information.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static autoPtr< faPatch > New(const word &name, const dictionary &dict, const label index, const faBoundaryMesh &bm)
Return a pointer to a new patch created.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
label start() const
The start label of the boundary faces in the polyMesh face list.
#define forAll(list, i)
Loop across all elements in list.
Template class for non-intrusive linked lists.
const labelListList & cellEdges() const
messageStream Info
Information stream (uses stdout - output is on the master only)
virtual const labelList & faceOwner() const
Return face owner.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
Mesh data needed to do the Finite Area discretisation.
label findPatchID(const word &patchName, const bool allowNotFound=true) const
Find patch index given a name, return -1 if not found.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
errorManipArg< error, int > exit(error &err, const int errNo=1)
Class which holds data needed for faPatch construction.
const std::string patch
OpenFOAM patch number as a std::string.
Finite area mesh. Used for 2-D non-Euclidian finite area method.
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
wordList toc() const
Return the table of contents.
static void noParallel()
Remove the parallel options.
const word & constant() const
Return constant name.
Foam::argList args(argc, argv)
Smooth ATC in cells next to a set of patches supplied by type.
A list of faces which address into the list of points.