53class addDimensionSetsToDebug
59 addDimensionSetsToDebug(
const addDimensionSetsToDebug&) =
delete;
60 void operator=(
const addDimensionSetsToDebug&) =
delete;
62 explicit addDimensionSetsToDebug(
const char*
name)
67 virtual ~addDimensionSetsToDebug()
69 deleteDemandDrivenData(dimensionSystemsPtr_);
70 deleteDemandDrivenData(unitSetPtr_);
71 deleteDemandDrivenData(writeUnitSetPtr_);
74 virtual void readData(Foam::Istream& is)
88addDimensionSetsToDebug addDimensionSetsToDebug_(
"DimensionSets");
120 <<
"Cannot find unitSet in dictionary " <<
dict.
name()
131 <<
"Cannot find " << unitSetCoeffs <<
" in dictionary "
142 for (
const entry& dEntry : unitDict)
144 if (
"writeUnits" == dEntry.keyword())
146 dEntry.readEntry(writeUnitNames);
151 dt.read(dEntry.stream(), unitDict);
153 bool ok =
unitSetPtr_->insert(dEntry.keyword(), dt);
157 <<
"Duplicate unit " << dEntry.keyword()
158 <<
" in DimensionSets dictionary"
164 if (writeUnitNames.size() != 0 && writeUnitNames.size() != 7)
167 <<
"Cannot find entry \"writeUnits\" in " << unitDict.name()
168 <<
" or it is not a wordList of size 7"
232 units_(unitNames.size()),
233 conversion_(unitNames.size()),
234 conversionPivots_(unitNames.size()),
249 if (unitNames.
size() == 7)
254 for (label rowI = 0; rowI < conversion_.
m(); rowI++)
256 scalar* row = conversion_[rowI];
258 for (label columnI = 0; columnI < conversion_.
n(); columnI++)
261 row[columnI] = dSet.dimensions()[rowI];
264 conversionPivots_.
setSize(conversion_.
m());
label size() const noexcept
The number of elements in list.
A HashTable similar to std::unordered_map.
void setSize(label n)
Alias for resize().
label m() const noexcept
The number of rows.
label n() const noexcept
The number of columns.
void size(const label n)
Older name for setAddressableSize.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T. FatalIOError if not found, or if the number of tokens is incorrect.
const fileName & name() const noexcept
The dictionary name.
const dictionary * findDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary pointer if present (and it is a dictionary) otherwise return nullptr...
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry (const access) with the given keyword.
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Construction of unit sets.
const PtrList< dimensionedScalar > & units() const noexcept
Return the units.
void coefficients(scalarField &exponents) const
(if valid) obtain set of coefficients of unitNames
dimensionSets(const HashTable< dimensionedScalar > &, const wordList &unitNames)
Construct from all units and set of units to use for inversion (writing).
bool read(const dictionary &dict)
Update the value of dimensioned<Type>, lookup in dictionary with the name().
const dimensionSet & dimensions() const noexcept
Return const reference to dimensions.
A keyword and a list of tokens is an 'entry'.
Abstract base class for registered object with I/O. Used in debug symbol registration.
A class for handling words, derived from Foam::string.
Template functions to aid in the implementation of demand driven data.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
OBJstream os(runTime.globalPath()/outputName)
Namespace for handling debugging switches.
dictionary & switchSet(const char *subDictName, dictionary *&subDictPtr)
Internal function to lookup a sub-dictionary from controlDict.
const dimensionSet dimPressure
const dimensionSet dimViscosity
List< word > wordList
List of word.
const dimensionSet dimPower
const dimensionSet dimless
Dimensionless.
const dimensionSet dimCompressibility
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const dimensionSet dimEnergy
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
dimensionedScalar pow3(const dimensionedScalar &ds)
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
const dimensionSet dimCurrent(0, 0, 0, 0, 0, 1, 0)
void LUBacksubstitute(const scalarSquareMatrix &luMmatrix, const labelList &pivotIndices, List< Type > &source)
LU back-substitution with given source, returning the solution in the source.
const dimensionSet dimMoles(0, 0, 0, 0, 1, 0, 0)
const dimensionSet dimArea(sqr(dimLength))
const dimensionSet dimVelocity
void LUDecompose(scalarSquareMatrix &matrix, labelList &pivotIndices)
LU decompose the matrix with pivoting.
const dimensionSet dimGasConstant
dictionary & dimensionSystems()
Top level dictionary.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dictionary * dimensionSystemsPtr_(nullptr)
const dimensionSet dimSpecificHeatCapacity(dimGasConstant)
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
const HashTable< dimensionedScalar > & unitSet()
Set of all dimensions.
const dimensionSet dimForce
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
const dimensionSets & writeUnitSet()
Set of units.
const dimensionSet dimDynamicViscosity
const dimensionSet dimAcceleration
const dimensionSet dimVolume(pow3(dimLength))
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
HashTable< dimensionedScalar > * unitSetPtr_(nullptr)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const dimensionSet dimDensity
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensionSets * writeUnitSetPtr_(nullptr)
void deleteDemandDrivenData(DataPtr &dataPtr)
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
const dimensionSet dimVol(dimVolume)
Older spelling for dimVolume.
const dimensionSet dimLuminousIntensity(0, 0, 0, 0, 0, 0, 1)
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.
const bool writeData(pdfDictionary.get< bool >("writeData"))