Commit Graph

252 Commits

Author SHA1 Message Date
4272820fca BUG: writeFile: Increased the number of value characters
The number of characters needed to print a double in scientific format
is 8 plus the number of decimal places; e.g., -6.453452e-231 (6 decimal
places, 14 characters). This has been set in writeFile.C, replacing a
value of 7. Presumably, the case of three digits in the exponent was not
considered when this was first implemented. This change ensures at least
one character of whitespace between tabulated numbers.

This resolves bug report https://bugs.openfoam.org/view.php?id=2801
2018-01-04 08:33:46 +00:00
4fc4f49cef ENH: Updated fieldAverage FO windowing. See #525
When specifying the averaging data, a new `windowType` option is
available, taking the values:

- none: no windowing
- approximate: past functionality (v1706 and earlier)
- exact: exact moving average - will store and write (for restart) all
  fields in the window
2017-08-09 16:52:03 +01:00
a79d2835f1 ENH: functionObjectList: format errors from FO reading. Fixes #575. 2017-10-30 11:43:12 +00:00
fb20bc107e INT: Updated dependent code following latest set of integrations 2017-09-06 16:05:12 +01:00
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
0e7954c22b BUG: sampledTriSurfaceMesh: sampling outside of mesh. Fixes #575.
There are a few issues:
- error would only throw exceptions if not parallel
- if we change this we also need to make sure the functionObjectList
  construction is synchronised
- bounding box overlap was not returning the correct status so the code
  to avoid the issue of 'badly formed bounding box' was not triggered.
2017-08-29 14:41:22 +01:00
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
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
8df433860f STYLE: use string substr instead of string::operator()
- makes the purpose clearer.
  In some places, string::resize() is even simpler.

