Commit Graph

1051 Commits

Author SHA1 Message Date
Mark Olesen
428f746c68 STYLE: include temperature (T) in the default paraFoam pre-selection 2018-04-12 13:51:51 +02:00
mattijs
d2b1b1cdc0 ENH: paraFoam: catch read errors. Fixes #798. 2018-04-12 15:12:04 +01:00
Mark Olesen
018124e3bf STYLE: use 'return nullptr' for empty autoPtr/tmp returns
- both autoPtr and tmp are defined with an implicit construct from
  nullptr (but with explicit construct from a pointer to null).
  Thus is it safe to use 'nullptr' when returning an empty autoPtr or tmp.
2018-03-21 09:31:09 +01: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
c0498e731a ENH: consolidate some common methods for paraview + catalyst 2018-04-03 18:42:35 +02: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
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
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
37e248c74b STYLE: consistent use of wordHashSet instead of HashSet<word>
- the wordHashSet typedef is always available when HashSet has been
  included.

- use default HashTable key (word) instead of explicitly mentioning it
2018-02-22 11:19:47 +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
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
e2332d6bd2 COMP: better handling of versioned cmake libraries
- sentinel was not working properly when building user-space routines
2018-01-31 08:35:56 +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
7f3d4b3554 Merge branch 'master' into develop 2018-01-23 16:11:28 +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
f385e3b984 ENH: finiteArea support for paraview reader plugin (paraFoam) 2017-12-06 15:10:11 +00:00
Andrew Heather
c2ff8ea99e ENH: Added finiteArea support to foamToVTK 2017-11-21 16:33:33 +00:00
Andrew Heather
3da2aee4ef ENH: Updated wildcard handling for function object field entries 2017-12-13 20:57:56 +00: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
f2ba618c19 STYLE: consistency in using argList::addArgument, argList::addOption 2017-11-22 12:54:28 +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
14d4484fae STYLE: single-string findStrings deprecated in favour of stringOps::match
- reduces ambiguity between matching a list of strings and a single string.
2017-11-13 10:37:38 +01:00
Andrew Heather
ec9a7cc016 ENH: function objects - enabled 'fields' entry to use patterns for some objects 2017-11-07 17:33:09 +00:00
Mark Olesen
7d7b0bfe84 STYLE: use list methods find/found instead of findIndex function 2017-10-24 19:07:34 +02:00
Andrew Heather
2defba00a9 ENH: Lagrangian - provided backwards compatibility for cases using the
old "positions" file form

The change to barycentric-based tracking changed the contents of the
cloud "positions" file to a new format comprising the barycentric
co-ordinates and other cell position-based info.  This broke
backwards compatibility, providing no option to restart old cases
(v1706 and earlier), and caused difficulties for dependent code, e.g.
for post-processing utilities that could only infer the contents only
after reading.

The barycentric position info is now written to a file called
"coordinates" with provision to restart old cases for which only the
"positions" file is available. Related utilities, e.g. for parallel
running and data conversion have been updated to be able to support both
file types.

To write the "positions" file by default, use set the following option
in the InfoSwitches section of the controlDict:

    writeLagrangianPositions 1;
