Commit Graph

14 Commits

Author SHA1 Message Date
Mark Olesen
0bb5c6e0b3 BUG: Nastran reading of free format truncates last field (fixes #3189)
- the old logic relied on the presence/absence of a comma to decide
  whether to parse as fixed or free format. This logic is faulty when
  handling the final (trailing) entry and will generally lead to the
  last field being truncated when read in.
  Now the caller decides on fixed vs free.

FIX: inconsistent Nastran surface output format

- use FREE format by default. Previously had an odd mix of SHORT
  format when created without options and LONG format (as default)
  when created with format options.
2024-06-26 12:03:04 +02:00
Mark Olesen
ad0235a751 ENH: support surface writer output transform (#2505)
- this allows the "relocation" of sampled surfaces. For example,
  to reposition into a different coordinate system for importing
  into CAD.

- incorporate output scaling for all surface writer types.

  This was previously done on an adhoc basis for different writers,
  but with now included in the base-level so that all writers
  can automatically use scale + transform.

  Example:

  formatOptions
  {
      vtk
      {
          scale 1000;  // m -> mm
          transform
          {
              origin  (0.05 0 0);
              rotation axisAngle;
              axis    (0 0 1);
              angle   -45;
          }
      }
  }
2022-06-13 08:22:52 +00:00
Mark Olesen
1a55829ef9 ENH: add fieldLevel handling for surface writers (#2382)
- this can be used to apply a uniform field level to remove from
  a sampled field. For example,

      fieldLevel
      {
          "p.*"   1e5;        // Absolute -> gauge [Pa]
          T       273.15;     // [K] -> [C]
          U       #eval{ 10/sqrt(3) };  // Uniform mag(U)=10
      }

  After the fieldLevel has been removed, any fieldScale is applied.
  For example

      fieldScale
      {
          "p.*"   0.01;       // [Pa] -> [mbar]
      }

  The fieldLevel for vector and tensor fields may still need some
  further refinement.
2022-02-28 19:08:39 +01:00
Mark Olesen
295822daa6 ENH: cleanup/reorganize surfaceWriter and fileFormats
- remove unused surfaceWriter constructors, noexcept on methods

- relocate/rename writerCaching from surfMesh -> fileFormats

- changed from surfaceWriters::writerCaching to
  ensightOutput::writerCaching to permit reuse elsewhere

- relocate static output helpers to ensightCase

- refactor NAS coordinate writing
2022-02-10 19:28:51 +01:00
Andrew Heather
7a34f29002 DOC: header documentation updates/corrections 2020-12-22 12:15:06 +00:00
Mark Olesen
0a1cd580ac ENH: improvements for nastran surface writer
- select default nastran PLOAD2 or PLOAD4 based on field type.
  Default to PLOAD2 for scalar types and PLOAD4 for vectors etc.

- relocate nastran SHELL/MAT cards.
  Previously wrote at the end of the file, now emit when writing the
  geometry itself. This improves modularity (of code and files)

- initial support for common geometry file for nastran
2020-09-16 17:27:56 +02:00
Mark Olesen
a9bf69b551 ENH: suppress surface Face-id field if writer manages that itself (#1600)
- 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
2020-09-16 17:27:56 +02:00
Mark Olesen
eeb050cca4 ENH: refine geometry and field scaling for nastran and raw surfaces (#1600)
- 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]
          }
      }
2020-04-03 19:11:51 +02:00
Mark Olesen
b476dd92e6 ENH: improvements for nastran surface writer (#1571)
- 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"
2020-02-27 13:16:40 +01:00
Mark Olesen
6b3b6bb99f ENH: add stream format options for surface writers (#1595)
- additional boundaryData options (header, binary, compression)

- remove vtkSurfaceWriter "writePrecision" keyword (1806 compatibilty)
  and use "precision" in format option sub-dictionary.
2020-02-19 21:30:55 +01:00
Mark Olesen
3be7610710 BUG: incorrect Nastran surface output and segmentation faults #1571
- indexing error in the output of values resulted in uniform output in
  most cases.

- allocation error for on-the-fly triangulation

ENH: changed decomposed storage from DynamicList to plain faceList for
clearer allocation control and better overhead
2020-01-27 12:34:41 +01:00
OpenFOAM bot
e9219558d7 GIT: Header file updates 2019-10-31 14:48:44 +00:00
Mark Olesen
773ec00d4b ENH: improved consistency of surface writers (#1232)
- remove writeGeometry() in favour of write() and make it pure virtual
  so that all writers must explicitly deal with it.

- establish proxy extension at construction time and treated as an
  invariant thereafter. This avoids potentially surprising changes in
  behaviour when writing.
2019-03-11 15:09:03 +01:00
Mark Olesen
181c974b11 ENH: improved sample surfaces and surface writers (#1206)
- The writers have changed from being a generic state-less set of
  routines to more properly conforming to the normal notion of a writer.
  These changes allow us to combine output fields (eg, in a single
  VTK/vtp file for each timestep).

  Parallel data reduction and any associated bookkeeping is now part
  of the surface writers.
  This improves their re-usability and avoids unnecessary
  and premature data reduction at the sampling stage.

  It is now possible to have different output formats on a per-surface
  basis.

- A new feature of the surface sampling is the ability to "store" the
  sampled surfaces and fields onto a registry for reuse by other
  function objects.

  Additionally, the "store" can be triggered at the execution phase
  as well
2019-02-07 18:11:34 +01:00