34 List<Pair<word>> regionSolverNames;
36 if (runTime.controlDict().found(
"regionSolvers"))
38 const dictionary& regionSolversDict =
39 runTime.controlDict().subDict(
"regionSolvers");
44 const word solverName(iter().stream());
46 regionSolverNames.append(Pair<word>(
regionName, solverName));
56 typeIOobject<IOdictionary> regionPropertiesHeader
61 runTime.time().constant(),
67 if (regionPropertiesHeader.headerOk())
69 HashTable<wordList> regions
71 IOdictionary(regionPropertiesHeader).lookup(
"regions")
74 if (regions.found(
"solid"))
76 const wordList& fluidRegions = regions[
"solid"];
79 regionSolverNames.append
81 Pair<word>(fluidRegions[i],
"solid")
86 if (regions.found(
"fluid"))
88 const wordList& fluidRegions = regions[
"fluid"];
91 regionSolverNames.append
93 Pair<word>(fluidRegions[i],
"fluid")
101 <<
"regionSolvers list missing from "
102 << runTime.controlDict().name()
107 regions_.setSize(regionSolverNames.size());
108 solvers_.setSize(regionSolverNames.size());
109 prefixes_.
setSize(regionSolverNames.size());
114 forAll(regionSolverNames, i)
116 const word& solverName = regionSolverNames[i].second();
122 forAll(regionSolverNames, i)
124 const word&
regionName = regionSolverNames[i].first();
149 forAll(regionSolverNames, i)
151 const word&
regionName = regionSolverNames[i].first();
152 const word& solverName = regionSolverNames[i].second();
154 solvers_.set(i,
solver::New(solverName, regions_[i]));
162 prefix0_.append(nRegionNameChars,
' ');
164 forAll(regionSolverNames, i)
166 prefixes_[i].
append(nRegionNameChars - prefixes_[i].
size(),
' ');
graph_traits< Graph >::vertices_size_type size_type
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
void append(const T &)
Append an element at the end of the list.
void setSize(const label)
Reset size of List.
const string & prefix() const
Return the prefix of the stream.
label size() const
Return the number of region solvers.
regionSolvers(const Time &runTime)
Construct from components.
solver & operator[](const label i)
Set the region i prefix and return the corresponding solver.
~regionSolvers()
Destructor.
void setGlobalPrefix() const
Set the Info prefix to space padding for global messages.
void setPrefix(const label i) const
Set the Info prefix to the space padded region name.
void resetPrefix() const
Reset the Info prefix to null.
Abstract base class for run-time selectable region solvers.
static autoPtr< solver > New(const word &solverName, fvMesh &mesh)
Select, construct and return the solver.
static void load(const word &solverName)
Load the specified solver library.
static const string null
An empty string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
errorManipArg< error, int > exit(error &err, const int errNo=1)
List< word > wordList
A List of words.
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 word & regionName(const solver ®ion)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
prefixOSstream Sout(cout, "Sout")