Commit Graph

56 Commits

Author SHA1 Message Date
56bfc75949 Rationalize the "pos" function
"pos" now returns 1 if the argument is greater than 0, otherwise it returns 0.
This is consistent with the common mathematical definition of the "pos" function:

https://en.wikipedia.org/wiki/Sign_(mathematics)

However the previous implementation in which 1 was also returned for a 0
argument is useful in many situations so the "pos0" has been added which returns
1 if the argument is greater or equal to 0.  Additionally the "neg0" has been
added which returns 1 if if the argument is less than or equal to 0.
2017-06-22 14:32:18 +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
bc1f2fa97e STYLE: use auto and cfind to simplify selector usage (issue #512) 2017-07-03 10:36:03 +02:00
bf2ed1abcf ENH: Updated pressure-work term creation for moving meshes 2017-06-27 11:18:55 +01:00
2af602c2f4 STYLE: for Istream/Ostream check() use FUNCTION_NAME in messages 2017-05-26 10:59:16 +02:00
bb67ccd37d ENH: Cleaned up hash table item found checks 2017-05-19 11:15:35 +01:00
7c12f7743b boundaryField() -> boundaryFieldRef() 2016-04-23 23:16:30 +01:00
7ba41e0095 Removed duplicate, inconsistent and spurious comments in .C files 2016-02-29 18:33:54 +00:00
cd852be3da OpenFOAM: Updated all libraries, solvers and utilities to use the new const-safe tmp
The deprecated non-const tmp functionality is now on the compiler switch
NON_CONST_TMP which can be enabled by adding -DNON_CONST_TMP to EXE_INC
in the Make/options file.  However, it is recommended to upgrade all
code to the new safer tmp by using the '.ref()' member function rather
than the non-const '()' dereference operator when non-const access to
the temporary object is required.

Please report any problems on Mantis.

Henry G. Weller
CFD Direct.
2016-02-26 17:31:28 +00:00
f4ba71ddd0 OpenFOAM libraries: Updated to use the new const-safe tmp 2016-02-26 08:13:59 +00:00
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
8628ef2fea Corrected capitalization of Doxygen documentation comments 2015-02-14 13:10:15 +00:00
1cba7e17b5 fvMotionSolverEngineMesh: construct the motionSolver from the engineTime IOdictionary
Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=774
2015-02-05 12:27:46 +00:00
52e78fb331 fvMotionSolverEngineMesh: Corrected handling of the piston and liner velocity
Changed the motion specification to be point-based rather than cell-based.
Resolves bug report http://www.openfoam.org/mantisbt/view.php?id=766
2013-03-12 17:00:48 +00:00
a07b59c279 STYLE: Updated copyright year 2013-01-21 16:49:49 +00:00
685635e6a3 ENH: Deleting parabolicCylindricalCS, sphericalCS and toroidalCS
coordinate systems
Modifying constructors from dictionary of coordinateSystem class (no
default type)
Adding localAxesRotation type. It constructs a axes-rotation tensor on each
cell centre.
Adding functionality to coordinateRotation blase class (transformTensor,
transformVector, etc)
2013-01-21 12:17:17 +00:00
100a25ee25 STYLE: defineDebug: move into Foam namespace 2012-12-17 17:35:42 +00:00
3ac086402d COMP: sampling: moved sampledSet writers to fileFormats library 2012-11-16 13:11:17 +00:00
bee3d042ab ENH: fvMotionSolverEngineMesh: updated for new fvMotionSolver 2012-08-31 16:55:59 +01:00
f3590edfa0 BUG: Time: restart with non-standard Time (e.g. engineTime) compared values instead of names. 2012-02-23 14:55:28 +00:00
ca4b8c347c ENH: polyMesh,meshSearch: default value on findCell, pointInCell 2011-11-08 17:03:54 +00:00
ee11f9c0e8 ENH: pointInCell, findCell: switchable in-cell algorithm 2011-10-28 11:33:30 +01:00
c2dd153a14 Copyright transfered to the OpenFOAM Foundation 2011-08-14 12:17:30 +01:00
1a0095489b gcc-4.6.0 warnings: removed initialised but unused variables 2011-04-06 22:55:47 +01:00
c8078e73e1 engineFoam: Corrected mesh construction and tutorial 2011-03-18 10:25:25 +00:00
c3cb632c24 Documentation: converted javadoc @ to LaTeX style \ in Doxygen code docs 2011-02-08 18:22:00 +00:00
eaef8d482b STYLE: Updated 1991 start copyright year to 2004 2011-01-14 16:08:00 +00:00
099cc39e2e Revert "STYLE: 2011 copyright date."
This reverts commit b18f6cc1ce.
2011-01-05 18:24:29 +00:00
b18f6cc1ce STYLE: 2011 copyright date. 2011-01-05 11:14:26 +00:00
bd7d27e622 COMP: avoid ambiguous construct from tmp - engine 2010-12-17 16:43:37 +01:00
28345247a7 STYLE: Fixing code style requirements for more files - those not
picked up by a copyright change.
2010-07-29 11:28:44 +01:00
d79237597e STYLE: Fixing code style requirements for all src. 2010-07-28 13:31:46 +01:00
28b1a9e2c6 Merge branch 'olesenm' 2010-06-03 10:25:03 +01:00
c51a2b0f63 ENH: have MUST_READ_IF_MODIFIED on IOdictionary construction 2010-06-02 09:48:07 +01:00
9525d57d71 STYLE: use readIfPresent instead of found/lookup combination 2010-05-20 08:52:45 +02:00
1075587fc1 STYLE: fully scope some method names 2010-04-29 15:12:44 +02:00
03338b9ea9 STYLE: partial revert for 5cfa97624e 2010-04-23 10:23:08 +02:00
5cfa97624e STYLE: more consistent New methods, use unregistered IOobject where appropriate 2010-04-20 17:13:35 +02:00
937e0d23d0 STYLE: consistent naming of files containing the 'New' method
before:
    - 'new' prefixed to camel-cased class name: eg, someClass -> newSomeClass
    - 'New' prefixed to templated class name:   eg, TmplClass -> NewTmplClass
    - 'New' suffixed to class name:             eg, someClass -> someClassNew

after:
    - consistent 'New' suffixed to class name, no change of case
          eg, someClass -> someClassNew
          eg, TmplClass -> TmplClassNew
2010-04-13 18:47:47 +02:00
b6f3bd4c23 STYLE: follow coding guide recommendation for '//- Destructor' 2010-04-12 11:55:52 +02:00
a50f01b079 STYLE: use forAllIter, forAllConstIter instead of long-hand version
STYLE: use 'forAll(' NOT 'forAll (', as per coding guide
2010-04-12 11:18:38 +02:00
d29c438657 STYLE: use url for FSF license instead of postal address, switch to GPL v3 2010-03-29 14:07:56 +02:00
5e972c772f remove trailing space from some files 2009-12-04 13:39:35 +01:00
9221793088 Changing
deltaT().value() to deltaTValue()
and
    deltaT0().value() to deltaT0Value()
across the whole code - faster to return especially if being used
often, in each call to a submodel for example.
2009-10-21 16:36:07 +01:00
d6a278f2b2 Introduced the new file unitConversion.H to hold degToRad, radToDeg
and other unit conversion functions as they are required e.g. slug <-> kg.
2009-10-21 10:55:00 +01:00
61a577c860 minor cleanup on constants/
- removed/renamed one level of directories, not all constants are dimensioned
    global/dimensionedConstants -> global/constants/
    global/dimensionedConstants/constants/* -> global/constants/

- formatting and doxygen cleanup

- added degToRad() and radToDeg() inline functions (in mathematicalConstants)
  removed equivalent degToRad() from engineTime
2009-10-19 13:00:33 +02:00
e9da288118 Reverted the Americanism "math" back to the original "mathematical" and reverted name of
the include file back to mathematicalConstants.H to make upgrading code slightly easier.
2009-10-10 22:58:58 +01:00
8dcea0f8cd using new constant definitions 2009-08-28 18:04:22 +01:00
31c76da40f Changed the runtime-selection tables to output a sorted toc. 2009-08-06 18:01:28 +01:00
5dd31ee0e5 Bug fixes from Niklas. 2009-04-08 16:53:05 +01:00