Commit Graph

26903 Commits

Author SHA1 Message Date
f2dcd88f1e Merge branch 'develop-feature-abaqus' into 'develop'
Added Abaqus sampling and writing

See merge request Development/openfoam!644
2023-12-04 10:36:29 +00:00
a1819a5411 ENH: Added new abaqus sampledSet
Generates sample positions from points specified in a file as Abaqus mesh
points.

Example usage:

    sets
    {
        cone25 // user-specified set name
        {
            type        abaqusMesh;
            file        "abaqusMesh.inp";

            // Optional entries

            // Scale, e.g. mm to m
            scale       0.001;

            // Search distance when the sample point is not located in a cell
            maxDist     0.25;

            ...
        }
    }
2023-12-04 10:34:14 +00:00
d3b3a5a41e ENH: Added new abaqus coordSet writer
Write coordSet(s) as Abaqus point fields

Example usage

    T
    {
        type        sets;
        setFormat   abaqus;
        fields      (T);
        sets
        {
            ...
        }
    }
    \endverbatim

    Optional format options
    \verbatim
    formatOptions
    {
        abaqus
        {
            format          ascii;

            // Optional entries

            // Custom header: $ entries are substituions
            header
            (
                "** OpenFOAM abaqus output"
                "** Project $FOAM_CASE"
                "** File $FILE_NAME"
                "** $FIELD_NAME Time t=$TIME"
            );

            // Write geometry in addition to field data
            writeGeometry   yes;

            // Null value when sample value is not found
            // Default is scalar::min
            nullValue       0;

            // Insert additional time sub-directory in the output path
            // - yes : postProcessing/<fo-name>/<time>/<file>
            // - no  : postProcessing/<fo-name>/<file>
            useTimeDir      no;

            // Available when 'useTimeDir' is 'no' to disambiguate file names

            // Time base for output file names:
            // - 'time'      : <base>.inp_<field>.<time>
            // - 'iteration' : <base>.inp_<field>.<iteration>
            timeBase        iteration;

            // Optional start counters when using timeBase iteration
            writeIndex
            (
                T 1
            );

            ...
        }
    }
2023-12-04 10:05:29 +00:00
3944c7a628 ENH: coordSetWriter - brought across field scaling and offsets from surface writers
Example:

    formatOptions
    {
        <writer>
        {
            // Apply offsets to field values
            fieldLevel
            {
                T   273.15; // Convert from K to C by subtracting 273.15
            }

            // Note: scale applied after application of field level
            fieldScale
            {
                p   0.001;  // Convert pressure from Pa to kPa by scaling by 0.001
            }
        }
    }
2023-12-04 09:57:08 +00:00
0ba821a96d Merge branch 'feature-caseInfo-json' into 'develop'
Extract case and solver information

See merge request Development/openfoam!646
2023-12-04 09:51:33 +00:00
f8742146a7 ENH: checkMesh - added -writeChecks option
Added -writeChecks <format> option

- writes computed mesh metrics to file in using <format>
- currently supported formats are OpenFOAM dictionary and JSON
2023-12-01 15:04:41 +00:00
9d20dd84a9 TUT: Added caseInfo function object example 2023-12-01 15:04:41 +00:00
6242e70d09 ENH: Added new caseInfo function object
Collects and writes case information to file in OpenFOAM dictionary or JSON
format.  Data includes:

- meta: case name, path, regions, parallel etc.
- dictionaries: entries retrieved from dictionaries - registered or from file
- per region: mesh metrics, boundary and boundary field types
- function object results

Example of function object specification:

    caseInfo
    {
        type            caseInfo;
        libs            (utilityFunctionObjects);

        // Warn when entries are not found
        lookupMode  warn; // none | warn | error;

        // Write format
        writeFormat json; //  dictionary | json;

        dictionaries
        {
            USolver // User-specified names
            {
                // Look up using registered name
                name        "fvSolution";

                // Optionally limit to specific entries
                include
                (
                    "solvers/U/solver"
                );
            }
            fvSchemes
            {
                name        "fvSchemes";

                // include all entries by default
            }
            timeScheme
            {
                name        "fvSchemes";

                include
                (
                    "/ddtSchemes/default"
                );
            }

            turbulence
            {
                name        "turbulenceProperties";

                // include all entries by default
            }
            controlDict
            {
                // Look up using file path
                path        "<case>/system/controlDict";

                include
                (
                    "application"
                    "deltaT"
                    "startTime"
                    "endTime"
                );
            }
        }

        functionObjects (minMax1);
    }
2023-12-01 14:00:52 +00:00
d77db0edb9 ENH: Added new JSONformatter to write Ostream content in JSON format
New Ostream wrapper that writes entries as JSON objects/convert OpenFOAM
dictionaries to JSON dictionaries, e.g.

    dictionary dict ...

    // Create file for writing
    OFstream os("myData.json");

    // Wrap Ostream
    JSONformatter json(os);

    // Write dictionary as JSON
    json.writeDict(dict);
