Commit Graph

148 Commits

Author SHA1 Message Date
ed94a2714d STYLE: use HashTable iterator 'val()' method instead of 'object()' 2019-01-18 16:26:50 +01:00
c0b11a5298 ENH: additional constructor for vtk::outputOptions 2019-01-18 09:03:07 +01:00
361257d9f4 STYLE: enumerate Nastran PLOADs in NASCore 2019-01-17 03:10:31 +01:00
907dd6d49f STYLE: consistent indentation and template parameters for FixedList 2019-01-08 21:50:12 +01:00
08b70bb222 STYLE: remove unused variable (vtm writer) 2018-12-11 16:40:14 +01:00
e3e0e0557f BUG: unguarded use of globalIndex in vtk writers (fixes #1110)
- the problem occurred when running the writers in a parallel solver
  or utility but requesting output on the master only.

  Adjusted the logic to avoid globalIndex for these cases.
  Previously the if (parallel_) checks were happening later, after the
  globalIndex had already been created.
2018-12-05 21:27:29 +01:00
dd0487ac2a STYLE: typo in comments 2018-11-28 12:35:34 +01:00
f4ae4f7b2c ENH: snappyHexMesh. Added leak-path detection.
Detects connections (during refinement) between
locationsInsideMesh and locationsOutsideMesh and
writes a sampledSet for postprocessing.
2018-08-02 16:39:06 +01:00
3e75a3736b STYLE: remove file series handling from foamVtkOutput
- now handled by the vtk::seriesWriter, and with its static methods.
2018-10-02 14:49:11 +02:00
0e47b0717d ENH: vtk::seriesWriter to encapsulate writing file series (issue #926) 2018-10-02 14:06:34 +02:00
42009c168e ENH: vtk::vtmWriter for generating vtkMultiBlockDataSet (.vtm) (issue #926)
- Provides a means of accumulating file entries for generating vtm
  by accumulate blocks, datasets and writing them later.

  Only a single block depth is currently supported and the methods
  are kept fairly simple.
2018-10-02 12:53:01 +02:00
ee0947b693 ENH: vtk::fileWriter base class for geometry/field writers (issue #926)
- Output formats such as vtp, vtu follow a particular internal data
  structure (HEAD, FIELD_DATA, PIECE, CELL_DATA/POINT_DATA) and other
  output conventions. This writer base tracks these expected output
  states internally to help avoid logic errors in the callers.
2018-09-29 13:14:50 +02:00
05427217a0 ENH: improvements for foamVtkOutput, foamVtkFormatter (issue #926)
- parallel list output for foamVtkOutput

- simplified '.series' file output

- beginDataArray() method instead of openDataArray() + closeTag()
  since this seems to be the most common use anyhow.
  With an optional argument for leaving the tag open, this works the
  same as openDataArray() which may be deprecated in the future.

- begin/end methods for CellData, PointData, FieldData (commonly used)

- templating parameters for file headers, content version,
  legacy fields. This improves coding robustness and convenience of use.

- use formatter and higher-level methods for legacy output

- attribute quoting character now part of the formatter itself
  instead of as an argument for xmlAttr().
  Toggle with quoting() method.

- pair-wise processing of xml attributes, which also allows them to be
  passed as optional entries when creating an xml tag.

- xmlComment with multiple arguments
2018-09-17 08:59:03 +02:00
19e03f7dd1 ENH: add renumbering support into foamVtuSizing algorithm (issue #926)
- allows cell point labels will use global numbering, but only for
  unmerged points. We'd ideally like to avoid point merging per se,
  and instead use VTK point blanking instead (as required).

  This approach allows parallel collation of the output into a single
  piece directly.
2018-09-17 09:00:51 +02:00
ac03307258 ENH: improve consistency in version handling (issue #1010)
- use std::string instead of c-string for the string constants

- centralize some definitions of resources into foamVersion.H

  Now expose some of the hard-coded values used in foamEtcFiles()
  so that they can be known or even overridden as required.

  Relocate to src/OpenFOAM/include as a constant location.
2018-11-23 11:08:36 +01:00
083e9e9665 ENH: isolate version information in foamVersion names instead of globals
- For compatibility, access to the old global names is provided via
  macros
        #define FOAMversion     foamVersion::version
        #define FOAMbuild       foamVersion::build
        #define FOAMbuildArch   foamVersion::buildArch

- this isolation makes it easier to provide additional scoped methods
  for dealing with version related information.  Eg, printBuildInfo()
2018-11-22 11:50:24 +01:00
1883a872a1 STYLE: adds comments in empty Make/options files
- easier when making modifications

STYLE: spelling in topoSetSource comments
2018-11-13 15:21:13 +01:00
ffec4c6fa7 STYLE: more consistent formatting for deprecated items
- Start brief descriptions with 'Deprecated(YYYY-MM)' so that it is
  readily visible in the short method description. Consistent date
  format (YYYY-MM), placed immediately after the \deprecated tag.
2018-11-11 17:17:33 +01:00
201fdf87d1 STYLE: relocate some vtk part handling from conversion to fileFormats
- these parts work with a polyMesh (don't need fvMesh)
2018-09-17 10:12:48 +02:00
a7a346b206 STYLE: indentation for FatalIOErrorInFunction calls 2018-11-06 09:49:22 +01:00
fd54070c3a BUG: eof errors in the STARCD, VTK file reader (#1059)
- previously simply read files until the input stream went bad and no
  more lines could be read.  With the more stringent checking of
  values read (commit 0ce7e364a4) this approach causes problems.

  Use the underlying tokenizer instead to decide about termination.
2018-11-03 15:46:37 +01:00
7cb51f5b98 ENH: limit vtk floatField range (fixes #1055)
- for space-savings the VTK fields are normally written as 'float'
  rather than double. When a double field contains very large values,
  these can result in a overflow when converted to float.

  Now trap these with the appropriate numeric limits.
  No warning when these values are clipped: it should be readily
  apparent from the output.

ENH: handle symmTensor component swapping directly on VTK output.

- use VTK output routines in vtkSurfaceWriter to benefit from the
  above changes
2018-11-01 17:58:36 +00:00
3b74512231 ENH: cleanup of Enum class
- more dictionary-like methods, enforce keyType::LITERAL for all
  lookups to avoid any spurious keyword matching.

- new readEntry, readIfPresent methods

- The get() method replaces the now deprecate lookup() method.

- Deprecate lookupOrFailsafe()
  Failsafe behaviour is now an optional parameter for lookupOrDefault,
  which makes it easier to tailor behaviour at runtime.

- output of the names is now always flatted without line-breaks.
  Thus,

     os << flatOutput(someEnumNames.names()) << nl;
     os << someEnumNames << nl;

  both generate the same output.

- Constructor now uses C-string (const char*) directly instead of
  Foam::word in its initializer_list.

- Remove special enum + initializer_list constructor form since
  it can create unbounded lookup indices.

- Removd old hasEnum, hasName forms that were provided during initial
  transition from NamedEnum.

- Added static_assert on Enum contents to restrict to enum or
  integral values.  Should not likely be using this class to enumerate
  other things since it internally uses an 'int' for its values.

  Changed volumeType accordingly to enumerate on its type (enum),
  not the class itself.
2018-10-18 12:57:32 +02:00
3963cd95d9 STYLE: code cleanup in fileFormats, conversion 2018-07-24 16:12:32 +02:00
c1964d7807 ENH: distinguish between face areaNormal/unitNormal in the code 2018-08-10 15:43:06 +02:00
b5162f91fc STYLE: use DynamicList instead of LIFO for managing tags in vtk::formatter 2018-08-09 08:57:48 +02:00
0e996431b7 STYLE: relocate STRING_QUOTE macro to macros.H 2018-08-02 16:26:25 +02:00
94a89d530a COMP: reduce compiler warnings for gcc-7
- ignore implicit-fallthrough for ragel generated code.

- add -Wno-deprecated-declarations for c++LESSWARN.
  These principally associated with older CGAL versions and their use
  of particular mpfr routines.
2018-07-24 09:29:01 +02:00
1f953b807c ENH: use double for VTK legacy output (issue #891)
- some paraview versions (eg, on windows) don't support float, only double.

  This mostly affected the vtkSurfaceWriter.

  The foamToVTK is also affected, but since it also supports the XML
  output formats (vtp, vtu) these can be used instead.
2018-06-21 10:24:04 +02:00
813a0500e2 BUG: incorrect order for VTK symmTensor (fixes #892)
- affected manually generated legacy output (vtkSetWriter, vtkSurfaceWriter)

- the order emitted by vtkSetWriter remains, but needs to revisited again.
2018-06-21 09:38:25 +02:00
c5518dd9ff ENH: additional vtk tools for faceNormals, writing file-series 2018-06-15 22:44:00 +02:00
c909a5df25 GIT: resolved merge conflict 2018-06-13 14:20:18 +01:00
cf0a288ead STYLE: typo in copyright dates 2018-06-12 09:03:30 +02:00
7402cd7b5a ENH: make sampleSets setSamples movable - preliminary to issue #869
- add some more documentation
2018-06-12 19:19:10 +02:00
b393c60d86 ENH: vtk: fix reading of inverted prisms. Fixes #850. 2018-05-31 12:42:43 +01:00
f9fe71815a STYLE: consistent use of '= delete' for removed constructors/assignments
- make the purpose more explicit, and reduces some work for the
  compiler as well.
2018-05-30 12:03:17 +02:00
6b6b36afd3 STYLE: revert bitSet/HashSet setMany() to set() method (issue #837)
- improves backward compatibility and more naming consistency.
  Retain setMany(iter1, iter2) to avoid ambiguity with the
  PackedList::set(index, value) method.
2018-05-29 17:38:02 +02:00
30309e9a65 COMP: 64-bit label ambiguity 2018-05-29 11:16:20 +02:00
5c60cbe34d ENH: improve ensightWrite handling of moving mesh
- now treat all mesh geometries as moving, since we cannot know
  beforehand if this is the case.
2018-05-08 12:41:06 +02:00
dbe16de58c ENH: cleaner, more consistent ensight case surface output files
- use same data mask width as ensightCase (8 digits)

- consolidate geometry time steps with data time steps if possible,
  for a cleaner case file.
2018-05-08 08:15:31 +02:00
01a313d889 BUG: collated ensight not working with isosurfaces (closes #318)
- the problem arises since the various surface writers are stateless.
  The collated output format hacks around this limitation by adding in
  its own fieldDict caching (to disk).

  Now include an updateMesh() method to hook into geometry changes.
  This is considered a stop-gap measure until the surface output
  handling is improved.
2018-05-07 16:59:15 +02:00
c0766ce8ea STYLE: consistent '// End namespace' markers 2018-04-27 09:51:35 +02:00
497dde2b2f CONFIG: bump API version number to 1804 to account for bitSet
- since PackedBoolList is now a compatibility typedef for bitSet,
  it is useful to have an additional means of distinction.

STYLE: simplify internal version tests and compiler defines.

- the API version is now conveyed via the OPENFOAM define directly.
  The older OPENFOAM_PLUS define is provided for existing code.
2018-04-26 09:28:42 +02:00
bac943e6fc ENH: new bitSet class and improved PackedList class (closes #751)
- The bitSet class replaces the old PackedBoolList class.
  The redesign provides better block-wise access and reduced method
  calls. This helps both in cases where the bitSet may be relatively
  sparse, and in cases where advantage of contiguous operations can be
  made. This makes it easier to work with a bitSet as top-level object.

  In addition to the previously available count() method to determine
  if a bitSet is being used, now have simpler queries:

    - all()  - true if all bits in the addressable range are empty
    - any()  - true if any bits are set at all.
    - none() - true if no bits are set.

  These are faster than count() and allow early termination.

  The new test() method tests the value of a single bit position and
  returns a bool without any ambiguity caused by the return type
  (like the get() method), nor the const/non-const access (like
  operator[] has). The name corresponds to what std::bitset uses.

  The new find_first(), find_last(), find_next() methods provide a faster
  means of searching for bits that are set.

  This can be especially useful when using a bitSet to control an
  conditional:

  OLD (with macro):

      forAll(selected, celli)
      {
          if (selected[celli])
          {
              sumVol += mesh_.cellVolumes()[celli];
          }
      }

  NEW (with const_iterator):

      for (const label celli : selected)
      {
          sumVol += mesh_.cellVolumes()[celli];
      }

      or manually

      for
      (
          label celli = selected.find_first();
          celli != -1;
          celli = selected.find_next()
      )
      {
          sumVol += mesh_.cellVolumes()[celli];
      }

- When marking up contiguous parts of a bitset, an interval can be
  represented more efficiently as a labelRange of start/size.
  For example,

  OLD:

      if (isA<processorPolyPatch>(pp))
      {
          forAll(pp, i)
          {
              ignoreFaces.set(i);
          }
      }

  NEW:

      if (isA<processorPolyPatch>(pp))
      {
          ignoreFaces.set(pp.range());
      }
2018-03-07 11:21:48 +01:00
5af5bfa1a5 ENH: error handling for Ragel STL parsing
- also simplify parsing by accepting any case on keywords.
  This implies that something like "sOlId", "SoLiD" will also
  be accepted. Although nobody should really count on this rather
  generous behaviour, it does simplfy the state machine even further.
2018-04-24 09:15:50 +02:00
a230e8d408 STYLE: Correcting typos 2018-03-28 17:14:16 +01:00
ea71484efa ENH: add alternative STL ASCII parsers
- In addition to the traditional Flex-based parser, added a Ragel-based
  parser and a handwritten one.

  Some representative timings for reading 5874387 points (1958129 tris):

      Flex   Ragel   Manual
      5.2s   4.8s    6.7s         total reading time
      3.8s   3.4s    5.3s         without point merging
2018-04-16 10:20:45 +02:00
5d1fb23555 ENH: code reduction in PackedList, PackedBoolList (issue #751)
- eliminate iterators from PackedList since they were unused, had
  lower performance than direct access and added unneeded complexity.

- eliminate auto-vivify for the PackedList '[] operator.
  The set() method provides any required auto-vivification and
  removing this ability from the '[]' operator allows for a lower
  when accessing the values. Replaced the previous cascade of iterators
  with simpler reference class.

PackedBoolList:

- (temporarily) eliminate logic and addition operators since
  these contained partially unclear semantics.

- the new test() method tests the value of a single bit position and
  returns a bool without any ambiguity caused by the return type
  (like the get() method), nor the const/non-const access (like
  operator[] has). The name corresponds to what std::bitset uses.

- more consistent use of PackedBoolList test(), set(), unset() methods
  for fewer operation and clearer code. Eg,

      if (list.test(index)) ...    |  if (list[index]) ...
      if (!list.test(index)) ...   |  if (list[index] == 0u) ...
      list.set(index);             |  list[index] = 1u;
      list.unset(index);           |  list[index] = 0u;

- deleted the operator=(const labelUList&) and replaced with a setMany()
  method for more clarity about the intended operation and to avoid any
  potential inadvertent behaviour.
2018-03-13 08:32:40 +01:00
3d608bf06a ENH: remove reliance on the Xfer class (issue #639)
This class is largely a pre-C++11 holdover. It is now possible to
simply use move construct/assignment directly.

In a few rare cases (eg, polyMesh::resetPrimitives) it has been
replaced by an autoPtr.
2018-03-05 13:28:53 +01:00
806b668418 STYLE: two-parameter Foam::name replaced by word::printf (issue #724)
- reduces some ambiguity and clarifies the expected output and
  behaviour.

STYLE: reduce some automatic conversions of char to string
2018-02-08 12:00:54 +01:00