78 int main(
int argc,
char *argv[])
92 "add non-conformal boundary conditions to the fields" 98 runTime.functionObjects().off();
120 cyclicNames.
append(nonConformalCyclicPolyPatch::typeName);
125 static const word dictName(
"createNonConformalCouplesDict");
136 if (!iter().isDict())
continue;
140 const bool havePatches = subDict.
found(
"patches");
141 const bool haveOwnerNeighbour =
142 subDict.
found(
"owner") || subDict.
found(
"neighbour");
144 if (havePatches == haveOwnerNeighbour)
147 <<
"Patches should be specified with either a single " 148 <<
"\"patches\" entry with a pair of patch names, or with " 149 <<
"two sub-dictionaries named \"owner\" and " 159 if (haveOwnerNeighbour)
169 neighbourDict[
"patch"]
200 if (fields)
Info<<
"Reading geometric fields" << nl <<
endl;
219 if (isA<processorPolyPatch>(pp) && firstProcPatchi == patches.
size())
222 firstProcFacei = pp.
start();
225 if (!isA<processorPolyPatch>(pp) && firstProcPatchi != patches.
size())
228 <<
"Processor patches do not follow boundary patches" 249 auto nccPatchNames = [&](
const label i)
254 cyclicNames[i] +
"_on_" + patchNames[i][0],
255 cyclicNames[i] +
"_on_" + patchNames[i][1]
263 << nonConformalCyclicPolyPatch::typeName
264 <<
" interfaces between patches: " <<
incrIndent << nl
267 << indent << Pair<word>(nccPatchNames(i)) <<
decrIndent << nl
269 transforms[i].write(
Info);
281 nonConformalCyclicPolyPatch::typeName,
289 patchFieldDicts[i][0]
300 nonConformalCyclicPolyPatch::typeName,
308 patchFieldDicts[i][1]
314 auto appendErrorPatches = [&](
const bool owner)
319 patchANames.
insert(patchNames[i][!owner]);
327 nonConformalErrorPolyPatch::typeName +
"_on_" + iter.key(),
332 nonConformalErrorPolyPatch::typeName,
342 appendErrorPatches(
true);
343 appendErrorPatches(
false);
365 const polyPatch& patch1 = patches[patchNames[i][0]];
366 const polyPatch& patch2 = patches[patchNames[i][1]];
390 auto appendProcPatches = [&](
const bool owner,
const bool first)
393 owner ? procHasPatch1 : procHasPatch2;
395 owner ? procHasPatch2 : procHasPatch1;
399 forAll(procHasPatchB, proci)
407 && procHasPatchB[proci]
420 nccPatchNames(i)[!owner],
421 patchNames[i][!owner]
426 patchFieldDicts[i][!owner]
433 appendProcPatches(
true,
true);
434 appendProcPatches(
false,
true);
435 appendProcPatches(
false,
false);
436 appendProcPatches(
true,
false);
443 forAll(newPatches, newPatchi)
448 *newPatches[newPatchi],
460 forAll(newPatches, newPatchi)
462 if (!newPatchFieldDicts[newPatchi].empty())
464 fvMeshTools::setPatchFields
468 newPatchFieldDicts[newPatchi]
488 Info<<
"Writing mesh to " << runTime.timeName() << nl <<
endl;
const fvPatchList & patches
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
labelList first(const UList< labelPair > &p)
static void scatterList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Scatter data. Reverse of gatherList.
A HashTable with keys but without contents.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
#define forAll(list, i)
Loop across all elements in list.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
Ostream & indent(Ostream &os)
Indent stream.
List of IOobjects with searching and retrieving facilities.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
static bool hasArgs(int argc, char *argv[])
Return true if there are arguments.
Mesh stitcher for stationary meshes.
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
static unsigned int defaultPrecision()
Return the default precision.
void size(const label)
Override size to be inconsistent with allocated storage.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
static word defaultRegion
Return the default region name.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool optionFound(const word &opt) const
Return true if the named option is found.
static SLList< string > validArgs
A list of valid (mandatory) arguments.
Field reading functions for post-processing utilities.
virtual bool write(const bool write=true) const
Write mesh using IO settings from time.
bool insert(const Key &key)
Insert a new entry.
IOdictionary systemDict(const word &dictName, const argList &args, const objectRegistry &ob, const word ®ionName=polyMesh::defaultRegion)
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
const word dictName() const
Return the local dictionary name (final part of scoped name)
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
virtual autoPtr< polyPatch > clone(const polyBoundaryMesh &bm) const
Construct and return a clone, resetting the boundary mesh.
const fileName & pointsInstance() const
Return the current instance directory for points.
const dictionary & optionalSubDict(const word &) const
Find and return a sub-dictionary if found.
A class for handling words, derived from string.
void append(const T &)
Append an element at the end of the list.
wordList patchNames(nPatches)
This boundary condition is not designed to be evaluated; it is assumed that the value is assigned via...
virtual bool connect(const bool changing, const bool geometric, const bool load)
Connect the mesh by adding faces into the nonConformalCyclics.
void conform(const surfaceScalarField &phi=NullObjectRef< surfaceScalarField >())
Conform the fvMesh to the polyMesh.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
void setInstance(const fileName &)
Set the instance for mesh files.
label size() const
Return the number of elements in the UPtrList.
static bool & parRun()
Is this a parallel run?
static label nProcs(const label communicator=0)
Number of processes in parallel run.
Info<< "Reading field p_rgh\"<< endl;volScalarField p_rgh(IOobject("p_rgh", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);pressureReference pressureReference(p, p_rgh, pimple.dict(), thermo.incompressible());mesh.schemes().setFluxRequired(p_rgh.name());hydrostaticInitialisation(p_rgh, p, rho, U, gh, ghf, pRef, thermo, pimple.dict());Info<< "Creating field dpdt\"<< endl;volScalarField dpdt(IOobject("dpdt", runTime.timeName(), mesh), mesh, dimensionedScalar(p.dimensions()/dimTime, 0));Info<< "Creating field kinetic energy K\"<< endl;volScalarField K("K", 0.5 *magSqr(U));dimensionedScalar initialMass=fvc::domainIntegrate(rho);multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
label start() const
Return start label of this patch in the polyMesh face list.
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
A patch is a list of labels that address the faces in the global face list.
Foam::argList args(argc, argv)
Ostream & incrIndent(Ostream &os)
Increment the indent level.
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
dictionary subOrEmptyDict(const word &, const bool mustRead=false) const
Find and return a sub-dictionary as a copy, or.
const word dictName("noiseDict")
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.