51 int main(
int argc,
char *argv[])
55 "Write field and boundary condition info for each patch" 56 " at each requested time instance" 59 timeSelector::addOptions();
62 argList::addBoolOption
65 "Do not combine patches" 76 const polyBoundaryMesh& bm =
mesh.boundaryMesh();
81 runTime.setTime(timeDirs[timeI], timeI);
86 if (
mesh.readUpdate() == polyMesh::TOPO_PATCH_CHANGE)
88 Info<<
"Detected changed patches. Recreating patch group table." 94 IOobjectList(
mesh,
runTime.timeName()).sortedNames()
97 PtrList<volScalarField> vsf(objNames.size());
98 PtrList<volVectorField> vvf(objNames.size());
99 PtrList<volSphericalTensorField> vsptf(objNames.size());
100 PtrList<volSymmTensorField> vsytf(objNames.size());
101 PtrList<volTensorField> vtf(objNames.size());
103 PtrList<pointScalarField> psf(objNames.size());
104 PtrList<pointVectorField> pvf(objNames.size());
105 PtrList<pointSphericalTensorField> psptf(objNames.size());
106 PtrList<pointSymmTensorField> psytf(objNames.size());
107 PtrList<pointTensorField> ptf(objNames.size());
146 Info<< bm[patchi].type() <<
"\t: " << bm[patchi].name() <<
nl;
167 DynamicList<HashTable<word>> fieldToTypes(bm.size());
169 DynamicList<DynamicList<label>> groupToPatches(bm.size());
172 HashTable<word> fieldToType;
185 label groupI = fieldToTypes.find(fieldToType);
188 DynamicList<label>
group(1);
189 group.append(patchi);
190 groupToPatches.append(
group);
191 fieldToTypes.append(fieldToType);
195 groupToPatches[groupI].append(patchi);
200 forAll(groupToPatches, groupI)
202 const DynamicList<label>& patchIDs = groupToPatches[groupI];
204 if (patchIDs.size() > 1)
209 bm.matchGroups(patchIDs, groups, nonGroupPatches);
211 const labelList sortedPatches(nonGroupPatches.sortedToc());
214 Info<< bm[sortedPatches[i]].type()
215 <<
"\t: " << bm[sortedPatches[i]].name() <<
nl;
221 Info<<
"group\t: " << groups[i] <<
nl;
242 label patchi = patchIDs[i];
243 Info<< bm[patchi].type()
244 <<
"\t: " << bm[patchi].name() <<
nl;
void addToFieldList(PtrList< GeoField > &fieldList, const IOobject &obj, const label fieldi, const typename GeoField::Mesh &mesh)
List< instant > instantList
List of instants.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
#define forAll(list, i)
Loop across all elements in list.
constexpr const char *const group
Group name for atomic constants.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
void collectFieldList(const PtrList< GeoField > &fieldList, const label patchi, HashTable< word > &fieldToType)
List< word > wordList
A List of words.
messageStream Info
Information stream (stdout output on master, null elsewhere)
List< label > labelList
A List of labels.
Foam::argList args(argc, argv)
bool found(const word &optName) const
Return true if the named option is found.
void outputFieldList(const PtrList< GeoField > &fieldList, const label patchi)
string expand(const std::string &s, const HashTable< string > &mapping, const char sigil='$')
Expand occurrences of variables according to the mapping and return the expanded string.