2023-12-01 11:54:35 +00:00
c7a639d0dd ENH: polyMeshCheck - added mesh quality metrics to meshState dictionary
Quality metrics, e.g. non-orthogonality, skewness etc are calculated/reported
in polyMeshCheck functions. These results are now added to the meshState/mesh
dictionary to enable external access.
2023-12-01 11:54:35 +00:00
0ff86ee2e7 ENH: replaced fragile dict interactions by meshState functions 2023-12-01 11:54:35 +00:00
79cd147de0 STYLE: Refactoring use of meshState in {fv|faMesh}
{fv|fa}Mesh classes inherited the [old] data class (renamed meshState)
- meshState removed from inheritance list and added as data members
2023-12-01 11:54:35 +00:00
da20ff2666 STYLE: renamed/moved 'data' to 'meshState'
ENH: added 'mesh' dictionary to meshState to hold mesh properties

- solver information now stored in a 'solver' dictionary (was solverPerformance)
  - {first|final}Iteration entry now stored in solver dict instead of top level
- mesh data (new) stored in 'mesh' dictionary
2023-12-01 11:54:34 +00:00
6da041e61f TUT: added -constant for redistributePar. See !605 2023-11-29 09:14:59 +00:00
6c08e995ba BUG: redistributePar: handle lagrangian in decompose mode. See !605
- only affects recent develop
- fixed by supplying invalid casename for non-master ranks
2023-11-28 16:50:51 +00:00
b4b022f283 BUG: SRFModel: tmp() abuse. Fixes #3038. 2023-11-27 18:03:11 +00:00
1c0f59c0e2 Merge branch 'feature-nonblockingACMI' into 'develop'
ENH: cyclicACMI: add non-blocking matrix updates.

See merge request Development/openfoam!641
2023-11-27 13:58:02 +00:00
7c64cdbd01 ENH: cyclicACMI: add non-blocking matrix updates. 2023-11-27 13:58:02 +00:00
7c8daed124 Merge branch 'feature-rom' into 'develop'
ENH: Reduced-order modelling field reconstruction with DMD

