29 #include "readFields.H" 52 Foam::wordList Foam::ROMmodels::DMD::modeNames(
const word& modeType)
const 55 for (
const label modei : modes_)
60 "mode"+modeType+
"_"+
name(modei)+
"_"+fieldName_+
"_"+objectName_
73 const dictionary&
dict,
96 dict.readEntry(
"field", fieldName_);
97 dict.readEntry(
"object", objectName_);
98 dict.readEntry(
"deltaT", deltaT_);
99 dict.readEntry(
"time", time_);
100 dict.readIfPresent(
"startTime", startTime_);
102 if (deltaT_ < SMALL || time_ < SMALL || startTime_ < 0)
105 <<
"Out-of-range values for " <<
nl 106 <<
tab <<
"deltaT: " << deltaT_
107 <<
tab <<
"time: " << time_ <<
nl 108 <<
tab <<
"startTime: " << startTime_ <<
nl 112 dict.readEntry(
"modes", modes_);
117 <<
"Empty list for the mode indices " <<
nl 118 <<
tab <<
"modes: " << modes_ <<
nl 122 dims_.reset(
dict.get<dimensionSet>(
"dimensions"));
125 dict.readEntry(
"amplitudes", amps_);
126 dict.readEntry(
"eigenvalues", evals_);
128 if ((amps_.size() != modes_.size()) || (evals_.size() != modes_.size()))
131 <<
"Inconsistent input sizes for " 132 <<
tab <<
"modes: " << modes_.size() <<
nl 133 <<
tab <<
"amplitudes: " << amps_.size() <<
nl 134 <<
tab <<
"eigenvalues: " << evals_.size() <<
nl 139 const wordList modeReNames(modeNames(word(
"Re")));
140 const wordList modeImNames(modeNames(word(
"Im")));
143 runTime_.setTime(time_, 0);
145 readFieldsHandler(mesh_).execute(modeReNames);
146 readFieldsHandler(mesh_).execute(modeImNames);
157 #define doLocalCode(InputType) \ 159 createAndWriteImpl<VolumeField<InputType>>(); \ 160 createAndWriteImpl<SurfaceField<InputType>>(); \ 169 #undef doInnerLocalCode virtual bool createAndWrite()
Create and write fields.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
constexpr char tab
The tab '\t' character(0x09)
#define doLocalCode(FieldType, Variable)
Macros for easy insertion into run-time selection tables.
DMD(Time &runTime, fvMesh &mesh, const dictionary &dict, const instantList ×)
Construct from components.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
SymmTensor< scalar > symmTensor
SymmTensor of scalars, i.e. SymmTensor<scalar>.
virtual bool read(const dictionary &dict)
Read DMD settings.
defineTypeNameAndDebug(combustionModel, 0)
List< word > wordList
List of word.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
SphericalTensor< scalar > sphericalTensor
SphericalTensor of scalars, i.e. SphericalTensor<scalar>.
List< instant > instantList
List of instants.
virtual bool read(const dictionary &dict)
Read model settings.
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...