52int main(
int argc,
char *argv[])
56 "Write field and boundary condition info for each patch"
57 " at each requested time instance"
60 timeSelector::addOptions();
63 argList::addBoolOption
66 "Do not combine patches"
77 const polyBoundaryMesh& bm =
mesh.boundaryMesh();
82 runTime.setTime(timeDirs[timeI], timeI);
87 if (
mesh.readUpdate() == polyMesh::TOPO_PATCH_CHANGE)
89 Info<<
"Detected changed patches. Recreating patch group table."
93 const IOobjectList objects(
mesh,
runTime.timeName());
99 #define createFields(FieldType, Variable) \
100 PtrList<FieldType> Variable \
102 readFields<FieldType>(objects, mesh) \
105 createFields(volScalarField, vsf);
106 createFields(volVectorField, vvf);
107 createFields(volSphericalTensorField, vsptf);
108 createFields(volSymmTensorField, vsytf);
109 createFields(volTensorField, vtf);
112 const pointMesh& pMesh = pointMesh::New(
mesh);
115 #define createFields(FieldType, Variable) \
116 PtrList<FieldType> Variable \
118 readFields<FieldType>(objects, pMesh) \
121 createFields(pointScalarField, psf);
122 createFields(pointVectorField, pvf);
123 createFields(pointSphericalTensorField, psptf);
124 createFields(pointSymmTensorField, psytf);
125 createFields(pointTensorField, ptf);
138 Info<< bm[patchi].type() <<
"\t: " << bm[patchi].name() <<
nl;
160 DynamicList<HashTable<word>> fieldToTypes(bm.size());
162 DynamicList<DynamicList<label>> groupToPatches(bm.size());
166 HashTable<word> fieldToType;
179 label groupI = fieldToTypes.find(fieldToType);
182 DynamicList<label>
group(1);
183 group.append(patchi);
184 groupToPatches.append(group);
185 fieldToTypes.append(fieldToType);
189 groupToPatches[groupI].append(patchi);
194 for (
const auto&
patchIDs : groupToPatches)
201 bm.matchGroups(
patchIDs, groups, nonGroupPatches);
203 for (
const label patchi : nonGroupPatches.sortedToc())
205 Info<< bm[patchi].type()
206 <<
"\t: " << bm[patchi].name() <<
nl;
208 for (
const word& groupName : groups)
210 Info<<
"group\t: " << groupName <<
nl;
233 Info<< bm[patchi].type()
234 <<
"\t: " << bm[patchi].name() <<
nl;
constexpr const char *const group
Group name for atomic constants.
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.
List< word > wordList
List of word.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
messageStream Info
Information stream (stdout output on master, null elsewhere).
void collectFieldList(const UPtrList< GeoField > &fieldList, const label patchi, HashTable< word > &fieldToType)
List< instant > instantList
List of instants.
void outputFieldList(const UPtrList< GeoField > &fieldList, const label patchi)
Ostream & endl(Ostream &os)
Add newline and flush stream.
constexpr char nl
The newline '\n' character (0x0a).
Foam::argList args(argc, argv)
#define forAll(list, i)
Loop across all elements in list.