57int main(
int argc,
char *argv[])
61 "Agglomerate boundary faces using the pairPatchAgglomeration"
62 " algorithm. Writes a map of fine to coarse grid."
65 argList::addOption(
"dict",
"file",
"Alternative viewFactorsDict");
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());
152 const label agglomi = pp.
start() -
mesh.nInternalFaces() + i;
153 nbrAgglom[agglomi] = finalAgglom[patchi][i];
158 syncTools::swapBoundaryFaceList(
mesh, nbrAgglom);
162 if (pp.
coupled() && !refCast<const coupledPolyPatch>(pp).owner())
166 const label agglomi = pp.
start() -
mesh.nInternalFaces() + i;
167 finalAgglom[patchi][i] = nbrAgglom[agglomi];
181 "facesAgglomeration",
182 mesh.time().timeName(),
192 facesAgglomeration.boundaryFieldRef();
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();
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,...
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
const Field< point_type > & localPoints() const
Return pointField of points in patch.
const List< face_type > & localFaces() const
Return patch faces addressing into local point list.
A keyword and a list of tokens is an 'entry'.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
Primitive patch pair agglomerate method.
const word & name() const noexcept
The patch name.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
A patch is a list of labels that address the faces in the global face list.
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
label start() const
Return start label of this patch in the polyMesh face list.
A class for handling words, derived from Foam::string.
const word dictName("faMeshDefinition")
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
#define forAll(list, i)
Loop across all elements in list.
Unit conversion functions.