- use C++11 string::back() in preference to str[str.size()-1]
2017-07-21 12:30:42 +02:00
2c69b7d7c4 STYLE: adjust some line lengths, doxygen comments 2017-07-20 13:50:35 +02:00
2fe3a62057 STYLE: use nullptr instead of 0 in autoPtr, tmp etc. 2017-07-14 16:50:21 +02:00
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
bc1f2fa97e STYLE: use auto and cfind to simplify selector usage (issue #512) 2017-07-03 10:36:03 +02:00
f55c568f13 ENH: upgrade from NamedEnum to Enum (issue #515) 2017-07-03 21:43:33 +02:00
d415bf77bf Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop 2017-06-26 13:33:19 +01:00
89e175958f ENH: function object: added helper function to return a local scope name 2017-06-26 13:23:45 +01:00
e0e457bd7d STYLE: Updated to read from parent instead of skipping to base class 2017-06-26 13:21:34 +01:00
2dc8038092 ENH: timeControl: adds some more #423. 2017-06-26 11:51:14 +01:00
34a1a5dec2 STYLE: Minor corrections to comments/fix typos 2017-06-23 12:13:46 +01:00
7e6faf049c Squashed commit of the following:
commit 510b9353f8cb932a87f1588b17a4dea230c29d3c
Author: mattijs <mattijs>
Date:   Wed Jun 14 16:36:35 2017 +0100

    ENH: timeControl: propagate time-change logic from Time.C

commit 6dc57a8f1e0e7605ea819deb6f11dd4b7874ff30
Author: mattijs <mattijs>
Date:   Thu Jun 1 11:28:56 2017 +0100

    ENH: timeControl: cleanup; avoid division by zero

commit 5ac4bc2dd8c1f4676eef9d7a03215caba23a2e19
Author: mattijs <mattijs>
Date:   Wed May 31 12:04:52 2017 +0100

    ENH: timeControl: allow ramping down as well as up.

commit a6b2db9e791f29258f04f3a9cbd6354aa468977d
Author: mattijs <mattijs>
Date:   Wed May 17 15:29:22 2017 +0100

    ENH: timeControl: limit any timestep change if deltaTCoeff enabled.

commit 004115ee03a6637ae0d23cce303a30d1b3af046f
Author: mattijs <mattijs>
Date:   Wed May 17 11:40:26 2017 +0100

    ENH: setTimeStep: have timeStart, timeEnd controls on time step adjustment.

    Also added smoothly varying time step change (through optional deltaTCoeff)
2017-06-14 16:40:17 +01:00
bb67ccd37d ENH: Cleaned up hash table item found checks 2017-05-19 11:15:35 +01:00
99f31a75f0 COMP: Removed override directives to remove compiler warnings 2017-05-18 12:40:48 +01:00
4ce77f6843 Merge branch 'master' into develop 2017-04-25 12:31:22 +01:00
d26ed93389 BUG: writeFile - corrected write of output file at start time 2017-04-25 12:30:35 +01:00
da6e90de63 Merge branch 'feature-readNow' into 'develop'
Feature read now

See merge request !102
2017-04-19 17:22:28 +01:00
140c5110fe STYLE: remove tabs from files and shorten line-length. 2017-04-10 16:11:33 +02:00
2da2970c7c BUG: timeActivatedFileUpdate: was potentially rereading itself!
Fixed by setting flag which then gets queried by Time. Fixes #420.
2017-04-06 10:26:16 +01:00
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
6b3742c3f1 BUG: Missed change during fix for #437 2017-03-21 13:57:55 +00:00
69bc13f300 BUG: Function objects - updated to enable user time emtries, e.g. if using engineTime. Fixes #437 2017-03-21 13:32:55 +00:00
2853678a60 ENH: support operations on surfFields in surfaceFieldValue
- this makes it possible to perform additional operations
  on surface values that have been previously sampled.

- support vectorField for weighting operations.

- reduce overhead by avoiding creation of weight fields, Sf fields
  and combined surface geometries unless they are actually required.

- extend some similar concepts and operations to volFieldValue
2017-03-02 14:50:36 +01:00
eed3b77060 ENH: Function objects - updated logic to determine whether or not to instantiate a time-based function object. Fixes #439 2017-03-21 16:55:24 +00:00
694a03dfeb Merge branch 'master' into develop 2017-03-21 13:58:06 +00:00
2f41df18e3 Merge branch 'master' into develop 2017-03-21 13:36:26 +00:00
f532a99dc3 ENH: logFiles - minor change to suppress compiler warning 2017-02-03 14:34:19 +00:00
b4f0b2930d STYLE: Minor code tidying 2017-02-03 12:20:58 +00:00
680ba0f214 BUG: timeControl: add tolerance to timeStart, timeEnd. Fixes #367. 2017-01-04 11:17:12 +00:00
58b6fae81a BUG: Corrected logFiles usage for parallel running; doc updates. Fixes #366 2016-12-23 10:30:29 +00:00
f0a046fa81 GIT: Resolved conflict 2016-12-14 15:56:58 +00:00
fbd4ff38b0 STYLE: correct the documented behaviour of 'none' for function objects
- cf. Line 224 of timeControl.C
2016-12-13 10:11:17 +01:00
989883d62b GIT: Resolved merge conflict 2016-12-12 12:23:45 +00:00
c0f44ac4f3 MRG: Integrated foundation code 2016-12-12 12:10:29 +00:00
8321f1ffcc ENH: initial support for handling subRegions in regionFunctionObject
- propagate updated objectRegistry methods (eg, lookupObjectRef etc)
  into regionFunctionObject
2016-12-07 12:09:21 +00:00
86982f5eb7 ENH: writeFile - return bool on successful read 2016-11-29 14:45:45 +00:00
9c4653e9c1 functionObject.H: Updated documentation
Patch contributed by Bruno Santos
Resolves patch request http://bugs.openfoam.org/view.php?id=2355
2016-11-26 18:42:25 +00:00
043bf18d98 functionObjects::grad: Avoid cache conflict with 'postProcess' utility
Resolves bug-report http://bugs.openfoam.org/view.php?id=2350
2016-11-24 23:04:01 +00:00
fb78378959 ENH: Function objects - ensure objects are up-to-date when writing 2016-11-24 12:36:52 +00:00
c10177fc6f BUG: writeFile - fileName was not set after last merge 2016-11-01 16:05:18 +00:00
3c9e050d6e ENH: stateFunctionObject - separated dictionary access and updated api to return result status for retrieving properties 2016-10-21 17:01:35 +01:00
bd0e982d99 MRG: Initial commit after latest Foundation merge 2016-09-30 11:16:28 +01:00