Go to the documentation of this file.
36 namespace regionModels
72 if (!time_.foundObject<
fvMesh>(regionName_))
95 Pout<<
"regionModel::initialise()" <<
endl;
98 label nBoundaryFaces = 0;
105 const polyPatch& regionPatch = rbm[patchI];
106 if (isA<mappedPatchBase>(regionPatch))
110 Pout<<
"found " << mappedWallPolyPatch::typeName
111 <<
" " << regionPatch.
name() <<
endl;
114 intCoupledPatchIDs.
append(patchI);
119 refCast<const mappedPatchBase>(regionPatch);
123 primaryMesh_.time().foundObject<
polyMesh>
131 primaryPatchIDs.
append(primaryPatchI);
136 primaryPatchIDs_.transfer(primaryPatchIDs);
137 intCoupledPatchIDs_.transfer(intCoupledPatchIDs);
142 <<
"Region model has no mapped boundary conditions - transfer "
143 <<
"between regions will not be possible" <<
endl;
146 if (!outputPropertiesPtr_.valid())
148 const fileName uniformPath(
word(
"uniform")/
"regionModels");
150 outputPropertiesPtr_.reset
156 regionName_ +
"OutputProperties",
158 uniformPath/regionName_,
177 if (
const dictionary* dictPtr = subDictPtr(modelName_ +
"Coeffs"))
179 coeffs_ <<= *dictPtr;
182 infoOutput_.readIfPresent(
"infoOutput", *
this);
198 if (
const dictionary* dictPtr =
dict.subDictPtr(modelName_ +
"Coeffs"))
200 coeffs_ <<= *dictPtr;
203 infoOutput_.readIfPresent(
"infoOutput",
dict);
218 const label regionPatchI,
219 const label nbrPatchI,
227 if (nbrRegionID != -1)
229 if (!interRegionAMI_[nbrRegionID].set(regionPatchI))
231 const polyPatch&
p = regionMesh().boundaryMesh()[regionPatchI];
237 interRegionAMI_[nbrRegionID].set
255 return interRegionAMI_[nbrRegionID][regionPatchI];
259 label nbrRegionID = interRegionAMINames_.size();
261 interRegionAMINames_.append(nbrRegion.
name());
263 const polyPatch&
p = regionMesh().boundaryMesh()[regionPatchI];
266 label nPatch = regionMesh().boundaryMesh().
size();
269 interRegionAMI_.resize(nbrRegionID + 1);
280 interRegionAMI_[nbrRegionID].set
297 return interRegionAMI_[nbrRegionID][regionPatchI];
305 const label regionPatchI
308 label nbrPatchI = -1;
318 if (regionPatchI > pbm.
size() - 1)
321 <<
"region patch index out of bounds: "
322 <<
"region patch index = " << regionPatchI
323 <<
", maximum index = " << pbm.
size() - 1
329 if (!isA<mappedPatchBase>(pp))
332 <<
"Expected a " << mappedPatchBase::typeName
347 refCast<const mappedPatchBase>(nbrPbm[nbrRegionPatchI]);
351 nbrPatchI = nbrRegionPatchI;
358 const polyPatch&
p = regionMesh().boundaryMesh()[regionPatchI];
361 <<
"Unable to find patch pair for local patch "
362 <<
p.name() <<
" and region " << nbrRegion.
name()
375 const word& regionType
382 regionType +
"Properties",
383 mesh.time().constant(),
394 regionMeshPtr_(NULL),
396 outputPropertiesPtr_(NULL),
398 intCoupledPatchIDs_(),
401 interRegionAMINames_(),
409 const word& regionType,
410 const word& modelName,
418 regionType +
"Properties",
419 mesh.time().constant(),
427 active_(
lookup(
"active")),
429 modelName_(modelName),
430 regionMeshPtr_(NULL),
431 coeffs_(subOrEmptyDict(modelName +
"Coeffs")),
432 outputPropertiesPtr_(NULL),
434 intCoupledPatchIDs_(),
435 regionName_(
lookup(
"regionName")),
436 functions_(*
this, subOrEmptyDict(
"functions"))
440 constructMeshObjects();
454 const word& regionType,
455 const word& modelName,
464 regionType +
"Properties",
465 mesh.time().constant(),
475 active_(
dict.lookup(
"active")),
477 modelName_(modelName),
478 regionMeshPtr_(NULL),
479 coeffs_(
dict.subOrEmptyDict(modelName +
"Coeffs")),
480 outputPropertiesPtr_(NULL),
482 intCoupledPatchIDs_(),
483 regionName_(
dict.lookup(
"regionName")),
484 functions_(*
this, subOrEmptyDict(
"functions"))
488 constructMeshObjects(
dict);
511 Info<<
"\nEvolving " << modelName_ <<
" for region "
512 << regionMesh().name() <<
endl;
530 if (time_.outputTime())
532 outputProperties().writeObject
536 time_.writeCompression()
545 functions_.preEvolveRegion();
557 functions_.postEvolveRegion();
label nbrCoupledPatchID(const regionModel &nbrRegion, const label regionPatchI) const
Return the coupled patch ID paired with coupled patch.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
void initialise()
Initialise the region.
A class for handling words, derived from string.
A class for handling file names.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
void constructMeshObjects()
Construct region mesh and fields.
#define forAll(list, i)
Loop across all elements in list.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurence of given element and return index,.
virtual void evolveRegion()
Evolve the region.
virtual void info()
Provide some feedback.
bool read(const char *, int32_t &)
const polyPatch & samplePolyPatch() const
Get the patch on the region.
autoPtr< fvMesh > regionMeshPtr_
Pointer to the region mesh database.
virtual bool read()
Read object.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
static const versionNumber currentVersion
Current version number.
This function object reads fields from the time directories and adds them to the mesh database for fu...
Ostream & incrIndent(Ostream &os)
Increment the indent level.
Mesh consisting of general polyhedral cells.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const polyBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
virtual void postEvolveRegion()
Post-evolve region.
A patch is a list of labels that address the faces in the global face list.
virtual void preEvolveRegion()
Pre-evolve region.
regionModel(const regionModel &)
Disallow default bitwise copy construct.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
virtual bool read()
Read control parameters from dictionary.
defineTypeNameAndDebug(regionModel, 0)
A list of keyword definitions, which are a keyword followed by any number of values (e....
Mesh data needed to do the Finite Volume discretisation.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
errorManip< error > abort(error &err)
const labelUList & faceCells() const
Return face-cell addressing.
const word & sampleRegion() const
Region to sample.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
Base class for region models.
virtual const AMIPatchToPatchInterpolation & interRegionAMI(const regionModel &nbrRegion, const label regionPatchI, const label nbrPatchI, const bool flip) const
Create or return a new inter-region AMI object.
bool foundObject(const word &name) const
Is the named Type found?
virtual ~regionModel()
Destructor.
static int & msgType()
Message tag of standard messages.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const Time & time_
Reference to the time database.
const word & name() const
Name function is needed to disambiguate those inherited.
prefixOSstream Pout(cout, "Pout")
virtual void evolve()
Main driver routing to evolve the region - calls other evolves.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
label size() const
Return the number of elements in the PtrList.
label size() const
Return the number of elements in the UList.
const word & name() const
Return name.
const labelList & intCoupledPatchIDs() const
Return the list of patch IDs internally coupled with the.
#define WarningInFunction
Report a warning using Foam::Warning.
label index() const
Return the index of this patch in the boundaryMesh.
word regionName_
Region name.
static const dictionary null
Null dictionary.
stressControl lookup("compactNormalStress") >> compactNormalStress
const fvMesh & regionMesh() const
Return the region mesh database.
const word & samplePatch() const
Patch (only if NEARESTPATCHFACE)