See merge request Development/openfoam!639
2023-11-24 19:57:18 +00:00
1a4d2f735f TUT: cylinder2D: add examples for the createROMfields utility 2023-11-24 19:57:11 +00:00
c9d1f741ce ENH: createROMfields: new reduced-order model utility to reconstruct fields 2023-11-24 19:57:11 +00:00
b093e3a709 CONFIG: increment API level to 2309
- filehandler and watched files changes
- addition of turbulence submodule
2023-11-23 22:42:22 +01:00
c5e4b62df7 ENH: improve/simplify streaming of exprValue
- ensure that operator<< and operator>> behave symmetrically
2023-11-23 22:42:22 +01:00
2ab3490552 STYLE: invert ASCII/BINARY checks. Helps if adding other formats
STYLE: use globalIndex::totalSize()
2023-11-23 22:42:20 +01:00
5a29b2b076 ENH: probes: reformat output for third-party readers 2023-11-23 15:32:31 +00:00
2d042268ba ENH: shm: add unbalancing info printing. Fixes #3034. 2023-11-23 15:31:43 +00:00
4ea5bfe2ac SUBMODULE: turbulence-community: add new submodule
SUBMODULE: updated cfmesh
2023-11-23 09:42:33 +00:00
92dc2e0459 BUG: facGrad: correct the gradient calculation (fixes #2979) 2023-11-22 15:31:32 +00:00
0ae6141397 Merge branch 'update-redistributePar' into 'develop'
improve fileHandler support for redistributePar

See merge request Development/openfoam!605
2023-11-21 11:14:45 +00:00
5be652d03c ENH: hostCollated: naming without ranges if running on single rank 2023-11-21 11:14:28 +00:00
31825dd981 BUG: redistributePar: cell/face/pointProcAddressing written to incorrect dir 2023-11-21 11:14:28 +00:00
910713398e ENH: redistributePar: loose matching of processors directories 2023-11-21 11:14:28 +00:00
9ed0bb1e4f ENH: redistributePar: update for distribute mode
- uses read&write handlers
- fixes initialisation of partial handlers
- 'uniform' copied to wrong place
- -overwrite not deleting old processors dirs
2023-11-21 11:14:28 +00:00
af267e0c1b BUG: redistributePar: excessive directories for collated. Fixes #2936.
BUG: collated: cooperate with non-parallel
2023-11-21 11:14:28 +00:00
4183419be0 TUT: redistributePar 2023-11-21 11:14:28 +00:00
259e8c22a5 ENH: improve check for decomposedBlock and simpler startup 2023-11-21 11:14:28 +00:00
c880efb4a6 ENH: improve fileHandler support for redistributePar
- use file handlers to manage where meshes/fields are to be read and
  written.
2023-11-21 11:14:28 +00:00
030a467a23 ENH: broadcast dynamicCode, create missing processor directories
- code is compiled dynamically on the master node.
  In the normal (non-distributed) case, simply poll the NFS
  to see when it appears on the sub-procs.

  For a case with distributed roots, first broadcast it (via MPI)
  to the IO master nodes and then poll afterwards.

- on startup, detect and create missing processorXXX/ subdirectories
  on distributed filesystems
2023-11-21 11:14:28 +00:00
65523e9d24 ENH: add delayed handling of file watches to regIOobject
- this delay the communication of file watches, which helps avoid
  communication deadlocks with master-only reading.

Co-authored-by: Mark Olesen <>
2023-11-21 11:14:28 +00:00
aec4ba30a3 ENH: handle watching included files 2023-11-21 11:14:28 +00:00
bcd873ccfe ENH: Update redistribute clouds with readOnProc/writeOnProc
- when reading, detect all clouds on all processors and uses this when
  reading fields. Similarly, when writing it uses writeOnProc to skip
  clouds that are empty on any particular processor.

Co-authored-by: Mark Olesen <>
2023-11-21 11:14:28 +00:00
eea72282ab ENH: CHT solvers - avoid fvSolution persisting on time db 2023-11-20 14:32:11 +00:00
11ecf55a86 Merge branch 'pstream-updates' into 'develop'
Extend some Pstream, PstreamBuffers and globalIndex functionality

See merge request Development/openfoam!640
2023-11-20 10:10:49 +00:00
8818201196 ENH: extend mpiAllGather to include integer and float types
- was previously limited to 'char' whereas gatherv/scatterv
  already supported various integer and float types

STYLE: rebundle allToAll declarations with macros

ENH: provide a version of allToAllConsensus returning the Map

- simplifies use and avoids ambiguities in the send/recv parameters

- the Map version will now also transmit zero value data if they exist
  in the Map. Unlike the List version, zero values are not necessary to
  signal connectivity with a Map.

COMP: forwarding template parameters for NBX routines

ENH: consolidate PstreamBuffers size exchange options

- had a variety of nearly identical backends for all-to-all,
  gather/scatter. Now combined internally with a dispatch enumeration
  which provides better control over which size exchange algorithm
  is used.

DEFEATURE: remove experimental full-NBX PstreamBuffers variant

- no advantages seen compared to the hybrid NBX/PEX approach.
  Removal reduces some code cruft.

DEFEATURE: remove experimental "double non-blocking" NBX version

- the idea was to avoid blocking receives for very large data transfers,
  but that is usually better accomplished with a hybrid NBX/PEX approach
  like PstreamBuffers allows
2023-11-20 09:39:35 +01:00
3fd1b74b26 ENH: globalIndex contains(), findProcAbove(), findProcBelow() methods
- these help when building upper or lower connected topologies.
  The new findProc() method is a non-failing whichProcID alternative
2023-11-20 09:36:23 +01:00
cfb752647a ENH: globalIndex and CompactListList improvements
- provide a globalIndex::calcOffsets() taking an indirect list, which
  enables convenient offsets calculation from a variety of inputs.

- new CompactListList unpack variant: copy_unpack()
  The copy_unpack() works somewhat like std::copy() in that it writes
  the generated sublists to iterator positions, which makes this
  type of code possible:

      CompactListList<label> compact = ...;
      DynamicList<face> extracted;

      compact.copy_unpack<face>
      (
          std::back_inserter(extracted),
          labelRange(4, 10)
      );

  -and-

      const label nOldFaces = allFaces.size();
      allFaces.resize(allFaces + nNewFaces);

      auto iter = allFaces.begin(nOldFaces);

      iter = compact.copy_unpack<face>(iter, /* selection 1 */);
      ...
      iter = compact.copy_unpack<face>(iter, /* selection 2 */);

ENH: globalIndex resize()

- can be used to shrink or grow the offsets table.
  Any extension of the offsets table corresponds to 'slots'
  with 0 local size.
2023-11-20 09:35:59 +01:00
ef201ecfea STYLE: adjust globalIndex/CompactListList overflow reporting
- report location with previous good offset and the new count that
  would cause overflow. Simpler to report and the (very long) list
  of input sizes is not particularly useful for diagnostics either.

ENH: add globalIndex comparison operators

- for outputting lists of globalIndex
2023-11-20 09:24:17 +01:00
5e0cafa637 COMP: fix constexpr mismatches 2023-11-20 09:11:33 +01:00
d6d28ccfa2 ENH: make sliceRange modifiable - similar to labelRange 2023-11-18 17:25:22 +01:00
a0b9732321 ENH: add support for CHAR_DATA token
- allows construction of string tokens holding character content.
  For example, data that has been serialized and buffered and that
  now needs to be written or sent to another process.
2023-11-18 15:24:15 +01:00