57int 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;
100 const auto& patchesDict =
101 agglomDict.optionalSubDict
103 "patchAgglomeration",
107 for (
const entry& dEntry : patchesDict)
111 for (
const label patchi : patchids)
117 Info <<
"\nAgglomerating patch : " <<
pp.name() <<
endl;
126 agglomObject.agglomerate();
128 finalAgglom[patchi] =
129 agglomObject.restrictTopBottomAddressing();
131 if (finalAgglom[patchi].size())
133 nCoarseFaces +=
max(finalAgglom[patchi] + 1);
143 if (finalAgglom[patchi].size() == 0)
160 const label agglomi =
pp.start() -
mesh.nInternalFaces() + i;
161 nbrAgglom[agglomi] = finalAgglom[patchi][i];
174 const label agglomi =
pp.start() -
mesh.nInternalFaces() + i;
175 finalAgglom[patchi][i] = nbrAgglom[agglomi];
189 "facesAgglomeration",
190 mesh.time().timeName(),
200 facesAgglomeration.boundaryFieldRef();
202 label coarsePatchIndex = 0;
209 facesAgglomerationBf[patchi];
211 forAll(bFacesAgglomeration, j)
213 bFacesAgglomeration[j] =
217 finalAgglom[patchi][j] + coarsePatchIndex
221 coarsePatchIndex +=
max(finalAgglom[patchi]) + 1;
225 Info<<
"\nWriting facesAgglomeration" <<
endl;
226 facesAgglomeration.write();
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
GeometricBoundaryField< scalar, fvPatchField, volMesh > Boundary
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
@ NO_REGISTER
Do not request registration (bool: false).
@ NO_READ
Nothing to be read.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Negative if the process is not a...
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
static void addNote(const string ¬e)
Add extra notes for the usage information.
A keyword and a list of tokens is an 'entry'.
Calculates a non-overlapping list of offsets based on an input size (eg, number of cells) from differ...
Primitive patch pair agglomerate method.
A polyBoundaryMesh is a polyPatch list with registered IO, a reference to the associated polyMesh,...
A patch is a list of labels that address the faces in the global face list.
A class for handling words, derived from Foam::string.
const word dictName("faMeshDefinition")
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
const dimensionSet dimless
Dimensionless.
List< label > labelList
A List of labels.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
messageStream Info
Information stream (stdout output on master, null elsewhere).
Ostream & endl(Ostream &os)
Add newline and flush stream.
IOList< labelList > labelListIOList
IO for a List of labelList.
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...
static constexpr const zero Zero
Global zero (0).
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
fvPatchField< scalar > fvPatchScalarField
#define forAll(list, i)
Loop across all elements in list.
Unit conversion functions.