Go to the documentation of this file.
57 int main(
int argc,
char *argv[])
61 "Agglomerate boundary faces using the pairPatchAgglomeration"
62 " algorithm. Writes a map of fine to coarse grid."
79 const bool writeAgglom(agglomDict.get<
bool>(
"writeFacesAgglomeration"));
97 label nCoarseFaces = 0;
99 for (
const entry& dEntry : agglomDict)
103 for (
const label patchi : patchids)
109 Info <<
"\nAgglomerating patch : " << pp.
name() <<
endl;
115 agglomDict.subDict(pp.
name())
118 agglomObject.agglomerate();
120 finalAgglom[patchi] =
121 agglomObject.restrictTopBottomAddressing();
123 if (finalAgglom[patchi].size())
125 nCoarseFaces +=
max(finalAgglom[patchi] + 1);
135 if (finalAgglom[patchi].size() == 0)
149 finalAgglom[patchi] =
identity(pp.size());
153 nbrAgglom[agglomi] = finalAgglom[patchi][i];
162 if (pp.
coupled() && !refCast<const coupledPolyPatch>(pp).owner())
167 finalAgglom[patchi][i] = nbrAgglom[agglomi];
181 "facesAgglomeration",
191 volScalarField::Boundary& facesAgglomerationBf =
194 label coarsePatchIndex = 0;
201 facesAgglomerationBf[patchi];
203 forAll(bFacesAgglomeration, j)
205 bFacesAgglomeration[j] =
209 finalAgglom[patchi][j] + coarsePatchIndex
213 coarsePatchIndex +=
max(finalAgglom[patchi]) + 1;
217 Info<<
"\nWriting facesAgglomeration" <<
endl;
218 facesAgglomeration.
write();
A keyword and a list of tokens is an 'entry'.
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,...
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Dimensionless.
A class for handling words, derived from Foam::string.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
static constexpr const zero Zero
Global zero (0)
label nInternalFaces() const
Number of internal faces.
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
static word timeName(const scalar t, const int precision=precision_)
static void addNote(const string ¬e)
Add extra notes for the usage information.
const word dictName("blockMeshDict")
Primitive patch pair agglomerate method.
const fileName & facesInstance() const
Return the current instance directory for faces.
Unit conversion functions.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
#define forAll(list, i)
Loop across all elements in list.
messageStream Info
Information stream (uses stdout - output is on the master only)
A patch is a list of labels that address the faces in the global face list.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
label nBoundaryFaces() const
Number of boundary faces (== nFaces - nInternalFaces)
const List< face_type > & localFaces() const
Return patch faces addressing into local point list.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
label start() const
Return start label of this patch in the polyMesh face list.
const Field< point_type > & localPoints() const
Return pointField of points in patch.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
labelList identity(const label len, label start=0)
Create identity map of the given length with (map[i] == i)
const Time & time() const
Return the top-level database.
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
const word & name() const
The patch name.