Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reader ¶
type Reader struct { // Comment, if not 0, is the comment character. // It is set to pound ('#') by NewReader. // Lines beginning with the Comment character without preceding // whitespace are ignored. // Comment must be a valid rune and must not be \r, \n, // or the Unicode replacement character (0xFFFD). Comment rune // contains filtered or unexported fields }
A Reader reads records from an OpenFOAM DAT file.
As returned by NewReader, a Reader expects input conforming to the usual, albeit variable, OpenFOAM DAT file format: fields delimited by whitespace, with or without leading whitespace, which is always ignored, and with lines beggining with '#' denoting comments. All parentheses are automatically removed while reading, hence tensors (of any order) will yield their component values as individual fields.
The exported fields can be changed to customize the details before the first call to Read or ReadAll.
The Reader converts all \r\n sequences in its input to plain \n, including in multiline field values, so that the returned data does not depend on which line-ending convention an input file uses.
func (*Reader) Read ¶
Read reads one record (a slice of fields) from r. Read always returns either a non-nil record or a non-nil error, but not both. If there is no data left to be read, Read returns nil, io.EOF.