Commit Graph

96 Commits

Author SHA1 Message Date
3ef8906a66 ENH: consolidate surfaceFormats for reading/writing triSurface (issue #294)
- eliminates previous code duplication and improves maintainability
2017-11-20 14:55:36 +01:00
d49929b210 ENH: improvements to stringOps format and split functions
- split now optionally retains empty substrings.
  Added split on fixed field width.

- Foam::name() now formats directly into string buffer, which a
  removes one layer of copying and also avoids using a non-constexpr
  in the temporary.

STYLE: explicit type narrowing on zero-padded output for ensight
2017-11-23 20:17:33 +01:00
416a3790ea STYLE: prefer autoPtr::reset() to autoPtr::set()
- in most cases already checked valid() so don't need additional check
  for setting an existing pointer
2017-11-22 19:11:11 +01:00
d65ca495d3 STYLE: minor changes in comments 2017-11-22 10:52:42 +01:00
7c1d8cb146 STYLE: more consistent use of labelUList and labelUIndList typedefs 2017-11-19 09:27:47 +01:00
8730a7622a ENH: enumerations for known cell models in cellModel, ptr/ref lookups
- this provides a better typesafe means of locating predefined cell
  models than relying on strings. The lookup is now ptr() or ref()
  directly. The lookup functions behave like on-demand singletons when
  loading "etc/cellModels".

  Functionality is now located entirely in cellModel but a forwarding
  version of cellModeller is provided for API (but not ABI) compatibility
  with older existing user code.

STYLE: use constexpr for cellMatcher constants
2017-11-18 11:05:05 +01:00
85877cb0f4 ENH: coordSet - added protection for the 'distance' option 2017-09-15 11:17:06 +01:00
accebc74ee ENH: improve consistency in parsing primitives from strings (issue #590)
- Any trailing whitespace when parsing from strings or character buffers
  is ignored rather than being treated as an error. This is consistent
  with behaviour when reading from an Istream and with leading whitespace
  being ignored in the underlying atof/atod, strtof/strtod... functions.

- Allow parsing directly from a std::string instead of just from a 'char*'.
  This reflects the C++11 addition of std::stod to complement the C
  functions strtod. This also makes it easier to parse string directly
  without using an IStringStream.

- Two-parameter parsing methods return success/failure.
  Eg,

      if (readInt32(str, &int32Val)) ...

- One-parameter parsing methods return the value on success or
  emit a FatalIOError.
  Eg,

      const char* buf;
      int32Val = readInt32(buf, &);

- Improved consistency when parsing unsigned ints.
  Use strtoimax and strtoumax throughout.

- Rename readDoubleScalar -> readDouble, readFloatScalar -> readFloat.
  Using the primitive name directly instead of the Foam typedef for
  better consistency with readInt32 etc.

- Clean/improve parseNasScalar.
  Handle normal numbers directly, reduce some operations.
2017-09-18 10:47:07 +02:00
2a586dcbe2 Merge remote-tracking branch 'origin/master' into develop 2017-09-15 11:20:35 +02:00
071dfb36fd BUG: parse issues for nastran long format (closes #589) 2017-09-15 10:40:55 +02:00
e70fc61660 ENH: consolidate, cleanup some string methods
- consolidate word::validated() into word::validate() and also allow
  as short form for string::validate<word>(). Also less confusing than
  having similarly named methods that essentially do the same thing.

- more consistent const access when iterating over strings

- add valid(char) for keyType and wordRe
2017-08-02 12:33:35 +02:00
2c69b7d7c4 STYLE: adjust some line lengths, doxygen comments 2017-07-20 13:50:35 +02:00
86ef9e86dc ENH: make treatment of stream allocators more uniform (issue #532)
- use allocator class to wrap the stream pointers instead of passing
  them into ISstream, OSstream and using a dynamic cast to delete
  then. This is especially important if we will have a bidirectional
  stream (can't delete twice!).

STYLE:

- file stream constructors with std::string (C++11)

- for rewind, explicit about in|out direction. This is not currently
  important, but avoids surprises with any future bidirectional access.

- combined string streams in StringStream.H header.
  Similar to <sstream> include that has both input and output string
  streams.
2017-07-17 15:14:38 +02:00
bc1f2fa97e STYLE: use auto and cfind to simplify selector usage (issue #512) 2017-07-03 10:36:03 +02:00
f55c568f13 ENH: upgrade from NamedEnum to Enum (issue #515) 2017-07-03 21:43:33 +02:00
80d69c27b1 COMP: compilation with WM_SP
- STLpoint.H
- isoAdvection.C
- checkMesh/writeFields.C

STYLE: drop construct STLpoint(Istream&), since it doesn't make much sense

- No use case for reading via an OpenFOAM stream and tokenizer.
  Should always be parsing ASCII or reading binary directly.
2017-06-26 17:11:46 +02:00
8221111245 STYLE: pass legacy nCmpt as int 2017-06-13 23:59:11 +02:00
cde12ad9e5 ENH: consolidate vtk classes into 'Foam::vtk' namespace
- elminate the foamVtkFormatter operator() in favour of xmlAttr.
  Improves readability and the purpose is clearer.
2017-06-13 14:10:07 +02:00
a2e978d43e ENH: add VTP, VTU output for most vtk writers (insitu only)
- with the xml append format it is possible to write raw binary
  (instead of base64), but the writer becomes more complicated.
  Either needs two passes to create, or need to allocate a block
  of space for the header information (like VTK itself does) and
  write later.

    * internalWriter
    * patchWriter
    * surfaceMeshWriter
    * lagrangianWriter

 Also these special purpose ones:
    * foamVtkWriteSurfFields
2017-06-01 18:28:40 +02:00
c4f1349496 ENH: construct VTK writers with the outputOptions and adjust internally
- this shifts responsibility away from caller to the individual writers
  for knowing which file formats are supported and which file ending is
  appropriate. When the writer receives the output format request,
  it can elect to downgrade or otherwise adjust it to what it can
  actually manage (eg, legacy vs xml vs xml-append).

  But currently still just with legacy format backends.
2017-05-31 22:08:54 +02:00
03944c2a26 ENH: support enumerations for vtk xml file tags and some legacy text elements 2017-05-30 10:34:01 +02:00
c685f70c82 ENH: rationalize VTK output classes and structures
- relocated to dedicated foamVtkOutput namespace. Make it easier to
  obtain a formatter directly without a foamVtkOutput::outputOptions.
  Make the logic clear within outputOptions (avoid previous, cryptic
  bit masking). foamVtkOutput::legacy also becomes a namespace instead
  of a class. Relocate commonly used things into src/fileFormats, leave
  volField-related parts in src/conversion.
2017-05-19 12:11:49 +02:00
6e154d84b4 STYLE: use Enum instead of NamedEnum in fileFormats 2017-06-12 16:17:04 +02:00
0af1e0b722 BUG: minor regression. STL reading in double, not float (issue #491)
- By definition, binary STL uses float (not double) when reading.
  The ascii STL should be the same. This reduces memory overhead when
  loading files. The older triSurface reader had float, the surfMesh
  reader had double, but now has float.

- Inconsistency in the STL merge-tolerances between triSurface reader,
  surfMesh reader and WM_SP vs WM_DP. Now use consistent tolerances
  conrresponding to 10,100 * doubleSMALL.

- Similar float/double code adjustments for TRI format since this is
  very similar to the STL reader and had a similar inconsistency between
  the triSurface and surfMesh version. The AC3D reader still uses
  double when reading, but this can be revisited in the future (and can
  then remove the stichTriangles method too).
2017-06-12 15:47:01 +02:00
951fbb6575 ENH: add construct from floatVector for STLpoint (issue #491) 2017-06-12 14:41:03 +02:00
39f0c4cf1a BUG: flex symbol conflict (issue #494) 2017-06-12 12:56:16 +02:00
db5348880e MRG: resolved merge conflicts from merge from develop branch 2017-05-19 16:29:54 +01:00
bb67ccd37d ENH: Cleaned up hash table item found checks 2017-05-19 11:15:35 +01:00
d71a7857bf Merge remote-tracking branch 'origin/develop' into integration-foundation 2017-05-18 12:43:15 +01:00
b6dec5860b ENH: histogram: output raw count, auto-range. Fixes #467 2017-05-18 10:54:45 +01:00
2e9bead519 MRG: merged develop line back into integration branch 2017-05-18 11:11:12 +01:00
708c1b5c41 ENH: simplify ensightCells/ensightFaces with labelRange
- can avoid allocating/reallocating SubList

STYLE: don't need NamedEnum for ensightCells, ensightFaces lookup
2017-05-08 11:21:44 +02:00
dcb1a95e35 MRG: Integrated Foundation code to commit 7d6845d 2017-03-23 14:33:33 +00:00
37e7fca9dc BUG: STL ASCII being incorrectly detected as BINARY (fixes #422)
- now explicitly check for "SOLID" or "solid" in the header

- does not affect triSurface in the master branch, since that used a
  different parser.
2017-03-08 13:30:43 +01:00
dd8b8bceac csvSetWriter: Corrected axis header
Resolves bug-report https://bugs.openfoam.org/view.php?id=2455
2017-02-09 17:47:56 +00:00
a719528832 ENH: use STL reader from surfMesh library for triSurface as well (issue #294)
- initial step in reducing duplicate IO for triSurface.

- write STL triangle using common core routines from fileFormats
2017-01-25 11:58:55 +01:00
801076f8d0 ENH: adjust header management for foamVtk output
- provide headerType typedef in foamVtkFormatter, foamVtkOutput

- remove byteOrder and headerType constants from foamVtkFormatter
  since the same strings can also be obtained from foamVtkPTraits

- additional convenience methods in foamVtkFormatter
2017-01-17 10:14:15 +01:00
2cc23a23e7 BUG: missing specializations in foamVtkPTraits header 2017-01-17 08:54:07 +01:00
f265b0484c BUG: extra newline in foamVtkAppendBase64Formatter flush()
Enhancements

- introduce intermediate layer for base64 foamVtk formatting
- add encodedLength() method, which is useful for xml appended output
2017-01-17 08:42:05 +01:00
9041c9083e BUG: incorrect addressing in ensight faces/cells (issue #334)
- was erroneously using global sizing for offsets instead the processor
  local sizing.

--

STYLE: adjust variable naming, indentation for consistency
2016-12-12 17:52:02 +01:00
e2cdac590f STYLE: removed unused code to avoid compiler warning 2016-12-12 12:15:40 +00:00
c0f44ac4f3 MRG: Integrated foundation code 2016-12-12 12:10:29 +00:00
fcd8d71ef9 STYLE: ensightCells, ensightFaces sub-lists are always allocated
- remove remnant nullptr check
2016-11-29 09:06:30 +01:00
f281f77e4a Updated member type comments
Resolves bug-report http://bugs.openfoam.org/view.php?id=2356
2016-11-28 21:23:00 +00:00
1022f4fc49 STYLE: Minor code formatting 2016-11-28 09:27:13 +00:00
e619a82ae6 COMP: minor adjustments for compiling with single-precision 2016-11-22 15:58:54 +01:00
19bd06c850 COMP: adjust vtk formatting for 64-bit labels 2016-11-22 10:27:11 +01:00
b799b5d65d ENH: surfMesh support for reading compressed binary stl files (issue #294)
- increases coverage.

STYLE: relocate some core pieces into fileFormats
2016-11-13 23:04:38 +01:00
d2fc2c9edc ENH: improved infrastructure for writing VTK content
Note: classes are prefixed with 'foamVtk' instead of 'vtk' to avoid potential
conflicts with VTK itself.

foamVtkCore
~~~~~~~~~~~
- General very low-level functionality.

foamVtkPTraits
~~~~~~~~~~~~~~
- Traits type of functionality for VTK

foamVtkOutputOptions
~~~~~~~~~~~~~~~~~~~~
- The various format output options as a class that can be passed to
  formatters etc.

foamVtkCells
~~~~~~~~~~~~
- Intended for unifying vtkTopo and PV-Reader code in the future.
- Handles polyhedron decompose internally etc

foamVtkOutput, foamVtkFormatter
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Output helpers.
- Selector for individual formatters.
  Currently write all scalar data a 'float' (not 'double'). Can
  revisit this in the future.
2016-11-03 14:24:00 +01:00
d8abc128f9 ENH: provide conversion to/from AVL/FIRE meshes (issue #204) 2016-08-05 13:22:22 +02:00