40 int main(
int argc,
char *argv[])
62 if (fieldNameDict.
found(
"U")) nameMap.
add(
"SU",
word(
"U"));
63 if (fieldNameDict.
found(
"p")) nameMap.
add(
"P",
word(
"p"));
64 if (fieldNameDict.
found(
"T")) nameMap.
add(
"T",
word(
"T"));
65 if (fieldNameDict.
found(
"rho")) nameMap.
add(
"DENS",
word(
"rho"));
66 if (fieldNameDict.
found(
"k")) nameMap.
add(
"TE",
word(
"k"));
67 if (fieldNameDict.
found(
"epsilon")) nameMap.
add(
"ED",
word(
"epsilon"));
68 if (fieldNameDict.
found(
"nuEff")) nameMap.
add(
"VIS",
word(
"nuEff"));
77 <<
"Cannot open SMAP file " << smapFile.name()
81 while (!smapFile.eof())
85 token fieldName(smapFile);
95 && fieldName.wordToken() !=
"CELL"
99 <<
"Expected first CELL, found "
105 smapFile >> fieldName;
108 starFieldNames[nCols++] = fieldName.wordToken();
109 smapFile >> fieldName;
127 if (nameMap.
found(starFieldNames[i]))
129 if (starFieldNames[i] ==
"SU")
136 nameMap.
lookup(starFieldNames[i]),
155 nameMap.
lookup(starFieldNames[i]),
177 forAll(mesh.cells(), celli)
189 smapFile >> (*sFields[i])[celli];
194 smapFile >> (*vFields[i])[celli].
x();
195 smapFile >> (*vFields[i])[celli].
y();
196 smapFile >> (*vFields[i])[celli].z();
207 for (
label i=0; i<nCols; i++)
211 sFields[i]->correctBoundaryConditions();
214 sFields[i] =
nullptr;
218 vFields[i]->correctBoundaryConditions();
221 vFields[i] =
nullptr;
231 <<
"Expected first SMAP dummy entry to be cell 0, found "
236 for (
label i=0; i<nCols; i++)
#define forAll(list, i)
Loop across all elements in list.
Generic GeometricField class.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const fileName & name() const
Return the name of the stream.
Extract command arguments and options from the supplied argc and argv parameters.
static void noParallel()
Remove the parallel options.
static SLList< string > validArgs
A list of valid (mandatory) arguments.
bool check(bool checkArgs=true, bool checkOpts=true) const
Check argument list.
A cell is defined as a list of faces with extra functionality.
A list of keyword definitions, which are a keyword followed by any number of values (e....
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
bool add(entry *, bool mergeEntry=false)
Add a new entry.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
void exit(const int errNo=1)
Exit : can be called for any error to exit program.
A token holds items read from Istream.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
int main(int argc, char *argv[])
static List< word > fieldNames
errorManipArg< error, int > exit(error &err, const int errNo=1)
VolField< vector > volVectorField
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
VolField< scalar > volScalarField
fileNameList readDir(const fileName &, const fileType=fileType::file, const bool filterVariants=true, const bool followLink=true)
Read a directory and return the entries as a string list.
Foam::argList args(argc, argv)