51 mesh_.validComponents<Type>()
54 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; ++cmpt)
56 if (
component(validComponents, cmpt) != -1)
59 const word fieldBase(fieldName + cmptName);
80 if (foundObject<volFieldType>(fieldName))
83 mesh_.data().solverPerformanceDict();
85 if (solverDict.
found(fieldName))
89 mesh_.validComponents<Type>()
92 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; ++cmpt)
94 if (
component(validComponents, cmpt) != -1)
101 createResidualField(resultName);
112 typedef GeometricField<Type, fvPatchField, volMesh> volFieldType;
113 typedef typename pTraits<Type>::labelType labelType;
115 if (foundObject<volFieldType>(fieldName))
117 const Foam::dictionary& solverDict =
118 mesh_.data().solverPerformanceDict();
120 if (solverDict.
found(fieldName))
122 const Pair<SolverPerformance<Type>> sp
124 solverDict.
lookup(fieldName)
127 const SolverPerformance<Type>& sp0 = sp.first();
128 const word& solverName = sp0.solverName();
129 const Type& initialResidual = sp0.initialResidual();
130 const Type& finalResidual = sp0.finalResidual();
131 const labelType nIterations = sp0.nIterations();
132 const Switch converged(sp0.converged());
134 const labelType validComponents(mesh_.validComponents<Type>());
138 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; ++cmpt)
140 if (
component(validComponents, cmpt) != -1)
142 const scalar ri =
component(initialResidual, cmpt);
143 const scalar rf =
component(finalResidual, cmpt);
151 const word cmptName(pTraits<Type>::componentNames[cmpt]);
152 const word resultName(fieldName + cmptName);
153 setResult(resultName +
"_initial", ri);
154 setResult(resultName +
"_final", rf);
155 setResult(resultName +
"_iters",
n);
Various functions to operate on Lists.
Generic GeometricField class.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
An ordered pair of two objects of type <T> with first() and second() elements.
const T & first() const noexcept
Access the first element.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
ITstream & lookup(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return an entry data stream. FatalIOError if not found, or not a stream.
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry (const access) with the given keyword.
const fvMesh & mesh_
Reference to the fvMesh.
bool foundObject(const word &fieldName) const
Find object (eg, a field) in the (sub) objectRegistry.
void updateSolverInfo(const word &fieldName)
Calculate the solver information.
void createResidualField(const word &fieldName)
Create and store a residual field on the mesh database.
void initialiseResidualField(const word &fieldName)
Initialise a residual field.
void writeFileHeader(Ostream &os)
Output file header information.
void setResult(const word &entryName, const Type &value)
Add result.
virtual void writeTabbed(Ostream &os, const string &str) const
Write a tabbed string to stream.
virtual OFstream & file()
Return access to the file (if only 1).
A traits class, which is primarily used for primitives and vector-space.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)