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

Function read

src/OpenFOAM/matrices/solution/solution.C:45–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
44
45void Foam::solution::read(const dictionary& dict)
46{
47 if (dict.found("cache"))
48 {
49 cache_ = dict.subDict("cache");
50 caching_ = cache_.lookupOrDefault("active", true);
51 }
52
53 if (dict.found("relaxationFactors"))
54 {
55 const dictionary& relaxDict(dict.subDict("relaxationFactors"));
56 if (relaxDict.found("fields") || relaxDict.found("equations"))
57 {
58 if (relaxDict.found("fields"))
59 {
60 fieldRelaxDict_ = relaxDict.subDict("fields");
61 }
62
63 if (relaxDict.found("equations"))
64 {
65 eqnRelaxDict_ = relaxDict.subDict("equations");
66 }
67 }
68 else
69 {
70 // backwards compatibility
71 fieldRelaxDict_.clear();
72
73 const wordList entryNames(relaxDict.toc());
74 forAll(entryNames, i)
75 {
76 const word& e = entryNames[i];
77 scalar value = readScalar(relaxDict.lookup(e));
78
79 if (e(0, 1) == "p")
80 {
81 fieldRelaxDict_.add(e, value);
82 }
83 else if (e.length() >= 3)
84 {
85 if (e(0, 3) == "rho")
86 {
87 fieldRelaxDict_.add(e, value);
88 }
89 }
90
91 }
92
93 eqnRelaxDict_ = relaxDict;
94 }
95
96 fieldRelaxDefault_ =
97 fieldRelaxDict_.lookupOrDefault<scalar>("default", 0.0);
98
99 eqnRelaxDefault_ =
100 eqnRelaxDict_.lookupOrDefault<scalar>("default", 0.0);
101
102 if (debug)

Callers 4

solution.CFile · 0.70
ZoneMesh.CFile · 0.50
coupledPolyPatch.CFile · 0.50

Calls 7

lookupMethod · 0.80
forAllFunction · 0.50
readScalarFunction · 0.50
foundMethod · 0.45
clearMethod · 0.45
addMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected