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

Function read

src/mesh/blockMesh/blockMeshTools/blockMeshTools.C:30–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
29
30void Foam::blockMeshTools::read
31(
32 Istream& is,
33 label& val,
34 const dictionary& dict
35)
36{
37 token t(is);
38 if (t.isLabel())
39 {
40 val = t.labelToken();
41 }
42 else if (t.isWord())
43 {
44 const word& varName = t.wordToken();
45 const entry* ePtr = dict.lookupScopedEntryPtr
46 (
47 varName,
48 true,
49 true
50 );
51 if (ePtr)
52 {
53 // Read as label
54 val = Foam::readLabel(ePtr->stream());
55 }
56 else
57 {
58 FatalIOErrorInFunction(is)
59 << "Undefined variable "
60 << varName << ". Valid variables are " << dict
61 << exit(FatalIOError);
62 }
63 }
64 else
65 {
66 FatalIOErrorInFunction(is)
67 << "Illegal token " << t.info()
68 << " when trying to read label"
69 << exit(FatalIOError);
70 }
71
72 is.fatalCheck
73 (
74 "operator>>(Istream&, List<T>&) : reading entry"
75 );
76}
77
78
79Foam::label Foam::blockMeshTools::read

Callers 3

blockMeshTools.CFile · 0.70
blockVertex.CFile · 0.50

Calls 6

readLabelFunction · 0.85
isLabelMethod · 0.80
labelTokenMethod · 0.80
isWordMethod · 0.80
exitFunction · 0.50
infoMethod · 0.45

Tested by

no test coverage detected