2017-09-13 13:13:36 +01:00
Andrew Heather
fb20bc107e INT: Updated dependent code following latest set of integrations 2017-09-06 16:05:12 +01: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
Mark Olesen
2cfc88fa03 STYLE: paraview reader attempts to shallow copy nullptr (closes #586)
- Can occur if the selected geometry does not actually exist.
  A non-critical bug since paraview catches this anyhow and
  just emits a warning message.
2017-09-12 15:42:10 +02:00
Mark Olesen
05aa701c15 ENH: handle all lagrangian fields in pv reader (issue #585)
- previous only checked for clouds at the last instance and only
  detected lagrangian fields from the first cloud.

  Now check for clouds at all instances and detect all of their fields
  as well.
2017-09-12 11:38:05 +02:00
Mark Olesen
37e863521a ENH: make token constructors explicit (issue #563)
- access tokenType enum values more consistently.
2017-08-10 11:53:37 +02:00
Andrew Heather
5f538909fb Merge branch 'style-noiseDict-syntax' into 'develop'
STYLE: New syntax compatible with v1706 (Fixes #548)

See merge request !131
2017-08-08 09:53:28 +01:00
Mark Olesen
3f6e130c91 STYLE: flatten PVReaders directory structure 2017-08-02 11:19:57 +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
Prashant
96edef9d5e STYLE: New syntax compatible with v1706 2017-07-26 11:28:26 +05:30
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
9e88a8a21e ENH: enable profiling output for postProcess and -postProcess (closes #526)
- added an explicit print, but only report profiling to the log
  file from master process.

  We don't wish to overwrite any profiling that was conducted during
  the simulation. Besides which, we don't have a proper Time object
  for handling the write nicely either.
2017-07-12 15:48:25 +02:00
Mark Olesen
cce74d493b ENH: remove deprecated ensight output order (issue #523)
- Added for transition purposes only in 1612 but can now be removed.
2017-07-11 14:57:05 +02:00
Mark Olesen
f55c568f13 ENH: upgrade from NamedEnum to Enum (issue #515) 2017-07-03 21:43:33 +02:00
Mark Olesen
7ac55ac74a ENH: consolidate arch and version strings (issue #513)
- make some IOobject writing routines non-templated.

- relocate more IOobject methods into the IOobjectI.H
  (generally cleanup the main header).
2017-07-03 13:24:08 +02:00
Mark Olesen
e62e34f0f0 ENH: add -cellZone option to foamToVTK 2017-07-04 14:16:18 +02:00
Mark Olesen
c5bd5393df ENH: lazier field loading in foamToVTK
- avoid loading surface fields if there are no faceZones

- avoid pointMesh if there are no appropriate point fields
2017-07-04 11:57:54 +02:00
Mark Olesen
6dd5a5f35f BUG: foamToVTK -cellSet produces rubbish or segfault (closes #516)
- erroneous double logic for subset meshes.

  The underlying vtk::vtuCells uses a cellMap to map into a global
  field, which also allows handling of decomposed polyhedral cells.

  If a mesh subset is involved (eg, cellSet, cellZone), then the
  set/zone cellMap can be used to ensure that the original number is
  properly adjusted. For foamToVTK, the meshSubsetHelper already
  does the subsetting and is used when loading fields.

  Does not affect ParaView reader module since there we work on the
  full field and do the subsetting manually (using the cellMap).
2017-07-04 13:19:16 +02:00
Mark Olesen
02edc5b206 STYLE: tabs and line length in files, very dubious NULL in ensight reader.
- disable automatically upgrading copyrights in files since changes to
  not automatically imply a change in copyright. Eg, fixing a typo in
  comments, or changing a variable from 'loopI' to 'loopi' etc.
2017-06-26 13:43:05 +02: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
mattijs
bea9063bd3 COMP: writeVTK: label64 compilation 2017-06-15 12:31:37 +01:00
Mark Olesen
2d530401fd ENH: add foamToVTK -name option
- as per foamToEnsight, foamToEnsightParts.
  Allows the user to specify different output directories.
2017-06-14 08:14:24 +02:00
Mark Olesen
7ee1dba43a STYLE: adjust feedback comments in foamToVTK 2017-06-13 22:28:39 +02:00
Mark Olesen
cde12ad9e5 ENH: consolidate vtk classes into 'Foam::vtk' namespace
- elminate the foamVtkFormatter operator() in favour of xmlAttr.
  Improves readability and the purpose is clearer.
2017-06-13 14:10:07 +02:00
Mark Olesen
a2e978d43e ENH: add VTP, VTU output for most vtk writers (insitu only)
- with the xml append format it is possible to write raw binary
  (instead of base64), but the writer becomes more complicated.
  Either needs two passes to create, or need to allocate a block
  of space for the header information (like VTK itself does) and
  write later.

    * internalWriter
    * patchWriter
    * surfaceMeshWriter
    * lagrangianWriter

 Also these special purpose ones:
    * foamVtkWriteSurfFields
2017-06-01 18:28:40 +02:00
Mark Olesen
c4f1349496 ENH: construct VTK writers with the outputOptions and adjust internally
- this shifts responsibility away from caller to the individual writers
  for knowing which file formats are supported and which file ending is
  appropriate. When the writer receives the output format request,
  it can elect to downgrade or otherwise adjust it to what it can
  actually manage (eg, legacy vs xml vs xml-append).

  But currently still just with legacy format backends.
2017-05-31 22:08:54 +02:00
Mark Olesen
a42c35f64b ENH: paraview reader module with internal caching of the vtk geometries
- The reader module allows two levels of caching.
  The OpenFOAM fvMesh can be cached in memory, for faster loading of
  fields. Additionally, the translated VTK geometries are held in a
  local cache. The cached VTK geometries should incur no additional
  overhead since they use the VTK reference counting for their storage
  management.
2017-05-24 17:12:49 +02:00
Mark Olesen
96d98cd2de ENH: paraFoam --help => immediate pass-through to paraview --help
ENH: Paraview modules.

- Update props with int, not bool (for more versatility)
- Set properties and tool-tips directly on widgets instead of buttons
2017-05-23 08:02:25 +02:00
Mark Olesen
2495fcb42e ENH: replace foamToVTK routines with library-level equivalents 2017-05-22 16:13:53 +02:00
Mark Olesen
8a66ec9975 ENH: replace paraview vtk conversion with library utilities
- this allows filling in the VTK structures without intermediate data
  and without sequencial insertion. Should be faster and smaller
  than the previous cell-wise insertion methods.
  Most importantly, it improves code reuse.
2017-05-15 13:01:38 +02:00
Mark Olesen
1f18a0f97f ENH: replace internal meshmaps with foamVtkMeshMaps 2017-05-15 12:57:36 +02:00
Mark Olesen
2f288cfbef ENH: first pv reader version with delayed assembly of output blocks
- this greatly simplifies data management and opens the possibility of
  reusing converted vtk meshes instead of converting each time.
2017-05-15 02:06:53 +02:00
Mark Olesen
cf5ebd82db ENH: improve internal bookkeeping in paraview readers
- has the selected values directly and use these lookup names to store
  directly into a hash. This replaces several parallel lists of
  decomp information etc and makes it easier.
2017-05-14 21:42:59 +02:00
Mark Olesen
09f0cfd5c7 STYLE: reduce number of small methods in paraview reader
- improves the overview of the code
2017-05-14 21:38:15 +02:00
Mark Olesen
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
Mark Olesen
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
Mark Olesen
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
Mark Olesen
e5cdee5dd9 STYLE: use labelRange and range-based-for in paraview readers
- also use updated forAll* macros
2017-05-12 15:36:44 +02:00
Mark Olesen
49500b0194 STYLE: more meaningful variable name when using meshSubsetHelper 2017-06-14 07:56:57 +02:00
Mark Olesen
523008e85d STYLE: corrected file vs fileName for CSV files 2017-06-13 07:23:32 +02:00
Mark Olesen
0ea219adf5 TUT: consistent writeCompression option
- Use on/off vs longer compressed/uncompressed.
  For consistency, replaced yes/no with on/off.

- Avoid the combination of binary/compressed,
  which is disallowed and provokes a warning anyhow
2017-06-13 06:50:16 +02:00
Andrew Heather
b80f24948d Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop 2017-06-01 17:28:21 +01:00
Andrew Heather
6a0b35bdc8 ENH: noiseModels - updated parallel usage (no longer needs proc dirs) and apply input data validation 2017-06-01 17:27:30 +01:00
Mark Olesen
15d0a918c5 COMP: use VTK_OVERRIDE on paraview methods
COMP: avoid undefined-var-template warning in runTimePostProcessing
2017-05-18 13:21:48 +02:00
Mark Olesen
667b885116 STYLE: remove ununsed foamToVTK template functions 2017-05-17 18:59:51 +02:00
Mark Olesen
b2edd73881 ENH: simplify foamToEnsight using new IOobjectList methods
BUG: foamToEnsight fails with missing field at time 0 (fixes #473)
2017-05-17 14:41:21 +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
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
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
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
a8e3482591 Merge branch 'edge-labelPair-containers' into 'develop'
Use updated edge and labelPair containers

See merge request !106
2017-05-02 16:35:54 +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
633e4c9c7f ENH: Use edgeHashes.H and labelPairHashes.H
- avoids some duplicate code.
2017-04-27 10:15:56 +02:00
Mark Olesen
140c5110fe STYLE: remove tabs from files and shorten line-length. 2017-04-10 16:11:33 +02:00
Mark Olesen
1bdb57985f COMP: drop FOAM_EXT_LIBBIN dependency for VTK-related items
- they don't use scotch/metis anyhow, which are the only things
  placed in FOAM_EXT_LIBBIN
2017-04-04 16:22:12 +02:00
Henry Weller
c164e91b0a surfaceFilmModels::perturbedTemperatureDependentContactAngleForce: New contact angle model
Combining a Function1 temperature dependency with a distributionModel stochastic
perturbation.
2017-04-04 00:09:38 +01:00
Andrew Heather
e6b67f6790 ENH: Clean-up after latest Foundation integrations 2017-03-28 14:21:07 +01:00
Andrew Heather
436ec1cf1f MRG: Integrated Foundation code to commit ba4dbed 2017-03-23 12:11:49 +00:00
Henry Weller
32052dce23 postProcessing/noise: Updated for changes to Function1 2017-03-16 20:56:09 +00:00
Henry Weller
2e2bfd237a Function1: Rationalized construction to support the simpler sub-dictionary format
e.g.
    ramp
    {
        type     quadratic;
        start    200;
        duration 1.6;
    }

but the old format is supported for backward compatibility:

    ramp linear;
    rampCoeffs
    {
        start    200;
        duration 1.6;
    }
2017-03-16 20:53:08 +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
5fc6c3ca34 ENH: provide FOAM_EXECUTABLE as environment variable in argList
- can be used directly from within an application or function-object.
  Makes it available for dictionaries.
2017-02-24 17:48:13 +01:00
Andrew Heather
cbf793fca2 ENH: Updated header file documentation 2017-03-21 09:40:35 +00:00
Mark Olesen
c1ca2f4a38 BUG: missing chdir in Allwclean for wallFunctionTable
STYLE: improve consistency in Allwclean scripts
2017-02-23 01:07:10 +01:00
Mark Olesen
3d02c8a530 ENH: improve isolation of shell variables in wmake scripts
- reduces unexpected interactions between various make elements
2017-02-10 16:13:54 +01:00
Andrew Heather
cf501ffa0f Merge branch 'master' into develop 2017-02-10 14:00:26 +00:00
Andrew Heather
84aa391403 BUG: noise - updated creation of control dictionary to allow -case option and env variables. Fixes #402 2017-02-10 13:57:36 +00:00
Henry Weller
5dd24f4968 Removed unhelpful clutter 2017-01-26 17:47:24 +00:00
Mark Olesen
9d63cc5ca8 ENH: add versioning for VTK library to runTimePostProcessing (issue #370)
Eg,
    librunTimePostProcessing.so
    librunTimePostProcessing.so.7 -> librunTimePostProcessing.so.7.1.0
    librunTimePostProcessing.so.7.1.0

- centralize handling of paraview/vtk versioning into wmake/cmakeFunctions
2017-01-23 13:37:42 +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
f47e8513d7 ENH: avoid deprecated paraview method SetImmediateUpdate()
- add support for patch names in block mesh reader.
2017-01-12 11:41:15 +01:00
Mark Olesen
ecb80a2ee8 ENH: refactor paraview readers code to avoid duplication
- as originally intended years ago, but never actually done.

- use 'foamPvCore' instead of 'vtkPVReaders' to avoid potential name
  collisions with any 'vtk*' files and since we may reuse these
  functions in other foam-paraview modules (not just readers).

STYLE: use same font size/colour for patch-names as for point-numbers

BUG: repair issue with single time-step

- paraview time-selector returns '0' as the requested time if there is
  only one time step. However, if we have skipped the 0/ directory,
  this single time step is likely a non-zero value.
2017-01-12 06:40:58 +01:00
Mark Olesen
7a90f5e6fb ENH: add versioning to paraview plugin support libraries (issue #370)
- use "-pvMAJ.MIN" suffix for similarity with the paraview convention

- use sentinel file to ensure clean change of intermediate targets

- ensure all library files are being properly removed
2017-01-05 16:22:07 +01:00
Mark Olesen
2c96ec7550 ENH: update QT interface code for ParaView reader (issue #337)
- remove old (ParaView-3) files

- Works in 4.4.0, 5.0.1, 5.2.0 etc

STYLE:
- slots now use SM properties directly without a second lookup.
  This reduces exposure of the QT elements and simplifies the coding.

- avoid focus borders on the Qt elements

- place the "use Polyhedron" checkbox into a column

- move "Cache Mesh" down in the GUI (an advanced feature and thus
  should be less prominent)

- obtain button labels/tooltip directly from the XML content
2017-01-05 11:31:11 +01:00
Mark Olesen
4eb679614c ENH: update blockMesh reader (issue #337)
- use property group customization instead of individual pqPropertyWidget
2017-01-04 12:27:36 +01:00
Mark Olesen
71ea6bec62 ENH: update blockMesh reader for paraview 5.2 (issue #337)
- although this is not the final desired form, since it uses
  individual pqPropertyWidget customizations (ie, ugly layout, too
  many bits of code), but is an interesting intermediate solution
  that may be useful in other contexts.
2017-01-04 10:48:13 +01:00
Mark Olesen
608bb5d83b COMP: update lnInclude directories when building (issue #364)
- Could be related to interrupted builds.
  So if there are any parts of the build that rely on an explicit
  'wmakeLnInclude', make sure that the contents are properly updated.

--

ENH: improved feedback from top-level Allwmake

- Report which section (libraries, applications) is being built.

- Provide final summary of date, version, etc, which can be helpful
  for later diagnosis or record keeping.

- The -log=XXX option for Allwmake now accepts a directory name
  and automatically appends an appropriate log name.
  Eg,
      ./Allwmake -log=logs/  ->> logs/log.linux64GccDPInt32Opt

  The default name is built from the value of WM_OPTIONS.

--

BUG: shell not exiting properly in combination with -log option

- the use of 'tee' causes the shell to hang around.
  Added an explicit exit to catch this.

--

- Detecting the '-k' (-non-stop) option at the top-level Allwmake, which
  may improve robustness.

- Explicit continue-on-error for foamyMesh (as optional component)

- unify format of script messages for better readability

COMP: reduce warnings when building Pstream (old-style casts in openmpi)
2016-12-22 11:26:29 +01:00
Mark Olesen
7b4680482e ENH: use string endsWith in a few places
fieldName.endsWith("_0")
vs
    fieldName.size() > 2 && fieldName(fieldName.size()-2, 2) == "_0"
2016-12-18 23:58:45 +01:00
Andrew Heather
c0f44ac4f3 MRG: Integrated foundation code 2016-12-12 12:10:29 +00:00
Henry Weller
3d08651324 PVReaders: Update link order to avoid problems on Ubuntu
Resolves bug-report http://bugs.openfoam.org/view.php?id=2372
2016-12-06 10:57:35 +00:00
Mark Olesen
a2bba390f2 COMP: improve robustness of cmake (vtk) builds when directories have moved 2016-11-28 23:28:21 +01:00
Mark Olesen
b69ab6c895 COMP: reduce compile noise for paraview modules
- vtkkwiml headers use old-style casts, so reduce compile-time warnings
2016-11-28 22:34:38 +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
784461b2fa ENH: make search of instances in IOobject::typeHeaderOk optional (issue #245)
- in specific cases it can be useful to suppress searching the instances.
  For example, if one only wishes to check if a "points" is available at
  the given time instance, without searching backwards through all
  times.
2016-11-21 14:28:40 +01:00
Henry Weller
80db302666 Allwmake: Remove 'set -x' which generates a lot of noise
'set -x' should be used for debugging.

Added command printing into wmake and Allwmake as a replacement for
'set -x' to log current target.
2016-11-13 18:08:22 +00:00
Mark Olesen
8e30111b44 DEFEATURE: drop reader module support for paraview 3.x (issue #295)
- Cannot test if these older reader modules actually build,
  owning largely to build issues since with paraview 3.14 (Feb 2012)
  and paraview 3.98 (Dec 2012) themselves.
2016-11-11 13:30:30 +01:00
Henry Weller
23795a7fb5 PVblockMeshReader: Removed unnecessary 'UpdateGUI' button
The 'Refresh' button updates the blockMesh and the GUI.
2016-11-11 12:17:53 +00:00
Mark Olesen
7aeaf61cda ENH: getting foamToTecplot working again
- updated code to use current API level 142.

- ThirdParty build of tecio now uses CMake.
2016-11-11 09:42:28 +01:00
Henry Weller
74cfb6bf34 PVblockMeshReader: Remove old vertex labels on refresh 2016-11-05 21:41:32 +00:00
Henry Weller
a21c3d6332 PVblockMeshReader: Added "Refresh" button to update the blockMesh
Reconstructs the blockMesh and updates the display from the current
blockMeshDict so that any changes can viewed without exiting
paraFoam -block
2016-11-04 20:50:13 +00:00
Henry Weller
3ab919d407 paraFoam -block: Added support for vertex and block names
Patch contributed by Mattijs Janssens
2016-11-04 17:29:02 +00:00
Mark Olesen
d2fc2c9edc ENH: improved infrastructure for writing VTK content
Note: classes are prefixed with 'foamVtk' instead of 'vtk' to avoid potential
conflicts with VTK itself.

foamVtkCore
~~~~~~~~~~~
- General very low-level functionality.

foamVtkPTraits
~~~~~~~~~~~~~~
- Traits type of functionality for VTK

foamVtkOutputOptions
~~~~~~~~~~~~~~~~~~~~
- The various format output options as a class that can be passed to
  formatters etc.

foamVtkCells
~~~~~~~~~~~~
- Intended for unifying vtkTopo and PV-Reader code in the future.
- Handles polyhedron decompose internally etc

foamVtkOutput, foamVtkFormatter
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Output helpers.
- Selector for individual formatters.
  Currently write all scalar data a 'float' (not 'double'). Can
  revisit this in the future.
2016-11-03 14:24:00 +01:00
Henry Weller
009203188f blockMesh: New experimental support for projecting block face point to geometric surfaces
For example, to mesh a sphere with a single block the geometry is defined in the
blockMeshDict as a searchableSurface:

    geometry
    {
        sphere
        {
            type searchableSphere;
            centre (0 0 0);
            radius 1;
        }
    }

The vertices, block topology and curved edges are defined in the usual
way, for example

    v 0.5773502;
    mv -0.5773502;

    a 0.7071067;
    ma -0.7071067;

    vertices
    (
        ($mv $mv $mv)
        ( $v $mv $mv)
        ( $v  $v $mv)
        ($mv  $v $mv)
        ($mv $mv  $v)
        ( $v $mv  $v)
        ( $v  $v  $v)
        ($mv  $v  $v)
    );

    blocks
    (
        hex (0 1 2 3 4 5 6 7) (10 10 10) simpleGrading (1 1 1)
    );

    edges
    (
        arc 0 1 (0 $ma $ma)
        arc 2 3 (0 $a $ma)
        arc 6 7 (0 $a $a)
        arc 4 5 (0 $ma $a)

        arc 0 3 ($ma 0 $ma)
        arc 1 2 ($a 0 $ma)
        arc 5 6 ($a 0 $a)
        arc 4 7 ($ma 0 $a)

        arc 0 4 ($ma $ma 0)
        arc 1 5 ($a $ma 0)
        arc 2 6 ($a $a 0)
        arc 3 7 ($ma $a 0)
    );

which will produce a mesh in which the block edges conform to the sphere
but the faces of the block lie somewhere between the original cube and
the spherical surface which is a consequence of the edge-based
transfinite interpolation.

Now the projection of the block faces to the geometry specified above
can also be specified:

    faces
    (
        project (0 4 7 3) sphere
        project (2 6 5 1) sphere
        project (1 5 4 0) sphere
        project (3 7 6 2) sphere
        project (0 3 2 1) sphere
        project (4 5 6 7) sphere
    );

which produces a mesh that actually conforms to the sphere.

See OpenFOAM-dev/tutorials/mesh/blockMesh/sphere

This functionality is experimental and will undergo further development
and generalization in the future to support more complex surfaces,
feature edge specification and extraction etc.  Please get involved if
you would like to see blockMesh become a more flexible block-structured
mesher.

Henry G. Weller, CFD Direct.
2016-10-13 15:05:24 +01:00
Henry Weller
8dd18cc077 vtkPVblockMeshConvert: Updated to use the new blockDescriptor::edgesPointsWeights 2016-10-09 17:52:52 +01:00
Henry Weller
3ea71fb56a foamToTecplot360: Updated to use tmp.ref()
Patch contributed by Bruno Santos
Resolves bug-report http://bugs.openfoam.org/view.php?id=2288
2016-10-09 15:13:50 +01:00
Henry Weller
50b549f368 blockMesh: rationalizing class and member names 2016-10-08 19:48:39 +01:00
Henry Weller
9e1e9011a5 decomposePar: Corrected construction of cloud for processors
Resolves bug-report http://bugs.openfoam.org/view.php?id=2239
2016-09-21 17:19:58 +01:00
Henry Weller
49bce39429 PV*Readers/Allwmake: set CXX and CC if required
Patch contributed by Bruno Santos
Resolves bug-report http://bugs.openfoam.org/view.php?id=2233
2016-09-04 21:05:20 +01:00
Henry Weller
bf9c6b6d17 foamToVTK, PVFoamReader: Resolve problems converting VTK_WEDGE
- There will be triangles rendered inside the mesh (when
    surface-rendering), because one of the cell's triangles is defined
    as a quadrangle in VTK_WEDGE.

  - Therefore, this VTK_WEDGE representation is only used when
    decomposing the mesh, otherwise the correct representation is done
    by VTK_POLYHEDRON.

  - Furthermore, using VTK_PYRAMID gave worse result, because it renders
    2 triangles inside the mesh for the collapsed quadrangle, likely due
    to mismatch with the adjacent cell's face.

  - Using VTK_HEXAHEDRON was not tested in this iteration, given that it
    should give even worse results, when compared to using VTK_PYRAMID.

Patch contributed by Bruno Santos
Resolves bug-report http://bugs.openfoam.org/view.php?id=2099
2016-08-24 22:08:10 +01:00
Henry Weller
655fb3841a foamToVTK::vtkTopo: Apply fix from #1633
Patch contributed by Bruno Santos
Resolves bug-report http://bugs.openfoam.org/view.php?id=2213
2016-08-24 09:45:23 +01:00
Henry Weller
72bd9fd6cd ParaView: GUI resource files in plugins are no longer supported
Patch contributed by Bruno Santos
Resolves bug-report http://bugs.openfoam.org/view.php?id=2192
2016-08-16 08:46:39 +01:00
Henry Weller
6f098748cc functionObjects: Separated writeFile and logFiles (previously writeFiles) from regionFunctionObject
Now the functionality to write single graph files or log files (vs time)
may be used in the creation of any form of functionObject, not just
those relating to a mesh region.
2016-08-07 15:23:55 +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
Mark Olesen
e5d9fd13c2 ENH: relocate meshSubsetHelper into dynamicMesh for re-use
- reuse for foamToTecplot360 and foamToVTK.
- remove dependency on vtkMesh where possible.
2016-11-09 23:33:24 +01:00
Mark Olesen
f0107b47f5 Merge branch 'ensight-preview' into 'develop'
Reworking of the ensight infrastructue and new ensightWrite function object



See merge request !70
2016-11-03 08:24:52 +00:00
Andrew Heather
40ed1952c3 ENH: noise models - enable the use of environment variables in input file names. Fixes #285 2016-11-01 20:51:51 +00:00
Andrew Heather
c499de996b ENH: Removed unused file 2016-11-01 14:29:20 +00:00
Mark Olesen
aca0b1ca04 COMP: ensight writer compilation for 64-bit labels (issue #263)
GIT: added missing source file.

ENH: add tutorial example under incompressible/simpleFoam/motorBike
2016-10-28 11:49:05 +02:00
Mark Olesen
b2ee629a94 BUG: removed oddness in pointer allocations (ensight parts).
- manifest in some parallel operations.

STYLE: update foamToEnsight, foamToEnsightParts to use C++ initializer_list

- avoid warning message when removing a non-existent directory (ensight output).
2016-10-27 15:11:30 +02:00
Andrew Heather
af81184ecf MRG: Resolve conflict with latest foundation merge 2016-10-26 15:37:15 +01: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
Mark Olesen
3915942195 ENH: cleanup ensightParts to use updated infrastructure (issue #241).
- Use ensightCase for case writing.
  Rebase ensightPartCells/ensightPartFaces on
  ensightCells/ensightFaces routines.

- Greatly reduces code duplication potential source of errors.
2016-10-07 11:24:47 +02:00
Mark Olesen
9b3f36d593 STYLE: reinstate targetType when building paraview modules (related to #258)
- potentially useful for static builds
2016-10-07 10:51:32 +02:00
Mark Olesen
b04a6a05e5 GIT: relocate ensight components to library locations 2016-10-05 13:13:12 +02:00
Mark Olesen
e57ca15bda ENH: complete reworking of foamToEnsight to make into a library (issue #241)
- eliminate ensightAsciiStream, ensightBinaryStream, ensightStream in
  favour of using ensightFile and ensightGeoFile classes throughout.

- encapsulate mesh-parts sorting with the ensightCells, ensightFaces
  class.

- handle of patches/faceZones entirely within ensightMesh for a lighter
  interaction with field output. Both faceZones and point fields need
  more testing to see if they behave properly for all cases.

- move some output functionality into its own namespace
  'ensightOutput', move into a library.

- use the ensightCase class to open new ensight output streams
  in the proper sub-directory locations.
2016-10-06 10:43:22 +02:00
Mark Olesen
68ad4c50b2 BUG: paraview plugin not being built in merged version (closes #258) 2016-10-04 15:58:24 +02:00
Mark Olesen
3e0e4532fd STYLE: minor adjustments to doxygen comments 2016-10-04 09:16:08 +02:00
Andrew Heather
bd0e982d99 MRG: Initial commit after latest Foundation merge 2016-09-30 11:16:28 +01:00