1. 16 Sep, 2020 1 commit
    • Mark Olesen's avatar
      ENH: suppress surface Face-id field if writer manages that itself (#1600) · a9bf69b5
      Mark Olesen authored
      - for CAE formats such as abaqus, nastran, starcd, etc, the element id
        is already part of the output format itself. For these cases, there
        is no use in generating an additional "Ids" field.
      
      ENH: add code to ignore negative face ids
      
      - these will arise from very special cases, such as when a
        solid element and side are encoded into a single integer.
      
      BUG: starcd surface values output did not use original face ids
      a9bf69b5
  2. 09 Sep, 2020 1 commit
  3. 11 Jun, 2020 1 commit
  4. 02 Jun, 2020 1 commit
    • Mark Olesen's avatar
      ENH: unify use of dictionary method names · 3e43edf0
      Mark Olesen authored
      - previously introduced `getOrDefault` as a dictionary _get_ method,
        now complete the transition and use it everywhere instead of
        `lookupOrDefault`. This avoids mixed usage of the two methods that
        are identical in behaviour, makes for shorter names, and promotes
        the distinction between "lookup" access (ie, return a token stream,
        locate and return an entry) and "get" access (ie, the above with
        conversion to concrete types such as scalar, label etc).
      3e43edf0
  5. 14 May, 2020 1 commit
  6. 04 May, 2020 1 commit
  7. 30 Apr, 2020 1 commit
    • Mark Olesen's avatar
      STYLE: update PrimitivePatch (#1648) · 8a5d108f
      Mark Olesen authored
      - simplified templating, which cleans up code and does not appear to
        break any normal user coding.
      
      ENH: unique_ptr instead of homegrown demand-driven handling.
      8a5d108f
  8. 28 Apr, 2020 1 commit
  9. 08 Apr, 2020 1 commit
    • Mark Olesen's avatar
      BUG: minor regression in surface reading of compressed files (#1600) · 5f90964d
      Mark Olesen authored
      - as a side-effect of recent changes, command-line stripping of .gz
        extensions on input was lost. For example,
      
            OK:    surfaceTransformPoints file.stl ...
            Fail:  surfaceTransformPoints file.stl.gz ...
      
      - restore the previous behaviour of silently stripping the '.gz'
        extension on input.
      
      ENH: add triSurface::New selector entry point
      
      - for symmetry with MeshedSurface
      5f90964d
  10. 03 Apr, 2020 5 commits
    • Mark Olesen's avatar
      ENH: add low-level handling for abaqus files (#1600) · 497cdb50
      Mark Olesen authored
      - reads/write shell elements
        Output elements are "bunched" according to type and their set
        without reordering.
      
      - preliminary reading of solids without extraction.
        Handling of *Surface specifications is not implemented
      497cdb50
    • Mark Olesen's avatar
      ENH: refine geometry and field scaling for nastran and raw surfaces (#1600) · eeb050cc
      Mark Olesen authored
      - enhancement and potential breaking change.
      
        Nastran surface writer previously used the keyword 'scale' for
        field scaling, which was applied uniformly to all output fields.
      
        Change the meaning of 'scale' to be geometric scaling
        (consistent with reading triSurfaceMesh etc).
      
        New 'fieldScale' entry is an optional dictionary of scaling
        parameters.
      
        Example,
      
            nastran
            {
                scale   1000;     // [m] -> [mm]
                fieldScale
                {
                   "p.*"   0.01;  // [Pa] -> [mbar]
                }
            }
      eeb050cc
    • Mark Olesen's avatar
    • Mark Olesen's avatar
      ENH: support independent specification of surface read/write format (#1600) · 560c053b
      Mark Olesen authored
      - adjustments to internal handling to improve run-time addition of
        other formats (eg, with additional user library)
      
        For example, to write a binary STL with a '.stl' extension:
      
          $ surfaceMeshConvert input.obj  -write-format stlb  output.stl
      
        Or in a sampler,
        to specify the input type without ambiguity:
      
        surf
        {
            type        meshedSurface;
            surface     sampling.inp;
      
            fileType    starcd;
            scale       0.001;
            ...
        }
      
      STYLE: regularize naming for input/output scaling
      
        * -read-scale   (compat: -scaleIn)
        * -write-scale  (compat: -scaleOut)
      
      CONFIG: change edge/surface selection name for STARCD format
      
      - now select as "starcd" instead of "inp" to avoid naming ambiguity
        with abaqus
      560c053b
    • Mark Olesen's avatar
      BUG: potential divide-by-zero in x3d surface output (#1212) · a88e67f2
      Mark Olesen authored
      - eg, for a uniform field and auto range.
      a88e67f2
  11. 02 Apr, 2020 3 commits
  12. 30 Mar, 2020 1 commit
  13. 12 Mar, 2020 3 commits
  14. 27 Feb, 2020 1 commit
    • Mark Olesen's avatar
      ENH: improvements for nastran surface writer (#1571) · b476dd92
      Mark Olesen authored
      - avoid face copying.
        Maintain separate offsets/list for non tri/quad face decomposition,
        which eliminates copying for tri/quad types that represent the bulk
        of geometries
      
      - report inappropriate use of PLOAD2 for higher-ranks only once per
        field instead of per face.  For this case, write its magnitude
        instead of 0.
      
      - perform field output scaling prior to calling the write face
        function. This will make it easier to handle different per-field
        scaling in the future (#1612)
      
      BUG: nastran quad written as "CTRIA3" instead of "CQUAD4"
      b476dd92
  15. 19 Feb, 2020 2 commits
  16. 18 Feb, 2020 5 commits
    • Mark Olesen's avatar
      ENH: support use of IOstreamOption for IFstream/OFstream · e3f681fa
      Mark Olesen authored
      - can be convenient to bundle IO options as a single parameter
      e3f681fa
    • Mark Olesen's avatar
      ENH: improvements to IOstreamOption · 33f9ae50
      Mark Olesen authored
      * Support default values for format/compress enum lookups.
      
        - Avoids situations where the preferred default format is not ASCII.
          For example, with dictionary input:
      
              format binar;
      
          The typing mistake would previously have caused formatEnum to
          default to ASCII. We can now properly control its behaviour.
      
              IOstream::formatEnum
              (
                  dict.get<word>("format"), IOstream::BINARY
              );
      
          Allowing us to switch ascii/binary, using BINARY by default even in
          the case of spelling mistakes. The mistakes are flagged, but the
          return value can be non-ASCII.
      
      * The format/compression lookup behave as pass-through if the lookup
        string is empty.
      
        - Allows the following to work without complaint
      
            IOstream::formatEnum
            (
                dict.getOrDefault("format", word::null), IOstream::BINARY
            );
      
        - Or use constructor-like failsafe method
      
            IOstream::formatEnum("format", dict, IOstream::BINARY);
      
        - Apply the same behaviour with setting stream format/compression
          from a word.
      
             is.format("binar");
      
          will emit a warning, but leave the stream format UNCHANGED
      
      * Rationalize versionNumber construction
      
        - constexpr constructors where possible.
          Default construct is the "currentVersion"
      
        - Construct from token to shift the burden to versionNumber.
          Support token as argument to version().
      
          Now:
      
              is.version(headerDict.get<token>("version"));
      
          or failsafe constructor method
      
              is.version
              (
                  IOstreamOption::versionNumber("version", headerDict)
              );
      
          Before (controlled input):
      
              is.version
              (
                  IOstreamOption::versionNumber
                  (
                      headerDict.get<float>("version")
                  )
              );
      
          Old, uncontrolled input - has been removed:
      
              is.version(headerDict.lookup("version"));
      
      * improve consistency, default behaviour for IOstreamOption construct
      
        - constexpr constructors where possible
      
        - add copy construct with change of format.
      
        - construct IOstreamOption from streamFormat is now non-explicit.
          This is a commonly expected result with no ill-effects
      33f9ae50
    • Mark Olesen's avatar
      4e1bc2d2
    • Mark Olesen's avatar
      STYLE: adjust names, locations for fileFormats · 4307e171
      Mark Olesen authored
      - renamed 'core/' -> 'base/' to avoid gitignore masking when re-adding
        files
      
      - rename 'nas/' to 'nastran/' for more clarity
      
      - relocated OBJstream from surfMesh to fileFormats
      
      STYLE: remove unused parseNASCoord. Was deprecated 2017-09
      4307e171
    • Mark Olesen's avatar
      ENH: overhaul ensight handling (#1579) · a9762812
      Mark Olesen authored
      - includes restructuring and simplification of low-level ensight part
        handling and refactor of backends to improve code reuse.
      
      foamToEnsight
      -------------
      
        * new cellZone support.
          This was previously only possible via a separate foamToEnsightParts
          utility that was not parallelized.
      
        * support for point fields.
      
        * `-nearCellValue` option (as per foamToVTK)
      
        * data indexing now uses values from the time index.
          This is consistent with the ensightWrite function object and
          can help with restarts.
      
        * existing ensight directories are removed, unless the -no-overwrite
          option is supplied
      
      foamToEnsightParts
      ------------------
        * now redundant and removed.
      
      ensightOutputSurface (new class)
      --------------------------------
        * a lightweight wrapper for point/face references that is tailored
          for the ensightSurfaceWriter. It uses compact face/point information
          and is serial only, since this is the format requirements from the
          surfaceWriter class.
      
      ensightMesh (revised class)
      ---------------------------
        * now only holds a polyMesh reference, which removes its dependency
          on finiteVolume and allows it to be relocated under fileFormats
          instead of conversion.
      
      Removed classes: ensightParts, ensighPartFaces, ensightPartCells
      
      - these were used by foamToEnsightParts, but not needed anymore.
      a9762812
  17. 28 Jan, 2020 1 commit
  18. 27 Jan, 2020 1 commit
  19. 23 Jan, 2020 1 commit
    • Mark Olesen's avatar
      ENH: stream adjustments · 0ff02713
      Mark Olesen authored
      - make stream constructors explicit
      
      - remove "using std::ifstream", "using std::iofstream" statements
        for a cleaner namespace.
      
      * copy/move assignments for ITstream
      
      * IStringStream: default construct and construct from std::string
        instead of Foam::string
      
      - reduce some overhead in masterOFstream
      
      - simplify Pstream handling of string variants (#1525)
      0ff02713
  20. 16 Jan, 2020 2 commits
    • Mark Olesen's avatar
      ENH: provide defaultName() static method for patches, zones · f0be8679
      Mark Olesen authored
      - consistent way of writing "patch" + Foam::name(id) etc.
      f0be8679
    • Mark Olesen's avatar
      ENH: consistency improvements for surface patch handling (fixes #483) · 2a98c4e6
      Mark Olesen authored
      - remove (unused) Istream constructors, prune some unused methods,
        rationalize write() vs writeDict().
        Deprecate inconsistent construction order.
      
      - handle empty names for ".ftr" surface patches (for plain triSurface
        format) with double-quoted strings for more reliable streaming.
        Written on a single line.
      
        This is _backward_ compatible, but if users have been parsing these
        files manually, they will need to adjust their code.
      
      Previously:
      ```
        (
        frt-fairing:001%1
        empty
      
        windshield:002%2
        empty
        ...
        )
      ```
      
      Updated (with example handling of empty name):
      ```
        (
        frt-fairing:001%1 empty
      
        windshield:002%2 ""
        ...
        )
      ```
      2a98c4e6
  21. 15 Jan, 2020 1 commit
  22. 11 Nov, 2019 1 commit
    • Mark Olesen's avatar
      ENH: rationalize some string methods. · 7c1190f0
      Mark Olesen authored
      - silently deprecate 'startsWith', 'endsWith' methods
        (added in 2016: 2b143606), in favour of
        'starts_with', 'ends_with' methods, corresponding to C++20 and
        allowing us to cull then in a few years.
      
      - handle single character versions of starts_with, ends_with.
      
      - add single character version of removeEnd and silently deprecate
        removeTrailing which did the same thing.
      
      - drop the const versions of removeRepeated, removeTrailing.
        Unused and with potential confusion.
      
      STYLE: use shrink_to_fit(), erase()
      7c1190f0
  23. 31 Oct, 2019 1 commit
  24. 05 Nov, 2019 1 commit
  25. 22 Oct, 2019 1 commit
  26. 29 Sep, 2019 1 commit