Commit Graph

19844 Commits

Author SHA1 Message Date
09f0cfd5c7 STYLE: reduce number of small methods in paraview reader
- improves the overview of the code
2017-05-14 21:38:15 +02:00
48bf71dd26 STYLE: avoid VTK InsertNextPoint if we already know the sizes
- avoids potentially issues if we reusing a vtkPoints array,
  and should be marginally faster without the additional
  range checking.
2017-05-14 21:24:06 +02:00
2e0337d024 ENH: use smart pointers for paraview readers
- adds flexiblity and reduces risk of memory leaks as we add/change
  features

STYLE: adjust naming for paraview internal polyDecomp
2017-05-14 21:04:11 +02:00
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
0c53a815ed ENH: avoid std::distance for std::initializer_list
- std::initializer_list has its own size() method, so no need to use
  std::distance.

STYLE/BUG: use separate iterator de-reference and increment in List

- avoids unnecessary copying of iterators, and avoids any potentially
  odd behaviour with the combination with incrementing.

ENH: support construct from iterator pair for DynamicList, SortableList
2017-05-14 16:28:21 +02:00
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
b83af3b085 rhoPimpleDyMFoam: Updated transonic formulation for consistency with sonicFoam 2017-05-12 18:34:00 +01:00
71710e0798 ENH: use prefix when displaying group,patch names for paraview selection
- easier to detect the implicit grouping
2017-05-12 15:37:04 +02:00
e5cdee5dd9 STYLE: use labelRange and range-based-for in paraview readers
- also use updated forAll* macros
2017-05-12 15:36:44 +02:00
418ebe4a87 ENH: replace writeFuncs in setSet with foamVtk library utilities 2017-05-19 12:28:13 +02:00
c685f70c82 ENH: rationalize VTK output classes and structures
- relocated to dedicated foamVtkOutput namespace. Make it easier to
  obtain a formatter directly without a foamVtkOutput::outputOptions.
  Make the logic clear within outputOptions (avoid previous, cryptic
  bit masking). foamVtkOutput::legacy also becomes a namespace instead
  of a class. Relocate commonly used things into src/fileFormats, leave
  volField-related parts in src/conversion.
2017-05-19 12:11:49 +02:00
12353e71e7 ENH: provide OpenFOAM/VTK low-level transcription routines
- Zero-copy does not work for several reasons, but this uses the
  OpenFOAM structures to write VTK-compatible formats into external
  arrays.
2017-05-12 15:35:08 +02:00
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
7b825d0817 rhoPimpleFoam: Updated transonic option to be consistent with sonicFoam
Improves stability on start-up and allows running at slightly larger time-steps.
2017-05-12 11:04:38 +01:00
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
034ddfa78f ENH: make coeffs dictionaries optional for surfaceFeatureExtract 2017-05-10 14:11:28 +02:00
8728e8353f STYLE: avoid explicit use of 'word' as HashTable template parameter
- less clutter and typing to use the default template parameter when
  the key is 'word' anyhow.

- use EdgeMap instead of the longhand HashTable version where
  appropriate
2017-05-10 13:44:27 +02:00
4d126bfe2d ENH: add dictionary optionalSubDict() method as per .org change (20-Apr) 2017-05-10 12:51:21 +02:00
d27d69e3f7 reconstructParMesh: Use tree method to improve speed and scaling
Based on development contributed by Paul Edwards, Intel.

Conflicts:
	applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C
2017-05-09 09:32:25 +01:00
24d1e50f45 BUG: LimitedScheme - corrected oriented flag. Fixes #493 2017-06-12 09:18:22 +01:00
132c0e719a TUT: Added min/max(p) function object 2017-06-09 10:53:37 +01:00
2af8d38827 ENH: Added new Joule Heating fvOption and test case
Evolves an electrical potential equation

    \f[
        \grad \left( \sigma \grad V \right)
    \f]

    where \f$ V \f$ is electrical potential and \f$\sigma\f$ is the
    electrical current

    To provide a Joule heating contribution according to:

    Differential form of Joule heating - power per unit volume:

    \f[
        \frac{d(P)}{d(V)} = J \cdot E
    \f]

    where \f$ J \f$ is the current density and \f$ E \f$ the electric
field.
    If no magnetic field is present:

    \f[
        J = \sigma E
    \f]

    The electric field given by

    \f[
        E = \grad V
    \f]

    Therefore:

    \f[
        \frac{d(P)}{d(V)} = J \cdot E
                          = (sigma E) \cdot E
                          = (sigma \grad V) \cdot \grad V
    \f]

