Commit Graph

3600 Commits

Author SHA1 Message Date
Mark Olesen
b8c257d6ad CONFIG: adjustments to environment
- provide default WM_DIR if not already set, to improve robustness if a
  reduced environment is used

- add etc/ to WM_PROJECT_SITE search. This makes the site directory
  structure consistent with the OpenFOAM structure.
  Eg,

      WM_PROJECT_SITE/etc/..
      WM_PROJECT_SITE/bin/..
      WM_PROJECT_SITE/platforms/..

- Don't set/export WM_OSTYPE.  The default is POSIX and is properly
  defaulted throughout, including in CMakeLists-OpenFOAM.txt (also for
  Catalyst)
2018-12-03 09:50:48 +01:00
Mark Olesen
628b2445fc ENH: improve setup for paraview
- removed reliance on ParaView_INCLUDE_DIR variable for conveying the
  major.minor version information when compiling. This can be somewhat
  fragile and also adds variable that is an unnecessary when running
  (only used when compiling).

  Instead use `have_pvplugin_support` function in paraviewFunctions
  wmake script to determine the maj.min from the PV_PLUGIN_PATH
  since we have already defined the output path there with paraview
  maj.min numbering.

  Can now build with paraview from the operating system,
  provided that it has develop headers available.

      ParaView_VERSION=system

  In the etc/config.sh/paraview setup, the maj.min is taken from
  the corresponding `paraview --version` output and used when
  defining the PV_PLUGIN_PATH.

  During the build, the include path taken from `paraview-config`
  for a system installation, from the guess installation root
  of the paraview binary, or ParaView_DIR otherwise.

NB: using a system ParaView for building runTimePostProcessing is unsupported.

- these types of builds appear to have various library resolution issues
  (eg, libexpat not being loaded). Additionally, the build logic does
  not yet cover this type of use case.
2018-11-29 01:48:00 +01:00
Mark Olesen
dd0487ac2a STYLE: typo in comments 2018-11-28 12:35:34 +01:00
Mark Olesen
41a03f3790 ENH: add regular expressions for reconstructPar, mapFieldsPar -fields option
- improved flexibility

- reconstruction of Lagrangian positions/fields now handled as a class
  for better modularity
2018-11-28 08:36:17 +01:00
Mark Olesen
b81420e524 ENH: additional variants of IOobjectList findObject()
- cfindObject() for const pointer access.

- getObject() for mutable non-const pointer access, similar to the
     objectRegistry::getObjectPtr()

- cfindObject(), findObject(), getObject() with template type access
  to also check the headerClassName.

  For example,

      cfindObject("U")  ->  good
      cfindObject<volVectorField>("U") -> good
      cfindObject<volScalarField>("U") -> nullptr

  This allows inversion of looping logic.

    1) Obtain the names for a particular Type

       for (const word& objName : objs.sortedNames<Type>())
       {
           const IOobject* io = objs[objName];
           ...
       }

    2) Use previously obtained names and apply to a particular Type

       for (const word& objName : someListOfNames)
       {
           const IOobject* io = objs.cfindObject<Type>(objName);
           if (io)
           {
               ...
           }
       }
