Commit Graph

24122 Commits

Author SHA1 Message Date
Mark Olesen
410d38b9d9 ENH: support true/false, yes/no values for FOAM_ABORT (#1896)
- consistent with FOAM_SIGFPE etc.

- centralize code as error::useAbort() static function to avoid
  scattering the logic throughout the code.

ENH: also accept "0" and "1" string values for Switch

- not the normal path for Switch input (eg, from a dictionary), but
  consistent with bool definitions and simplifies string parsing.

  This means that `FOAM_SIGFPE=1 application` will now also work.
2020-10-28 16:04:12 +01:00
Mark Olesen
9eb73a92e2 TUT: fix use of "constant/triSurface" etc (#1887)
- use bracketed syntax (eg, "<constant>/triSurface") instead for
  implicit case resolution.
2020-10-28 16:04:12 +01:00
Mark Olesen
5579e7a62b ENH: improve some efficiency in expressions
- use refPtr to simplify some logic.
- avoid copying field if an average will be used
- initialize geometric fields with a uniform value instead of Zero
- minor tweak of method names

- apply bugfix #1889 (longer description elsewhere)
2020-10-28 16:04:08 +01:00
Mark Olesen
51b2490258 ENH: additional options for transformPoints and surfaceRefineRedGreen
- add -recentre option to shift points according to the bounding box
  centre before performing other operations

- add -auto-origin to use the bounding box centre as the origin for
  rotations. Has lower priority than the -origin option.

- surfaceTransformPoints now has distinct -read-scale, -write-scale
  options (as per surfaceMeshConvert). Silently accepts -scale as
  equivalent to -write-scale, for backwards compatibility and
  similarity with transformPoints

- add -steps option for surfaceRefineRedGreen for successive
  refinement
2020-10-22 14:59:12 +02:00
Mark Olesen
4f84aa5362 STYLE: adjustments for code integration
- adjust contributor names to include windows port

BUG: bash script marked as sh (fixes #1890)
2020-10-22 14:52:56 +02:00
Ivor Clifford
d8525f1746 INT: polyline: new extrusion model
Allows specification of extrusion path using blockMesh 'edges' syntax.
See tutorials/mesh/extrudeMesh/polyline

Contribution by Ivor Clifford/Paul Scherrer Institut
2020-10-22 10:13:15 +01:00
Mark Olesen
e11c072bc4 CONFIG: incorrect BC code templates (fixes #1885)
- autoPtr to Function requires clone() method, not optional copy/move
  argument.

- fix bad character range for 'sed'
2020-10-20 14:23:40 +02:00
Mark Olesen
f425424eef ENH: add api/patch information to FatalError (#1880)
- can be useful when confronted with partial outputs

- provision for redirecting error/warning
2020-10-19 21:14:22 +02:00
Mark Olesen
1071d413a3 ENH: add ROOTGREAT constants (symmetry with ROOTSMALL)
ENH: add some scalar constants for .org compatibility (#1881)

Although it can very much be a moving target, it can prove partly
useful to have some compatibility constants/methods.

- The wholesale change of 'GREAT' -> 'great' etc (JAN-2018), makes
  user coding for multiple versions problematic. When
  COMPAT_OPENFOAM_ORG is defined, now define constants (aliases) named
  as per the openfoam.org version. Values, however, remain identical.

- For type-safe dictionary value retrieval, we have the templated
  get<> methods added around NOV-2018 and deprecated the lookupType
  method.

  The .org version followed suit in NOV-2019, but opted for renaming
  the templated lookupType method as a templated 'lookup' method.

  Using this is discouraged, but allowed when COMPAT_OPENFOAM_ORG is
  defined.
2020-10-19 21:14:17 +02:00
Mark Olesen
cb47decbf1 ENH: add Switch::negate() method (no-op for invalid state)
- flips state while preserving the textual representation.
  Eg, OFF <-> ON, YES <-> NO etc.

- fix test case to avoid triggering abort(), which we cannot try/catch
2020-10-15 17:21:33 +02:00
Mark Olesen
f7839acd47 ENH: output Enum name list without leading number
- not usually of any interest.
  Unifies code for Ostream and std::ostream operators
2020-10-15 17:21:33 +02:00
Mark Olesen
f1d9fea6f2 ENH: construct token::compound from object and token from compound (#1879)
- provides a more direct means of generating a compound token without
  an Istream

- add transferCompoundToken() without Istream reference

- mark more token methods as noexcept
2020-10-15 17:21:33 +02:00
Mark Olesen
de544c9422 COMP: mark autoPtr copy assigment as '= delete' (#639)
- was marked as transitional/deprecated (2018-02), now deleted.

- avoids unexpected stealing of the pointer.
  Use the move assignment it that is the intention.
2020-10-15 17:21:33 +02:00
Mark Olesen
132ae101f6 COMP: avoid autoPtr copy assignment and implicit casting 2020-10-15 17:21:33 +02:00
Mark Olesen
f0d4f7cdc5 ENH: additional cellModel edge() method to return a single edge
STYLE: update cell methods

- avoid shadow variable names, range-for, etc
- simplify coding

STYLE: relocate cellModeller (compatibility) from namespace to a struct

- avoids misleading namespace clutter in doxygen
2020-10-13 12:47:37 +02:00
Mark Olesen
2d67788c74 ENH: simplify treeBoundBox::calcExtremities
STYLE: avoid shadow variable names, add more doxygen markup

STYLE: cull some unused code from triangleFuncs
2020-10-13 12:47:37 +02:00
Mark Olesen
2a6cbeb7cb ENH: update and document point/object hit methods
- add point() as unchecked getter method.

- add hitPoint(.., label) convenience method for common combination of
  setHit() + setIndex(label) + setPoint(..)

GIT: remove unused headers, typedefs (point2DHit.H pointHitSort.H)
2020-10-13 12:47:37 +02:00
Mark Olesen
a475a19d01 CONFIG: bump API to 2010
- mostly reflects minor additions to Pstream methods and blockMesh
  improvements.
2020-10-12 12:52:39 +02:00
Mark Olesen
f83bc8c22b Merge remote-tracking branch 'origin/master' into develop 2020-10-12 12:52:17 +02:00
Mark Olesen
9c7aa9727a ENH: add UPstream::parRun(const bool)
- slightly neater code when disabling/restoring parallel state

  New
      const bool oldParRun = Pstream::parRun(false);
      ...
      Pstream::parRun(oldParRun);

  Old
      const bool oldParRun = Pstream::parRun();
      Pstream::parRun() = false;
      ...
      Pstream::parRun() = oldParRun;
2020-10-12 12:51:22 +02:00
Mark Olesen
295eef471d CONFIG: increment patch level 2020-10-12 11:17:59 +02:00
Mark Olesen
6ecb4b69b1 SUBMODULE: update for bugfixes, compilation (external-solver, OpenQBMM) 2020-10-12 11:17:48 +02:00
Mark Olesen
bea6563210 CONFIG: ptscotch header not found on ArchLinux (fixes #1877)
- on ArchLinux, everything is installed under /usr/include/scotch.

  The detection script uses SCOTCH_ARCH_PATH as an initial guess for
  ptscotch as well. However, on the second pass, it has an absolute
  value ("/usr") instead of a logical one ("scotch-system").
  This resulted in the logic for handling scotch+ptscotch subdirs
  being bypassed.
2020-10-12 10:34:49 +02:00
Mark Olesen
c1ad429564 BUG: parallel foamToEnsight fails depending on lagrangian order (fixes #1873)
- the problem arises when output fields are missing on some
  processors.

  When the information is combined, the resulting HashTables can have
  different insertion orders. This poses an issue when there are hash
  key collisions and thus different chaining.

- Use sorted order.
2020-10-08 18:23:54 +02:00
mattijs
ea0de58bbf ENH: add ffmpeg support to foamCreateVideo
- additional -tool= option to guide the discovery process
2020-10-07 20:48:04 +02:00
Mark Olesen
0783bd28d1 ENH: additional face constructors, cellModel methods
- support construct face from subset of labels.

- additional cellModel face() method to return a single face.

- reduce some allocations in cellModel centre/mag methods

STYLE: mark old cellModeller methods as compile-time deprecated

- deprecated in 2017, but not marked as such

STYLE: indentation, spacing in some headers
2020-10-07 09:18:23 +02:00
Mark Olesen
525ad206be BUG: compilation error for DimensionedField::T() fixes #1868
- incorrectly used const access for the tmp instead of ref()
2020-10-07 09:18:23 +02:00
Mark Olesen
833ee40904 ENH: add pTraits for uint8_t 2020-10-07 09:17:00 +02:00
Mark Olesen
568cb050f2 STYLE: place projectCurveEdge, projectEdge into blockEdges namespace
- consistent with other blockEdge types
- adjust some debug output
2020-10-07 09:17:00 +02:00
Andrew Heather
57a76e2647 Merge branch 'feature-blockMesh-edges' into 'develop'
Feature block mesh edges

See merge request Development/openfoam!383
2020-10-06 09:37:10 +01:00
Mark Olesen
121c69ef2e TUT: use new 'arc' specification in several tutorials
- in most cases this eliminates manually calculation of circumferential
  points.

TUT: improve parameterization of sphere blockMeshDict

- allow separate parameterization of radius, ratio of inner to outer,
  and the number of divisions in x/y/z and radial directions
2020-10-05 15:45:39 +02:00
Mark Olesen
1d08ed9be2 ENH: support arc edge specification with origin point
- The arc will frequently enclose an angle less than 180 degrees.
  For the case, it is possible to define the arc by its endpoints
  and its centre (origin) point. For example,

      arc 0 1 origin (0 0 0);

  When defined in the way, any discrepancy in the arc radius for the
  endpoints is resolved by adjusting the origin to ensure that the
  average radius is satisfied.

  It is also possible to specify a \em flatness factor as a multiplier
  of the radius. For example,

      arc 0 1 origin 1.1 (0 0 0);

ENH: minor code cleanup for block edges

ENH: expose point appending as polyList::concat
2020-10-05 14:08:48 +02:00
Mark Olesen
8939a55653 ENH: relocate blockMesh polyMesh generation into library (for code reuse)
STYLE: adjust blockMesh advanced/non-advanced options

- make -merge-points "non-advanced" (for better exposure)
- make -write-obj "advanced" (-write-vtk is preferred)
2020-10-05 12:36:04 +02:00
Mark Olesen
179e4cbcf2 STYLE: dimensionSet lookup with LITERAL, not REGEX 2020-10-02 09:19:32 +02:00
Mark Olesen
f9190e2a3c ENH: primitiveEntry construct with empty token list
- contents to be filled with a later assignment.

  This can help avoid deduction issues when populating from a list of
  tokens, and the templated version is selected:

  ```
  template<class T>
  primitiveEntry(const keyType&, const T&);
  ```

ENH: support construct empty ITstream with given name

- populate contents later by assigment
2020-10-02 09:16:07 +02:00
Mark Olesen
a415f04431 COMP: cannot compare 'this' for different DynamicList types
- Eg, cannot compare addresses of DynamicList<T,16> and DynamicList<T,8>
  [clang], so compare their cdata pointers instead.
2020-10-01 11:35:59 +02:00
Mark Olesen
9785029979 BUG: CompactListList transfer leaves old size (fixes #1863)
- use clear/swap paradigm for more code reuse

Note: fixed similar issue with copy/reuse constructor
2020-10-01 11:35:59 +02:00
Mark Olesen
56c9134ccc ENH: add identity(IntRange) and Istream operator for common types
- provides consistency with identity(label, label) and looks more
  familiar than using labelRange::labels()

- relocates labelRange IO operators to IntRange

ENH: make sliceRange interators random access

STYLE: scalarRanges::match() instead of predicate operator
2020-10-01 11:35:43 +02:00
mattijs
3b3cffc758 BUG: mapPolyMesh: incorrect addressing. Fixes #1864
Triggered when running e.g. postProcess
2020-09-30 11:44:25 +01:00
Andrew Heather
27e71c2d9e Merge branch 'Pstream-ranges' into 'develop'
Pstream ranges

See merge request Development/openfoam!382
2020-09-29 10:16:37 +01:00
Mark Olesen
5dc5ea928a ENH: add UPstream::subProcs() static method
- returns a range of `int` values that can be iterated across.
  For example,

      for (const int proci : Pstream::subProcs()) { ... }

  instead of

      for
      (
          int proci = Pstream::firstSlave();
          proci <= Pstream::lastSlave();
          ++proci
      )
      {
          ...
      }
2020-09-28 14:26:07 +02:00
Mark Olesen
e18ff114a6 ENH: add UPstream::allProcs() method
- returns a range of `int` values that can be iterated across.
  For example,

      for (const int proci : Pstream::allProcs()) { ... }

  instead of

      for (label proci = 0; proci < Pstream::nProcs(); ++proci) { ... }
2020-09-28 14:25:59 +02:00
Mark Olesen
f8a8728f8f TUT: update movingCone blockMesh to merge points (#1862)
- wedge geometry, so topology merge results in zero-sized faces.
2020-09-28 11:08:32 +02:00
Mark Olesen
aca4f077ac ENH: fanPressure - use fanCurve entry if present
- only use implicit legacy handling if the "fanCurve" entry is missing
  and the "file" entry is present.
2020-09-28 11:08:32 +02:00
Mark Olesen
245ac07312 COMP: add missing include and clone() method to TableFile 2020-09-28 11:08:32 +02:00
Andrew Heather
43b9b63ab0 ENH: fanPressureFvPatchScalarField - updated fanCurve to use a Function1 2020-09-28 11:08:32 +02:00
Mark Olesen
12b68e1151 ENH: replace finiteArea timeVaryingUniformFixedValue with Function1 version
- timeVaryingUniformFixedValue -> uniformFixedValue

- allows a variety of functions (eg, coded, expressions, tables, ...)

- more similarity to finiteVolume patch type

STYLE: remove unused timeVarying... from etc/controlDict
2020-09-28 11:08:30 +02:00
Mark Olesen
bb3660b9a5 ENH: add construct ConstantField with uniform value 2020-09-25 15:30:50 +02:00
Mark Olesen
97be8fc767 ENH: add finer control to the expected expression types
- adds "future-proofing" for derived expression boundary conditions
  by moving potential failure modes into the base class.
2020-09-25 08:45:16 +02:00
Mark Olesen
ea42a7a6d4 ENH: change uniformGradient from Function1 to PatchFunction1 2020-09-25 08:39:57 +02:00