Usage
    Isotropic (scalar) electrical conductivity
    \verbatim
    jouleHeatingSourceCoeffs
    {
        anisotropicElectricalConductivity no;

        // Optionally specify the conductivity as a function of
        // temperature
        // Note: if not supplied, this will be read from the time
        // directory
        sigma           table
        (
            (273        1e5)
            (1000       1e5)
        );
    }
    \endverbatim

    Anisotropic (vectorial) electrical conductivity
    jouleHeatingSourceCoeffs
    {
        anisotropicElectricalConductivity yes;

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

            coordinateRotation
            {
                type        axesRotation;
                e1          (1 0 0);
                e3          (0 0 1);
            }
        }

        // Optionally specify sigma as a function of temperature
        //sigma           (31900 63800 127600);
        //
        //sigma           table
        //(
        //    (0      (0 0 0))
        //    (1000   (127600 127600 127600))
        //);
    }

    Where:
    \table
        Property     | Description               | Required  | Default
value
        T            | Name of temperature field | no        | T
        sigma        | Electrical conductivity as a function of
temperature |no|
        anisotropicElectricalConductivity | Anisotropic flag | yes |
    \endtable

    The electrical conductivity can be specified using either:
    - If the \c sigma entry is present the electrical conductivity is
      specified
      as a function of temperature using a Function1 type
    - If not present the sigma field will be read from file
    - If the anisotropicElectricalConductivity flag is set to 'true',
      sigma
      should be specified as a vector quantity
2017-06-09 10:29:21 +01:00
caf9a0870d ENH: Added bash completion for OpenFOAM applications 2017-06-08 16:24:06 +01:00
b36491576d COMP: foamList - removed corruption error on exit 2017-06-08 16:14:51 +01:00
c187e9b523 ENH: foamHelp - minro refactoring to enable use of foamHelp -help option 2017-06-08 16:07:58 +01:00
40ddfb4277 COMP: renamed runtime selection table to avoid duplicate entry clashes 2017-06-08 16:06:16 +01:00
2b060155c3 ENH: Added script to create bash tab-completions 2017-06-08 16:05:31 +01:00
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
ede3a844e1 Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop 2017-05-08 11:55:12 +01:00
91585fd32e STYLE: checkMesh: formatting help 2017-05-08 11:54:48 +01:00
cd8083eb95 Merge branch 'feature-consistency-face-access' into 'develop'
Feature consistency face access

See merge request !109
2017-05-08 10:58:42 +01:00
46a1fed97b Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop 2017-05-08 10:51:24 +01:00
134f7abd57 ENH: checkMesh: output vol fields of mesh quality. Fixes #466. 2017-05-08 10:50:59 +01:00
708c1b5c41 ENH: simplify ensightCells/ensightFaces with labelRange
- can avoid allocating/reallocating SubList

STYLE: don't need NamedEnum for ensightCells, ensightFaces lookup
2017-05-08 11:21:44 +02:00
b4f6484ddf ENH: use faceTraits for managing differences between face representations 2017-05-07 16:58:44 +02:00
0c4d2bcd76 ENH: improve consistency in access for face, triFace, edge.
- ensure that each have found() and which() methods

- add faceTraits for handling compile-time differences between
  'normal' and tri-faces

- provide line::unitVec method (complimentary to edge::unitVec)
2017-05-07 15:49:52 +02:00
c872b0f13f Merge remote-tracking branch '1612/master' into develop 2017-05-05 10:20:02 +02:00
f895c934e7 COMP: skip compilation of plugins if include files are missing (fixes #464) 2017-05-05 10:14:48 +02:00
8006d64d74 COMP: skip compilation of plugins if include files are missing (fixes #464) 2017-05-05 10:02:34 +02:00
cd6221664f Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop 2017-05-04 17:50:33 +01:00
4b7c74f8eb BUG: sampledPlane: fix parallel running on subset. Fixes #463. 2017-05-04 17:50:07 +01:00
97b6475877 Merge branch 'feature-improved-container-classes' into 'develop'
improved container classes

See merge request !108
2017-05-04 16:48:57 +01:00
ff132ff5f6 ENH: orientedFields - updated mapping and parallel utils 2017-05-04 15:32:51 +01:00
6747d14dfa BUG: odd table size after shrink (issue #460)
- remove this unused method
2017-05-04 13:11:46 +02:00
7edd801c72 BUG: wall/patch distance and inverseDistanceDiffusivity - updated dimensions and use meshWave as a default method for backwards compatibility. Fixes #462 2017-05-04 11:33:00 +01:00
8dae01913c ENH: regex matching on std::string, not Foam::string
- avoids unneeded promotion of types.
  Easier to switch regex engines in the future.
2017-05-04 12:31:49 +02:00
3b2cd0b107 DPMDyMFoam, DPMDyMFoam: Corrected support for closed-domain simulations
Also added support for extrapolated pressure boundary conditions.
2017-05-04 09:39:23 +01:00
b39b90a9b5 CrankNicolsonDdtScheme: Corrected input of off-centering coefficient of 1 2017-05-11 19:33:01 +01:00
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
759306a3e2 STYLE: more consistent typedefs in Map, PtrMap, HashPtrTable 2017-05-04 02:47:32 +02:00