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;
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;
128 finalAgglom[patchi] =
129 agglomObject.restrictTopBottomAddressing();
131 if (finalAgglom[patchi].size())
133 nCoarseFaces +=
max(finalAgglom[patchi] + 1);
143 if (finalAgglom[patchi].size() == 0)
161 nbrAgglom[agglomi] = finalAgglom[patchi][i];
170 if (
pp.coupled() && !refCast<const coupledPolyPatch>(
pp).owner())
175 finalAgglom[patchi][i] = nbrAgglom[agglomi];
189 "facesAgglomeration",
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();
const List< face_type > & localFaces() const
Return patch faces addressing into local point list.
static void addNote(const string ¬e)
Add extra notes for the usage information.
void size(const label n)
Older name for setAddressableSize.
const fileName & facesInstance() const
Return the current instance directory for faces.
const Field< point_type > & localPoints() const
Return pointField of points in patch.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Unit conversion functions.
const word dictName("faMeshDefinition")
Ostream & endl(Ostream &os)
Add newline and flush stream.
Ignore writing from objectRegistry::writeObject()
const dimensionSet dimless
Dimensionless.
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
const Time & time() const
Return the top-level database.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
#define forAll(list, i)
Loop across all elements in list.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
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...
void agglomerate()
Agglomerate patch.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
A class for handling words, derived from Foam::string.
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
label nInternalFaces() const noexcept
Number of internal faces.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO...
static word timeName(const scalar t, const int precision=precision_)
Return a time name for the given scalar time value formatted with the given precision.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Primitive patch pair agglomerate method.
messageStream Info
Information stream (stdout output on master, null elsewhere)
A patch is a list of labels that address the faces in the global face list.
label nBoundaryFaces() const noexcept
Number of boundary faces (== nFaces - nInternalFaces)
Defines the attributes of an object for which implicit objectRegistry management is supported...
Do not request registration (bool: false)
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
A keyword and a list of tokens is an 'entry'.
static constexpr const zero Zero
Global zero (0)