2018-11-28 11:28:38 +01:00
Mark Olesen
7477459186 STYLE: const-correctness on IOobject* access
- foamToEnsight, foamToEnsightParts, profiling
2018-11-28 08:00:53 +01:00
Mark Olesen
29e1d9e982 Merge remote-tracking branch 'origin/develop' into develop 2018-11-27 16:59:08 +01:00
Mark Olesen
ad88c551f9 Merge remote-tracking branch 'vtk/feature-vtm' into develop 2018-11-27 11:23:37 +01:00
Mark Olesen
46e2e71f28 STYLE: update dictionary documentation for topoSources (#1060) 2018-11-27 08:32:27 +01:00
Mark Olesen
d8a55e46b6 ENH: align foamToEnsightParts internals with foamToEnsight
- add -region option and -fields filtering
2018-11-25 12:12:19 +01:00
Mark Olesen
b5432011fa ENH: improve option naming consistency in
- foamToVTK, foamToEnsight, foamToEnsightParts
2018-11-25 10:47:00 +01:00
Mark Olesen
a139543e9c ENH: add boundaryToCell, patchToCell topoSetCellSources (#1060)
- can be used, for example, to visualize all wall cells - for quality
  or other purposes - without requiring an intermediate faceSet for
  the selection. Request arising from pending merge !213.
2018-11-24 13:52:43 +01:00
Mark Olesen
05353da5f4 BUG: errors found in feature-vtm merge !213
- vtkWrite with moving mesh was not updated the subsets properly,
  which caused it to crash.

- foamToVTK -overwrite ignored for single region cases,
  was working for multi-region cases

- minor documentation changes
2018-11-23 14:04:07 +01:00
Mark Olesen
0d29257a6d STYLE: use vtk::surfaceWriter instead of sampleSurface version 2018-10-16 14:49:56 +02:00
Mark Olesen
2b42076d58 ENH: restructuring of foamToEnsight code
- align with foamToVTK code base
2018-10-09 21:28:53 +02:00
Mark Olesen
89cca8578c ENH: rewrite of foamToVTK to include parallel output (#926)
- Default format is now XML binary (base64) instead of legacy format.
  The old -xml option is redundant and ignored.
  The new -legacy option can be used to force legacy output instead.

- Polyhedral decomposition is now off by default (old -poly is ignored).
  The option -poly-decomp forces decomposition of polyhedrals into
  primitive shapes.

- reduced memory footprint by reading and converting fields
  successively.

- Creation of symlinks to processor files is no longer required or
  desired. The old -noLinks option is ignored.

- Ignore -useTimeName option. Always number according to timeIndex.
2018-10-09 20:00:55 +02:00
Mark Olesen
4f2ec88d24 ENH: improvements to the parallelization of ensightCloud output
- communication mode is now selectable (default is blocking)

- eliminate serial-only version as being redundant
2018-10-10 10:32:14 +02:00
Mark Olesen
e4fac35d60 ENH: cleanup ensightMesh method names and handling of internal vs boundary
- this removes the old 'magically' means of suppressing the internal
  mesh in favour of specifying it directly.
2018-10-09 17:49:15 +02:00
Mark Olesen
6f06ce6e02 ENH: parallel and xml output for vtk::lagrangianWriter (issue #926) 2018-09-17 11:35:17 +02:00
Mark Olesen
0d2dbaf61b ENH: parallel and xml output for vtk topoSet writers (issue #926)
- introduce lower-level vtk::indirectPatchWriter class
2018-09-17 15:41:58 +02:00
Mark Olesen
05427217a0 ENH: improvements for foamVtkOutput, foamVtkFormatter (issue #926)
- parallel list output for foamVtkOutput

- simplified '.series' file output

- beginDataArray() method instead of openDataArray() + closeTag()
  since this seems to be the most common use anyhow.
  With an optional argument for leaving the tag open, this works the
  same as openDataArray() which may be deprecated in the future.

- begin/end methods for CellData, PointData, FieldData (commonly used)

- templating parameters for file headers, content version,
  legacy fields. This improves coding robustness and convenience of use.

- use formatter and higher-level methods for legacy output

- attribute quoting character now part of the formatter itself
  instead of as an argument for xmlAttr().
  Toggle with quoting() method.

- pair-wise processing of xml attributes, which also allows them to be
  passed as optional entries when creating an xml tag.

- xmlComment with multiple arguments
2018-09-17 08:59:03 +02:00
Mark Olesen
ac03307258 ENH: improve consistency in version handling (issue #1010)
- use std::string instead of c-string for the string constants

- centralize some definitions of resources into foamVersion.H

  Now expose some of the hard-coded values used in foamEtcFiles()
  so that they can be known or even overridden as required.

  Relocate to src/OpenFOAM/include as a constant location.
2018-11-23 11:08:36 +01:00
Mark Olesen
577babc72b ENH: reject bad time values for blockMesh -time (closes #1093) 2018-11-22 15:51:05 +01:00
Mark Olesen
343a3b958d ENH: guard against non-dictionary entries in changeDictionary (#1092) 2018-11-22 13:59:49 +01:00
Mark Olesen
083e9e9665 ENH: isolate version information in foamVersion names instead of globals
- For compatibility, access to the old global names is provided via
  macros
        #define FOAMversion     foamVersion::version
        #define FOAMbuild       foamVersion::build
        #define FOAMbuildArch   foamVersion::buildArch

- this isolation makes it easier to provide additional scoped methods
  for dealing with version related information.  Eg, printBuildInfo()
2018-11-22 11:50:24 +01:00
Mark Olesen
6dcc46b187 ENH: improve error handling for foamHelp
- Catch any leading option (the incorrect location).
- Catch initialization error for cleaner result.
2018-11-21 20:18:39 +01:00
mattijs
9bfc010e64 ENH: faMesh: decompose zero-sized patches. Fixes #1090. 2018-11-21 16:38:33 +00:00
Mark Olesen
dd87c98393 ENH: add read guard for dimensionedType constructors (#762)
- deprecate dimensionedType constructors using an Istream in favour of
  versions accepting a keyword and a dictionary.

  Dictionary entries are almost the exclusive means of read
  constructing a dimensionedType. By construct from the dictionary
  entry instead of doing a lookup() first, we can detect possible
  input errors such as too many tokens as a result of a input syntax
  error.

  Constructing a dimensionedType from a dictionary entry now has
  two forms.

  1.  dimensionedType(key, dims, dict);

      This is the constructor that will normally be used.

      It accepts entries with optional leading names and/or
      dimensions. If the entry contains dimensions, they are
      verified against the expected dimensions and an IOError is
      raised if they do not correspond. On conclusion, checks the
      token stream for any trailing rubbish.

  2.  dimensionedType(key, dict);

      This constructor is used less frequently.

      Similar to the previous description, except that it is initially
      dimensionless. If entry contains dimensions, they are used
      without further verification. The constructor also includes a
      token stream check.

      This constructor is useful when the dimensions are entirely
      defined from the dictionary input, but also when handling
      transition code where the input dimensions are not obvious from
      the source.

      This constructor can also be handy when obtaining values from
      a dictionary without needing to worry about the input dimensions.
      For example,

         Info<< "rho: " << dimensionedScalar("rho", dict).value() << nl;

      This will accept a large range of inputs without hassle.

ENH: consistent handling of dimensionedType for inputs (#1083)

BUG: incorrect Omega dimensions (fixes #2084)
2018-11-20 15:14:10 +01:00
Mark Olesen
f2de61f82c STYLE: add geometric constraint to decomposeParDict example (issue #921) 2018-11-15 11:45:18 +01:00
Mark Olesen
1883a872a1 STYLE: adds comments in empty Make/options files
- easier when making modifications

STYLE: spelling in topoSetSource comments
2018-11-13 15:21:13 +01:00
Mark Olesen
2ac5df6f93 BUG: inconsistent field ordering in PDRMesh (fixes #1069) 2018-11-12 12:59:03 +01:00
Mark Olesen
faaa93fdb5 ENH: add IOobjectList::findObject() method
- naming similar to objectRegistry, with unambiguous resolution.
  The lookup() methods have different return types depending on the
  calling parameter.

STYLE: use IOobjectListTemplates.C for implementations

- previously included as local definition within IOobjectList.C,
  but will be adding more templated methods soon.

- adjust parameters (eg, matchName instead of matcher) to show their
  function

ENH: handle objectRegistry::names<void>(...)

- this is equivalent to no Type restriction, and can be used when
  filtering names. Eg,

     obr.names<void>(wordRe..);
2018-11-09 21:57:55 +01:00
Mark Olesen
91cfe4c271 ENH: add wordRes::matching() method
- returns indices of matching entries.
2018-11-09 21:21:15 +01:00
Mark Olesen
3cf177e759 Work-package-09 geometric constraint 2018-11-08 20:50:47 +00:00
Mark Olesen
2fb382bf8a ENH: multiple zone selection for fvMeshSubsetProxy (#973)
- handle tmp fields in interpolate methods

- special method interpolateInternal() for creating a volume field
  with zero-gradient treatment for patches from an internal field.

  This method was previously also called interpolate(), but that
  masked the ability to subset the internal field only.

  Ensight output needs the volume field:
      uses interpolateInternal().

  VTK output has separate handling of internal and patch fields:
      uses interpolate().

ENH: added fvMeshSubset mesh() method for baseMesh or subMesh.

- simplies coding when the fvMeshSubset may or may not be in active use.

ENH: update foamToEnsight to use newer methods in wrapped form

- static interpolate functions with renaming for manual use with
  fvMeshSubset (when fvMeshSubsetProxy may be too limiting in
  functionality)
2018-10-02 17:06:44 +02:00
Mark Olesen
5f556ffb4a ENH: make sourceInfo sub-dictionary optional for topoSet (#1060)
- helps reduce clutter in the topoSetDict files.

  Caveats when using this.

  The older specification styles using "name" will conflict with the
  set name. Eg,

    {
        name    f0
        type    faceSet;
        action  add;
        source  patchToFace;
        sourceInfo
        {
            name   inlet;
        }
    }

    would flattened to the following
    {
        name    f0
        type    faceSet;
        action  add;
        source  patchToFace;
        name   inlet;
    }
    which overwrites the "name" used for the faceSet.

    The solution is to use the updated syntax:

    {
        name    f0
        type    faceSet;
        action  add;
        source  patchToFace;
        patch   inlet;
    }
2018-11-07 10:33:36 +01:00
Mark Olesen
6090faedef ENH: additional topoSources, and consistency changes (#1060)
- faceBitSet, pointBitSet and faceBoolSet (similar to cellBitSet)
  * allows topo sources in a wider variety of places.
  * With copy or move constructors.

- cylinderToPoint, searchableSurfaceToFace, searchableSurfaceToPoint,
  sphereToFace, sphereToPoint sources

- optional innerRadius for sphere and cylinder sources to treat as hollow.

- support "sets" as well as "set" for cellToCell, faceToFace... sources.

  * convenience and avoids writing the set during processing.
2018-11-06 18:25:05 +01:00
Mark Olesen
a7a346b206 STYLE: indentation for FatalIOErrorInFunction calls 2018-11-06 09:49:22 +01:00
Mark Olesen
f5baa9a583 ENH: extend globalIndex toGlobal methods
- now applicable to labelLists.

Note:
  in some situations it will be more efficient to use
  Foam::identity() directly. Eg,

     globalIndex globalCells(mesh.nCells());
     ...
     labelList cellIds
     (
         identity(globalCells.localSize(), globalCells.localStart())
     );
2018-11-05 16:23:33 +01:00
Mark Olesen
50baac3c45 ENH: construct string types from Istream now explicit (#1033)
- this helps for trapping unguarded dictionary lookups.
2018-11-03 20:24:34 +01:00
mattijs
30dcac006f COMP: Allwmake: make -q work 2018-11-01 14:12:52 +00:00
Mark Olesen
7325e3ac7d ENH: topoSetSource::SUBTRACT enum action (#1060)
- old 'DELETE' enum was easily confused with 'REMOVE', which removes
  the set, not the elements from the set.

- provide corresponding subtractSet() method

STYLE: HashSet set/unset instead of insert/erase methods in topoSetSource

- simplifies switching to/from bitSet storage
2018-10-30 15:09:44 +00:00
Mark Olesen
50fe195374 ENH: use "origin" for searchable sphere etc. (#1060)
- replaces "centre", using the same keyword as other objects
  (eg, plane, rotatedBox, coordinateSystem etc).
2018-10-29 15:51:05 +00:00
Mark Olesen
c2e58dca64 ENH: support multiple zones for topo set sources (#1060)
- uses the keywords 'zones' and 'zone' to avoid potential conflicts
  with a named topoSet action, but accepts 'name' for compatibility.
2018-10-29 12:54:30 +00:00
mattijs
966eed302e BUG: subsetMesh: mapping topoSets. Fixes #1053. 2018-10-30 12:43:30 +00:00
mattijs
f2ef995113 ENH: checkMesh: pass by reference. See #755. 2018-10-29 15:08:52 +00:00
mattijs
3be48a677c ENH: snappyHexMesh: update main snappyHexMeshDict. See #1031. 2018-10-17 12:04:53 +01:00
Mark Olesen
07dafe7b0b STYLE: use range-for when looping dictionary entries.
- as part of the cleanup of dictionary access methods (c6520033c9)
  made the dictionary class single inheritance from IDLList<entry>.

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

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

   vs

      forAllConstIter(dictionary, topDict, iter))
      {
          Info<< "entry:" << iter().keyword()
              << " is dict:" << iter().isDict() << nl;
      }
2018-10-19 13:08:24 +02:00
Mark Olesen
4e04c1966f ENH: use dictionary::get<word>() instead of lookup() in a few places 2018-10-19 09:11:31 +02:00
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