Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
0ca0a626
Commit
0ca0a626
authored
Nov 13, 2017
by
Mark Olesen
Browse files
STYLE: use readLabel/readScalar (string) instead of via IStringStream
parent
817b9a14
Changes
2
Hide whitespace changes
Inline
Side-by-side
applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C
View file @
0ca0a626
...
...
@@ -68,9 +68,11 @@ namespace Foam
return
Hash
<
face
>::
operator
()(
t
,
0
);
}
}
const
string
SEPARATOR
(
" -1"
);
bool
isSeparator
(
const
string
&
line
)
bool
isSeparator
(
const
std
::
string
&
line
)
{
return
line
.
substr
(
0
,
6
)
==
SEPARATOR
;
}
...
...
@@ -100,7 +102,7 @@ label readTag(IFstream& is)
}
while
(
tag
==
SEPARATOR
);
return
readLabel
(
IStringStream
(
tag
)()
);
return
readLabel
(
tag
);
}
...
...
@@ -144,14 +146,14 @@ void skipSection(IFstream& is)
}
scalar
readUnvScalar
(
const
string
&
unvString
)
scalar
readUnvScalar
(
const
std
::
string
&
unvString
)
{
string
s
(
unvString
);
s
.
replaceAll
(
"d"
,
"E"
);
s
.
replaceAll
(
"D"
,
"E"
);
return
readScalar
(
IStringStream
(
s
)()
);
return
readScalar
(
s
);
}
...
...
@@ -170,13 +172,13 @@ void readUnits
string
line
;
is
.
getLine
(
line
);
label
l
=
readLabel
(
IStringStream
(
line
.
substr
(
0
,
10
))
())
;
label
l
=
readLabel
(
line
.
substr
(
0
,
10
));
Info
<<
"l:"
<<
l
<<
endl
;
string
units
(
line
.
substr
(
10
,
20
));
Info
<<
"units:"
<<
units
<<
endl
;
label
unitType
=
readLabel
(
IStringStream
(
line
.
substr
(
30
,
10
))
())
;
label
unitType
=
readLabel
(
line
.
substr
(
30
,
10
));
Info
<<
"unitType:"
<<
unitType
<<
endl
;
// Read lengthscales
...
...
@@ -215,7 +217,7 @@ void readPoints
string
line
;
is
.
getLine
(
line
);
label
pointi
=
readLabel
(
IStringStream
(
line
.
substr
(
0
,
10
))
())
;
label
pointi
=
readLabel
(
line
.
substr
(
0
,
10
));
if
(
pointi
==
-
1
)
{
...
...
src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriterTemplates.C
View file @
0ca0a626
...
...
@@ -70,7 +70,7 @@ Foam::fileName Foam::ensightSurfaceWriter::writeUncollated
}
// const scalar timeValue = Foam::name(this->mesh().time().timeValue());
const
scalar
timeValue
=
readScalar
(
IStringStream
(
timeDir
)
())
;
const
scalar
timeValue
=
readScalar
(
timeDir
);
OFstream
osCase
(
baseDir
/
surfName
+
".case"
);
ensightGeoFile
osGeom
...
...
@@ -179,7 +179,7 @@ Foam::fileName Foam::ensightSurfaceWriter::writeCollated
// surfName already validated
const
fileName
meshFile
(
baseDir
/
surfName
+
".000000.mesh"
);
const
scalar
timeValue
=
readScalar
(
IStringStream
(
timeDir
)
())
;
const
scalar
timeValue
=
readScalar
(
timeDir
);
label
timeIndex
=
0
;
// Do case file
...
...
@@ -194,7 +194,7 @@ Foam::fileName Foam::ensightSurfaceWriter::writeCollated
if
(
is
.
good
()
&&
dict
.
read
(
is
))
{
dict
.
lookup
(
"times"
)
>>
times
;
const
scalar
timeValue
=
readScalar
(
IStringStream
(
timeDir
)
())
;
const
scalar
timeValue
=
readScalar
(
timeDir
);
label
index
=
findLower
(
times
,
timeValue
);
timeIndex
=
index
+
1
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment