45 if (foundObject<fieldType>(fieldName))
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))
84 if (solverDict.
found(fieldName))
88 mesh_.validComponents<Type>()
91 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; ++cmpt)
93 if (
component(validComponents, cmpt) != -1)
100 createResidualField(resultName);
111 typedef GeometricField<Type, fvPatchField, volMesh> volFieldType;
112 typedef typename pTraits<Type>::labelType labelType;
114 if (foundObject<volFieldType>(fieldName))
118 if (solverDict.
found(fieldName))
120 const List<SolverPerformance<Type>> sp
122 solverDict.
lookup(fieldName)
125 const SolverPerformance<Type>& sp0 = sp.
first();
126 const word& solverName = sp0.solverName();
127 const Type& initialResidual = sp0.initialResidual();
128 const Type& finalResidual = sp0.finalResidual();
129 const labelType nIterations = sp0.nIterations();
130 const Switch converged(sp0.converged());
132 const labelType validComponents(mesh_.validComponents<Type>());
136 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; ++cmpt)
138 if (
component(validComponents, cmpt) != -1)
140 const scalar ri =
component(initialResidual, cmpt);
141 const scalar rf =
component(finalResidual, cmpt);
149 const word cmptName(pTraits<Type>::componentNames[cmpt]);
150 const word resultName(fieldName + cmptName);
151 setResult(resultName +
"_initial", ri);
152 setResult(resultName +
"_final", rf);
153 setResult(resultName +
"_iters",
n);
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. ...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
A traits class, which is primarily used for primitives.
Generic GeometricField class.
Various functions to operate on Lists.
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry (const access) with the given keyword.
void writeFileHeader(Ostream &os)
Output file header information.
A class for handling words, derived from Foam::string.
void initialiseResidualField(const word &fieldName)
Initialise a residual field.
pTraits< Type >::labelType validComponents() const
Return a labelType of valid component indicators.
void updateSolverInfo(const word &fieldName)
Calculate the solver information.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
T * first()
The first entry in the list.
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
const fvMesh & mesh_
Reference to the fvMesh.
virtual void writeTabbed(Ostream &os, const string &str) const
Write a tabbed string to stream.