45 if (foundObject<fieldType>(fieldName))
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>()
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))
118 mesh_.data().solverPerformanceDict();
120 if (solverDict.
found(fieldName))
122 const List<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>());
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);
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 and vector-space.
Generic GeometricField class.
::Foam::direction nComponents(const expressions::valueTypeCode) noexcept
The number of components associated with given valueTypeCode.
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.