MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / read

Function read

src/functionObjects/field/streamLine/streamLine.C:304–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

302// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
303
304bool Foam::functionObjects::streamLine::read(const dictionary& dict)
305{
306 if (dict != dict_)
307 {
308 dict_ = dict;
309 }
310
311 Info<< type() << " " << name() << ":" << nl;
312
313 dict.lookup("fields") >> fields_;
314 UName_ = dict.lookupOrDefault("U", word("U"));
315
316 if (findIndex(fields_, UName_) == -1)
317 {
318 FatalIOErrorInFunction(dict)
319 << "Velocity field for tracking " << UName_
320 << " should be present in the list of fields " << fields_
321 << exit(FatalIOError);
322 }
323
324
325 dict.lookup("trackForward") >> trackForward_;
326 dict.lookup("lifeTime") >> lifeTime_;
327 if (lifeTime_ < 1)
328 {
329 FatalErrorInFunction
330 << "Illegal value " << lifeTime_ << " for lifeTime"
331 << exit(FatalError);
332 }
333
334
335 bool subCycling = dict.found("nSubCycle");
336 bool fixedLength = dict.found("trackLength");
337
338 if (subCycling && fixedLength)
339 {
340 FatalIOErrorInFunction(dict)
341 << "Cannot both specify automatic time stepping (through '"
342 << "nSubCycle' specification) and fixed track length (through '"
343 << "trackLength')"
344 << exit(FatalIOError);
345 }
346
347
348 nSubCycle_ = 1;
349 if (dict.readIfPresent("nSubCycle", nSubCycle_))
350 {
351 trackLength_ = VGREAT;
352 if (nSubCycle_ < 1)
353 {
354 nSubCycle_ = 1;
355 }
356 Info<< " automatic track length specified through"
357 << " number of sub cycles : " << nSubCycle_ << nl << endl;
358 }
359 else
360 {
361 dict.lookup("trackLength") >> trackLength_;

Callers 3

streamLine.CFile · 0.70
updateMeshFunction · 0.70
movePointsFunction · 0.70

Calls 12

wordClass · 0.85
findIndexFunction · 0.85
lookupMethod · 0.80
readIfPresentMethod · 0.80
meshSearchClass · 0.70
typeEnum · 0.50
nameFunction · 0.50
exitFunction · 0.50
NewFunction · 0.50
foundMethod · 0.45
resetMethod · 0.45
axisMethod · 0.45

Tested by

no test coverage detected