Commit Graph

21640 Commits

Author SHA1 Message Date
9a87a043d6 ENH: consistency updates for patchToFace topoSetSource (#1060)
- Support specification with "patches" and "patch" keywords
  (similar to zone selection). Keyword "name" for compatibility.
2018-10-30 12:01:36 +00:00
de1832abdd ENH: consistency update for box topoSetSources (#1060)
- "boxes" has precedence over "box" (similar to treatment of "zones"
  vs "zone")
2018-10-30 12:01:36 +00:00
50fe195374 ENH: use "origin" for searchable sphere etc. (#1060)
- replaces "centre", using the same keyword as other objects
  (eg, plane, rotatedBox, coordinateSystem etc).
2018-10-29 15:51:05 +00:00
c2e58dca64 ENH: support multiple zones for topo set sources (#1060)
- uses the keywords 'zones' and 'zone' to avoid potential conflicts
  with a named topoSet action, but accepts 'name' for compatibility.
2018-10-29 12:54:30 +00:00
26f6f4257a STYLE: createBafflesDict: typo in comment 2018-10-31 13:55:06 +00:00
3cb12d2d9c ENH: PatchFunction1: have 'sampled' type.
type sampled is the equivalent of 'mappedField' bc
functionality - it samples a registered field on a
different region/patch/cells.
2018-10-31 13:37:11 +00:00
192e2eeb9d BUG: tutorials: fix tutorials for 1812. See #1059. 2018-10-31 12:08:55 +00:00
5f91007d4a ENH: twoSimpleRotors: missing value field 2018-10-30 16:48:05 +00:00
0048b05fdf ENH: PatchFunction1: backwards compatibility. See #1046. 2018-10-30 15:13:23 +00:00
04a985ccb3 ENH: ConstantField: allow nonuniform. See #1046. 2018-10-30 13:37:54 +00:00
6f2376a649 ENH: ConstantField: allow 'constant' keyword. See #1046. 2018-10-30 13:26:23 +00:00
966eed302e BUG: subsetMesh: mapping topoSets. Fixes #1053. 2018-10-30 12:43:30 +00:00
f87496b35d ENH: mappedPatchBase: short circuit when sampling own mesh. Fixed when doing #1046. 2018-10-30 12:10:28 +00:00
f2ef995113 ENH: checkMesh: pass by reference. See #755. 2018-10-29 15:08:52 +00:00
ccafd3cd30 ENH: overset: insert cellDisplacement into suppressed fields. See #1026. 2018-10-29 14:37:13 +00:00
3be48a677c ENH: snappyHexMesh: update main snappyHexMeshDict. See #1031. 2018-10-17 12:04:53 +01:00
e2961e9e41 Merge branch 'feature-patchFunction1' into 'develop'
Feature patch function1

See merge request Development/OpenFOAM-plus!215
2018-10-29 09:44:31 +00:00
c20b12b62f Feature patch function1 2018-10-29 09:44:31 +00:00
f16c417fff CONFIG: mismatch in keyword for singleProcessorFaceSets
- catch some dictionary entries from pre-develop branch
2018-10-19 22:18:06 +02:00
f865fb432f TUT: missing semi-colons 2018-10-19 21:48:31 +02:00
6ba6d7466d ENH: general consistency and documentation update for surface writers 2018-10-19 19:26:05 +02:00
d63b4cd4f4 ENH: minor changes to rationalize sampledSurface
- make hasFaceId a top-level virtual method and remove keepIds
  equivalent from sampledTriSurfaceMesh. This makes the property
  available without casting.

- New sampling type 'none'.
  Can be used to temporarily disable a sampling surface definition,
  or to provide boilerplate for overwriting later.
2018-10-19 16:02:44 +02:00
b76f2421dc STYLE: default construct/assignment for mergedSurf
COMP: fix incorrect reference in meshedSurfRef
2018-10-10 19:08:27 +02:00
07dafe7b0b STYLE: use range-for when looping dictionary entries.
- as part of the cleanup of dictionary access methods (c6520033c9)
  made the dictionary class single inheritance from IDLList<entry>.

  This eliminates any ambiguities for iterators and allows
  for simple use of range-for looping.

  Eg,
      for (const entry& e : topDict))
      {
          Info<< "entry:" << e.keyword() << " is dict:" << e.isDict() << nl;
      }

   vs

      forAllConstIter(dictionary, topDict, iter))
      {
          Info<< "entry:" << iter().keyword()
              << " is dict:" << iter().isDict() << nl;
      }
2018-10-19 13:08:24 +02:00
4e04c1966f ENH: use dictionary::get<word>() instead of lookup() in a few places 2018-10-19 09:11:31 +02:00
4ad73873af STYLE: use dictionary writeEntry for output 2018-10-18 12:57:32 +02:00
3c5fffcd1c STYLE: simplify read/write coding for some thermophysicalModels 2018-10-18 12:57:32 +02: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
f2c78362e7 CONFIG: default to using logical value for cwd()
- this helps for many cases outlined in issue #1007, but can also be
  useful when simply using symlinks for shorter or reorganized
  directory structures.
2018-10-18 08:05:44 +02:00
6e9520d3c1 Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop 2018-10-17 10:29:34 -07:00
5daa38d5b4 ENH:
Update of overRhoPimpleDyMFoam and overInterDyMFoam solvers.
Adding corresponding tutorials with best possible settings
The main effort was put on reducing pressure spikes as the
stencil change with hole cells on the background mesh.
2018-10-17 10:10:06 -07:00
14a39405c2 ENH: simple dataCloud function object (issue #1044)
- writes positions and a single field (eg, diameter) in plain ASCII files,
  suitable for importing in a spreadsheet or manipulation with
  scripting tools.

- code integrated from
  https://develop.openfoam.com/Community/OpenFOAM-addOns
2018-10-17 17:37:23 +02:00
8fabc32539 ENH: simplify objectRegistry access names (issue #322)
New name:  findObject(), cfindObject()
  Old name:  lookupObjectPtr()

      Return a const pointer or nullptr on failure.

  New name:  findObject()
  Old name:  --

      Return a non-const pointer or nullptr on failure.

  New name:  getObjectPtr()
  Old name:  lookupObjectRefPtr()

      Return a non-const pointer or nullptr on failure.
      Can be called on a const object and it will perform a
      const_cast.

- use these updated names and functionality in more places

NB: The older methods names are deprecated, but continue to be defined.
2018-10-17 16:44:10 +02:00
e0255cfff2 ENH: add compareOp for three-way comparison
- similar to the \c <=> operator in C++20.
  Primarily for use when defining cascaded sort function objects.
2018-10-17 09:29:28 +02:00
8b569b16d1 STYLE: logical ops return bool (issue #1043)
- these currently only with bool parameters, but the return value should
  nonetheless always be a bool value:

      andOp(), orOp(), lessOp(), lessEqOp(), greaterOp(), greaterEqOp()

- renamed the unused eqEqOp() to equalOp() for naming consistency with
  the equal() global function.

ENH: equalOp() specialization for scalars

- function object version of the equal() function.
  The default constructor uses the same tolerance (VSMALL),
  but can also supply an alternative tolerance on construction.
2018-10-17 07:59:26 +02:00
0a0fee88a0 STYLE: update fileName docs and minor code cleanup 2018-10-16 23:03:38 +02:00
01737e14e7 BUG: removeFaces: do not remove if inbetween same cells. See #998.
This is the additional fix to make dynamic unrefinement work again.
2018-10-17 09:13:35 +01:00
8d590dd780 STYLE: decompistionConstraint: indentation 2018-10-17 08:55:55 +01:00
03b5870c07 ENH: overset: clean-up interpolation triggering. See #1041. 2018-10-17 08:54:34 +01:00
4cce1d74d2 ENH: overset: do not trigger wall-wall interaction. See #1041. 2018-10-15 14:07:10 +01:00
8e03400635 ENH: snappyHexMesh: force all running; remove excess tutorial. 2018-10-15 11:33:00 +01:00
1eba709319 ENH: Added new fieldExtents function object
Description
    Calculates the spatial minimum and maximum extents of a field

    The extents are derived from the bound box limits after identifying
    the locations where field values exceed the user-supplied threshold
    value.

Usage
    Example of function object specification:

    fieldExtents1
    {
        type        fieldExtents;
        libs        ("libfieldFunctionObjects.so");
        ...
        writeToFile yes;
        log         yes;
        fields      (alpha);
        threshold   0.5;
        patches     ();
    }

    Where the entries comprise:

        Property      | Description              | Required   | Default
        type          | type name: fieldExtents  | yes        |
        writeToFile   | write extents data to file | no       | yes
        log           | write extents data to standard output | no | yes
        internalField | Process the internal field | no       | yes
        threshold     | Field value to identify extents boundary | yes |
        referencePosition | Reference position   | no         | (0 0 0)
        fields        | list of fields to process | yes       |
        patches       | list of patches to process | no       | <all>

    Output data is written to the file \<timeDir\>/fieldExtents.dat

Note
    For non-scalar fields, the magnitude of the field is employed and
    compared to the threshold value.
2018-10-16 13:01:15 +01:00
5d7b2329dd STYLE: use range-for in dictionary internals 2018-10-16 11:36:29 +02:00
77017e58f4 ENH: support token stream checking to entry (issue #762)
- Eg,
    scalar val(-GREAT);

    const entry* eptr = dict.findEntry(k);

    if (eptr)
    {
        val = eptr.get<scalar>();

        // Or
        eptr.readEntry(val);
    }
2018-10-16 11:13:35 +02:00
8a923518a5 STYLE: mark compatibility change in motionSolver keyword
- was "solver" in 1612 and "motionSolver" for later versions
2018-10-16 10:21:33 +02:00
873b2f0a9f STYLE: use explicit dictionary access for dictionaryEntry
- clarifies the meanings of get<T> etc, avoids later ambiguities.

ENH: simplify phaseProperties construction, add input checks
2018-10-16 09:58:49 +02:00
7864672c78 ENH: make cwd() behaviour user-adjustable (issue #1007)
- with the 'cwd' optimization switch it is possible to select the
  preferred behaviour for the cwd() function.

  A value of 0 causes cwd() to return the physical directory,
  which is what getcwd() and `pwd -P` return.
  Until now, this was always the standard behaviour.

  With a value of 1, cwd() instead returns the logical directory,
  which what $PWD contains and `pwd -L` returns.
  If any of the sanity checks fail (eg, PWD points to something other
  than ".", etc), a warning is emitted and the physical cwd() is
  returned instead.

  Apart from the optical difference in the output, this additional
  control helps workaround file systems with whitespace or other
  characters in the directory that normally cause OpenFOAM to balk.
  Using a cleaner symlink elsewhere should skirt this issue.

  Eg,
      cd $HOME
      ln -s "/mounted volume/user/workdir"  workdir
      cd workdir
      # start working with OpenFOAM
2018-10-16 01:30:44 +02:00
50852b3392 CONFIG: improve shell env handling of paths with spaces (#1007, #1008)
- foamCleanPath now only splits the environment variable on ':', which
  allows other directories with spaces or '(..)' etc to pass through
  without major issue.

- The filter arguments are split on whitespace, colons or semi-colons.
2018-10-15 21:37:46 +02:00
5c8a1b746d STYLE: use <case> instead of $FOAM_CASE expansion in more places 2018-10-15 21:19:13 +02:00
c6520033c9 ENH: rationalize dictionary access methods
- use keyType::option enum to consolidate searching options.
  These enumeration names should be more intuitive to use
  and improve code readability.

    Eg,   lookupEntry(key, keyType::REGEX);
    vs    lookupEntry(key, false, true);

  or

    Eg,   lookupEntry(key, keyType::LITERAL_RECURSIVE);
    vs    lookupEntry(key, true, false);

- new findEntry(), findDict(), findScoped() methods with consolidated
  search options for shorter naming and access names more closely
  aligned with other components. Behave simliarly to the
  methods lookupEntryPtr(), subDictPtr(), lookupScopedEntryPtr(),
  respectively. Default search parameters consistent with lookupEntry().

    Eg, const entry* e = dict.findEntry(key);
    vs  const entry* e = dict.lookupEntryPtr(key, false, true);

- added '*' and '->' dereference operators to dictionary searchers.
2018-10-15 16:16:12 +02:00