Commit Graph

24211 Commits

Author SHA1 Message Date
b25c4611cb ENH: Cloud patch interaction model updates
- MultiInteraction: updated to call info() function of child models
- PatchInteractionModel: added postEvolve hook
- KinematicCloud: call patchInteraction() postEvolve hook
2020-12-04 13:40:28 +00:00
7d897ee7a3 Merge branch 'issue-1871-refPtr-adjointTurbulence' into 'develop'
Issue 1871 - simplifies adjoint turbulence code by using refPtr instead of combined autoPtr/tmp

See merge request Development/openfoam!385
2020-12-04 07:33:40 +00:00
fcf3f8ec17 ENH: replace autoPtr/tmp combination with refPtr (issue #1871)
- reduces some code complexity.
2020-12-03 19:17:59 +00:00
5ad2fe621a Merge branch 'updated-surface-handling' into 'develop'
Updated surface handling

See merge request Development/openfoam!394
2020-11-30 17:13:39 +00:00
029b1373a3 DOC: document writeFile updateHeader flag (fixes #1942) 2020-11-30 13:59:10 +01:00
ab692caf7c ENH: support multiple weights on some field function objects (#1930)
- weight fields are combined by multiplication

  - volFieldValue:
    * 0-N scalar fields

  - surfaceFieldValue:
    * 0-N scalar fields
    * 0-1 vector fields

  In some cases this can be used to avoid creating additional
  fields.

      weightFields  (rho U);
  vs.
      derivedFields (rhoU);
      weightField   rhoU;
2020-11-30 13:59:10 +01:00
f8d08a805b ENH: additional handling for out-of-range sampling (#1891)
- when sampling onto a meshed surface, the sampling surface may be
  outside of the mesh region, or simply too far away to be considered
  reasonable.

  Can now specify a max search distance and default values for samples
  that are too distant.
  If a default value is not specified, uses Type(Zero).

  Eg,

      maxDistance     0.005;
      defaultValue
      {
          "p.*"   1e5;
          T       273.15;
          U       (-100 -100 -100);
      }
2020-11-30 13:59:10 +01:00
a947e9ddcf ENH: new sampled faceZones (#1874) 2020-11-30 13:59:10 +01:00
90fe49e8e5 ENH: adjust sampledPatch (#1874) for similarity with surfaceFieldValue 2020-11-30 13:59:10 +01:00
6cf8151817 ENH: support surfaceFieldValue on multiple faceZones or patches (#1874)
- additional "names" entry to specify a word/regex list of selections
  For example,
  {
      type    patch;
      name    inlets;
      names   ("inlet_[0-9].*" inlet);
  }

- if "names" exists AND contains a literal (non-regex) that can be used
  as a suitable value for "name", the "name" entry becomes optional.
  For example,
  {
      type    patch;
      names   ("inlet_[0-9].*" inlet);

      // inferred name = inlet
  }

- reduce some overhead in surfaceFieldValue

TUT: surfaceFieldValue on patches : reactingParcelFoam/verticalChannel
2020-11-30 13:59:10 +01:00
f82af7cb2a ENH: initial support for abaqus surface sampled output (#1600)
- supports geometry and field-specific scaling, separate geometry and
  fields. Beta-feature for suppressing geometry output entirely.
2020-11-30 13:59:10 +01:00
1d398d8cae ENH: handle abaqus SURFACE input (#1600)
- read surfaces which are defined in terms of solid element sides. Eg,

```
  *ELEMENT, TYPE=C3D4, ELSET=...
  1, ...
  2, ...

  *SURFACE, NAME=Things, TYPE=ELEMENT
  1, S1
  2, S1
```

  The element and side number are encoded as a synthetic face id
  according to

      -(10 * elemId + sideNum)

  but the underlying solid geometry is discarded, since there is no
  reasonable way to pass it through the surface sampling mechanism.
2020-11-30 13:59:10 +01:00
986199f897 ENH: align bitSet and FixedList methods names
- bitSet and PackedList fill() as per boost dynamic_bitset.
  Silently deprecate assign(val), which is potentially confusing
  with other forms of assign().

- FixedList fill() as per std::array.
  Add missing assignment from Foam::zero

- minor code simplication in bitSet and PackedList

STYLE: fix typo in comment, qualify Foam::zero
2020-11-30 13:59:07 +01:00
66c8607d5f CONFIG: trap -with-bear, but continue argument processing
- makes it easier to combine with -log options etc.
2020-11-30 10:21:57 +01:00
fc6a5a6dad GIT: correct submodule indices 2020-11-28 21:17:35 +01:00
7830cc503e BUG: Fix sign in Lee model. Fixes #1934. 2020-11-27 19:46:08 -08:00
c879c24412 ENH: redistributePar: suppress warning. Fixes #1937. 2020-11-26 13:46:50 +00:00
9c86b5d722 ENH: robustness improvements for wmakeFunctions
- relocated module-prefix handling to wmakeFunctions
2020-11-26 12:54:46 +01:00
a50047bbcc ENH: add hook for bear frontend to create json output (#1936)
Example usage,

   wmake -with-bear src/OpenFOAM
   src/Allwmake -with-bear -s -j

- bin/tools/vscode-settings

  Emit some json content suitable for setting up Visual Studio Code
  for use with OpenFOAM.

  For example,
      bin/tools/vscode-settings > .vscode/settings.json

Ideas from Volker Weissman
2020-11-26 12:54:46 +01:00
fb7afd5f96 TUT: fix missing line ending and wrong blockMeshDict vertex location 2020-11-26 02:15:20 +01:00
024d22cb64 BUG: missing nullptr check in Function1/PatchFunction1 fallback logic 2020-11-26 01:53:15 +01:00
b4eb214d56 BUG: transformPoints flagged zero or negative scaling as an error
- additional check was introduced by 51b2490258, but scaling with
  zero is useful for flattening a mesh
2020-11-26 01:04:55 +01:00
9fe09ad21d ENH: installation helpers
----
install-dirs: a general directory installer

  Copy installs non-binary (platform) directories.
  Eg,

      install-dirs -prefix=... -devel
      install-dirs -prefix=... -default -no-app

----
install-platform: a platform (binary) installer

  This is primarily driven by the need to install into system mpi
  directories. The problem noted in issue #1893 is caused by the
  rpm-mpi-hooks (fedora and redhat-8).

  For the additional mpi library qualifier (openmpi-x86_64) to be
  added to the requirements, the mpi-specific libraries (eg,
  libPstream.so) need to be installed in the mpi system directory
  (eg, /usr/lib64/openmpi).

  However, then need symlinks from the system locations back to our
  local directories to ensure that the libraries are correctly found
  via our LD_LIBRARY_PATH and we don't get dummy libraries.

----
update-mpi-links: a post-install update hook

  Expected paths are registered as persistent information into the
  hook during packaging. Triggering the hook after installation
  completes the creation of the symlinks.

Normal usage,
```
prefix="/tmp/local-install/openfoam"

bin/tools/install-dirs -prefix="$prefix" -common
bin/tools/install-platform -prefix="$prefix"
```
Installs
 - /tmp/local-install/openfoam/META-INFO
 - /tmp/local-install/openfoam/bin
 - /tmp/local-install/openfoam/etc
 - /tmp/local-install/openfoam/platforms/linux64GccDPInt32Opt/bin
 - /tmp/local-install/openfoam/platforms/linux64GccDPInt32Opt/lib

Can also place architecture-dependent bits elsewhere,
```
prefix="/tmp/local-install/openfoam"
multi_arch="$(dpkg-architecture -qDEB_TARGET_MULTIARCH)"

bin/tools/install-dirs -prefix="$prefix" -common
bin/tools/install-platform -exec-prefix="$prefix/$multi_arch"
```
Installs
 - /tmp/local-install/openfoam/META-INFO
 - /tmp/local-install/openfoam/bin
 - /tmp/local-install/openfoam/etc
 - /tmp/local-install/openfoam/x86_64-linux-gnu/bin
 - /tmp/local-install/openfoam/x86_64-linux-gnu/lib

Can use it to flatten out platforms entirely,
```
prefix="/tmp/local-install/openfoam"
bin/tools/install-dirs -prefix="$prefix" -common
bin/tools/install-platform -exec-prefix="$prefix"
```
Installs
 - /tmp/local-install/openfoam/META-INFO
 - /tmp/local-install/openfoam/bin
 - /tmp/local-install/openfoam/etc
 - /tmp/local-install/openfoam/lib
2020-11-25 21:31:22 +01:00
c2bf9e1cc8 CONFIG: bump API to 2011
- mostly to reflect changes in config prefs and output methods
2020-11-25 21:31:02 +01:00
52c6642a4c Merge remote-tracking branch 'origin/master' into develop 2020-11-25 21:30:49 +01:00
1fa4221bc8 COMP: fix label ambiguity 2020-11-25 19:53:03 +01:00
501cd35351 ENH: consistent naming for ZoneMesh lookup method
- findZone(), cfindZone() to return pointer to existing or nullptr if
  not found. This fits with methods such as findObject() etc for other
  classes and can simplify code without checks for '-1' as not found.

- use simpler constructors for empty cell/face/point zones
2020-11-25 19:53:03 +01:00
be7a3f21be ENH: add BitOps::set(), unset() functions for boolList, labelHashSet 2020-11-25 19:53:03 +01:00
0de32a6e6f ENH: improve flexiblity for flat output of items (#1929)
- change to a templated implementation instead of relying on
  the container's writeList() method.

  This inlines the generation while also adding the flexibility to
  define different delimiters (at compile time) without the
  performance penalty of passing run-time parameters.
2020-11-25 19:53:03 +01:00
d2f1690536 ENH: align Enum methods with HashTable
- deprecate get(key, deflt) in favour of lookup(key, deflt).
  Method name compatibility with HashTable.

- deprecate operator().
  The meaning is too opaque and equally served by other means:

  - use get(key) instead of operator()(key).
    Const access whereas HashTable::operator()(key)
    creates missing entry.

  - lookup(key, deflt) - instead of operator()(key, deflt).
    Const access whereas HashTable::operator()(key, deflt)
    creates a missing entry.

- make Enum iterable to allow participation in range-for etc.
2020-11-25 19:53:02 +01:00
9122713b37 STYLE: mark deprecated findIndices methods with warnings
- were deprecated Aug-2018, but not marked as such
2020-11-25 19:53:02 +01:00
7349b97ecc STYLE: use labelRange for identity 2020-11-25 19:53:02 +01:00
ae49b51182 ENH: improve offsets handling in extrudeToRegionMesh (#1933)
- non-uniform offsets are generated due to truncation errors,
  which can lead to problems later on (e.g. redistributePar).

  Detect if the offsets are close to being uniform.
2020-11-25 19:53:02 +01:00
89ea011585 ENH: snappyHexMesh: gapLevel. See #1463.
Adds distance-to-surface as a pre-selection
to detect cells-in-gaps. Before it could only
use inside or outside but not distance.
2020-11-25 16:10:02 +00:00
ac98e498fe BUG: meshToMesh - corrected mapping of internal field for tgt->src mapping. Fixes #1935 2020-11-24 12:01:15 +00:00
9c26b5ce9f BUG: subsetMesh: map instead of truncate. See #1558.
This also is to do with redistributePar:
this uses subsetMesh to generate parts to
send to different processors.
2) related to 1558: make sure not to choose 'mapped'
patches to move the processor patches into so
we can use the mapper cloning and correctly
size additional data (e.g. offsets). This should
be generalised to hold for any patch type
holding local data ...
2020-11-23 19:58:31 +00:00
f9033cbf92 BUG: wall distance: Fixes #1932.
Potential problem with multiple faces. Rewritten to
use DynamicList.
2020-11-23 13:08:17 +00:00
eaf6440a0a COMP: Allwmake: delay building finiteArea
For convenience - build finiteVolume first
2020-11-23 13:08:17 +00:00
88afcae8e8 Merge branch 'feature-Function1' into 'develop'
corrections and improvements for Function1

See merge request Development/openfoam!391
2020-11-20 15:18:25 +00:00
4b964f676e STYLE: fix doxygen comments 2020-11-19 16:57:45 +01:00
8d2d894ae0 ENH: support frequency or period for Sine/Square Function1 (#1917)
- For slow oscillations it can be more intuitive to specify the
  period.

ENH: separate mark/space for Square

- makes it easier to tailor the desired intervals.

BUG: incorrect square wave fraction with negative phase shifts

ENH: additional cosine Function1

STYLE: avoid code duplication by inheriting Cosine/Square from Sine.
2020-11-19 16:57:45 +01:00
6e3bc1f7d0 STYLE: can add compile-time deprecated message for autoPtr::set()
- deprecated Feb-2018, but not marked as such.

  The set() method originally enforce an additional run-time check
  (Fatal if pointer was already set), but this was rarely used.
  In fact, the set() method was invariably used in constructors
  where the pointer by definition was unset.

  Can now mark as deprecated to catch the last of these.
  We prefer reset() for similarity with std::unique_ptr

  Eg,
  FOAM_EXTRA_CXXFLAGS="-DFoam_autoPtr_deprecate_setMethod"  wmake
2020-11-19 16:57:45 +01:00
2f2dcdcf6f ENH: Function1 and PatchFunction1 improvements (#1917)
- easier support for non-mandatory functions.

  In some boundary conditions it can be desirable to support
  additional functions, but not necessarily require them. Make this
  easier to support with a Function1, PatchFunction1 NewIfPresent()
  selector.

- support for compatibility lookups

- harmonize branching logic and error handling between Function1 and
  PatchFunction1.

ENH: refactor a base class for Function1, PatchFunction1

- includes base characteristics, patch or scalar information

ENH: additional creation macros

- makeConcreteFunction1, makeConcretePatchFunction1Type for adding a
  non-templated function into the correct templated selection table.
  makeScalarPatchFunction1 for similarity with makeScalarFunction1
2020-11-19 16:57:45 +01:00
07bbae0c55 STYLE: use brace constructors for Foam::zero and Foam::one
- makes it clearer that these are constructors and not function calls
2020-11-19 16:57:45 +01:00
98d05fa80a STYLE: prefix zero/one with Foam:: qualifier
ENH: support construction of zero-sized IndirectList

- useful when addressing is to be generated in-place after construction.
  Eg,

      indirectPrimitivePatch myPatches
      (
          IndirectList<face>(mesh.faces(), Zero),
          mesh.points()
      );
      labelList& patchFaces = myPatches.addressing();

      patchFaces.resize(...);
      // populate patchFaces

STYLE: add noexcept for zero/one fields and remove old dependency files

COMP: correct typedefs for geometricOneField, geometricZeroField
2020-11-19 16:55:29 +01:00
f126e29121 ENH: fanPressureFvPatchScalarField - adjust compatibility handling
COMP: add missing clone() for fanCurve member

STYLE: reduce padding in data members
2020-11-19 12:36:57 +01:00
d1453b037a STYLE: duplicate include dir 2020-11-18 22:41:14 +01:00
da7165077c BUG: typo in solidProperties prevents re-reading of "Hf" (fixes #1927) 2020-11-18 19:38:55 +01:00
6dd2cc808e CONFIG: provisional cuda rule. Update naming for CGAL rules 2020-11-17 21:29:07 +01:00
9fd514bbe6 ENH: support OFstream "/dev/null" equivalent directly
- uses ocountstream for the output, which swallows all output.
  Improves portability

ENH: improved efficiency in countstreambuf

- xsputn() instead of overflow
- more consistent seek* methods
2020-11-17 14:43:00 +01:00