Commit Graph

51 Commits

Author SHA1 Message Date
c594d0ae91 STYLE: carp() method is const 2018-12-16 22:07:56 +01:00
d1caaa0529 ENH: build dummy runTimePostProcessing if VTK/ParaView are not available
- this allows more use of the runTimePostProcessing functionObject
  that will fail more gracefully if the proper version could not be
  built.

  The dummy functionObject simply emits a message that it is not available.
2018-12-15 18:08:51 +01:00
5c8a1b746d STYLE: use <case> instead of $FOAM_CASE expansion in more places 2018-10-15 21:19:13 +02:00
5f3f101b4e BUG: Doxygen corrections 2018-09-11 12:13:19 +01:00
aec949d7cc ENH: Consistency improvement for setting postProcessing directory name 2018-02-27 14:37:05 +00:00
f9fe71815a STYLE: consistent use of '= delete' for removed constructors/assignments
- make the purpose more explicit, and reduces some work for the
  compiler as well.
2018-05-30 12:03:17 +02:00
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
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
610c290969 ENH: added functionObject::execute(int) method
- this is a provision for defining execute actions that can be called
  largely independently of the normal time-loop constraints. This can
  be useful to provide hooks for sub-cycling, or to define an action
  that can be triggered manually or on some other event.
2017-11-28 10:00:15 +01:00
89e175958f ENH: function object: added helper function to return a local scope name 2017-06-26 13:23:45 +01: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
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
c0f44ac4f3 MRG: Integrated foundation code 2016-12-12 12:10:29 +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
3dbd39146c STYLE: consistency updates 2016-09-27 15:17:55 +01:00
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
7200384f18 Corrected documentation for Doxygen 2016-06-21 11:04:34 +01:00
71fdcab771 Updated header documentation processed by Doxygen 2016-06-19 21:23:54 +01:00
6a53ed41ba Doxygen documentation: Standardized the 'See also' heading 2016-06-17 17:31:34 +01:00
de4c018b19 Doxygen documentation: Remove superfluous linebreak 2016-06-17 17:13:39 +01:00
ae1a6dd12d functionObjects: Simplified the handling of the post-processing mode
Replaced the 'postProcess' argument to the 'write' and 'execute'
functions with the single static member 'postProcess' in the
functionObject base-class.
2016-06-13 08:36:03 +01:00
18b632e71d Utilities patchAverage and patchIntegrate replaced by postProcess
e.g.
    postProcess -func 'patchAverage(name=inlet,p)'
    postProcess -func 'patchIntegrate(name=inlet,p)'
2016-06-12 22:32:15 +01:00
447c850987 functionObjectList: Added support for 'libs' to load libraries for all functionObjects
e.g.

functions
{
    libs ("libfieldFunctionObjects.so");

    div
    {
        type            div;
        field           U;
        executeControl  writeTime;
        writeControl    writeTime;
    }

    Q
    {
        type            Q;
        executeControl  writeTime;
        writeControl    writeTime;
    }
}
2016-05-21 20:01:42 +01:00
5af1a7e4f3 functionObjects::partialWrite: Redundant and removed
the equivalent functionality is provided by the writeRegisteredObject
   functionObject in a MUCH simpler, easier and extensible manner.

functionObject: Removed the now redundant 'timeSet' function.
2016-05-18 12:23:29 +01:00
83bae2efd3 functionObjects: Renamed dictionary entry 'functionObjectLibs' -> 'libs'
This changes simplifies the specification of functionObjects in
controlDict and is consistent with the 'libs' option in controlDict to
load special solver libraries.

Support for the old 'functionObjectLibs' name is supported for backward compatibility.
2016-05-16 22:09:01 +01:00
78d2971b21 functionObjects: rewritten to all be derived from 'functionObject'
- Avoids the need for the 'OutputFilterFunctionObject' wrapper
  - Time-control for execution and writing is now provided by the
    'timeControlFunctionObject' which instantiates the processing
    'functionObject' and controls its operation.
  - Alternative time-control functionObjects can now be written and
    selected at run-time without the need to compile wrapped version of
    EVERY existing functionObject which would have been required in the
    old structure.
  - The separation of 'execute' and 'write' functions is now formalized in the
    'functionObject' base-class and all derived classes implement the
    two functions.
  - Unnecessary implementations of functions with appropriate defaults
    in the 'functionObject' base-class have been removed reducing
    clutter and simplifying implementation of new functionObjects.
  - The 'coded' 'functionObject' has also been updated, simplified and tested.
  - Further simplification is now possible by creating some general
    intermediate classes derived from 'functionObject'.
