Commit Graph

1291 Commits

Author SHA1 Message Date
Mark Olesen
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
Mark Olesen
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
Mark Olesen
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
Mark Olesen
0a0fee88a0 STYLE: update fileName docs and minor code cleanup 2018-10-16 23:03:38 +02:00
Mark Olesen
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
Mark Olesen
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
Mark Olesen
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
Mark Olesen
8eddcc072a ENH: avoid readScalar, readLabel etc from dictionary (#762, #1033)
- use the dictionary 'get' methods instead of readScalar for
  additional checking

     Unchecked:  readScalar(dict.lookup("key"));
     Checked:    dict.get<scalar>("key");

- In templated classes that also inherit from a dictionary, an additional
  'template' keyword will be required. Eg,

     this->coeffsDict().template get<scalar>("key");

  For this common use case, the predefined getXXX shortcuts may be
  useful. Eg,

     this->coeffsDict().getScalar("key");
2018-10-12 08:14:47 +02:00
Mattijs Janssens
fdf19d67a4 Merge branch 'feature-coordinateSystem' into 'develop'
coordinate system improvements

See merge request Development/OpenFOAM-plus!211
2018-10-11 16:32:03 +01:00
Mark Olesen
a77ab5d4eb STYLE: relocate distributed flag into ParRunControl
- adjust member order in TimePaths to better packing
2018-10-11 09:12:01 +02:00
Mark Olesen
f7c85b034b STYLE: clearer handling of argList -case internals (issue #1037) 2018-10-11 08:32:43 +02:00
Mark Olesen
2cd2732fed ENH: avoid change when setting UPtrList twice (issue #1035)
UPtrList::set(const label i, T* ptr);

No-op if the new pointer value is identical to the current content.
This avoid memory management issues.
2018-10-09 08:27:50 +02:00
Mark Olesen
3b77493abc ENH: wordRes matcher method that distinguishes literal vs. regex
- useful for customizing the behaviour of white/black lists depending
  on the type of the match.
2018-10-07 18:30:33 +02:00
Mark Olesen
501326b27a ENH: additional constructor and methods for regionProperties
- can now construct with READ_IF_PRESENT and use count() to determine
  if it was loaded. names() and sortedNames() for a collected overview.
2018-10-01 16:01:02 +02:00
Mark Olesen
8548009eee ENH: generalize instant to be templated, movable, etc
- allows reuse for other purposes
2018-10-03 14:05:45 +02:00
Mark Olesen
6c91048e8b ENH: fileName hasPath(), removePath() methods
- improved move constructors/assignments for fileName, string, etc
2018-10-03 14:05:45 +02:00
Mark Olesen
6697bb4735 ENH: improve, simplify, rationalize coordinate system handling (issue #863)
Previously the coordinate system functionality was split between
coordinateSystem and coordinateRotation. The coordinateRotation stored
the rotation tensor and handled all tensor transformations.

The functionality has now been revised and consolidated into the
coordinateSystem classes. The sole purpose of coordinateRotation
is now just to provide a selectable mechanism of how to define the
rotation tensor (eg, axis-angle, euler angles, local axes) for user
input, but after providing the appropriate rotation tensor it has
no further influence on the transformations.

--

The coordinateSystem class now contains an origin and a base rotation
tensor directly and various transformation methods.

  - The origin represents the "shift" for a local coordinate system.

  - The base rotation tensor represents the "tilt" or orientation
    of the local coordinate system in general (eg, for mapping
    positions), but may require position-dependent tensors when
    transforming vectors and tensors.

For some coordinate systems (currently the cylindrical coordinate system),
the rotation tensor required for rotating a vector or tensor is
position-dependent.

The new coordinateSystem and its derivates (cartesian, cylindrical,
indirect) now provide a uniform() method to define if the rotation
tensor is position dependent/independent.

The coordinateSystem transform and invTransform methods are now
available in two-parameter forms for obtaining position-dependent
rotation tensors. Eg,

      ... = cs.transform(globalPt, someVector);

In some cases it can be useful to use query uniform() to avoid
storage of redundant values.

      if (cs.uniform())
      {
          vector xx = cs.transform(someVector);
      }
      else
      {
          List<vector> xx = cs.transform(manyPoints, someVector);
      }

Support transform/invTransform for common data types:
   (scalar, vector, sphericalTensor, symmTensor, tensor).

====================
  Breaking Changes
====================

- These changes to coordinate systems and rotations may represent
  a breaking change for existing user coding.

- Relocating the rotation tensor into coordinateSystem itself means
  that the coordinate system 'R()' method now returns the rotation
  directly instead of the coordinateRotation. The method name 'R()'
  was chosen for consistency with other low-level entities (eg,
  quaternion).

  The following changes will be needed in coding:

      Old:  tensor rot = cs.R().R();
      New:  tensor rot = cs.R();

      Old:  cs.R().transform(...);
      New:  cs.transform(...);

  Accessing the runTime selectable coordinateRotation
  has moved to the rotation() method:

      Old:  Info<< "Rotation input: " << cs.R() << nl;
      New:  Info<< "Rotation input: " << cs.rotation() << nl;

- Naming consistency changes may also cause code to break.

      Old:  transformVector()
      New:  transformPrincipal()

  The old method name transformTensor() now simply becomes transform().

====================
  New methods
====================

For operations requiring caching of the coordinate rotations, the
'R()' method can be used with multiple input points:

       tensorField rots(cs.R(somePoints));

   and later

       Foam::transformList(rots, someVectors);

The rotation() method can also be used to change the rotation tensor
via a new coordinateRotation definition (issue #879).

The new methods transformPoint/invTransformPoint provide
transformations with an origin offset using Cartesian for both local
and global points. These can be used to determine the local position
based on the origin/rotation without interpreting it as a r-theta-z
value, for example.

================
  Input format
================

- Streamline dictionary input requirements

  * The default type is cartesian.
  * The default rotation type is the commonly used axes rotation
    specification (with e1/e2/3), which is assumed if the 'rotation'
    sub-dictionary does not exist.

    Example,

    Compact specification:

        coordinateSystem
        {
            origin  (0 0 0);
            e2      (0 1 0);
            e3      (0.5 0 0.866025);
        }

    Full specification (also accepts the longer 'coordinateRotation'
    sub-dictionary name):

        coordinateSystem
        {
            type    cartesian;
            origin  (0 0 0);

            rotation
            {
                type    axes;
                e2      (0 1 0);
                e3      (0.5 0 0.866025);
            }
        }

   This simplifies the input for many cases.

- Additional rotation specification 'none' (an identity rotation):

      coordinateSystem
      {
          origin  (0 0 0);
          rotation { type none; }
      }

- Additional rotation specification 'axisAngle', which is similar
  to the -rotate-angle option for transforming points (issue #660).
  For some cases this can be more intuitive.

  For example,

      rotation
      {
          type    axisAngle;
          axis    (0 1 0);
          angle   30;
      }
  vs.
      rotation
      {
          type    axes;
          e2      (0 1 0);
          e3      (0.5 0 0.866025);
      }

- shorter names (or older longer names) for the coordinate rotation
  specification.

     euler         EulerRotation
     starcd        STARCDRotation
     axes          axesRotation

================
  Coding Style
================
- use Foam::coordSystem namespace for categories of coordinate systems
  (cartesian, cylindrical, indirect). This reduces potential name
  clashes and makes a clearer declaration. Eg,

      coordSystem::cartesian csys_;

  The older names (eg, cartesianCS, etc) remain available via typedefs.

- added coordinateRotations namespace for better organization and
  reduce potential name clashes.
2018-10-01 13:54:10 +02:00
Mark Olesen
7d88075842 ENH: dictionary lookup with detection of zero tokens (#1033)
- the opposite problem from issue #762. Now we also test if the input
  token stream had any tokens at all.

- called by the dictionary get<> and readEntry() methods.
2018-10-05 09:56:17 +02:00
Mark Olesen
4a61042f3f ENH: add column access and other methods for Tensor
- Can now retrieve or set a column/row of a tensor.
  Either compile-time or run-time checks.

  Get
     t.col<1>();   t.col(1);
     t.row<1>();   t.row(1);

  Set
     t.col<1>(vec);   t.col(1,vec);
     t.row<1>(vec);   t.row(1,vec);

  The templated versions are compile-time checked

     t.col<3>();
     t.col<3>(vec);

  The parameter versions are run-time checked

     t.col(3);
     t.col(3,vec);

ENH: provide named access to tensor/tensor inner product as inner()
2018-09-28 11:20:31 +02:00
Mark Olesen
64c3e484bb STYLE: add nBoundaryFaces() method to primitiveMesh
- nBoundaryFaces() is often used and is identical to
  (nFaces() - nInternalFaces()).

- forward the mesh nInternalFaces() and nBoundaryFaces() to
  polyBoundaryMesh as nFaces() and start() respectively,
  for use when operating on a polyBoundaryMesh.

STYLE:

- use identity() function with starting offset when creating boundary maps.

     labelList map
     (
         identity(mesh.nBoundaryFaces(), mesh.nInternalFaces())
     );

  vs.

     labelList map(mesh.nBoundaryFaces());
     forAll(map, i)
     {
         map[i] = mesh.nInternalFaces() + i;
     }
2018-09-27 10:17:30 +02:00
Mark Olesen
12c903bba8 ENH: define nameOp<>, typeOp<>, sizeOp<> functors (issue #1013) 2018-09-19 15:32:04 +02:00
Andrew Heather
d3812b9b69 Merge remote-tracking branch 'origin/master' into develop 2018-08-29 13:51:40 +01:00
Will Bainbridge
5e7a766159 BUG: cubicEqn, quadraticEqn: Correction to repeated roots
Also extended the cubic equation test routine and modified the error
methods so that they more accurately generate the round of error of
evaluation.

This resolves bug report https://bugs.openfoam.org/view.php?id=3015
2018-07-24 15:54:32 +01:00
Andrew Heather
6e35bcda70 ENH: Updated config for release v1806 2018-06-28 12:56:00 +01:00
Mark Olesen
be07fc9bbe STYLE: some test apps compiling into wrong location (issue #876) 2018-06-27 10:31:35 +02:00
Mark Olesen
30b4eda7a4 TUT: update some old keywords found in tutorials
- functionObjectLibs -> libs
- redirectType -> name
- change deprecated writeCompression flags types to Switch.

- cleanup some trailing ';;' from some dictionaries
2018-06-26 14:18:52 +02:00
Mark Olesen
62b83a76a4 ENH: face, triFace sign() method analogous to plane
- a quick test for which side of the face a point is located
2018-08-14 10:08:22 +02:00
Mark Olesen
b41d5ed523 STYLE: remove deprecated constraints format from tutorials 2018-07-11 17:02:40 +02:00
Mark Olesen
ae36f5f504 ENH: change argList get<> and getList<> from read<>, readList<>
- more consistent with dictionary method naming. The get<> or
  getList<> returns a value, doesn't read into a existing location.
2018-08-09 11:27:36 +02:00
Mark Olesen
dd9ecd4988 ENH: add missing Hash function for List/UList (issue #966)
- there were previously no hashing mechanisms for lists so they
  would fall back to the definition for primitives and hash the
  memory location of the allocated List object.

- provide a UList::Hash<> sub-class for inheritance, and also a global
  specialization for UList<T>, List<T> such that the hash value for
  List<List<T>> cascades properly.

- provide similar function in triFace to ensure that it remains
  similar in behaviour to face.

- added SymmHash to Pair, for use when order is unimportant.

STYLE: use string::hash() more consistently

- no particular reason to use Hash<word>() which forwards to
  string::hash() anyhow
2018-08-08 23:54:27 +02:00
Mark Olesen
e0f83938ee ENH: ignore -noFunctionObjects option when disabled
- With argList::noFunctionObjects() we use the logic added in
  4b93333292 (issue #352)

  By removing the '-noFunctionObjects' option, we automatically
  suppress the creation of function-objects via Time (with argList
  as a parameter).
  There is generally no need in these cases for an additional

      runTime.functionObjects().off()  statement

  Use the argList::noFunctionObjects() for more direct configuration
  and reduce unnecessary clutter in the -help information.

  In previous versions, the -noFunctionObjects would have been redundant
  anyhow, so we can also just ignore it now instead.
2018-08-08 09:44:28 +02:00
Mark Olesen
822acaf6ef ENH: make indices for boundBox::add() a templated parameter
- allows use with any container with begin(), end() and where the
  "*iterator" dereference returns a label, which is used for indexing
  into the list of points.
  This container could be labelUList, bitSet, labelHashSet, etc
2018-08-07 22:23:16 +02:00
Mark Olesen
0e996431b7 STYLE: relocate STRING_QUOTE macro to macros.H 2018-08-02 16:26:25 +02:00
Mark Olesen
9be9f02a12 ENH: bitSet, PackedList copy construct a subset
Eg,
    processorPolyPatch pp = ...;

    UOPstream toNbr(pp.neighbProcNo(), pBufs);
    toNbr << PackedList<Width>(faceValues, pp.range());
2018-08-01 17:54:53 +02:00
Mark Olesen
80f4ff87dd ENH: allow use of FixedList<label,N> for bitSet construct/set/unset
- allows direct 'hashing' of fixed lists. Eg, triFace
2018-08-01 13:01:43 +02:00
Mark Olesen
35facb8208 ENH: add PackedList::unpack() method
- allows for simpler unpacking of a full list, or list range into any
  sufficiently large integral type.

  For example,
    processorPolyPatch pp = ...;

    UOPstream toNbr(pp.neighbProcNo(), pBufs);
    toNbr << faceValues.unpack<char>(pp.range());
2018-08-01 12:48:35 +02:00
Mark Olesen
215570915e ENH: explicit convert to bool operator for autoPtr
- behaves the same as the valid() method, but can be queried directly
  like a normal raw pointer and as per std::unique_ptr.
  Eg,

      autoPtr<T> ptr = ...

      if (ptr) ...
2018-07-30 14:33:22 +02:00
Bernhard Gschaider
b5f093076b STYLE: add sigFpe test 2018-07-30 12:13:42 +02:00
Mark Olesen
a5e5ba3179 ENH: add bitSet-type of methods for boolList
- test(), get(), set(), unset() with behaviour as per bitSet,
  to allow easier swapping out of boolList <-> bitSet.
2018-07-27 15:51:19 +02:00
Mark Olesen
db9cd2bc85 ENH: add IOobjectList append() method for building larger lists
- supports copy append and move append
2018-07-27 15:38:32 +02:00
Mark Olesen
fe808e24e7 ENH: add rpmToRads() convenience functions
- simplifies conversion of RPM to radians/sec for const variables
2018-07-23 22:20:26 +02:00
mattijs
423ed38986 COMP: rigidBodyDynamics: add Time& argument to make them compile 2018-07-19 18:03:10 +01:00
Mark Olesen
ca2a83d532 Merge remote-tracking branch 'origin/develop' into develop-pre-release 2018-06-20 01:56:41 +02:00
Mark Olesen
8295d398aa BUG: accessing invalid coordinateRotation after move assignment (fixes #884)
- incorrect coordinateSystem clear() after the move

- add Test-coordinateSystem
2018-06-19 21:24:38 +02:00
Mark Olesen
f9fe71815a STYLE: consistent use of '= delete' for removed constructors/assignments
- make the purpose more explicit, and reduces some work for the
  compiler as well.
2018-05-30 12:03:17 +02:00
Mark Olesen
6b6b36afd3 STYLE: revert bitSet/HashSet setMany() to set() method (issue #837)
- improves backward compatibility and more naming consistency.
  Retain setMany(iter1, iter2) to avoid ambiguity with the
  PackedList::set(index, value) method.
2018-05-29 17:38:02 +02:00
Mark Olesen
d318a630b6 ENH: add directive '#sinclude' (or '#includeIfPresent' as long name)
- consistency with make and more succinct.

- reduce code duplication in findEtcFiles.
2018-05-28 13:38:03 +02:00
Mark Olesen
48d654cf19 ENH: avoid memory leaks for HashPtrTable, PtrMap insertion (issue #749)
- disallow insert() of raw pointers, since a failed insertion
  (ie, entry already existed) results in an unmanaged pointer.

  Either insert using an autoPtr, or set() with raw pointers or autoPtr.

- IOobjectList::add() now takes an autoPtr instead of an object reference

- IOobjectList::remove() now returns an autoPtr instead of a raw pointer
2018-05-17 09:56:36 +01:00
Mark Olesen
0ea44eda59 ENH: bitSet::find_first_not() method (issue #751)
- find the position of the first bit off - symmetrical with find_first()
2018-05-02 08:33:49 +02:00
Mark Olesen
dd8341f659 ENH: make format of ExecutionTime = ... output configurable (issue #788)
- controlled by the the 'printExecutionFormat' InfoSwitch in
  etc/controlDict

      // Style for "ExecutionTime = " output
      // - 0 = seconds (with trailing 's')
      // - 1 = day-hh:mm:ss

   ExecutionTime = 112135.2 s  ClockTime = 113017 s

   ExecutionTime = 1-07:08:55.20  ClockTime = 1-07:23:37

- Callable via the new Time::printExecutionTime() method,
  which also helps to reduce clutter in the applications.
  Eg,

     runTime.printExecutionTime(Info);

  vs

     Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
         << "  ClockTime = " << runTime.elapsedClockTime() << " s"
         << nl << endl;

--

ENH: return elapsedClockTime() and clockTimeIncrement as double

- previously returned as time_t, which is less portable.
2018-04-27 15:00:34 +02:00
Mark Olesen
10b69fa2b4 ENH: ListOp::inplaceMapValue using a Map<label> for the mapping.
For example, with some HashTable or Map container of models

    { model0 => 1, model1 => 4, model2 => 5, model3 => 12, model4 => 15, }

specify the remapping

    Map<label> mapper({{1, 3}, {2, 6}, {3, 12}, {5, 8}});

inplaceMapValue(mapper, models) then yields

    { model0 => 3, model1 => 4, model2 => 8, model3 => 12, model4 => 15, }

--

ENH: extend bitSet::count() to optionally count unset bits instead.

--

ENH: BitOps compatibility methods for boolList.

- These ease coding that uses a boolList instead of bitSet and use
  short-circuit logic when possible.

  Eg, when 'bitset' and 'bools' contain the same information

      bitset.count()  <->  BitOps::count(bools)
      bitset.all()    <->  BitOps::all(bools)
      bitset.any()    <->  BitOps::any(bools)
      bitset.none()   <->  BitOps::none(bools)

  These methods can then be used directly in parameters or in logic.
  Eg,

      returnReduce(bitset.any(), orOp<bool>());
      returnReduce(BitOps::any(bools), orOp<bool>());

      if (BitOps::any(bools)) ...
2018-04-27 10:43:32 +02:00
Mark Olesen
c0766ce8ea STYLE: consistent '// End namespace' markers 2018-04-27 09:51:35 +02:00
Andrew Heather
e6787bfa9a Merge branch 'feature-bitset' into 'develop'
ENH: new bitSet class and improved PackedList class (closes #751)

See merge request Development/OpenFOAM-plus!200
2018-04-25 11:39:59 +01:00
Mark Olesen
2fde6c3ab0 ENH: improve handling of mismatched brackets, forgotten ';' (issue #762)
- flags the following type of problems:

  * mismatches:

        keyword  mismatch ( set of { brackets ) in the } entry;

  * underflow (too many closing brackets:

        keyword  too many ( set of ) brackets ) in ) entry;

- a missing semi-colon

        dict
        {
           keyword  entry with missing semi-colon
        }

  will be flagged as 'underflow', since it parses through the '}' but
  did not open with it.

Max monitoring depth is 60 levels of nesting, to avoid incurring any
memory allocation.
2018-04-25 09:55:00 +02:00
Mark Olesen
672f0574e2 COMP: resolve signed/unsigned long ambiguity on Darwin 2018-04-24 13:17:22 +02:00
Andrew Heather
a230e8d408 STYLE: Correcting typos 2018-03-28 17:14:16 +01:00
Mark Olesen
ea71484efa ENH: add alternative STL ASCII parsers
- In addition to the traditional Flex-based parser, added a Ragel-based
  parser and a handwritten one.

  Some representative timings for reading 5874387 points (1958129 tris):

      Flex   Ragel   Manual
      5.2s   4.8s    6.7s         total reading time
      3.8s   3.4s    5.3s         without point merging
2018-04-16 10:20:45 +02:00
Mark Olesen
a8da75d27e STYLE: support wordRe ICASE enum
- better naming consistency with std::regex_constants::icase

- deprecate older NOCASE, but leave supported
2018-04-13 10:42:42 +02:00
Mark Olesen
5f88e4271e ENH: allow "<case>", "<system>" ... in the string expansions (issue #792)
- the expansions were previously required as slash to follow, but
  now either are possible.

    "<case>", "<case>/" both yield the same as "$FOAM_CASE" and
    will not have a trailing slash in the result. The expansion of
    "$FOAM_CASE/" will however have a trailing slash.

- adjust additional files using these expansions
2018-04-11 23:10:49 +02:00
Mark Olesen
fc5895f1df STYLE: rename toLabel, toLabelRange classes -> labelOp, labelRangeOp
- make purpose as functors _slightly_ clearer.

- base definition removed for stricter enforcement of the specialization
  requirement.
2018-04-11 22:48:03 +02:00
Mark Olesen
a9741cea79 ENH: additional text expansion shortcuts (issue #792)
Support the following expansions when they occur at the start of a
string:

    Short-form       Equivalent
    =========       ===========
      <etc>/          ~OpenFOAM/   (as per foamEtcFile)
      <case>/         $FOAM_CASE/
      <constant>/     $FOAM_CASE/constant/
      <system>/       $FOAM_CASE/system/

These can be used in fileName expansions to improve clarity and reduce
some typing

     "<constant>/reactions"   vs  "$FOAM_CASE/constant/reactions"
2018-04-10 13:41:41 +02:00
Mark Olesen
b85d0b5cb7 ENH: provide Rand48 as generator in the expected C++11 form
- this removes an OS-specific dependency (eg, drand48_r is not POSIX)
  and allows easier use of other random number generators.

  The Rand48 generator has identical behaviour and period as the
  lrand48() library routine, but holds its own seed and state
  (which makes it re-entrant) and can be combined with other
  random distributions.

  However, when using the modified form to obtain scalar values
  they will not be identical to what drand48() yields.

  This is because drand48() uses the raw 48-bit values to directly
  set the mantissa of an IEEE double where as the newer distribution
  normalizes based on the 32-bit value.

STYLE: simplify code in Random::shuffle and use Swap
2018-04-09 11:08:34 +02:00
Mark Olesen
2f86cdc712 STYLE: more consistent use of dimensioned Zero
- when constructing dimensioned fields that are to be zero-initialized,
  it is preferrable to use a form such as

      dimensionedScalar(dims, Zero)
      dimensionedVector(dims, Zero)

  rather than

      dimensionedScalar("0", dims, 0)
      dimensionedVector("zero", dims, vector::zero)

  This reduces clutter and also avoids any suggestion that the name of
  the dimensioned quantity has any influence on the field's name.

  An even shorter version is possible. Eg,

      dimensionedScalar(dims)

  but reduces the clarity of meaning.

- NB: UniformDimensionedField is an exception to these style changes
  since it does use the name of the dimensioned type (instead of the
  regIOobject).
2018-03-16 10:24:03 +01:00
Mark Olesen
5d008f7a18 ENH: improvements for PtrList, UPtrList and new PtrDynList container
- improve internal handling to permit deriving resizable containers
  (eg, PtrDynList).

- include '->' iterator dereferencing

- Only append/set non-const autoPtr references. This doesn't break
  existing code, but makes the intention more transparent.
2018-03-22 01:13:38 +01:00
Mark Olesen
6a541ccc92 COMP: avoid attempted auto-vivify with PackedBoolList []
- also ensure fewer side-effects from inplaceReorder

- provide ListOps::reorder especially for PackedList and PackedBoolList
  since they behave differently from regular lists.
2018-03-15 15:20:00 +01:00
Mark Olesen
d17bc72585 ENH: consistency of HashSet setMany(), insertMany() with packed-list version
- this also provides a better separation of the intent
  (ie, inserting a single value, or inserting multiply values)
2018-03-14 21:08:29 +01:00
Mark Olesen
5d1fb23555 ENH: code reduction in PackedList, PackedBoolList (issue #751)
- eliminate iterators from PackedList since they were unused, had
  lower performance than direct access and added unneeded complexity.

- eliminate auto-vivify for the PackedList '[] operator.
  The set() method provides any required auto-vivification and
  removing this ability from the '[]' operator allows for a lower
  when accessing the values. Replaced the previous cascade of iterators
  with simpler reference class.

PackedBoolList:

- (temporarily) eliminate logic and addition operators since
  these contained partially unclear semantics.

- the new test() method tests the value of a single bit position and
  returns a bool without any ambiguity caused by the return type
  (like the get() method), nor the const/non-const access (like
  operator[] has). The name corresponds to what std::bitset uses.

- more consistent use of PackedBoolList test(), set(), unset() methods
  for fewer operation and clearer code. Eg,

      if (list.test(index)) ...    |  if (list[index]) ...
      if (!list.test(index)) ...   |  if (list[index] == 0u) ...
      list.set(index);             |  list[index] = 1u;
      list.unset(index);           |  list[index] = 0u;

- deleted the operator=(const labelUList&) and replaced with a setMany()
  method for more clarity about the intended operation and to avoid any
  potential inadvertent behaviour.
2018-03-13 08:32:40 +01:00
Mark Olesen
23b6ea4b85 ENH: provide iterators for IndirectList, UIndirectList
- consistency with other containers.
  Allows range-for, enables various std algorithms, and can be used
  with ListOp::create() with an iterator range.
2018-03-07 17:50:34 +01:00
Mark Olesen
77338c8bd0 ENH: reduce overhead for clockTime, cpuTime
- clockValue class for managing the clock values only, with a null
  constructor that does not query the system clock (can defer to later).
  Can also be used directly for +/- operations.

- refactor clockTime, cpuTime, clock to reduce storage.
2018-03-15 10:01:51 +01:00
Mark Olesen
fb4c99b698 STYLE: minor cleanup of contiguous (issue #769) 2018-03-14 21:01:44 +01:00
Mark Olesen
bac943e6fc ENH: new bitSet class and improved PackedList class (closes #751)
- The bitSet class replaces the old PackedBoolList class.
  The redesign provides better block-wise access and reduced method
  calls. This helps both in cases where the bitSet may be relatively
  sparse, and in cases where advantage of contiguous operations can be
  made. This makes it easier to work with a bitSet as top-level object.

  In addition to the previously available count() method to determine
  if a bitSet is being used, now have simpler queries:

    - all()  - true if all bits in the addressable range are empty
    - any()  - true if any bits are set at all.
    - none() - true if no bits are set.

  These are faster than count() and allow early termination.

  The new test() method tests the value of a single bit position and
  returns a bool without any ambiguity caused by the return type
  (like the get() method), nor the const/non-const access (like
  operator[] has). The name corresponds to what std::bitset uses.

  The new find_first(), find_last(), find_next() methods provide a faster
  means of searching for bits that are set.

  This can be especially useful when using a bitSet to control an
  conditional:

  OLD (with macro):

      forAll(selected, celli)
      {
          if (selected[celli])
          {
              sumVol += mesh_.cellVolumes()[celli];
          }
      }

  NEW (with const_iterator):

      for (const label celli : selected)
      {
          sumVol += mesh_.cellVolumes()[celli];
      }

      or manually

      for
      (
          label celli = selected.find_first();
          celli != -1;
          celli = selected.find_next()
      )
      {
          sumVol += mesh_.cellVolumes()[celli];
      }

- When marking up contiguous parts of a bitset, an interval can be
  represented more efficiently as a labelRange of start/size.
  For example,

  OLD:

      if (isA<processorPolyPatch>(pp))
      {
          forAll(pp, i)
          {
              ignoreFaces.set(i);
          }
      }

  NEW:

      if (isA<processorPolyPatch>(pp))
      {
          ignoreFaces.set(pp.range());
      }
2018-03-07 11:21:48 +01:00
Mark Olesen
3d608bf06a ENH: remove reliance on the Xfer class (issue #639)
This class is largely a pre-C++11 holdover. It is now possible to
simply use move construct/assignment directly.

In a few rare cases (eg, polyMesh::resetPrimitives) it has been
replaced by an autoPtr.
2018-03-05 13:28:53 +01:00
Mark Olesen
57291e8692 STYLE: use autoPtr::New and tmp::New for simple return types 2018-02-26 14:00:30 +01:00
Mark Olesen
52b36f84b5 ENH: cleanup tmp class (issue #639)
Improve alignment of its behaviour with std::shared_ptr

  - element_type typedef
  - swap, reset methods

* additional reference access methods:

cref()
    returns a const reference, synonymous with operator().
    This provides a more verbose alternative to using the '()' operator
    when that is desired.

        Mnemonic: a const form of 'ref()'

constCast()
    returns a non-const reference, regardless if the underlying object
    itself is a managed pointer or a const object.
    This is similar to ref(), but more permissive.

        Mnemonic: const_cast<>

    Using the constCast() method greatly reduces the amount of typing
    and reading. And since the data type is already defined via the tmp
    template parameter, the type deduction is automatically known.

    Previously,

        const tmp<volScalarField>& tfld;

        const_cast<volScalarField&>(tfld()).rename("name");
        volScalarField& fld = const_cast<volScalarField&>(tfld());

    Now,

        tfld.constCast().rename("name");
        auto& fld = tfld.constCast();

--

BUG: attempts to move tmp value that may still be shared.

- old code simply checked isTmp() to decide if the contents could be
  transfered. However, this means that the content of a shared tmp
  would be removed, leaving other instances without content.

* movable() method checks that for a non-null temporary that is
  unique (not shared).
2018-02-26 12:05:00 +01:00
Mark Olesen
660f3e5492 ENH: cleanup autoPtr class (issue #639)
Improve alignment of its behaviour with std::unique_ptr

  - element_type typedef
  - release() method - identical to ptr() method
  - get() method to get the pointer without checking and without releasing it.
  - operator*() for dereferencing

Method name changes

  - renamed rawPtr() to get()
  - renamed rawRef() to ref(), removed unused const version.

Removed methods/operators

  - assignment from a raw pointer was deleted (was rarely used).
    Can be convenient, but uncontrolled and potentially unsafe.
    Do allow assignment from a literal nullptr though, since this
    can never leak (and also corresponds to the unique_ptr API).

Additional methods

  - clone() method: forwards to the clone() method of the underlying
    data object with argument forwarding.

  - reset(autoPtr&&) as an alternative to operator=(autoPtr&&)

STYLE: avoid implicit conversion from autoPtr to object type in many places

- existing implementation has the following:

     operator const T&() const { return operator*(); }

  which means that the following code works:

       autoPtr<mapPolyMesh> map = ...;
       updateMesh(*map);    // OK: explicit dereferencing
       updateMesh(map());   // OK: explicit dereferencing
       updateMesh(map);     // OK: implicit dereferencing

  for clarity it may preferable to avoid the implicit dereferencing

- prefer operator* to operator() when deferenced a return value
  so it is clearer that a pointer is involve and not a function call
  etc    Eg,   return *meshPtr_;  vs.  return meshPtr_();
2018-02-26 12:00:00 +01:00
Mark Olesen
bcabe827f6 ENH: dedicated HashSetOps, HashTableOps namespaces
- relocated HashSetPlusEqOp and HashTablePlusEqOp to
  HashSetOps::plusEqOp and HashTableOps::plusEqOp, respectively

- additional functions for converting between a labelHashSet
  and a PackedBoolList or List<bool>:

  From lists selections to labelHashSet indices:

      HashSetOps::used(const PackedBoolList&);
      HashSetOps::used(const UList<bool>&);

  From labelHashSet to list forms:

      PackedBoolList bitset(const labelHashSet&);
      List<bool> bools(const labelHashSet&);
2018-03-06 11:41:34 +01:00
Mark Olesen
15f7260884 ENH: cleanup of ListOps, ListListOps. Adjustments to List, PackedList.
- relocated ListAppendEqOp and ListUniqueEqOp to ListOps::appendEqOp
  and ListOps::UniqueEqOp, respectively for better code isolation and
  documentation of purpose.

- relocated setValues to ListOps::setValue() with many more
  alternative selectors possible

- relocated createWithValues to ListOps::createWithValue
  for better code isolation. The default initialization value is itself
  now a default parameter, which allow for less typing.

  Negative indices in the locations to set are now silently ignored,
  which makes it possible to use an oldToNew mapping that includes
  negative indices.

- additional ListOps::createWithValue taking a single position to set,
  available both in copy assign and move assign versions.
  Since a negative index is ignored, it is possible to combine with
  the output of List::find() etc.

STYLE: changes for PackedList

- code simplication in the PackedList iterators, including dropping
  the unused operator() on iterators, which is not available in plain
  list versions either.

- improved sizing for PackedBoolList creation from a labelUList.

ENH: additional List constructors, for handling single element list.

- can assist in reducing constructor ambiguity, but can also helps
  memory optimization when creating a single element list.
  For example,

    labelListList labels(one(), identity(mesh.nFaces()));
2018-03-01 14:12:51 +01:00
Mark Olesen
b4703f4a08 ENH: pre-cleanup of Xfer class (issue #639)
- This class is largely a pre-C++11 holdover, prior to having movable
  references.

- align internals with autoPtr instead of always unconditionally
  allocating memory. The valid() method can be used to check for a null
  pointer.

- Consolidate into a single file, in anticipation of future removal.
2018-03-04 21:38:33 +01:00
Mark Olesen
081783db6c ENH: add Xfer rvalue(), valid() methods
- rvalue() is a (transitional) means of converting Xfer content to a
  reference for move construct, move assign semantics.

- valid() method for consistency with autoPtr and tmp classes
2018-02-28 09:30:31 +01:00
Mark Olesen
25339a5b49 ENH: minor cleanup of the Xfer class
- simplify structure, removed unused constuctors.

- transfer from base objects via '=' assignment removed as being too
  non-transparent

- add New factory method with perfect forwarding.
2018-01-26 15:53:57 +01:00
Mark Olesen
db1c1e89be ENH: avoid xfer on simple data types
- in many places can use move construcors or rely on RVO
2018-01-26 12:50:06 +01:00
Mark Olesen
fa3acc9955 ENH: make CompactListList swapable and move construct/assignable 2018-01-26 12:19:48 +01:00
Mark Olesen
d029f4c5c9 ENH: improved swap/transfer methods for FixedList
- the transfer method was previously a copy

- use std::reverse_iterator adaptors in FixedList
  This greatly reduces the amount of code and now avoids the array-bounds
  warning for FixedList::rend()

- use pointer arithmetic instead of dereferencing the internal array
2018-01-25 18:23:11 +01:00
Mark Olesen
8fc27e0ec8 ENH: make hashedWordList movable 2018-01-25 15:00:25 +01:00
Mark Olesen
915e8c9f35 ENH: remove Foam::Swap specializations for HashSet, HashTable
- without these will use the normal move construct + move assign.
  This is similarly efficient, but avoids the inadvertently having the
  incorrect Swap being used for derived classes.

STYLE: remove unused xfer methods for HashTable, HashSet

- unneeded since move construct and move assignment are possible
2018-01-25 12:13:16 +01:00
Mark Olesen
7ee93afe9e ENH: allow early completion in PackedBoolList::used()
- can stop producing content when the target number of entries has
  been reached.

- change return type to labelList instead an Xfer container.
  This allows return-value-optimization and avoids a surrounding
  allocation. This potentially breaks existing code.

- make PackedList and PackedBoolList moveable. Drop xfer wrappers.
2018-01-25 10:16:23 +01:00
Mark Olesen
2f32b586b5 ENH: PtrList, UPtrList cleanup
- rationalize iterators, reduce code duplication,
  improve assignment behaviour, moveable construct and assignment.
2018-01-09 13:15:50 +01:00
Mark Olesen
cc5f30f25e ENH: several improvements for linked-lists
- support move construct/assignment for linked-lists themselves
  and when moving into a 'normal' list

- better consistency with begin/end signatures and the various
  iterators.

- for indirect linked-lists, provide iterator access to the underlying
  data element address:   iter.get()  vs  &(iter())

- add standard '->' indirection for iterators (as per normal STL
  definitions)
2017-11-27 14:11:25 +01:00
Mark Olesen
ec38e7a408 ENH: prevent conversion of string to regExp in stringListOps (closes #739)
* For most cases, this conversion would be largely unintentional
  and also less efficient. If the regex is desirable, the caller
  should invoke it explicitly.
  For example,

      findStrings(regExp(str), listOfStrings);

  Or use one of the keyType, wordRe, wordRes variants instead.
  If string is to be used as a plain (non-regex) matcher,
  this can be directly invoked

      findMatchingStrings(str, listOfStrings);

  or using the ListOps instead:

      findIndices(listOfStrings, str);

* provide function interfaces for keyType.
2018-02-22 09:28:03 +01:00
Mark Olesen
f959927910 ENH: improve consistency of ListOps and stringListOps
- subsetList, inplaceSubsetList with optional inverted logic.

- use moveable elements where possible.

- allow optional starting offset for the identity global function.
  Eg,  'identity(10, start)' vs 'identity(10) + start'
2018-02-21 12:58:00 +01:00
Mark Olesen
c126464d1c ENH: change wordRes to be a List of wordRe instead of a wrapper (issue #259)
- this permits direct storage of a list with additional matcher
  capabilities

- provide wordRes::matcher class for similar behaviour as previously
2018-02-21 10:05:30 +01:00
Mark Olesen
03b287ed24 COMP: adjust tests to compile with current code base 2018-02-20 17:24:08 +01:00
Mark Olesen
09a6e94073 BUG: incorrect HashTable / HashSet instances
- Eg instead of using labelHashSet, used HashSet<label> which uses
  the string::hash for hashing. Other places inadvertently using the
  string::hash instead of Hash<label> for hashing.

STYLE: use Map<..> instead of HashTable<.., label, Hash<label>>

- reduces clutter
2018-02-09 09:30:02 +01:00
Mark Olesen
806b668418 STYLE: two-parameter Foam::name replaced by word::printf (issue #724)
- reduces some ambiguity and clarifies the expected output and
  behaviour.

STYLE: reduce some automatic conversions of char to string
2018-02-08 12:00:54 +01:00
Mark Olesen
e42c228155 ENH: cleanup List constructors (issue #725)
- add copy construct from UList

- remove copy construct from dissimilar types.

  This templated constructor was too generous in what it accepted.
  For the special cases where a copy constructor is required with
  a change in the data type, now use the createList factory method,
  which accepts a unary operator. Eg,

      auto scalars = scalarList::createList
      (
          labels,
          [](const label& val){ return 1.5*val; }
      );
2018-02-08 08:53:14 +01:00
Mark Olesen
9bd7ea593e ENH: added fileName::relative() method
- this currently just strips off the leading parent directory name

     "/this/path/and/subdirs/name"

     relative("/this/path")  -> "and/subdirs/name"
     relative("/this")       -> "path/and/subdirs/name"
2018-01-23 18:25:55 +01:00
Mark Olesen
39ee5d5079 ENH: add HashTable += operation (combines HashTables)
- adjust return values of HashSet operators.
2018-01-23 16:35:43 +01:00
Mark Olesen
23c9dd716d ENH: coding cleanup for memory streams
- simplify structure.
- protect against nullptr when resetting memory streams
- make UIListStream swappable
- add uiliststream as an example of using a plain std::istream
2018-01-22 09:42:06 +01:00
Mark Olesen
0a5e4cf1b0 ENH: define stdFoam::min(), stdFoam::max() as constexpr as per C++14 2018-01-19 17:13:03 +01:00
Mark Olesen
12aa2d3c30 ENH: SubStrings::str(int) method for similarity with std::smatch
- define regExp::results_type using SubStrings container for handling
  groups. This makes a later shift to std::smatch easier, but changes
  the regExp API for matching with groups. Previously had list element
  0 for regex group 1, now list element 0 is the entire match and list
  element 1 is regex group 1.

  Old:
      List<std::string> mat;
      if (re.match(text, mat))  Info<< "group 1: " << mat[0] << nl;

  New:
      regExp::results_type mat;
      if (re.match(text, mat))  Info<< "group 1: " << mat.str(1) << nl;
2018-01-17 00:15:36 +01:00
Mark Olesen
adbbd0e678 ENH: add argList option ignoring for compatibility upgrades
- can be used to handle when options become redundant, but it is
  undesirable to treat its presence as an error. Can now tag it as
  being ignored.

     argList::ignoreOptionCompat({"oldOption", 1706}, true);
     argList::ignoreOptionCompat({"oldBoolOpttion", 1706}, false);

     command  -oldOption xyz -oldBoolOpttion
2018-01-08 16:25:27 +01:00
Mark Olesen
345a2a42f1 ENH: simplify method names for reading argList options and arguments
- use succincter method names that more closely resemble dictionary
  and HashTable method names. This improves method name consistency
  between classes and also requires less typing effort:

    args.found(optName)        vs.  args.optionFound(optName)
    args.readIfPresent(..)     vs.  args.optionReadIfPresent(..)
    ...
    args.opt<scalar>(optName)  vs.  args.optionRead<scalar>(optName)
    args.read<scalar>(index)   vs.  args.argRead<scalar>(index)

- the older method names forms have been retained for code compatibility,
  but are now deprecated
2018-01-08 15:35:18 +01:00
Mark Olesen
2feb11dbeb ENH: add testing for directory lister class 2018-01-10 15:01:12 +01:00
Mark Olesen
199dc3376c STYLE: missing comma in Test-decomposePar 2018-01-08 11:57:54 +01:00
Mark Olesen
f55a42a835 ENH: improve robustness of scalarRanges from string (fixes #673)
- now avoid Istream and token mechanism in favour of a simpler string
  parser. This makes the code clearer, smaller, robuster.

- provide convenience ge/gt/le/lt static constructors for scalarRange
  for using bounds directly with specifying via a string parameter.

- scalarRange, scalarRanges now follow the unary predicate pattern
  (using an operator() for testing). This allows their reuse in
  other contexts. Eg, for filtering operations:

      myHash.filterValues(scalarRange::ge(100));

- remove unused scalarRanges methods that were specific to handling
  lists of time values. These were superseded by timeSelector methods
  several versions ago.
2018-01-08 09:59:04 +01:00
Mark Olesen
85eb441bea STYLE: add constexpr to PackedList methods 2018-01-04 19:16:15 +01:00
Mark Olesen
995c55b60e CONFIG: add clang third-party lib to LD_LIBRARY_PATH
- required if there is no system openmp and libomp or libgomp are
  only found in the clang hierarchy

STYLE: add some notes in the openmp rules.

- the _OPENMP macro is now used in low-level testing files
2017-12-19 16:07:15 +01:00
Mark Olesen
00325db33b ENH: additional options for transforming points (closes #660)
- The -rotate-angle option allows convenient specification of a
  rotation about an arbitrary axis. Eg, -rotate-angle '((1 1 1) 45)'

- The -origin option can be used to temporarily shift the origin
  for the rotation operations. For example,

      -origin '(0 0 1)' -rotate-angle '((1 0 0) 180)'

  for mirroring.
2017-12-19 11:24:08 +01:00
Mark Olesen
f38ad72ad0 ENH: add argList::optionCount method
- convenience for checking is any/all particular options have been
  specified. Eg,

  if (args.optionCount({"opt1", "opt2", "opt3"}) < 3) ...
2017-12-19 08:20:45 +01:00
mattijs
ddde330884 ENH: overset: new solvers, new stencil 2017-12-08 16:00:02 +00:00
Mark Olesen
7cb5b638ad STYLE: more consistency in handling of -region vs -allRegions 2018-07-19 09:15:33 +02:00
Mark Olesen
8042647610 STYLE: use newer argList access methods 2018-07-19 08:32:18 +02:00
Mark Olesen
71ab8a473d ENH: add normalise methods for vectors and normalised function
- the vector normalise() method modifies the object inplace,
  the normalised function returns a copy.

      vector vec1(1,2,3);
      vec1.normalise();
  vs
      vector vec1(1,2,3);
      vec1 /= mag(vec1) + VSMALL;

  For const usage, can use either of these

      const vector vec2a(normalised(vector(1,2,3)));
      const vector vec2b(vector(1,2,3).normalise());
2018-07-13 11:58:47 +02:00
Andrew Heather
7b8e2b1a18 Merge remote-tracking branch 'origin/master' into develop 2018-07-10 16:42:59 +01:00
Mark Olesen
2662042d49 ENH: improve controls for Time (issue #910)
- relocate some standard functionality to TimePaths to allow a lighter
  means of managing time directories without using the entire Time
  mechanism.

- optional enableLibs for Time construction (default is on)
  and a corresponding argList::noLibs() and "-no-libs" option

STYLE:

- mark Time::outputTime() as deprecated MAY-2016

- use pre-increment for runTime, although there is no difference in
  behaviour or performance.
2018-07-02 10:20:01 +02:00
Mark Olesen
8fc6bd17c9 ENH: improvements in profiling (issue #648)
- include amount of free system memory in profiling, which can give an
  indication of when swapping is about to start

- profilingSummary utility to collect profiling from parallel
  calculations. Collects profiling information from processor
  directories and summarize the time spent and number of calls as (max
  avg min) values.
2017-12-01 15:44:20 +01:00
Mark Olesen
d49929b210 ENH: improvements to stringOps format and split functions
- split now optionally retains empty substrings.
  Added split on fixed field width.

- Foam::name() now formats directly into string buffer, which a
  removes one layer of copying and also avoids using a non-constexpr
  in the temporary.

STYLE: explicit type narrowing on zero-padded output for ensight
2017-11-23 20:17:33 +01:00
Mark Olesen
aa112c3f26 ENH: support option aliases with versioning
- can be used for adjusting option names between versions
2017-11-22 14:42:31 +01:00
Mark Olesen
f2ba618c19 STYLE: consistency in using argList::addArgument, argList::addOption 2017-11-22 12:54:28 +01:00
Mark Olesen
a881204946 ENH: stringOps inplace methods now use a std::string parameter
- this makes them applicable to Foam::string, Foam::word etc

ENH: improvements to CStringList

- add strings() sublist variant which can be useful when handling
  command arguments separately

- add construct from SubStrings.
2017-11-22 08:03:52 +01:00
Mark Olesen
8730a7622a ENH: enumerations for known cell models in cellModel, ptr/ref lookups
- this provides a better typesafe means of locating predefined cell
  models than relying on strings. The lookup is now ptr() or ref()
  directly. The lookup functions behave like on-demand singletons when
  loading "etc/cellModels".

  Functionality is now located entirely in cellModel but a forwarding
  version of cellModeller is provided for API (but not ABI) compatibility
  with older existing user code.

STYLE: use constexpr for cellMatcher constants
2017-11-18 11:05:05 +01:00
Mark Olesen
c7392f7fb0 ENH: additional dictionary compatibility/migration methods
- when dictionary keywords change between versions, the programmer
  can use these compatibility methods to help with migration.

    * csearchCompat, foundCompat, lookupEntryPtrCompat, lookupEntryCompat,
      lookupCompat, lookupOrDefaultCompat, readIfPresentCompat, ...

  They behave like their similarly named base versions, but accept an
  additional list of older keyword names augmented by a version number.
  For example,

      dict.readIfPresentCompat
      (
          "key", {{"olderName", 1612}, {"veryOld", 240}},
          myscalar
      );

   where 1612=OpenFOAM-v1612, 240=OpenFOAM-v2.4.x, etc.
2017-11-08 19:08:10 +01:00
Mark Olesen
8d5f28bcc0 ENH: dictionary add/set methods now return a pointer to the entry
- If the entry could be directly inserted: a pointer to the inserted entry.
- If a dictionary merge was required: a pointer to the dictionary that
  received the entry.
- Return nullptr on any type of insertion failure.

This change is code compatible with existing code since it only alters
a bool return value to be a pointer return value.
2017-11-08 17:43:28 +01:00
Mark Olesen
2ae2783635 ENH: add a test dictionary token streaming class 2017-11-07 13:12:43 +01:00
Mark Olesen
61534989df ENH: simplify primitiveEntry parsing code, move append new tokens
- simplify string output code
2017-11-05 22:07:17 +01:00
Mark Olesen
c4de3e0a4d ENH: enhancements to behaviour of token
- improved memory alignment reduces overhead for Int32 compilation

- added move/swap semantics

- made the type() readonly in favour of setVariant() to allow change
  of variant within a particular storage representation.
  Eg, STRING -> VERBATIMSTRING.
2017-11-05 20:05:28 +01:00
Mark Olesen
e1b71c028c ENH: add move/swap semantics to string types and regExp
- move append() single element to List and DynamicList

ENH: add stringOps::count to avoid unnecessary string conversions
2017-11-05 13:26:10 +01:00
Mark Olesen
cae8a894cd ENH: allow creation of ITstream by parsing string 2017-11-06 09:25:58 +01:00
Mark Olesen
507486194e ENH: improved parallel transfer of strings
- support send/receive with embedded '\0' characters
2017-11-04 15:51:52 +01:00
Mark Olesen
b76d6b5cb5 STYLE: adjust tests for some updates in methods (issue #876) 2018-06-14 17:17:17 +02:00
mattijs
3b6027d1be ENH: test: make test apps compile. Fixes #876. 2018-06-14 15:14:14 +01:00
Mark Olesen
a784afc87d STYLE: floor/truncate instead of rounding for Random::position (issue #865)
- affects random integer ranges.
  Simpler to extend the range by one and floor (truncate) instead of
  rounding using odd intervals.
2018-06-13 12:38:13 +02:00
Mark Olesen
3bcbb1615b ENH: improve uniformity of Random::position<label>() (closes #865)
- start/end values were underrepresented due to rounding.
  Now extend the range to include -0.5 and +0.5 beyond the usual
  range to ensure the same number density.
2018-06-12 08:16:06 +02:00
mattijs
f51ee9a0e2 Merge remote-tracking branch 'origin/develop' into develop-pre-release 2018-05-31 17:34:16 +01:00
mattijs
ec5d9cdf01 Merge remote-tracking branch 'origin/develop' into develop-pre-release 2018-05-29 12:13:58 +01:00
Andrew Heather
ad25e18c7f Merge remote-tracking branch 'origin/develop' into develop-pre-release 2018-05-18 12:18:13 +01:00
Mark Olesen
053a648ee6 ENH: improvements to HashTable internals
- make single-parameter construct (label) explicit
- consolidate iterators
- slightly reduced overhead for some HashSet types
- improved resizing behaviour
- compact output for empty Ptr hashes
2017-10-31 08:46:47 +01:00
Mark Olesen
db552fb751 DEFEATURE: remove StaticHashTable
- unused, unmaintained and slower than the regular HashTable
2017-10-30 21:35:05 +01:00
Mark Olesen
930d6dcaf2 ENH: dummy I/O for nullObject, additional null subclass for zero/one
- the zero::null and one::null sub-classes add an additional null
  output adapter.

  The function of the nil class (special-purpose class only used for
  HashSet) is now taken by zero::null.
2017-10-31 10:54:17 +01:00
Mark Olesen
cd46cb7041 ENH: consistent reverse iterator definitions for UList and FixedList
- consistent with C++ STL conventions, the reverse iterators should
  use operator++ to transit the list from rbegin() to rend().

  The previous implementation used raw pointers, which meant that they
  had the opposite behaviour: operator-- to transit from rbegin() to
  rend().

  The updated version only has operator++ defined, thus the compiler
  should catch any possible instances where people were using the old
  (incorrect) versions.

- updated forAllReverseIters() and forAllConstReverseIters() macros to
  be consistent with new implementation and with C++ STL conventions.
2017-10-29 20:57:43 +01:00
Mark Olesen
d6b32094e1 ENH: add reverse iteration macros
- forAllReverseIters and forAllReverseConstIters macros
- stdFoam::rbegin(), stdFoam::rend()
  stdFoam::crbegin(), stdFoam::crend()
2017-10-29 16:02:19 +01:00
Mark Olesen
4e48beffd4 ENH: support "one-shot" changes to the dictionary inputMode (issue #429)
- Instead of relying on #inputMode to effect a global change it is now
  possible (and recommended) to a temporary change in the inputMode
  for the following entry.

     #default   : provide default value if entry is not already defined
     #overwrite : silently remove a previously existing entry
     #warn      : warn about duplicate entries
     #error     : error if any duplicate entries occur
     #merge     : merge sub-dictionaries when possible (the default mode)

  This is generally less cumbersome than the switching the global
  inputMode. For example to provide a set of fallback values.

      #includeIfPresent "user-files"
      ...
      #default value uniform 10;

  vs.

      #includeIfPresent "user-files"
      #inputMode protect
      ...
      value uniform 10;
      #inputMode merge    // _Assuming_ we actually had this before

  These directives can also be used to suppress the normal dictionary
  merge semantics:

     #overwrite dict { entry val; ... }
2017-07-29 17:44:22 +02:00
Mark Olesen
2fdc6b161a ENH: support full-scoping for keywords as lvalue (issue #429)
- patterns only supported for the final element.

  To create an element as a pattern instead of a word, an embedded
  string quote (single or double) is used for that element.
  Any of the following examples:

      "/top/sub/dict/'(p|U).*"     100;
      "/top/sub/dict/'(p|U).*'"    100;
      "/top/sub/dict/\"(p|U).*"    100;
      "/top/sub/dict/\"(p|U).*\""  100;

  are equivalent to the longer form:

      top
      {
          sub
          {
              dict
              {
                  "(p|U).*"     100;
              }
          }
      }

  It is not currently possible to auto-vivify intermediate
  dictionaries with patterns.

    NOK   "/nonexistent.*/value"   100;
    OK    "/existing.*/value"      100;

- full scoping also works for the #remove directive

        #remove "/dict1/subdict2/entry1"
2017-07-20 10:58:05 +02:00
Will Bainbridge
fe595af8c6 ENH: rigidBodyModelState: Added time value member
The absolute value of the the time has been added to the rigid body
model state. This value is not directly necessary for calculating the
evolution of the rigid body system, it just facilitates the
implementation of sub-models which are in some way time-dependent.
2017-12-13 11:59:46 +00:00
Mark Olesen
7d7b0bfe84 STYLE: use list methods find/found instead of findIndex function 2017-10-24 19:07:34 +02:00
Mark Olesen
0a62fd2f87 ENH: allow passing of comparator to sortToc methods
- this increases the flexibility of the interface

- Add stringOps 'natural' string sorting comparison.
  Digits are sorted in their natural order, which means that
      (file10.txt file05.txt file2.txt)
  are sorted as
      (file2.txt file05.txt file10.txt)

STYLE: consistent naming of template parameters for comparators

  - Compare for normal binary predicates
  - ListComparePredicate for list compare binary predicates
2017-10-27 14:28:00 +02:00
Mark Olesen
8ec64d8128 STYLE: compilation of some unit tests 2017-10-26 23:59:18 +02:00
Mark Olesen
16e75d8475 ENH: add fileName::validate static method (issue #628)
- similar to word::validate to allow stripping of invalid characters
  without triggering a FatalError.

- use this validated fileName in Foam::readDir to avoid problems when
  a directory contains files with invalid characters in their names

- adjust rmDir to handle filenames with invalid characters

- fileName::equals() static method to compare strings while ignoring
  any differences that are solely due to duplicate slashes
2017-10-26 21:23:24 +02:00
Mark Olesen
2bd2f83f6e ENH: cleanup and rationalize memory-backed streams
- more consistent naming:
  * Versions that hold and manage their own memory:
      IListStream, OListStream

  * Versions that reference a fixed size external memory:
      UIListStream, UOListStream

- use List storage instead of DynamicList within OListStream.
  Avoids duplicate bookkeeping, more direct handling of resizing.
2017-10-26 12:09:47 +02:00
Mark Olesen
c1c4e91ffb ENH: handle underflow (rounding) of float/double as zero (issue #625)
- The problem occurs when using atof to parse values such as "1e-39"
  since this is out of range for a float and _can_ set errno to
  ERANGE.

  Similar to parsing of integers, now parse with the longest floating
  point representation "long double" via strtold (guaranteed to be
  part of C++11) and verify against the respective VGREAT values for
  overflow. Treat anything smaller than VSMALL to be zero.
2017-10-25 20:55:37 +02:00
Mark Olesen
88bb403fe0 ENH: new stream output: OListStream
- an output stream to a DynamicList
2017-10-24 11:59:11 +02:00
Mark Olesen
7e8217fd17 ENH: include memory streams
- these provide a similar functionality to string-streams, but operate
  on a externally provided memory buffer which can be used to reduce
  the amount of copying.

- classes were previously staged as part of the ADIOS community
  repository.
2017-10-23 12:06:59 +02:00
Mark Olesen
af5f857618 ENH: add reset() method to IStringStream
- for convenience and symmetry with OStringStream

STYLE: void return value for stream rewind() methods

- this makes it easier to design bidirectional streams
2017-10-23 07:50:12 +02:00
Mark Olesen
74f667a85b ENH: additional low-level raw binary output for Ostream.
- low-level beginRaw(), writeRaw(), endRaw() methods.
  These can be used to directly add '()' decorators for serial output
  or prepare/cleanup parallel buffers.
  Used, for example, when outputting indirect lists in binary to avoid.
2017-10-20 10:26:55 +02:00
Mark Olesen
3cbf399470 BUG: failed swap/transfer for DynamicList with different sizing parameters
- now use public functions instead of direct access of private 'capacity_'
  information
2017-10-24 10:29:09 +02:00
Mark Olesen
e1167d9592 ENH: provide openmp compile and link flags.
- the USE_OMP preprocessor symbol is also defined with the openmp
  compile flag to allow conditional compilation of openmp-specific
  code.
2017-10-23 09:38:43 +02:00
Mark Olesen
b29f2a61b6 BUG: missing parallel-aware for metis-like decomposition 2017-10-13 12:45:28 +02:00
Mark Olesen
f116217466 STYLE: remove FULLDEBUG output on readLabel, readScalar
- used in various places to test if the input can be parsed as a
  label/scalar, so warnings tend to flood the output.

- be more explicit when encountering range errors
2017-10-12 12:15:56 +02:00
Mark Olesen
5f98600b53 COMP: handle kahip .so version, and openmp dependency 2017-10-11 18:41:28 +02:00
Andrew Heather
c60627686a Merge branch 'feature-kahip-decompose' into 'develop'
add support for KaHIP decomposition

See merge request Development/OpenFOAM-plus!154
2017-10-11 16:36:48 +01:00
Mark Olesen
e9254eee58 ENH: support KaHIP decomposition
- refactor some common metis-like elements into the metisLikeDecomp
  abstract class.
2017-10-09 21:00:34 +02:00
Mark Olesen
4ba4899660 ENH: minor update of PackedList methods
- additional convenience constructors
2017-10-07 16:10:35 +02:00
Mark Olesen
049617d037 ENH: update List and DynamicList methods (issue #595)
- improve functional compatibility with DynList (remove methods)
  * eg, remove an element from any position in a DynamicList
  * reduce the number of template parameters
  * remove/subset regions of DynamicList

- propagate Swap template specializations for lists, hashtables

- move construct/assignment to various containers.

- add find/found methods for FixedList and UList for a more succinct
  (and clearer?) usage than the equivalent global findIndex() function.

- simplify List_FOR_ALL loops
2017-09-20 17:20:54 +02:00
Sergio Ferraris
e8ec236cdf Merge branch 'feature-string-parsing' into 'develop'
improve consistency in parsing primitives from strings

See merge request !146
2017-09-25 18:28:47 +01:00
Mark Olesen
610854af03 STYLE: minor cleanup after merge 2017-09-22 16:25:17 +02:00
Mark Olesen
66104f2569 ENH: improve input stringency for argList options
Previously:

  - bad command-line input such as -label 1234xyz would parse as a
    label (with value 1234) and the trailing junk would be silently
    ignored. This may or may not be appropriate. If the trailing junk
    looked like this '100E' or '1000E-' (ie, forgot to type the
    exponent), the incorrectly parsed values can be quite bad:

        label  = 32684
        scalar = 6.93556e-310

Now:

  - use the updated readLabel/readScalar routines that trigger a
    FatalIOError on bad input:

        --> FOAM FATAL IO ERROR:
        Trailing content found parsing '1234xyz'

        --> FOAM FATAL IO ERROR:
        Trailing content found parsing '100E'

   This traps erroneous command-line input immediately.
2017-09-21 16:53:46 +02:00
Mark Olesen
accebc74ee ENH: improve consistency in parsing primitives from strings (issue #590)
- Any trailing whitespace when parsing from strings or character buffers
  is ignored rather than being treated as an error. This is consistent
  with behaviour when reading from an Istream and with leading whitespace
  being ignored in the underlying atof/atod, strtof/strtod... functions.

- Allow parsing directly from a std::string instead of just from a 'char*'.
  This reflects the C++11 addition of std::stod to complement the C
  functions strtod. This also makes it easier to parse string directly
  without using an IStringStream.

- Two-parameter parsing methods return success/failure.
  Eg,

      if (readInt32(str, &int32Val)) ...

- One-parameter parsing methods return the value on success or
  emit a FatalIOError.
  Eg,

      const char* buf;
      int32Val = readInt32(buf, &);

- Improved consistency when parsing unsigned ints.
  Use strtoimax and strtoumax throughout.

- Rename readDoubleScalar -> readDouble, readFloatScalar -> readFloat.
  Using the primitive name directly instead of the Foam typedef for
  better consistency with readInt32 etc.

- Clean/improve parseNasScalar.
  Handle normal numbers directly, reduce some operations.
2017-09-18 10:47:07 +02:00
Andrew Heather
d8d6030ab6 INT: Integration of Mattijs' collocated parallel IO additions
Original commit message:
------------------------

Parallel IO: New collated file format

When an OpenFOAM simulation runs in parallel, the data for decomposed fields and
mesh(es) has historically been stored in multiple files within separate
directories for each processor.  Processor directories are named 'processorN',
where N is the processor number.

This commit introduces an alternative "collated" file format where the data for
each decomposed field (and mesh) is collated into a single file, which is
written and read on the master processor.  The files are stored in a single
directory named 'processors'.

The new format produces significantly fewer files - one per field, instead of N
per field.  For large parallel cases, this avoids the restriction on the number
of open files imposed by the operating system limits.

The file writing can be threaded allowing the simulation to continue running
while the data is being written to file.  NFS (Network File System) is not
needed when using the the collated format and additionally, there is an option
to run without NFS with the original uncollated approach, known as
"masterUncollated".

The controls for the file handling are in the OptimisationSwitches of
etc/controlDict:

OptimisationSwitches
{
    ...

    //- Parallel IO file handler
    //  uncollated (default), collated or masterUncollated
    fileHandler uncollated;

    //- collated: thread buffer size for queued file writes.
    //  If set to 0 or not sufficient for the file size threading is not used.
    //  Default: 2e9
    maxThreadFileBufferSize 2e9;

    //- masterUncollated: non-blocking buffer size.
    //  If the file exceeds this buffer size scheduled transfer is used.
    //  Default: 2e9
    maxMasterFileBufferSize 2e9;
}

When using the collated file handling, memory is allocated for the data in the
thread.  maxThreadFileBufferSize sets the maximum size of memory in bytes that
is allocated.  If the data exceeds this size, the write does not use threading.

When using the masterUncollated file handling, non-blocking MPI communication
requires a sufficiently large memory buffer on the master node.
maxMasterFileBufferSize sets the maximum size in bytes of the buffer.  If the
data exceeds this size, the system uses scheduled communication.

The installation defaults for the fileHandler choice, maxThreadFileBufferSize
and maxMasterFileBufferSize (set in etc/controlDict) can be over-ridden within
the case controlDict file, like other parameters.  Additionally the fileHandler
can be set by:
- the "-fileHandler" command line argument;
- a FOAM_FILEHANDLER environment variable.

A foamFormatConvert utility allows users to convert files between the collated
and uncollated formats, e.g.
    mpirun -np 2 foamFormatConvert -parallel -fileHandler uncollated

An example case demonstrating the file handling methods is provided in:
$FOAM_TUTORIALS/IO/fileHandling

The work was undertaken by Mattijs Janssens, in collaboration with Henry Weller.
2017-07-07 11:39:56 +01:00
Will Bainbridge
62e3d37324 primitiveShapes: Generalised tetrahedron and triangle cutting. Cuts are
now possible with level-sets as well as planes. Removed tetPoints class
as this wasn't really used anywhere except for the old tet-cutting
routines. Restored tetPointRef.H to be consistent with other primitive
shapes. Re-wrote tet-overlap mapping in terms of the new cutting.
2017-05-22 11:40:37 +01:00
Mark Olesen
c59c3af146 STYLE: relocate surfaceMeshConvertTesting to test/ (closes #584)
- relocate as Test-surfaceMeshConvert.
2017-09-11 14:50:51 +02:00
Mark Olesen
139edb2468 ENH: add input surface scaling (issue #514)
- surfaceFeatureExtract
  * dictionary "scale" entry

- triSurface
- triSurfaceLoader
  * optional scaleFactor on reading

- surfaceAdd
- surfaceBooleanFeatures
- surfaceClean
- surfaceCoarsen
  * scale option

- surfaceTransformPoints, transformPoints
  * scale option as scalar or vector quantity
2017-08-14 09:18:15 +02:00
Mark Olesen
fbdd16a293 ENH: add stringOps::splitAny, stringOps::splitSpace
- assists when building simple hand-rolled parsers.
  Also add string::split() taking a sub-string for the delimiter.
2017-08-14 10:36:12 +02:00
Mark Olesen
5da321b6e6 TUT: various blockMeshDict with convertToMeters instead of scale 2017-08-07 20:57:05 +02:00
Mark Olesen
5148e4f860 STYLE: manage dictionary inputMode directly within entry class
- The logic for switching input-mode was previously completely
  encapsulated within the #inputMode directive, but without any
  programming equivalent. Furthermore, the encapsulation in inputMode
  made the logic less clear in other places.

  Exposing the inputMode as an enum with direct access from entry
  simplifies things a fair bit.

- eliminate one level of else/if nesting in entryIO.C for clearer logic

- for dictionary function entries, simply use
  addNamedToMemberFunctionSelectionTable() and avoid defining a type()
  as a static. For most function entries the information is only used
  to get a name for the selection table lookup anyhow.
2017-08-03 07:14:17 +02:00
Mark Olesen
e70fc61660 ENH: consolidate, cleanup some string methods
- consolidate word::validated() into word::validate() and also allow
  as short form for string::validate<word>(). Also less confusing than
  having similarly named methods that essentially do the same thing.

- more consistent const access when iterating over strings

- add valid(char) for keyType and wordRe
2017-08-02 12:33:35 +02:00
Mark Olesen
797155f862 ENH: additional method for switching error throwing on/off (issue #552)
- error::throwExceptions(bool) returning the previous state makes it
  easier to set and restore states.

- throwing() method to query the current handling (if required).

- the normal error::throwExceptions() and error::dontThrowExceptions()
  also return the previous state, to make it easier to restore later.
2017-07-29 12:25:30 +02:00
Mark Olesen
910967c070 ENH: add Foam::SubStrings container and stringOps::split
- generic means of holding ranges of substring iterators
2017-07-20 19:53:57 +02:00
Mark Olesen
72f242405a STYLE: word::validated without underscore prefix by default (issue #518)
- this now appears to be the more common use case.
2017-07-18 14:09:49 +02:00
Mark Olesen
cc290b7c02 ENH: improve dictionary parsing behaviour for ill-formed entries (closes #510)
- mostly associated with forgotten quotes around "(abd|def)" ...

- Address different potential problems:

      (key) { key1   entry1; }
      (key) { key1   entry1; };    // <- Note trailing ';'
      (key) entry2;
2017-07-19 11:00:44 +02:00
Mark Olesen
db376a412d ENH: improved behaviour of input stream rewind (issue #534)
- clear error flags. Special handling for igzstream.
2017-07-18 11:10:51 +02:00
Mark Olesen
b4b50a3aa8 ENH: added OStringStream reset method (closes #534)
- resets the output buffer completely - implementing what rewind was
  likely meant to have accomplished for many use cases.

STYLE: OSHA1stream reset() for symmetry. Deprecate rewind().
2017-07-17 18:32:42 +02:00
Mark Olesen
86ef9e86dc ENH: make treatment of stream allocators more uniform (issue #532)
- use allocator class to wrap the stream pointers instead of passing
  them into ISstream, OSstream and using a dynamic cast to delete
  then. This is especially important if we will have a bidirectional
  stream (can't delete twice!).

STYLE:

- file stream constructors with std::string (C++11)

- for rewind, explicit about in|out direction. This is not currently
  important, but avoids surprises with any future bidirectional access.

- combined string streams in StringStream.H header.
  Similar to <sstream> include that has both input and output string
  streams.
2017-07-17 15:14:38 +02:00
Andrew Heather
b0db30ba2f Merge branch 'feature-externalFileCoupler' into 'develop'
Feature external file coupler

See merge request !126
2017-07-18 11:12:05 +01:00
Mark Olesen
8399277d7d STYLE: eliminate duplicate includes (issue #293) 2017-07-17 14:44:05 +02:00
Mark Olesen
7a408c713b ENH: refactor and combine externalFileCoupler (issue #529) 2017-07-17 12:54:02 +02:00
Mark Olesen
84e47f2d2a ENH: cleanup dictionary code
- use typedefs and new features/methods
- file-scope template to avoid code duplication.
2017-07-06 12:58:04 +02:00
Mark Olesen
e54a930dcc ENH: add mpiBufferSize optimisationSwitch (issue #517)
- allows configuration without an environment variable.
  For compatibility still respect MPI_BUFFER_SIZE env-variable.
2017-07-05 15:52:44 +02:00
Mark Olesen
1bcb454f6d STYLE: hash constructors with power-of-two
- use 1024 instead of 1000 since it will be changed internally to 1024 anyhow.
2017-07-05 10:46:50 +02:00
Andrew Heather
d415bf77bf Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop 2017-06-26 13:33:19 +01:00
Andrew Heather
4abc7a92ed STYLE: Header updates 2017-06-26 11:03:00 +01:00
Mark Olesen
c0b38033ea ENH: integration of lumpedPointMotion
- This provides a mechanism for moving mesh patches based on external
  input (eg, from an external structures solver). The patch points are
  influenced by the position and rotation of the lumped points.

  BC:  lumpedPointDisplacementPointPatchVectorField

  Controlling mechanisms:
  - externalCoupler
    for coordinating the master/slave

  - lumpedPointMovement
    manages the patch-points motion, but also for extracting forces/moments

  - lumpedPointState
    represents the positions/rotations of the controlling points

  Utils:
  - lumpedPointZones
    diagnostic for visualizing the correspondence between controlling
    points and patch faces

  - lumpedPointMovement
    Test that the patch motion is as desired without invoking moveMesh.
    With the -slave option, return items from a precalculated table
    for the lumpedPointDisplacementPointPatchVectorField BC.
2017-06-23 14:43:09 +01:00
Mark Olesen
6ecddbe4a5 STYLE: use #includeEtc in tutorial cases
#includeEtc "caseDicts/setConstraintTypes"
 vs.
    #include "${WM_PROJECT_DIR}/etc/caseDicts/setConstraintTypes"
2017-06-21 16:42:57 +01:00
Mark Olesen
7eec9f0dd6 STYLE: use standardized 0.orig/ for overset tutorials 2017-06-14 14:15:22 +02:00
Mark Olesen
710f23aa35 COMP: hash-table size overflow with 64-bit labels (fixes #498)
- Requires (1L << N) instead of (1 << N), otherwise it overflows
  and the result is zero.
2017-06-14 12:54:38 +02:00
mattijs
fd665b4a3c ENH: overset: Initial release of overset capability.
Adds overset discretisation to selected physics:
- diffusion : overLaplacianDyMFoam
- incompressible steady : overSimpleFoam
- incompressible transient : overPimpleDyMFoam
- compressible transient: overRhoPimpleDyMFoam
- two-phase VOF: overInterDyMFoam

The overset method chosen is a parallel, fully implicit implementation
whereby the interpolation (from donor to acceptor) is inserted as an
adapted discretisation on the donor cells, such that the resulting matrix
can be solved using the standard linear solvers.

Above solvers come with a set of tutorials, showing how to create and set-up
simple simulations from scratch.
2017-06-14 09:51:02 +01:00
Mark Olesen
0e7630feca ENH: improved handling of 'unresolved' surface intersections (issue #450)
- the heuristic for matching unresolved intersections is a relatively
  simple matching scheme that seems to be more robust than attempting to walk
  the geometry or the cuts.

- avoid false positives for self intersection
2017-05-08 14:57:47 +02:00
Mark Olesen
11c5456628 ENH: improvements for surfaceIntersection (issue #450)
- adjust for updates in 'develop'

- change surfaceIntersection constructor to take a dictionary of
  options.

        tolerance      | Edge-length tolerance          | scalar | 1e-3
        allowEdgeHits  | Edge-end cuts another edge     | bool   | true
        avoidDuplicates | Reduce the number of duplicate points    | bool | true
        warnDegenerate | Number of warnings about degenerate edges | label | 0
2017-04-28 08:49:45 +02:00
Mark Olesen
62e7ddccdc ENH: add (C++11) user-literal for degrees to radians conversion
- Programming convenience.
  Eg, cos(45_deg) vs cos(degToRad(45))

STYLE: conversions marked as constexpr and noexcept
2017-05-31 10:16:19 +02:00
Mark Olesen
8afc6cbd86 ENH: Enum class as drop-in alternative for NamedEnum
- the NamedEnum wrapper is somewhate too rigid.
  * All enumerated values are contiguous, starting as zero.
  * The implicit one-to-one mapping precludes using it for aliases.
  * For example, perhaps we want to support alternative lookup names for an
    enumeration, or manage an enumeration lookup for a sub-range.
2017-05-29 13:13:53 +02:00
Mark Olesen
fb4971644f ENH: cleanup of NamedEnum
- Remove the unused enums() method since it delivers wholly unreliable
  results. It is not guaranteed to cover the full enumeration range,
  but only the listed names.

- Remove the unused strings() method.
  Duplicated functionality of the words(), but was never used.

- Change access of words() method from static to object.
  Better code isolation. Permits the constructor to take over
  as the single point of failure for bad input.

- Add values() method

- do not expose internal (HashTable) lookup since it makes it more
  difficult to enforce constness and the implementation detail should
  not be exposed. However leave toc() and sortedToc() for the interface.

STYLE: relocated NamedEnum under primitives (was containers)

- internal typedef as 'value_type' for some consistency with STL conventions
2017-05-29 10:30:55 +02:00
Mark Olesen
dd54aa3018 BUG: non-lazy PackedList (fixes #484)
- The unset() method never auto-vivifies, whereas the set() method
  always auto-vivifies. In the case where set() is called with a zero
  for its argument - eg, set(index, 0) - this should behave
  identically to an unset() and not auto-vivify out-of-range entries.
2017-05-26 21:02:28 +02:00
Mark Olesen
26fef427ed ENH: provide lookupOrDefault for NamedEnum - makes for easier use. 2017-05-26 16:59:20 +02:00
Andrew Heather
e0a5537d3f Merge branch 'feature-oriented-fields' of develop.openfoam.com:Development/OpenFOAM-plus into feature-oriented-fields 2017-05-24 14:22:54 +01:00
mattijs
8255005e19 ENH: mapDistributePolyMesh: new test app 2017-05-18 16:57:22 +01:00
Andrew Heather
db5348880e MRG: resolved merge conflicts from merge from develop branch 2017-05-19 16:29:54 +01:00
Mark Olesen
3814762785 ENH: relocate triSurface classes into surfMesh library (issue #294)
- simplifies organization, includes, linkage etc.
2017-05-18 10:42:05 +02:00
Andrew Heather
2e9bead519 MRG: merged develop line back into integration branch 2017-05-18 11:11:12 +01:00
Andrew Heather
91b90da4f3 Integrated Foundation code to commit 104aac5 2017-05-17 16:35:18 +01:00
Mark Olesen
9761e9d81e ENH: added classes() method to objectRegistry/IOobjectList
- provides a summary hash of classes used and their associated object names.

  The HashTable representation allows us to leverage various HashTable
  methods. This hashed summary view can be useful when querying
  particular aspects, but is most useful when reducing the objects in
  consideration to a particular subset. For example,

      const wordHashSet interestingTypes
      {
          volScalarField::typeName,
          volVectorField::typeName
      };

      IOobjectList objects(runTime, runTime.timeName());
      HashTable<wordHashSet> classes = objects.classes();

      classes.retain(interestingTypes);

      // Or do just the opposite:
      classes.erase(unsupportedTypes);

  Can also use the underlying HashTable filter methods

STYLE: use templated internals to avoid findString() when matching subsets
2017-05-17 10:43:24 +02:00
Mark Olesen
cf889306d0 ENH: added HashTable count, filter and generalized toc methods
- Generalized means over filtering table entries based on their keys,
  values, or both.  Either filter (retain), or optionally prune elements
  that satisfy the specified predicate.

  filterKeys and filterValues:
  - Take a unary predicate with the signature

        bool operator()(const Key& k);

  - filterEntries:
    Takes a binary predicate with the signature

        bool operator()(const Key& k, const T& v);

==

  The predicates can be normal class methods, or provide on-the-fly
  using a C++ lambda. For example,

      wordRes goodFields = ...;
      allFieldNames.filterKeys
      (
          [&goodFields](const word& k){ return goodFields.match(k); }
      );

  Note that all classes that can match a string (eg, regExp, keyType,
  wordRe, wordRes) or that are derived from a Foam::string (eg, fileName,
  word) are provided with a corresponding

      bool operator()(const std::string&)

  that either performs a regular expression or a literal match.
  This allows such objects to be used directly as a unary predicate
  when filtering any string hash keys.

  Note that HashSet and hashedWordList both have the proper
  operator() methods that also allow them to be used as a unary
  predicate.

- Similar predicate selection with the following:
    * tocKeys, tocValues, tocEntries
    * countKeys, countValues, countEntries

  except that instead of pruning, there is a simple logic inversion.
2017-05-17 10:18:14 +02:00
Mark Olesen
8d018e7950 ENH: added constant predicates
- predicates::always and predicates::never returning true and false,
  respectively. These simple classes make it easier when writing
  templated code.

  As well as unary and binary predicate forms, they also contain a
  match(std::string) method for compatibility with regex-based classes.

STYLE: write bool and direction as primitive 'int' not as 'label'.
2017-05-17 10:18:14 +02:00
Mark Olesen
a8d2ebf298 ENH: cleanup wordRe interfaces etc.
- ensure that the string-related classes have consistently similar
  matching methods. Use operator()(const std::string) as an entry
  point for the match() method, which makes it easier to use for
  filters and predicates. In some cases this will also permit using
  a HashSet as a match predicate.

regExp
====
- the set method now returns a bool to signal that the requested
  pattern was compiled.

wordRe
====
- have separate constructors with the compilation option (was previously
  a default parameter). This leaves the single parameter constructor
  explicit, but the two parameter version is now non-explicit, which
  makes it easier to use when building lists.

- renamed compile-option from REGEX (to REGEXP) for consistency with
  with the <regex.h>, <regex> header names etc.

wordRes
====
- renamed from wordReListMatcher -> wordRes. For reduced typing and
  since it behaves as an entity only slightly related to its underlying
  list nature.

- Provide old name as typedef and include for code transition.

- pass through some list methods into wordRes

hashedWordList
====
- hashedWordList[const word& name] now returns a -1 if the name is is
  not found in the list of indices. That has been a pending change
  ever since hashedWordList was generalized out of speciesTable
  (Oct-2010).

- add operator()(const word& name) for easy use as a predicate

STYLE: adjust parameter names in stringListOps

- reflect if the parameter is being used as a primary matcher, or the
  matcher will be derived from the parameter.
  For example,
      (const char* re), which first creates a regExp
      versus (const regExp& matcher) which is used directly.
2017-05-16 23:54:43 +02:00
Mark Olesen
6933bc3021 ENH: HashPtrTable remove/erase now include safeguard against end-iterator
- This makes the following safe:

      auto iter = ptrTable.find(unknownKey);
      ptrTable.erase(iter);

- Unmask HashPtrTable::erase(const Key& key) method
2017-05-15 09:57:25 +02:00
Mark Olesen
4b0d1632b6 BUG: hashtable key_iterator ++ operator returning incorrect type
ENH: ensure std::distance works with hashtable iterators
2017-05-14 16:58:47 +02:00
Mark Olesen
83669e284f ENH: improvements to labelRange const_iterator
- inherit from std::iterator to obtain the full STL typedefs, meaning
  that std::distance works and the following is now possible:

      labelRange range(100, 1500);
      scalarList list(range.begin(), range.end());

  --
  Note that this does not work (mismatched data-types):

      scalarList list = identity(12345);

  But this does, since the *iter promotes label to scalar:

      labelList ident = identity(12345);
      scalarList list(ident.begin(), ident.end());

  It is however more than slightly wasteful to create a labelList
  just for initializing a scalarList. An alternative could be a
  a labelRange for the same purpose.

      labelRange ident = labelRange::identity(12345);
      scalarList list(ident.begin(), ident.end());

  Or this
      scalarList list
      (
          labelRange::null.begin(),
          labelRange::identity(12345).end()
      );
2017-05-14 14:39:17 +02:00
Mark Olesen
0e7b135181 STYLE: adjust const access for linked-list iterators 'operator*'
- provides const/non-const access to the underlying list, but the
  iterator access itself is const.

- provide linked-list iterator 'found()' method for symmetry with
  hash-table iterators. Use nullptr for more clarity.
2017-05-12 12:26:28 +02:00
Mark Olesen
f73b5b629f ENH: added HashTable 'lookup' and 'retain' methods
- lookup(): with a default value (const access)
  For example,
      Map<label> something;
      value = something.lookup(key, -1);

    being equivalent to the following:

      Map<label> something;
      value = -1;  // bad value
      if (something.found(key))
      {
          value = something[key];
      }

    except that lookup also makes it convenient to handle const references.
    Eg,

      const labelList& ids = someHash.lookup(key, labelList());

- For consistency, provide a two parameter HashTable '()' operator.
  The lookup() method is, however, normally preferable when
  const-only access is to be ensured.

- retain(): the counterpart to erase(), it only retains entries
  corresponding to the listed keys.

  For example,
      HashTable<someType> largeCache;
      wordHashSet preserve = ...;

      largeCache.retain(preserve);

    being roughly equivalent to the following two-stage process,
    but with reduced overhead and typing, and fewer potential mistakes.

      HashTable<someType> largeCache;
      wordHashSet preserve = ...;

      {
          wordHashSet cull(largeCache.toc()); // all keys
          cull.erase(preserve);               // except those to preserve
          largeCache.erase(cull);             //
      }

  The HashSet &= operator and retain() are functionally equivalent,
  but retain() also works with dissimilar value types.
2017-05-11 12:25:35 +02:00
Mark Olesen
03d180724b ENH: improve HashTable iterator access and management
- provide key_iterator/const_key_iterator for all hashes,
  reuse directly for HashSet as iterator/const_iterator, respectively.

- additional keys() method for HashTable that returns a wrapped to
  a pair of begin/end const_iterators with additional size/empty
  information that allows these to be used directly by anything else
  expecting things with begin/end/size. Unfortunately does not yet
  work with std::distance().

  Example,
     for (auto& k : labelHashTable.keys())
     {
        ...
     }
2017-05-04 10:17:18 +02:00
Mark Olesen
e105e30bfb STYLE: add edge(labelPair) constructor, debug info etc. 2017-05-04 02:42:50 +02:00
Mark Olesen
f8c58bdd5c ENH: HashSet iterators operator* now return Key.
- much more useful than returning nil. Can now use with a for range:

    for (auto i : myLabelHashSet)
    {
        ...
    }
2017-05-02 01:58:38 +02:00
Mark Olesen
8f75bfbed5 ENH: add HashTable::writeKeys and HashSet::writeList
- can use the hash-set writeList in combination with FlatOutput:

  Eg, flatOutput(myHashSet);
2017-05-02 00:51:04 +02:00
Mark Olesen
c0a50dc621 ENH: improve overall consistency of the HashTable and its iterators
- previously had a mismash of const/non-const attributes on iterators
  that were confused with the attributes of the object being accessed.

- use the iterator keys() and object() methods consistently for all
  internal access of the HashTable iterators. This makes the intention
  clearer, the code easier to maintain, and protects against any
  possible changes in the definition of the operators.

- 'operator*': The standard form expected by STL libraries.
  However, for the std::map, this dereferences to a <key,value> pair,
  whereas OpenFOAM dereferences simply to <value>.

- 'operator()': OpenFOAM treats this like the 'operator*'

- adjusted the values of end() and cend() to reinterpret from nullObject
  instead of returning a static iteratorEnd() object.
  This means that C++ templates can now correctly deduce and match
  the return types from begin() and end() consistently.
  So that range-based now works.

  Eg,
      HashTable<label> table1 = ...;
      for (auto i : table1)
      {
          Info<< i << endl;
      }

  Since the 'operator*' returns hash table values, this prints all the
  values in the table.
2017-05-02 00:15:12 +02:00
Mark Olesen
0298c02b2d ENH: ensure nullObject is large enough for reinterpret
- previously occupied 1 byte. Now occupies enough to hold a pointer,
  which helps if using reinterpret_cast to something that has some
  member content.
2017-05-01 22:39:36 +02:00
Mark Olesen
805b76d4b9 ENH: support UList[labelRange] and SubList construction with labelRange
This uses a concept similar to what std::valarray and std::slice do.
A labelRange provides a convenient container for holding start/size
and lends itself to addressing 'sliced' views of lists.
For safety, the operations and constructors restricts the given input range
to a valid addressible region of the underlying list, while the labelRange
itself precludes negative sizes.

The SubList version is useful for patches or other things that have a
SubList as its parameter. Otherwise the UList [] operator will be the
more natural solution. The slices can be done with a labelRange, or
a {start,size} pair.

Examples,
     labelList list1 = identity(20);

     list1[labelRange(18,10)]  = -1;
     list1[{-20,25}] = -2;
     list1[{1000,5}] = -3;

     const labelList list2 = identity(20);
     list2[{5,10}] = -3;  // ERROR: cannot assign to const!
2017-05-01 14:01:09 +02:00
Mark Olesen
75ef6f4e50 ENH: add labelRange comparison operators and subset methods
- improve interface consistency.
2017-04-30 21:29:24 +02:00
Mark Olesen
7b427c382e ENH: add Tuple2 comparison operators, typedefs 2017-04-30 13:05:49 +02:00
Mark Olesen
c65e2e580d ENH: add some standard templates and macros into stdFoam.H
- some functionality similar to what the standary library <iterator>
  provides.

  * stdFoam::begin() and stdFoam::end() do type deduction,
    which means that many cases it is possible to manage these types
    of changes.

    For example, when managing a number of indices:
       Map<labelHashSet> lookup;

    1) Longhand:

        for
        (
            Map<labelHashSet>::const_iterator iter = lookup.begin();
            iter != lookup.end();
            ++iter
        )
        { .... }

    1b) The same, but wrapped via a macro:

        forAllConstIter(Map<labelHashSet>, lookup, iter)
        { .... }

    2) Using stdFoam begin/end templates directly

        for
        (
            auto iter = stdFoam::begin(lookup);
            iter != stdFoam::end(lookup);
            ++iter
        )
        { .... }

    2b) The same, but wrapped via a macro:

        forAllConstIters(lookup, iter)
        { .... }

Note that in many cases it is possible to simply use a range-based for.
Eg,
     labelList myList;

     for (auto val : myList)
     { ... }

     for (const auto& val : myList)
     { ... }

These however will not work with any of the OpenFOAM hash-tables,
since the standard C++ concept of an iterator would return a key,value
pair when deferencing the *iter.

The deduction methods also exhibits some slightly odd behaviour with
some PtrLists (needs some more investigation).
2017-04-29 22:28:16 +02:00
Mark Olesen
6a5ea9a2bf ENH: improve HashSet construction and assignment
- make construct from UList explicit and provide corresponding
  assignment operator.

- add construct,insert,set,assignment from FixedList.
  This is convenient when dealing with things like edges or triFaces.
2017-04-29 15:19:47 +02:00
Mark Olesen
ded105c539 STYLE: HashTable documentation
- explicitly mention the value-initialized status for the operator().
  This means that the following code will properly use an initialized
  zero.

      HashTable<label> regionCount;

      if (...)
         regionCount("region1")++;

      ... and also this;

      if (regionCount("something") > 0)
      {
          ...
      }

  Note that the OpenFOAM HashTable uses operator[] to provide read and
  write access to *existing* entries and will provoke a FatalError if
  the entry does not exist.

  The operator() provides write access to *existing* entries or will
  create the new entry as required.
  The STL hashes use operator[] for this purpose.
2017-04-29 12:27:11 +02:00
Mark Olesen
1d9b311b82 ENH: further refinement to edge methods
- more hash-like methods.
  Eg, insert/erase via lists, clear(), empty(),...

- minVertex(), maxVertex() to return the smallest/largest label used

- improved documentation, more clarification about where/how negative
  point labels are treated.
2017-04-29 12:14:46 +02:00
Andrew Heather
c9df5f9249 Merge branch 'dict-lookup' into 'develop'
Dict lookup

See merge request !105
2017-05-02 16:37:57 +01:00
Andrew Heather
1a24be6e54 Merge branch 'feature-random-numbers' into 'develop'
Updated random numbers

See merge request !107
2017-04-28 10:11:18 +01:00
Andrew Heather
7f0cc0045d ENH: Random numbers - updated dependent code from change cachedRandom->Random class 2017-04-28 09:15:52 +01:00
Mark Olesen
5514471c15 BUG: FixedList '<' operator using a template parameter (fixes #458)
- cannot use comparison of list sizes. Okay for UList, but not here.

STYLE:
- don't need two iterators for the '<' comparison, can just access
  internal storage directly
2017-04-27 01:30:50 +02:00
Mark Olesen
ffe3e0e425 ENH: allow '^' as anchor for dictionary scoping (issue #429)
- The existing ':' anchor works for rvalue substitutions
  (Eg, ${:subdict.name}), but fails for lvalues, since it is
  a punctuation token and parse stops there.
2017-04-25 11:57:21 +02:00
Mark Olesen
f2304f7c0b ENH: various enhancements for edge.
- support edge-ordering on construction, and additional methods:
  - sort(), sorted(), unitVec(), collapse()

- null constructor initializes with -1, for consistency with face,
  triFace and since it is generally much more useful that way.

- add some methods that allow edges to used somewhat more like hashes.
  - count(), found(), insert(), erase()

  Here is possible way to use that:

      edge someEdge;  // initializes with '-1' for both entries

      if (someEdge.insert(pt1))
      {
         // added a new point label
      }

      ... later

      // unmark point on edge
      someEdge.erase(pt2);

--

STYLE:

- use UList<point> instead of pointField for edge methods for flexibility.

  The pointField include is retained, however, since many other routines
  may be relying on it being included via edge.H
2017-04-23 19:25:35 +02:00
Henry Weller
c085c5df25 Merged the edgeMesh library into the meshTools library 2017-04-21 10:38:53 +01:00
Mark Olesen
f2e3c1c422 ENH: provide HashTable::iterator::found() method
- This can be used as a convenient alternative to comparing against end().
  Eg,

    dictionaryConstructorTable::iterator cstrIter =
        dictionaryConstructorTablePtr_->find(methodType);

    if (cstrIter.found())
    {
        ...
    }
  vs.
    if (cstrIter != dictionaryConstructorTablePtr_->end())
    {
        ...
    }
2017-04-11 09:55:54 +02:00
Mark Olesen
5d15a13247 STYLE: use FOAM_UTILITIES in Make/options
- consistent with use of FOAM_SOLVERS, and reduces reliance on the FOAM_APP
  env variable
2017-04-07 08:17:43 +02:00
Mark Olesen
96fd3c9367 STYLE: consistent use of LIB_SRC in Make/options
- had occasional remnant use of FOAM_SRC
2017-04-06 23:56:23 +02:00
Andrew Heather
fb724ce113 MRG: Integrated Foundation code to commit 9f37c3c 2017-03-31 15:34:28 +01:00
Mark Olesen
836d04ffc1 ENH: various general improvments to the POSIX functions
- ensure proper and sensible handling of empty names.
  Eg, isDir(""), isFile("") are no-ops, and avoid file-stat

- rmDir:
  * optional 'silent' option to suppress messages.
  * removes all possible sub-entries, instead of just giving up on
    the first problem encountered.

- reduced code duplication in etcFiles

ENH: provide WM_USER_RESOURCE_DIRNAME define (in foamVersion.H)

- this is still a hard-coded value, but at least centrally available
2017-03-30 11:45:25 +02:00
Andrew Heather
45381b1085 MRG: Integrated Foundation code to commit 19e602b 2017-03-28 11:30:10 +01:00
Andrew Heather
dcb1a95e35 MRG: Integrated Foundation code to commit 7d6845d 2017-03-23 14:33:33 +00:00
Andrew Heather
436ec1cf1f MRG: Integrated Foundation code to commit ba4dbed 2017-03-23 12:11:49 +00:00
Andrew Heather
04c3d535b0 MRG: Integrated Foundation code to commit 47bd8e1 2017-03-23 10:12:38 +00:00
Will Bainbridge
0be6269add Added robust primitive cubic/quadratic/linear equation solutions.
Applied to eigen-value calculations. Fixed repeated-eigen-value issues
in eigen-vector generation.
2017-03-22 15:11:54 +00:00
Henry Weller
96ad725a0b Updated UPstream::commsTypes to use the C++11 enum class 2017-03-10 19:54:55 +00:00
Mark Olesen
f05be160e2 BUG: dictionary entries not being properly merged/overwritten (closes #418)
STYLE: update dictionary documentation
2017-03-03 11:36:24 +01:00
Mark Olesen
9077098935 ENH: provide string removeStart, removeEnd convenience methods 2017-03-10 11:39:40 +01:00
Mark Olesen
31555346cc Merge remote-tracking branch 'origin/master' into develop 2017-03-10 13:30:39 +01:00
Mark Olesen
215349aa69 BUG: in wordRe::operator=(const keyType&)
- the regex was not being unset on assignment.
- drop unused recompile() method as being dubious
2017-03-10 13:05:35 +01:00
Mark Olesen
3d3c14cbff ENH: add inplaceUniqueSort function
- determines a unique sort order (as per uniqueOrder) and uses that to
  reorder the list and possibly truncate it.
2017-03-08 11:10:16 +01:00
Mark Olesen
b7dc6d0441 ENH: add subsetList/inplaceSubsetList functions with unary predicate
- these are suitable for use with lambda functions.

- Deprecate the unused 3-parameter version of subset/inplaceSubset.

- Deprecate initList and initListList in favour of initializer_list

STYLE: adjust some comments, remove dead code in regionSizeDistribution.C
2017-03-07 17:00:30 +01:00
Henry Weller
d2be645483 thermophysicalProperties: New base-class for liquidProperties and in the future gasProperties
Description
    Base-class for thermophysical properties of solids, liquids and gases
    providing an interface compatible with the templated thermodynamics
    packages.

liquidProperties, solidProperties and thermophysicalFunction libraries have been
combined with the new thermophysicalProperties class into a single
thermophysicalProperties library to simplify compilation and linkage of models,
libraries and applications dependent on these classes.
2017-02-18 21:53:20 +00:00
Henry Weller
c52e4b58a1 thermophysicalModels: Changed specie thermodynamics from mole to mass basis
The fundamental properties provided by the specie class hierarchy were
mole-based, i.e. provide the properties per mole whereas the fundamental
properties provided by the liquidProperties and solidProperties classes are
mass-based, i.e. per unit mass.  This inconsistency made it impossible to
instantiate the thermodynamics packages (rhoThermo, psiThermo) used by the FV
transport solvers on liquidProperties.  In order to combine VoF with film and/or
Lagrangian models it is essential that the physical propertied of the three
representations of the liquid are consistent which means that it is necessary to
instantiate the thermodynamics packages on liquidProperties.  This requires
either liquidProperties to be rewritten mole-based or the specie classes to be
rewritten mass-based.  Given that most of OpenFOAM solvers operate
mass-based (solve for mass-fractions and provide mass-fractions to sub-models it
is more consistent and efficient if the low-level thermodynamics is also
mass-based.

This commit includes all of the changes necessary for all of the thermodynamics
in OpenFOAM to operate mass-based and supports the instantiation of
thermodynamics packages on liquidProperties.

Note that most users, developers and contributors to OpenFOAM will not notice
any difference in the operation of the code except that the confusing

    nMoles     1;

entries in the thermophysicalProperties files are no longer needed or used and
have been removed in this commet.  The only substantial change to the internals
is that species thermodynamics are now "mixed" with mass rather than mole
fractions.  This is more convenient except for defining reaction equilibrium
thermodynamics for which the molar rather than mass composition is usually know.
The consequence of this can be seen in the adiabaticFlameT, equilibriumCO and
equilibriumFlameT utilities in which the species thermodynamics are
pre-multiplied by their molecular mass to effectively convert them to mole-basis
to simplify the definition of the reaction equilibrium thermodynamics, e.g. in
equilibriumCO

    // Reactants (mole-based)
    thermo FUEL(thermoData.subDict(fuelName)); FUEL *= FUEL.W();

    // Oxidant (mole-based)
    thermo O2(thermoData.subDict("O2")); O2 *= O2.W();
    thermo N2(thermoData.subDict("N2")); N2 *= N2.W();

    // Intermediates (mole-based)
    thermo H2(thermoData.subDict("H2")); H2 *= H2.W();

    // Products (mole-based)
    thermo CO2(thermoData.subDict("CO2")); CO2 *= CO2.W();
    thermo H2O(thermoData.subDict("H2O")); H2O *= H2O.W();
    thermo CO(thermoData.subDict("CO")); CO *= CO.W();

    // Product dissociation reactions

    thermo CO2BreakUp
    (
        CO2 == CO + 0.5*O2
    );

    thermo H2OBreakUp
    (
        H2O == H2 + 0.5*O2
    );

Please report any problems with this substantial but necessary rewrite of the
thermodynamic at https://bugs.openfoam.org

Henry G. Weller
CFD Direct Ltd.
2017-02-17 11:22:14 +00:00
Mark Olesen
e3d9084c62 ENH: support ASCII List output on a single-line
- Introduce writeList(Ostream&, label) method in various List classes to
  provide more flexibility and avoid hard-coded limits when deciding if a
  list is too long and should be broken up into multiple lines (ASCII only).

- The old hard-code limit (10) is retained in the operator<< versions

- This functionality is wrapped in the FlatOutput output adapter class
  and directly accessible via the 'flatOutput()' function.

Eg,
    #include "ListOps.H"
    Info<< "methods: " << flatOutput(myLongList) << endl;

    // OR

    Info<< "methods: ";
    myLongList.writeList(os) << endl;
2017-02-10 09:55:37 +01:00
Mark Olesen
9f91084eef ENH: provide word::validated() static method
- Constructs a validated word, in which all invalid characters have
  been stripped out and any leading digit is '_'-prefixed.
  Words with leading digits cause parse issues when read back later.

- Replaces previous functionally identical code from src/conversion

--
COMP: test against nullObject instead of checking address for null pointer.
2017-02-03 15:13:13 +00:00
Mark Olesen
722d23f59c ENH: additional methods/operators for boundBox (related to #196)
- Constructor for bounding box of a single point.

- add(boundBox), add(point) ...
  -> Extend box to enclose the second box or point(s).

  Eg,
      bb.add(pt);
  vs.
      bb.min() = Foam::min(bb.min(), pt);
      bb.max() = Foam::max(bb.max(), pt);

Also works with other bounding boxes.
  Eg,
      bb.add(bb2);
      // OR
      bb += bb2;
  vs.
      bb.min() = Foam::min(bb.min(), bb2.min());
      bb.max() = Foam::max(bb.max(), bb2.max());

'+=' operator allows the reduction to be used in parallel
gather/scatter operations.

A global '+' operator is not currently needed.

Note: may be useful in the future to have a 'clear()' method
that resets to a zero-sized (inverted) box.

STYLE: make many bounding box constructors explicit
2017-01-25 19:26:50 +01:00
Mark Olesen
17d76e6261 ENH: boundBox 'reduce' method (related to #196)
reduce()
- parallel reduction of min/max values.
  Reduces coding for the callers.

  Eg,
      bb.reduce();

  instead of the previous method:
      reduce(bb.min(), minOp<point>());
      reduce(bb.max(), maxOp<point>());

STYLE:

- use initializer list for creating static content
- use point::min/point::max when defining standard boxes
2017-01-25 18:52:37 +01:00
Mark Olesen
de5688e095 ENH: expose HashTable iterator object() methods
- to the referenced object via a method name, which may be clearer
  than deferencing the iterator

     [key, value] =>  iter.key(), *iter
     [key, value] =>  iter.key(), iter()
     [key, value] =>  iter.key(), iter.object()
2017-01-26 18:11:02 +01:00
Mark Olesen
2b9b2dd865 BUG: HashPtrTable has problems with null pointers (issue #395)
- print and copy operations should not be allowed to dereference a
  nullptr.
2017-01-26 18:00:33 +01:00
Henry Weller
8632583934 Removed trailing blank lines
Resolves bug-report https://bugs.openfoam.org/view.php?id=2438
2017-01-19 20:17:47 +00:00
Mark Olesen
a99143506d BUG: not incrementing when reading via singly-linked list 2017-01-24 12:59:13 +01:00
Mark Olesen
7af6fa7b67 ENH: freshen code in labelRange classes
- misc improvements in functionality.
2017-01-23 17:09:26 +01:00
Mark Olesen
934764d700 ENH: optionally eliminate duplicates on hashedWordList construction (issue #375)
- makes it easier to use as a wordHashSet replacement for situations
  where we want to avoid duplicates but retain the input order.

- support construction from HashTable, which means it works like the
  HashTable::sortedToc but with its own hashing for these keys.

- expose rehash() method for the user. There is normally no need for
  using it directly, but also no reason to lock it away as private.
2017-01-10 12:42:40 +01:00
Henry Weller
126125c185 Rationalized the keyword to specify a file name in a dictionary to 'file'
e.g. in tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/T

    hot
    {
        type            externalCoupledTemperature;
        commsDir        "${FOAM_CASE}/comms";
        file            "data";
        initByExternal  yes;
        log             true;
        value           uniform 307.75; // 34.6 degC
    }

Previously both 'file' and 'fileName' were used inconsistently in different
classes and given that there is no confusion or ambiguity introduced by using
the simpler 'file' rather than 'fileName' this change simplifies the use and
maintenance of OpenFOAM.
2017-01-07 09:38:54 +00:00
Andrew Heather
fbeaad7e58 BUG: test-mesh updated to test polyMesh constructor. Fixes #372 2017-01-04 15:59:49 +00:00
Mark Olesen
2b14360662 ENH: additional startsWith(), endsWith() string methods
- As the names describe, check if the string starts or ends with a
  particular value. Always true if the given text is empty or if the
  string is identical to the given text.
2016-12-18 23:21:51 +01:00
Mark Olesen
e379720053 ENH: additional fileName methods
- add an extension to the file name
   - remove a file extension
   - check if a file name has an extension
   - check if a file name has a particular extension (as word),
     or matches a particular grouping of extensions (as wordRe).
2016-12-18 20:40:03 +01:00
Mark Olesen
b08dadff62 ENH: initializer list constructor for fileName
This slightly more convenient when working with char[] input:

     fileName file1{ "path", "name", "to", "file.ext" };
vs.  fileName file1 = fileName(path)/"name"/"to"/"file.ext";

But is a bit more efficient since it avoid most of the intermediate
copying and resizing incurred by the '/' operator.
2016-12-18 20:09:58 +01:00
Andrew Heather
30d8fc3459 ENH: Tutorial updates and clean-up 2016-12-16 13:26:28 +00:00
Mark Olesen
5f9be34a42 Merge branch 'feature-objectRegistry' into 'develop'
ENH: improve objectRegistry functionality (issue #322)

- Recursive searching for objects within a registry is now optional
  (previous it was always done).

  A recursive search effectively blocks the construction of sub-sub-registries
  if their names are 'masked' by some parent level sub-registry with
  the same name! (BUG)

- Recursive search is now turned OFF by default, which makes it consistent
  with dictionary and probably causes the least number of surprises.

----
Various new convenience methods added:

lookupObjectRef()
- returns a non-const reference.
  For example,

      volScalarField& U = mesh().lookupObjectRef<volScalarField>("U");

  Instead of

      volScalarField& U = const_cast<volScalarField&>
      (
          mesh().lookupObject<volScalarField>("U")
      );

--
lookupObjectPtr()
- returns a const pointer, and nullptr on failure.
  For example,

      const volScalarField* Uptr = mesh().lookupObjectPtr<volScalarField>("U");
      if (Uptr)
      {
          const volScalarField& U = *Uptr;
          ...
      }

  Instead of

      if (mesh().foundObject<volScalarField>("U"))
      {
          const volScalarField& U = mesh().lookupObject<volScalarField>("U");
          ...
      }

--
lookupObjectRefPtr()
- returns a non-const pointer, and nullptr on failure.
  For example,

      volScalarField* Uptr = mesh().lookupObjectRefPtr<volScalarField>("U");
      if (Uptr)
      {
          volScalarField& U = *Uptr;  // use as reference
          (*Uptr) = ...;              // or use directly
      }

  Instead of

      if (mesh().foundObject<volScalarField>("U"))
      {
          volScalarField& U = const_cast<volScalarField&>
          (
              mesh().lookupObject<volScalarField>("U")
          );
      }

--
sortedNames()
- now works with template parameters and with regular expression
  matching as well.
  For example,

      wordList names  = mesh().sortedNames();
      wordList fields = mesh().sortedName<volScalarField>();

  Instead of

      wordList names  = mesh().sortedNames();
      wordList fields = mesh().names<volScalarField>();
      Foam::sort(fields);

--

See merge request !83
2016-12-06 10:48:43 +00:00
Mark Olesen
92fa5a1921 ENH: improve objectRegistry functionality (issue #322)
- Recursive searching for objects within a registry is now optional
  (previous it was always done).

  A recursive search effectively blocks the construction of sub-sub-registries
  if their names are 'masked' by some parent level sub-registry with
  the same name! (BUG)

- Recursive search is now turned OFF by default, which makes it consistent
  with dictionary and probably causes the least number of surprises.

----
Various new convenience methods added:

lookupObjectRef()
- returns a non-const reference.
  For example,

      volScalarField& U = mesh().lookupObjectRef<volScalarField>("U");

  Instead of

      volScalarField& U = const_cast<volScalarField&>
      (
          mesh().lookupObject<volScalarField>("U")
      );

--
lookupObjectPtr()
- returns a const pointer, and nullptr on failure.
  For example,

      const volScalarField* Uptr = mesh().lookupObjectPtr<volScalarField>("U");
      if (Uptr)
      {
          const volScalarField& U = *Uptr;
          ...
      }

  Instead of

      if (mesh().foundObject<volScalarField>("U"))
      {
          const volScalarField& U = mesh().lookupObject<volScalarField>("U");
          ...
      }

--
lookupObjectRefPtr()
- returns a non-const pointer, and nullptr on failure.
  For example,

      volScalarField* Uptr = mesh().lookupObjectRefPtr<volScalarField>("U");
      if (Uptr)
      {
          volScalarField& U = *Uptr;  // use as reference
          (*Uptr) = ...;              // or use directly
      }

  Instead of

      if (mesh().foundObject<volScalarField>("U"))
      {
          volScalarField& U = const_cast<volScalarField&>
          (
              mesh().lookupObject<volScalarField>("U")
          );
      }

--
sortedNames()
- now works with template parameters and with regular expression
  matching as well.
  For example,

      wordList names  = mesh().sortedNames();
      wordList fields = mesh().sortedName<volScalarField>();

  Instead of

      wordList names  = mesh().sortedNames();
      wordList fields = mesh().names<volScalarField>();
      Foam::sort(fields);

--
2016-12-01 13:04:07 +01:00
Mark Olesen
8628ddac43 ENH: add Test-objectRegistry (issue #322)
- test clearly shows failure to insert a sub-registry when it has
  the same name as one of the parent sub-registry.
2016-12-01 12:30:38 +01:00
Mark Olesen
8563f892a9 ENH: provide a 'dimensioned' null-like constructor for dimensionedType
- The null constructor already creates a dimensionless Zero,
  but named "undefined".

  Provide an constructor for a dimensioned Zero,
  but named "0" for universal clarity to its value.
2016-12-02 08:48:01 +01:00
Andrew Heather
1f826361c6 STYLE: Consistency updates to change input of <var>Name to <var>. Fixes #306 2016-11-22 14:50:33 +00:00
Mark Olesen
95e7faf309 STYLE: use the more succinct forms for argList (issue #307)
* args[int]   vs  args.args()[int]
  * args[word]  vs  args.options()[word]
  etc.
2016-11-20 13:06:57 +01:00
Mark Olesen
a32eff4e59 ENH: ensure face, triFace and labelledTri all work consistently (issue #294)
- triFace() now initialized with '-1', which makes it behave
  equivalently to face(label).

- supply default region=0 for some labelledTri constructors.
  This allows labelledTri to work more like a triFace and makes it
  easier to use in templated methods and eases conversion from
  triFace to a labelledTri.

- labelledTri(const labelUList&) can now be used when converting
  from a face. It can have 3 values (use default region)
  or 4 values (with region).

- face, triFace, labelledTri now all support construction with
  initializer lists. This can be useful for certain types of code.
  Eg,
      triFace     f1{a, b, c};
      face        f2{a, b, c};
      labelledTri f3{a, b, c};

  Work without ambiguity.
  Also useful for templated methods:

      FaceType f{remap[a], remap[b], remap[c]};
2016-11-12 20:57:48 +01:00
Henry Weller
659076c0fa LList, SLList: Added construction from and assignment to initializer_list
SLList: now a C++11 template alias rather than a wrapper-class.
2016-08-12 10:01:41 +01:00
Henry Weller
ef720003c3 FixedList: Added void operator=(std::initializer_list<T>) 2016-08-11 22:02:05 +01:00
Henry Weller
900c804bf0 HashTable: Added void operator=(std::initializer_list<Tuple2<Key, T>>) 2016-08-11 21:41:55 +01:00
Mark Olesen
28c75d8d7d BUG: Field construct from Xfer<Field> fails (issued #298)
- Cannot pass through to underlying list constructor directly.

- As this constructor was broken, there seem to be a number of
  workarounds scattered in the code. Could revisit them in the future
  as part of code-style:

      edgeMesh(const Xfer<pointField>&, const Xfer<edgeList>&);
      CompactIOField(const IOobject&, const Xfer<Field<T>>&);
      GlobalIOField(const IOobject&, const Xfer<Field<Type>>&);
      IOField(const IOobject&, const Xfer<Field<Type>>&);
2016-11-13 14:37:40 +01:00
Mark Olesen
7c10b89a56 Merge branch 'initialier_list-updates' into 'merge-foundation'
ENH: Support more C++11 initializer lists (issue #261)

DynamicList
-----------
  - construction, assignment and append

HashSet
-------
  - construction, insert, set.
  - assignment will use the implicit List constructor

hashedWordList
--------------
  - construction, assignment
  - additional sort() and uniq() methods.
  - Readonly access to HashTable information via lookup() method.
  - NB: could avoid 'const char**' constructors in the future


Some tests are included

See merge request !67
2016-10-18 19:31:45 +01:00
Mark Olesen
1967fd3dad ENH: Support more C++11 initializer lists (issue #261)
DynamicList
-----------
  - construction, assignment and append

HashSet
-------
  - construction, insert, set.
  - assignment will use the implicit List constructor

hashedWordList
--------------
  - construction, assignment
  - additional sort() and uniq() methods.
  - Readonly access to HashTable information via lookup() method.
  - NB: could avoid 'const char**' constructors in the future
2016-10-18 20:08:37 +02:00
Mark Olesen
33d9b7e867 Add base64 encoding layer (issue #272)
- Can be attached to any currently open std::ostream.
2016-10-17 12:05:29 +02:00
Mark Olesen
2c06a905ab Cleanup endian support (closes #271)
- Place common code under OSspecific.

By including "endian.H", either one of WM_BIG_ENDIAN or WM_LITTLE_ENDIAN
will be defined.

Provides inline 32-bit and 64-bit byte swap routines that can be
used/re-used elsewhere.

The inplace memory swaps currently used by the VTK output are left for
the moment pending further cleanup of that code.
2016-10-17 12:02:01 +02:00
Andrew Heather
6823cb02ab Merge branch 'merge-foundation' of develop.openfoam.com:Development/OpenFOAM-plus into merge-foundation 2016-10-04 14:49:34 +01:00
Andrew Heather
7c106cd43e GIT: Resolved conflict 2016-10-04 09:45:46 +01:00
Mark Olesen
bbec683e42 ENH: provide list of enums for NamedEnum
- can be used to loop over all enumerations in the order of definition.
2016-09-27 12:40:17 +02:00
Andrew Heather
47eb24bed5 GIT: Resolved conflicts arising from merge with develop branch 2016-09-26 10:57:34 +01:00
mattijs
6c56d61846 ENH: fvc: instantiating 2D volVectorField 2016-09-20 17:07:30 +01:00
Andrew Heather
9fbd612672 GIT: Initial state after latest Foundation merge 2016-09-20 14:49:08 +01:00
Henry Weller
8339b57255 List: Added void operator=(std::initializer_list<T>) 2016-08-09 20:36:32 +01:00
Henry Weller
076c4c6e82 HashTable: Added C++11 initializer_list constructor
e.g.
    HashTable<label, string> table1
    {
        {"kjhk", 10},
        {"kjhk2", 12}
    };

    HashTable<label, label, Hash<label>> table2
    {
        {3, 10},
        {5, 12},
        {7, 16}
    };
2016-08-05 22:30:26 +01:00
Henry Weller
2bb52eff6e Test-fileName: Added recent etcFiles.H 2016-08-05 17:25:56 +01:00
Henry Weller
58f905ff70 C++11: Replaced the C NULL with the safer C++11 nullptr
Requires gcc version 4.7 or higher
2016-08-05 17:19:38 +01:00
Henry Weller
7a299ed7cb FixedList: Add constructors from iterators and C++11 initializer_list using C++11 constructor delegation 2016-08-05 16:25:18 +01:00
Henry Weller
3c423d64d2 Test-List: Add demonstration of C++11 initializer list in conjunction with uniform initialization of vector
List<vector> list5
     {
         {5, 3, 1},
         {10, 2, 2},
         {8, 1, 0}
     };
2016-08-05 16:22:51 +01:00
Henry Weller
d01eb45cfc List: Reinstated construction from two iterators and added construction from an initializer list
Until C++ supports 'concepts' the only way to support construction from
two iterators is to provide a constructor of the form:

        template<class InputIterator>
        List(InputIterator first, InputIterator last);

which for some types conflicts with

        //- Construct with given size and value for all elements
        List(const label, const T&);

e.g. to construct a list of 5 scalars initialized to 0:

    List<scalar> sl(5, 0);

causes a conflict because the initialization type is 'int' rather than
'scalar'.  This conflict may be resolved by specifying the type of the
initialization value:

    List<scalar> sl(5, scalar(0));

The new initializer list contructor provides a convenient and efficient alternative
to using 'IStringStream' to provide an initial list of values:

    List<vector> list4(IStringStream("((0 1 2) (3 4 5) (6 7 8))")());

or

    List<vector> list4
    {
        vector(0, 1, 2),
        vector(3, 4, 5),
        vector(6, 7, 8)
    };
2016-08-02 09:31:41 +01:00
Henry Weller
7cbe9153b2 LUscalarMatrix: Added processor-local matrix inverse function 2016-07-17 14:44:50 +01:00
Mark Olesen
cae7ce37f5 ENH: provide formatting version of Foam::name() (issue #253)
- there are some cases in which the C-style sprintf is much more
  convenient, albeit problematic for buffer overwrites.

  Provide a formatting version of Foam::name() for language
  primitives that is buffer-safe.

  Returns a Foam::word, so that further output will be unquoted, but
  without any checking that the characters are indeed entirely valid
  word characters.

  Example use,
      i = 1234;
      s = Foam::name("%08d", i);
      produces '00001234'

  Alternative using string streams:

      std::ostringstream buf;
      buf.fill('0');
      buf << setw(8) << i;
      s = buf.str();

  Note that the format specification can also be slightly more complex:

     Foam::name("output%08d.vtk", i);
     Foam::name("timing=%.2fs", time);

It remains the caller's responsibility to ensure that the format mask
is valid.
2016-07-01 08:23:13 +02:00
Henry Weller
6a53ed41ba Doxygen documentation: Standardized the 'See also' heading 2016-06-17 17:31:34 +01:00
Mark Olesen
6d5db96ad9 ENH: subdict output with leading name (issue #255)
- Introduce dictionary::writeEntries for better code-reuse.

  Before
  ======
      os << nl << indent << "name";
      dict.write(os);

  After
  =====
      dict.write(os, "name");
2016-06-09 18:33:56 +01:00
Mark Olesen
2b5e73fbce BUG: incorrect face order/orientation in boundBox (issue #196)
- was fortunately not used anywhere previously
2016-07-28 07:00:33 +02:00
Andrew Heather
e2935fa680 Merge branch 'fix-systemcall' into 'develop'
replace system() call with vfork/exec combination (issue #185)

Tested systemCall function object, dynamicCode, but should be rechecked with IB+openmpi
@Prashant

See merge request !55
2016-07-26 15:26:00 +01:00
Andrew Heather
b460e096ae Merge branch 'feature-symlinks' into 'develop'
ENH: OSspecific - softlink handling (fixes #164)

Links are followed in most cases, with some notable exceptions:

- mv, mvBak:
  renames the link, not the underlying file/directory

- rmDir:
  remove the symlink to a directory, does not recurse into the
  underlying directory

See merge request !51
2016-07-26 15:25:33 +01:00
Mark Olesen
2f3945e6b3 STYLE: missing include in codeStream test dictionary 2016-07-15 09:05:44 +02:00
Mark Olesen
42b2086683 ENH: adapter for a list of C++ strings <-> a list of C-style strings
- Translate a list of C++ strings into C-style (argc, argv) pair.
- Translate C-style (argc, argv) pair to list of C++ strings.

Useful when interfacing to external C-code and some libraries
2016-06-16 08:22:53 +02:00
Mark Olesen
2dc31390df ENH: add some system information when outputting profiling
- basic cpuInfo (model identification, MHz, etc)
- process memInfo

- profiling is activated via the case system/controlDict by
  adding a "profiling" sub-dictionary.

  Simply add the following (everything enabled):

      profiling
      {}

  Which corresponds to the longer form:

      profiling
      {
          active      true;  // default: true
          cpuInfo     true;  // default: true
          memInfo     true;  // default: true
          sysInfo     true;  // default: true
      }

  This can be used to selectively disable any extra information
  (eg, you don't want anyone else to know what hardware was used).
2016-06-15 20:17:44 +02:00
Mark Olesen
c7b27f5af9 ENH: provide basic cpu-information
- can be useful later when trying to interpret run-times etc.

  Contains only the most basic information.
2016-06-15 12:38:46 +02:00
Mark Olesen
1452cc0827 BUG: ensight writers not catching special reserved characters (fixes #122)
- most notably the '%' which is used as a separator in places
  caused problems.

EHN: only use valid ensight file/variable names for writers

- fixed:   foamToEnsightParts, ensightSurfaceWriter
- pending: foamToEnsight

BUG: no geometry written for foamToEnsightParts with moving mesh (fixes #142)

- an incorrect path was causing the issue
2016-06-07 17:16:09 +01:00
Henry Weller
67de20df25 Further standardization of loop index naming: pointI -> pointi, patchI -> patchi 2016-05-18 21:20:42 +01:00
Mark Olesen
5d29b49811 BUG: UOPstream indexes out of bounds after whitespace stripping (fixes #134)
- only affects transfer of C-style string with a single character
  remaining after whitespace stripping. Test added into Test-parallel.

- Note some idiosyncrasies in the behaviour:

      send                   |    receives
    -------------------------+-------------------------
        string("a b c")      |    string "a b c"
        string("a")          |    string "a"
        "a b c"              |    word   "abc"
        'd'                  |    char   'd'
        "d"                  |    char   'd'
        "d   "               |    char   'd'
2016-06-02 09:45:04 +02:00
Henry Weller
3c053c2fe6 GeometricField: Renamed internalField() -> primitiveField() and dimensionedInternalField() -> internalField()
These new names are more consistent and logical because:

primitiveField():
primitiveFieldRef():
    Provides low-level access to the Field<Type> (primitive field)
    without dimension or mesh-consistency checking.  This should only be
    used in the low-level functions where dimensional consistency is
    ensured by careful programming and computational efficiency is
    paramount.

internalField():
internalFieldRef():
    Provides access to the DimensionedField<Type, GeoMesh> of values on
    the internal mesh-type for which the GeometricField is defined and
    supports dimension and checking and mesh-consistency checking.
2016-04-30 21:40:09 +01:00
Henry Weller
5df2b96489 GeometricField::internalField() -> GeometricField::internalFieldRef()
Non-const access to the internal field now obtained from a specifically
named access function consistent with the new names for non-canst access
to the boundary field boundaryFieldRef() and dimensioned internal field
dimensionedInternalFieldRef().

See also commit 22f4ad32b1
2016-04-30 14:25:21 +01:00
Henry Weller
154150d710 Updated header 2016-04-29 17:18:33 +01:00
Henry Weller
c43b78e8de List: Removed unused constructor from iterators
Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=2074
2016-04-29 17:17:45 +01:00
Henry Weller
785cebed88 GeometricField, volFields: Added experimental member function ".v()" and perfix operator "~"
both of which return the dimensionedInternalField for volFields only.

These will be useful in FV equation source term expressions which need
not evaluate boundary conditions.
2016-04-26 20:45:53 +01:00
Henry Weller
450728ea84 Standardized cell, patch, face and processor loop index names 2016-04-25 12:00:53 +01:00
andy
fd9d801e2d GIT: Initial commit after latest foundation merge 2016-04-25 11:40:48 +01:00
Henry Weller
43beb06018 Standardized cell, patch and face loop index names 2016-04-25 10:28:32 +01:00
Henry Weller
2d5ff31649 boundaryField() -> boundaryFieldRef() 2016-04-24 22:07:37 +01:00
Henry Weller
a0e86416c5 Updated header 2016-04-23 23:38:10 +01:00
Henry Weller
d8f8498c87 boundaryField() -> boundaryFieldRef() 2016-04-23 23:37:53 +01:00
Henry Weller
e47179a70d applications/test/rigidBodyDynamics/pendulumAndSpring: Another slightly more complex test 2016-04-17 15:47:03 +01:00
Henry Weller
8c6fa81eba vector::zero -> Zero 2016-04-16 18:34:41 +01:00
Henry Weller
75c7b7b239 quaternion/septernion: Added multi- quaternion/septernion averaging
Using method based on
http://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/20070017872.pdf
but simplified for the case where the quaternions are similar.
2016-04-16 15:59:05 +01:00
Henry Weller
23a8779379 septernion: Changed definition of the forward transformation for consistency with spatialTransform
inline Foam::vector Foam::septernion::transformPoint(const vector& v) const
{
    return r().transform(v - t());
}

Now there is a 1:1 correspondence between septernion and
spatialTransform and a septernion constructor from spatialTransform
provided.

Additionally "septernion::transform" has been renamed
"septernion::transformPoint" to clarify that it transforms coordinate
points rather than displacements or other relative vectors.
2016-04-15 11:27:18 +01:00
Henry Weller
a0170df6c1 rigidBodyDynamics: Removed quaternion counter and index: 'nw', 'wIndex'
Replaced with 'unitQuaterion()' virtual function to indicate if the
joint uses a unit quaternion to represent rotation.
2016-04-12 22:17:52 +01:00
Henry Weller
315a1baad3 rigidBodyDynamics: Simplify handling of quaternions by maintaining a unit quaternion in the joint state field 'q'
'w' is now obtained from 'v' using the relation w = sqrt(1 - |sqr(v)|)
and 'v' is stored in the joint state field 'q' and integrated in the
usual manner but corrected using quaternion transformations.
2016-04-12 21:44:34 +01:00
Henry Weller
5e6bdeea57 applications/test/rigidBodyDynamics/sphericalJoint: Test for the quaternion-based spherical joint 2016-04-12 16:37:52 +01:00
Henry Weller
985506be28 applications/test/rigidBodyDynamics/spring: Updated comment 2016-04-12 16:37:26 +01:00
Henry Weller
948add3e10 applications/test/rigidBodyDynamics/spring: Correct typo 2016-04-12 16:16:30 +01:00
Henry Weller
f51dfc37f2 rigidBodyDynamics: Simplified the interface to the solvers 2016-04-12 12:57:31 +01:00
Henry Weller
2870be400e rigidBodyDynamics/rigidBodySolvers: Added run-time selectable solvers to integrate the rigid-body motion
Currently supported solvers: symplectic, Newmark, CrankNicolson

The symplectic solver should only be used if iteration over the forces
and body-motion is not required.  Newmark and CrankNicolson both require
iteration to provide 2nd-order behavior.

See applications/test/rigidBodyDynamics/spring for an example of the
application of the Newmark solver.

This development is sponsored by Carnegie Wave Energy Ltd.
2016-04-12 11:33:20 +01:00
Henry Weller
33be0fa564 rigidBodyDynamics/rigidBodyModelState: New class to hold the motion state of the rigid-body model
This is a more convenient way of maintaining the state or multiple
states (for higher-order integration), storing, retrieving and passing
between processors.
2016-04-11 19:01:16 +01:00
Henry Weller
be567300c3 rigidBodyDynamics/restraints: Complete dictionary IO 2016-04-11 11:45:51 +01:00
Henry Weller
1f51c8a89d rigidBodyDynamics: Added support for restraints and a linear spring with damper
applications/test/rigidBodyDynamics/spring: Test of the linear spring with damper restraint
Damped simple harmonic motion of a weight on a spring is simulated and
the results compared with analytical solution

    Test-spring
    gnuplot spring.gnuplot
    evince spring.eps

This development is sponsored by Carnegie Wave Energy Ltd.
2016-04-10 23:12:07 +01:00
Henry Weller
01d503b1c0 applications/test/rigidBodyDynamics/pendulum: Cleanup 2016-04-10 23:07:23 +01:00
Henry Weller
8ca752eb79 applications/test/rigidBodyDynamics/pendulum/pendulum: Corrected joint type 2016-04-08 18:03:51 +01:00
Henry Weller
9ffaed8fd8 rigidBodyDynamics/bodies/jointBody: Special body to support elements of composite joints 2016-04-08 17:16:01 +01:00
Henry Weller
8b6fe62f88 rigidBodyModel: Added operator<<(Ostream&, const rigidBodyModel&) 2016-04-08 17:02:02 +01:00
Henry Weller
93f2f0d41a rigidBodyDynamics: Simplified the IO of bodies 2016-04-08 16:56:48 +01:00
Henry Weller
77ed073bdb rigidBodyDynamics/bodies: Complete set of clone functions to support copy construction and assignment 2016-04-07 23:04:17 +01:00
Henry Weller
0c7ce8938b rigidBodyDynamics: Added dictionary-based IO of the rigidBodyModel 2016-04-07 21:47:08 +01:00
Henry Weller
343136e6cc applications/test/rigidBodyDynamics/pendulum: Simplified using sphere constructor and body lookup by name 2016-04-04 17:08:20 +01:00
Henry Weller
e50d8ece57 applications/test/rigidBodyDynamics/pendulum: Add a test for merging bodies 2016-04-04 09:26:37 +01:00
Henry Weller
4344a73231 applications/test/rigidBodyDynamics/pendulum: Very simple test/demonstration of the rigidBodyDynamics library
Simple swinging pendulum simulation with 1-DoF.  The motion is integrated
    using a symplectic method for just over 2-periods.
2016-04-03 22:17:10 +01:00
Henry Weller
6e573ad7e8 UList: Rationalize assignment (shallow-copy vs deep-copy)
//- Disallow default shallow-copy assignment
    //
    //  Assignment of UList<T> may need to be either shallow (copy pointer)
    //  or deep (copy elements) depending on context or the particular type
    //  of list derived from UList and it is confusing and prone to error
    //  for the default assignment to be either.  The solution is to
    //  disallow default assignment and provide separate 'shallowCopy' and
    //  'deepCopy' member functions.
    void operator=(const UList<T>&) = delete;

    //- Copy the pointer held by the given UList.
    inline void shallowCopy(const UList<T>&);

    //- Copy elements of the given UList.
    void deepCopy(const UList<T>&);
2016-04-03 10:26:05 +01:00
Henry Weller
4831f8146c applications/test/Matrix/Test-Matrix.C: Corrected typo 2016-04-02 23:28:03 +01:00
Henry Weller
88bd912374 Pstream: optimisation of data exchange
Contributed by Mattijs Janssens.

1. Any non-blocking data exchange needs to know in advance the sizes to
   receive so it can size the buffer.  For "halo" exchanges this is not
   a problem since the sizes are known in advance but or all other data
   exchanges these sizes need to be exchanged in advance.

   This was previously done by having all processors send the sizes of data to
   send to the master and send it back such that all processors
   - had the same information
   - all could work out who was sending what to where and hence what needed to
     be received.

   This is now changed such that we only send the size to the
   destination processor (instead of to all as previously). This means
   that
   - the list of sizes to send is now of size nProcs v.s. nProcs*nProcs before
   - we cut out the route to the master and back by using a native MPI
     call

   It causes a small change to the API of exchange and PstreamBuffers -
   they now return the sizes of the local buffers only (a labelList) and
   not the sizes of the buffers on all processors (labelListList)

2. Reversing the order of the way in which the sending is done when
   scattering information from the master processor to the other
   processors. This is done in a tree like fashion. Each processor has a
   set of processors to receive from/ send to. When receiving it will
   first receive from the processors with the least amount of
   sub-processors (i.e. the ones which return first). When sending it
   needs to do the opposite: start sending to the processor with the
   most amount of sub-tree since this is the critical path.
2016-04-02 18:32:11 +01:00
Henry Weller
d4046bb85e LLTMatrix, LUscalarMatrix, QRMatrix: Provided consistent 'solve' interface 2016-03-24 19:13:04 +00:00
Henry Weller
e9199c6e14 QRMatrix: New class to provide QR-decomposition by Householder reflection
This development is sponsored by Carnegie Wave Energy Ltd.
2016-03-24 14:49:25 +00:00
Henry Weller
0945cfd35f LLTMatrix: New matrix form to support Cholesky decomposition
of symmetric positive-definite matrices and the solution of associated
linear systems.
2016-03-23 15:33:03 +00:00
Henry Weller
730f89dc9d Use Zero rather than pTraits<Type>::zero unless a static typed '0' is required 2016-03-22 17:46:52 +00:00
Henry Weller
caf8776f9b SquareMatrix, SymmetricSquareMatrix: Changed the constructor from size to require only n
This avoids the need to check that the m and n dimensions are the same.
2016-03-22 14:13:48 +00:00
Henry Weller
445ce0f2ce Test-Matrix: Removed timing test 2016-03-20 19:50:23 +00:00
Henry Weller
67a51b1fdd Matrix: Added (i, j) addressing to allow support for addressing blocks of the matrix
This change brings OpenFOAM into line with the standard matrix
addressing in other C++ libraries for better interoperability.
2016-03-20 19:44:29 +00:00
Henry Weller
b4ebcd770f quaternion: Added generalized construction from and conversion to Euler-angles
The particular rotation sequence is specified via the enumeration:

    //- Euler-angle rotation sequence
    enum rotationSequence
    {
        ZYX, ZYZ, ZXY, ZXZ, YXZ, YXY, YZX, YZY, XYZ, XYX, XZY, XZX
    };

and provided as an argument to the constructor from Euler-angles

    //- Construct a quaternion given the three Euler angles:
    inline quaternion
    (
        const rotationSequence rs,
        const vector& angles
    );

and conversion to Euler-angles:

    //- Return a vector of euler angles corresponding to the
    //  specified rotation sequence
    inline vector eulerAngles(const rotationSequence rs) const;
2016-03-14 08:07:42 +00:00
Henry Weller
9a8a1c83b0 messageStream: Added DebugInfo and DebugInFunction:
DebugInfo:
    Report an information message using Foam::Info if the local debug
    switch is true

DebugInFunction:
    Report an information message using Foam::Info for FUNCTION_NAME in
    file __FILE__ at line __LINE__ if the local debug switch is true
2016-03-04 11:30:13 +00:00
Henry Weller
95d146ecdf Rationalized the indentation of C-preprocessor directives 2016-02-29 15:42:03 +00:00
Henry Weller
f4ba71ddd0 OpenFOAM libraries: Updated to use the new const-safe tmp 2016-02-26 08:13:59 +00:00
Henry Weller
350d03246e scripts: Reformat with consistent section separators 2016-02-15 18:30:24 +00:00
Henry Weller
04b00f4f05 pplications/test/ListOps/Make/options: Removed extraneous backslash 2016-02-08 16:33:56 +00:00
Henry Weller
fbb9f22d9d Test-PackedList1: Removed chained assigments 2016-02-08 16:30:00 +00:00
Henry Weller
968c888fc4 Rename DataEntry -> Function1
Function1 is an abstract base-class of run-time selectable unary
functions which may be composed of other Function1's allowing the user
to specify complex functions of a single scalar variable, e.g. time.
The implementations need not be a simple or continuous functions;
interpolated tables and polynomials are also supported.  In fact form of
mapping between a single scalar input and a single primitive type output
is supportable.

The primary application of Function1 is in time-varying boundary
conditions, it also used for other functions of time, e.g. injected mass
is spray simulations but is not limited to functions of time.
2016-02-08 16:18:07 +00:00
Henry Weller
56fa7c0906 Update code to use the simpler C++11 template syntax removing spaces between closing ">"s 2016-01-10 22:41:16 +00:00
Henry Weller
4eba393fe1 Update code to use the simpler C++11 template syntax 2016-01-10 19:20:16 +00:00
Andrew Heather
f0c3e8d599 STYLE: Updated version to 'plus' 2015-12-22 23:14:17 +00:00
Andrew Heather
0e01c44129 GIT: Resolved conflict 2015-12-09 16:19:28 +00:00
Andrew Heather
8837a89237 STYLE: Updated links from openfoam.org to openfoam.com 2015-12-09 15:03:05 +00:00
Chris Greenshields
93002626c0 blockMeshDict files moved to system directory (new default location) in template cases and unit test cases 2015-11-13 16:05:59 +00:00
Henry Weller
c4d5f65a10 Completed update ...ErrorIn -> ...ErrorInFunction
Avoids the clutter and maintenance effort associated with providing the
function signature string.
2015-11-11 09:03:39 +00:00
Henry Weller
e2ef006b91 applications: Update ...ErrorIn -> ...ErrorInFunction
Avoids the clutter and maintenance effort associated with providing the
function signature string.
2015-11-10 17:53:31 +00:00
Henry Weller
78d7482e5b SolverPerformance: Complete the integration of the templated SolverPerformance<Type>
Now solvers return solver performance information for all components
with backward compatibility provided by the "max" function which created
the scalar solverPerformance from the maximum component residuals from
the SolverPerformance<Type>.

The residuals functionObject has been upgraded to support
SolverPerformance<Type> so that now the initial residuals for all
(valid) components are tabulated, e.g. for the cavity tutorial case the
residuals for p, Ux and Uy are listed vs time.

Currently the residualControl option of pimpleControl and simpleControl
is supported in backward compatibility mode (only the maximum component
residual is considered) but in the future this will be upgraded to
support convergence control for the components individually.

This development started from patches provided by Bruno Santos, See
http://www.openfoam.org/mantisbt/view.php?id=1824
2015-11-10 08:50:11 +00:00
Henry Weller
4b0c0a5278 Test-error: Updated to use test the new "...InFunction" macros 2015-11-07 16:28:13 +00:00
Henry Weller
7b5d6114ad PtrListDictionary: New form of Dictionary in which the list type is PtrList rather than a linked-list 2015-09-16 21:26:26 +01:00
Henry Weller
913103ec0a Rename circulators to be consistent with the standard OpenFOAM class naming convention 2015-08-06 16:54:47 +01:00
Henry Weller
f3f35e8f39 applications/test: Updated include and link options 2015-07-16 14:37:19 +01:00
Henry Weller
4cd1e85311 fvSchemes: Removed fluxRequired entries 2015-07-16 10:55:49 +01:00
Henry Weller
542c05adda UList, FixedList: Correct swap member function
Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1787
2015-07-15 12:10:05 +01:00
Henry Weller
72300041df Removed use of the deprecated "register" keyword
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4340.html
2015-06-30 10:26:44 +01:00
Henry
5aa5fe6f11 TurbulenceModels: LienCubicKE, ShihQuadraticKE and LienLeschziner models rewritten
The implementation now correspond to the definitions in the readily
available reference:

http://personalpages.manchester.ac.uk/staff/david.d.apsley/specturb.pdf

in which a large number of linear and non-linear models are presented in
a clean and consistent manner.  This has made re-implementation and
checking far easier than working from the original references which anyway
are no longer available for the LienCubicKE and ShihQuadraticKE models.
2015-03-01 17:55:16 +00:00
Henry
6e217f31c2 symmTensor: Add support for the innerSqr function
which takes the inner product of a symmTensor with itself and returns a symmTensor
2015-02-28 16:09:55 +00:00
Henry
8cd3023439 Rationalize position searching and add cell->tet decomposition as the default cell-search algorithm
Resolves issues with probes and findRefCell for meshes in which all cell face-pyramids are positive.
2015-02-25 10:57:06 +00:00
Henry
c778346c96 Formatting: Rationalized the indentation of #include 2015-02-10 20:35:50 +00:00
Henry
83de811719 Updated headers 2015-02-04 16:33:02 +00:00
Henry
1f2176056b applications/test: Updated to compile with Clang-3.5 2015-02-04 16:32:36 +00:00
Henry
71fe553d85 applications/test/LduMatrix: no longer compiles and needs replacing 2015-02-04 16:31:54 +00:00
Henry
33b1bf4c87 regExp: Add support for case-insensitive patterns
From https://github.com/OpenFOAM/OpenFOAM-2.2.x/pull/1
2015-01-28 16:35:36 +00:00
Henry
2aec249647 Updated the whole of OpenFOAM to use the new templated TurbulenceModels library
The old separate incompressible and compressible libraries have been removed.

Most of the commonly used RANS and LES models have been upgraded to the
new framework but there are a few missing which will be added over the
next few days, in particular the realizable k-epsilon model.  Some of
the less common incompressible RANS models have been introduced into the
new library instantiated for incompressible flow only.  If they prove to
be generally useful they can be templated for compressible and
multiphase application.

The Spalart-Allmaras DDES and IDDES models have been thoroughly
debugged, removing serious errors concerning the use of S rather than
Omega.

The compressible instances of the models have been augmented by a simple
backward-compatible eddyDiffusivity model for thermal transport based on
alphat and alphaEff.  This will be replaced with a separate run-time
selectable thermal transport model framework in a few weeks.

For simplicity and ease of maintenance and further development the
turbulent transport and wall modeling is based on nut/nuEff rather than
mut/muEff for compressible models so that all forms of turbulence models
can use the same wall-functions and other BCs.

All turbulence model selection made in the constant/turbulenceProperties
dictionary with RAS and LES as sub-dictionaries rather than in separate
files which added huge complexity for multiphase.

All tutorials have been updated so study the changes and update your own
cases by comparison with similar cases provided.

Sorry for the inconvenience in the break in backward-compatibility but
this update to the turbulence modeling is an essential step in the
future of OpenFOAM to allow more models to be added and maintained for a
wider range of cases and physics.  Over the next weeks and months more
turbulence models will be added of single and multiphase flow, more
additional sub-models and further development and testing of existing
models.  I hope this brings benefits to all OpenFOAM users.

Henry G. Weller
2015-01-21 19:21:39 +00:00
Henry
0da35af2f4 Update headers 2015-01-12 12:34:38 +00:00
Henry
ff29093117 Incompressible turbulence models: Remove the correction of the laminar transport model
Explicitly correct laminar transport at the application level as is done in the multiphase solvers
2015-01-12 12:32:38 +00:00
Henry
a92a04f18d Updated options files for new location of radiation lnInclude directory 2015-01-11 22:27:36 +00:00
Henry
c4804e5a0b wallDist: Add support for cached wall-reflection vectors
Currently these vectors are generated at the same time as the wall-distance field
by the same run-time selected algorithm.  This will be changed so that the wall-reflection
vectors are only generated and stored if required.
2015-01-08 16:08:53 +00:00
Henry
69ff8aa4d2 wallDist: now a MeshObject cached and updated automatically with a run-time selected algorithm
When using models which require the wallDist e.g. kOmegaSST it will
request the method to be used from the wallDist sub-dictionary in
fvSchemes e.g.

wallDist
{
    method meshWave;
}

specifies the mesh-wave method as hard-coded in previous OpenFOAM versions.
2015-01-08 10:40:23 +00:00
Henry
c93f87cc7f Added support for glibc < 2.18
Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1474
2015-01-04 20:13:37 +00:00
Henry
5cf6680021 Updated header 2015-01-02 19:20:50 +00:00
Henry
3588970280 LduMatrixOperations: Added support for scaling symmetric matrices
Note: non-uniform scaling of a symmetric matrix generates an asymmetric matrix
2015-01-02 19:20:19 +00:00
Henry
f4596ad247 Resolve issues relating to compilation with clang-3.5.0 2014-12-15 22:38:10 +00:00
Henry
844b283030 New version of wmake supporting out-of-tree object and dependency files 2014-12-14 21:42:18 +00:00
OpenFOAM-admin
9fb26d59d3 GIT: Repo update 2014-12-11 08:35:10 +00:00
william
98e6dc581c BUG: mantis #1373: eigen value/vector calculation now handles repeated eigen values 2014-08-28 10:54:00 +01:00
mattijs
2e99db9c22 ENH: OSspecific - softlink handling (fixes #164)
Links are followed in most cases, with some notable exceptions:

- mv, mvBak:
  renames the link, not the underlying file/directory

- rmDir:
  remove the symlink to a directory, does not recurse into the
  underlying directory
2014-04-23 15:00:00 +02:00
OpenFOAM-admin
fbb3ddf2c4 Updated for release 2.3.0 2014-02-17 10:21:46 +00:00
mattijs
80ef6e2392 ENH: hexRef8: test more 2013-12-20 16:01:18 +00:00
mattijs
1186a190aa ENH: Test-hexref8: added pointFields 2013-12-20 13:20:50 +00:00
Henry
5b7dff49e4 ODESolvers: Use the ODESystem protected data rather than pass redundant argument to solve 2013-11-09 13:53:37 +00:00
andy
ce4131ccc4 GIT: resolve conflict 2013-11-05 16:39:20 +00:00
Henry
489d295448 ODE solvers: further rationalisation and the addition of the Runge-Kutta-Fehlberg method 2013-11-02 22:48:13 +00:00
Henry
dedfb01ada Rationalisation of the ODE solvers library 2013-10-31 23:51:16 +00:00
Henry
286d6c5d29 ODE: Renamed to ODESystem
Also some additional documentation
2013-10-30 23:12:33 +00:00
mattijs
20a3d67c93 STYLE: various: small coding issues 2013-10-14 14:48:05 +01:00
mattijs
fd0f8ecedd ENH: volField test: comment 2013-10-02 16:09:08 +01:00
Henry
00db27b969 UniformField: New field type 2013-09-27 22:47:59 +01:00
laurence
259d030fed ENH: Update tests for PtrList and sort 2013-09-25 10:11:36 +01:00
mattijs
4d7eae5104 ENH: hexRef8: cleanup 2013-09-23 17:22:33 +01:00
mattijs
8d5977c186 Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev 2013-09-19 16:16:19 +01:00
Henry
2824e86e4f Test-volField: Corrected equation and test case to run 2013-09-19 15:09:45 +01:00
mattijs
3e4f021d10 BUG: Test-fieldMapping: correct comment 2013-09-19 14:49:26 +01:00
mattijs
a009a149b4 ENH: hexRef8: new testcase for refinement and unrefinement 2013-09-19 14:48:39 +01:00
mattijs
f101836853 BUG: Test-fieldMapping: was always inflating 2013-09-19 11:34:09 +01:00
mattijs
9a534cf76d ENH: fieldMapping: new test app 2013-09-18 17:24:57 +01:00
Henry
470553c61a Updated headers 2013-09-09 12:41:33 +01:00
Henry
51f085faa5 Rewrite of ddtPhiCorr - ddtCorr and density-weight HbyA on compressible solvers.
For DyM solvers phiAbs is replaced by Uf but this conversion is currently not complete
2013-09-09 12:41:20 +01:00
Henry
046f740f0e Renamed relativeFlux -> makeRelative and absoluteFlux -> makeAbsolute 2013-08-20 15:40:00 +01:00
Henry
b3d794ee97 TurbulenceModels: Added structure for LES model and the Smagorinsky model within this structure. 2013-08-01 17:14:42 +01:00
mattijs
db0036f34e ENH: patchRegion: test app for PatchEdgeFaceWave 2013-07-30 13:01:32 +01:00
Henry
0af5f10b63 RhoPimpleFoam: test version of rhoPimpleFoam demonstrating the new templated turbulence library 2013-07-28 18:11:04 +01:00
Henry
def7148136 applications/test/PisoFoam: test version of pisoFoam using new templated turbulence library 2013-07-28 18:09:54 +01:00
Henry
144a2b232e dimensionedType: Added missing cmpt functions 2013-07-04 10:00:44 +01:00
mattijs
f2e2ce6f91 ENH: Test-volField: patchGroup reading 2013-07-02 13:45:01 +01:00
laurence
f5bfc5d2e7 ENH: scalarMatrices: Add determinant calculation 2013-06-07 08:57:04 +01:00
mattijs
9426345a09 ENH: Test-GAMGAgglomeration: moved test into GAMGAgglomeration 2013-06-06 08:59:23 +01:00
mattijs
3c1893a8d8 Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev 2013-06-04 11:33:22 +01:00
mattijs
97b0a10211 ENH: Test-GAMGAgglomeration: check for region connectivity 2013-06-04 11:32:18 +01:00
laurence
399c65f963 Merge branch 'master' into feature/cvMesh 2013-05-30 10:34:49 +01:00
mattijs
2e5227a6f8 ENH: Test-ExtendedStencil: more examples 2013-05-21 15:33:17 +01:00
laurence
2c77f55d1d Merge branch 'master' into feature/cvMesh 2013-05-13 10:54:26 +01:00
mattijs
7da6784897 ENH: testDict: key substitution 2013-05-08 14:11:13 +01:00
laurence
6f9823d0de Merge branch 'master' into feature/cvMesh
Conflicts:
	src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C
	src/OpenFOAM/algorithms/indexedOctree/indexedOctree.H
	src/dynamicMesh/polyMeshFilter/polyMeshFilter.C
	src/meshTools/indexedOctree/treeDataPrimitivePatch.C
	src/meshTools/indexedOctree/treeDataTriSurface.C
	src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C
2013-05-08 12:20:52 +01:00
mattijs
d7cadf4937 Merge remote-tracking branch 'origin/master' into feature/procAgglom
Conflicts:
	src/OpenFOAM/db/IOstreams/Pstreams/Pstream.H
	src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C
	src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H
	src/OpenFOAM/db/IOstreams/Pstreams/combineGatherScatter.C
	src/OpenFOAM/db/IOstreams/Pstreams/gatherScatter.C
	src/OpenFOAM/db/IOstreams/Pstreams/gatherScatterList.C
	src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorGAMGInterfaceField/processorGAMGInterfaceField.C
	src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorGAMGInterfaceField/processorGAMGInterfaceField.H
	src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterface.H
	src/finiteVolume/fvMesh/fvMesh.H
2013-04-23 09:41:15 +01:00
laurence
72c3da08b2 Merge branch 'master' into feature/cvMesh
Conflicts:
	applications/test/Matrix/Test-Matrix.C
	applications/utilities/mesh/generation/extrude2DMesh/extrude2DMesh/extrude2DMesh/extrude2DMesh.C
	applications/utilities/mesh/generation/extrude2DMesh/extrude2DMesh/extrude2DMesh/extrude2DMesh.H
	src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C
	src/OpenFOAM/primitives/Tensor2D/Tensor2DI.H
2013-04-05 16:09:24 +01:00
laurence
55253a89a9 ENH: Update Test-Matrix.C to check solutions for symmetric square matrices 2013-03-21 10:22:47 +00:00
andy
b45a4486b1 STYLE: Updates to erroneous copyright dates - applications 2013-03-13 09:45:16 +00:00
andy
53df4289df ENH: Consistency updates - license text abnd code formatting 2013-03-12 15:40:03 +00:00
laurence
3577b3d409 ENH: Add SymmetricSquareMatrix class and specialisations of LUDecompose and LUSolve. 2013-03-01 16:32:33 +00:00
laurence
bf07d6ba68 ENH: Add SymmetricSquareMatrix class and specialisations of LUDecompose and LUSolve. 2013-03-01 16:32:33 +00:00
mattijs
fee11f0fa5 ENH: laplacianFoam: back to solve on single processor 2013-02-22 17:26:12 +00:00