2016-05-15 16:40:01 +01:00
ded5f35dd6 functionObjects: Separated 'execute' and 'write' functions to simplify support for post-processing 2016-05-13 09:05:29 +01:00
6164c2f262 Standardized the naming of functions which control the writing of fields etc.
to have the prefix 'write' rather than 'output'

So outputTime() -> writeTime()

but 'outputTime()' is still supported for backward-compatibility.

Also removed the redundant secondary-writing functionality from Time
which has been superseded by the 'writeRegisteredObject' functionObject.
2016-05-12 17:38:01 +01:00
c983670c91 functionObjects: Changed options 'outputControl' -> 'writeControl' and 'outputInterval' -> 'writeInterval'
for consistency with the time controls in controlDict and to avoid
unnecessary confusion.  All code and tutorials have been updated.

The old names 'outputControl' and 'outputInterval' are but supported for
backward compatibility but deprecated.
2016-05-12 11:38:11 +01:00
82151962c5 functionObjects: Removed redundant "start()" member function 2016-05-11 10:20:39 +01:00
32dbb01e96 functionObjectList: Rationalized and simplified the handling of disabled functionObjects
Simplified and generalized the handling of functionObjects which fail to
construct by removing them from the list rather than maintaining an
"enabled" switch in each functionObject.
2016-05-11 09:03:52 +01:00
5469e21fe2 execFlowFunctionObjects: Replaced with script providing instructions to use the '-postProcess' option 2016-05-09 17:02:00 +01:00
4281d14eb1 functionObjects: Updated documentation 2016-05-04 21:01:22 +01:00
891b2a0f8b functionObjects: Moved functionObjects namespace documentation into functionObject.H 2016-05-04 13:56:36 +01:00
67e2d02800 functionObjectFile: Separated into functionObjectFile and functionObjectFiles
functionObjectFile provides basic directory, file and formatting functions
functionObjectFiles provides multi-file cache
2016-04-30 09:18:42 +01:00
42fb1b9e8e Updated notImplemented -> NotImplemented
The new NotImplemented macro uses __PRETTY_FUNCTION__ for GNU compatible
compilers otherwise __func__ to provide the function name string.
2015-11-01 10:26:37 +00:00
2d773bc089 ENH: adding hook adjustTimeStep to function objects. The hook is called in
Time::adjustDeltaT(). It allows function objects to manipulate the time step to
    dump at adjustable times. The following options are available for output in
    function objects: timeStep, outputTime, adjustableTime, runTime, clockTime
    and cpuTime.
2013-09-09 14:13:21 +01:00
a50d78ea93 EMH: Adding a hook to functionObject called 'timeSet' at the
end of Time::operator++. This allows to know if the next timeIndex will be
a dumping time. The function object "partialWrite" modifyes the write option
of the those fields which will be written down at given intervals of the overall
outout times.
2013-06-07 10:11:07 +01:00
6aba1d08f8 ENH: Updated moving mesh support in function objects 2012-12-13 10:39:43 +00:00
c2dd153a14 Copyright transfered to the OpenFOAM Foundation 2011-08-14 12:17:30 +01:00
95d8fd4860 STYLE: Updated copyright dates 2011-05-11 11:34:38 +01: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
797c4a7457 ENH: functionObjects: force writing when used through execFlowFunctionObjects 2010-10-26 16:23:36 +01:00
d79237597e STYLE: Fixing code style requirements for all src. 2010-07-28 13:31:46 +01:00
b6f3bd4c23 STYLE: follow coding guide recommendation for '//- Destructor' 2010-04-12 11:55:52 +02:00
0a746b6a82 STYLE: Corrected incorrect comment and minor formatting 2010-04-07 11:40:28 +01:00
d29c438657 STYLE: use url for FSF license instead of postal address, switch to GPL v3 2010-03-29 14:07:56 +02:00
dedabab18f expose name of functionObjects 2009-07-21 17:28:27 +01:00