Commit Graph

88 Commits

Author SHA1 Message Date
Mark Olesen
dc521b95df STYLE: consistent use of '= delete' 2018-05-30 12:03:17 +02:00
mattijs
977a9894b4 ENH: codedMotionSolver: motion solver with user-supplied coding 2018-05-21 08:59:01 +01:00
Mark Olesen
dd8341f659 ENH: make format of ExecutionTime = ... output configurable (issue #788)
- controlled by the the 'printExecutionFormat' InfoSwitch in
  etc/controlDict

      // Style for "ExecutionTime = " output
      // - 0 = seconds (with trailing 's')
      // - 1 = day-hh:mm:ss

   ExecutionTime = 112135.2 s  ClockTime = 113017 s

   ExecutionTime = 1-07:08:55.20  ClockTime = 1-07:23:37

- Callable via the new Time::printExecutionTime() method,
  which also helps to reduce clutter in the applications.
  Eg,

     runTime.printExecutionTime(Info);

  vs

     Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
         << "  ClockTime = " << runTime.elapsedClockTime() << " s"
         << nl << endl;

--

ENH: return elapsedClockTime() and clockTimeIncrement as double

- previously returned as time_t, which is less portable.
2018-04-27 15:00:34 +02:00
Mark Olesen
ef922b6917 STYLE: adjust codeTemplates to use '= delete' 2018-04-19 07:38:31 +02:00
Mark Olesen
5947f9a337 ENH: more succinct output from command-line errors.
- unknown options or missing option values now emit a shorter message
  without the entire usage. This makes it easier to identify the errors
  and is better aligned with the behaviour of GNU system tools.

  ====
     $ simpleFoam -case
     Using: OpenFOAM-plus (see www.OpenFOAM.com)
     Build: plus-01234

     Error: option '-case' requires an argument

     See 'simpleFoam -help' for usage
  ====

- provide for reduced (-help) and full (-help-full) usage information.
  In many cases the reduced usage provided sufficient and easier
  to find the information.

- make -srcDoc an alias for -doc-source

- no warnings about option aliases for future dates.
2017-11-24 10:27:11 +01:00
Mark Olesen
c0ba7bf05a STYLE: use Ostream writeEntry when writing key/value entries
- makes for clearer code

ENH: make writeIfDifferent part of Ostream
2017-11-06 00:49:24 +01:00
Henry Weller
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
Henry Weller
f96db2d600 BUG: codedFvOptionTemplate: updated 'setValue' to 'constrain'
Resolves bug-report https://bugs.openfoam.org/view.php?id=2579
2017-06-13 16:52:16 +01:00
Mark Olesen
2b249e1ad3 STYLE: avoid default copyright assignment when generating from code templates 2017-07-11 08:58:52 +02:00
Mark Olesen
9097801105 STYLE: additional divisions for code templates 2017-07-11 08:48:10 +02:00
Mark Olesen
2af602c2f4 STYLE: for Istream/Ostream check() use FUNCTION_NAME in messages 2017-05-26 10:59:16 +02:00
Andrew Heather
91b90da4f3 Integrated Foundation code to commit 104aac5 2017-05-17 16:35:18 +01:00
Will Bainbridge
ea257737df codeTemplates: The copyright year is now set automatically 2017-04-18 11:01:41 +01:00
Mark Olesen
865f09e623 STYLE: comments in codedFvOptionTemplate 2017-03-07 18:48:57 +01:00
Mark Olesen
26cd9ae174 STYLE: update foam comment template 2017-02-09 11:52:32 +01:00
Henry Weller
4fcdb0b4e4 codedFvOption: Added cellSet support
Patch provided by Mattijs Janssens
Resolves bug-report http://bugs.openfoam.org/view.php?id=2240
2016-09-09 12:29:06 +01:00
Henry Weller
71fdcab771 Updated header documentation processed by Doxygen 2016-06-19 21:23:54 +01:00
Henry Weller
b3f3562d3c Doxygen documentation: Use the standard 'Usage' rather than the '\heading....' 2016-06-17 17:22:24 +01:00
Henry Weller
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
Henry Weller
83c7e97655 dynamicCode: Renamed 'redirectType' to 'name' to clarify the purpose
of the entry which is to provide the name of the generated class.

'redirectType' is supported for backward-compatibility.
2016-05-18 23:10:42 +01:00
Henry Weller
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
Henry Weller
354bc8bdcb dynamicCode: the "code" entry is now optional
codedFunctionObject: Added the "codeWrite" entry
    for the "write" function for consistency.
    The previous method of using the "code" entry for the "write"
    function was inconsistent and very confusing.
2016-05-18 12:20:03 +01:00
Henry Weller
fc0bdee154 dynamicCode/functionObjectTemplate: Updated and simplified by deriving from the regionFunctionObject base-class 2016-05-16 22:23:53 +01:00
Henry Weller
1c992eba9c etc/codeTemplates/functionObject: Updated and simplified using fvMeshFunctionObject as the base-class 2016-05-16 22:16:22 +01:00
Henry Weller
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
Henry Weller
ee0aff67ce etc/codeTemplates/functionObject: Updated to correspond to the new functionObject structure 2016-05-15 21:47:18 +01:00
Henry Weller
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
Henry Weller
437030a57d functionObjects: Removed the redundant "viable" member function
Construction failure and recovery is not handled with exceptions in functionObjectList
2016-05-11 12:57:17 +01:00
Henry Weller
080908732d src/postProcessing/functionObjects: Removed unused IOOutputFilter clutter 2016-05-10 12:54:42 +01:00
Henry Weller
32762aa1f9 Change field loop index from "fieldI" to "fieldi" 2016-05-02 18:20:48 +01:00
Henry Weller
0534a225fd functionObjects: Moved into the functionObjects namespace and rationalized and simplified failable construction
Rather than requiring each functionObject to handle failed construction
internally (using the active_ flag) the static member function "viable"
is provided which returns true if construction of the functionObject is
likely to be successful.  Failed construction is then handled by the
wrapper-class which constructs the functionObject,
e.g. "OutputFilterFunctionObject".
2016-05-02 16:28:24 +01:00
Chris Greenshields
aa89254c79 foamNewFunctionObject: script to create template code for a new function object
Run foamNewFunctionObject -h for details
2016-03-22 17:40:03 +00:00
Henry Weller
7e5d9982a7 etc/codeTemplates/BC: Use Use 'Zero' rather than 'pTraits<Type>::zero' to initialize to 0 2016-03-22 08:33:16 +00:00
Henry Weller
95d146ecdf Rationalized the indentation of C-preprocessor directives 2016-02-29 15:42:03 +00:00
Henry Weller
caed25f447 Code templates: Updated headers 2016-02-15 20:53:21 +00:00
Henry Weller
350d03246e scripts: Reformat with consistent section separators 2016-02-15 18:30:24 +00:00
Henry Weller
968c888fc4 Rename DataEntry -> Function1
Function1 is an abstract base-class of run-time selectable unary
functions which may be composed of other Function1's allowing the user
to specify complex functions of a single scalar variable, e.g. time.
The implementations need not be a simple or continuous functions;
interpolated tables and polynomials are also supported.  In fact form of
mapping between a single scalar input and a single primitive type output
is supportable.

The primary application of Function1 is in time-varying boundary
conditions, it also used for other functions of time, e.g. injected mass
is spray simulations but is not limited to functions of time.
2016-02-08 16:18:07 +00:00
Henry Weller
56fa7c0906 Update code to use the simpler C++11 template syntax removing spaces between closing ">"s 2016-01-10 22:41:16 +00:00
Henry Weller
4eba393fe1 Update code to use the simpler C++11 template syntax 2016-01-10 19:20:16 +00:00
Chris Greenshields
cc996852a7 foamNewApp: corrected template case 2015-12-07 17:28:40 +00:00
Chris Greenshields
b52f7571b9 foamNewApp: added execution and clock times to template 2015-12-07 14:15:14 +00:00
Chris Greenshields
a3e555e72c foamNewBC: script to create template code for a new boundary condition
Run foamNewBC -h for details
2015-12-04 14:33:56 +00:00
Chris Greenshields
e356211140 foamNewApp: script to create template for a new application
Creates a directory containing source .C file and Make directory
Will deprecate foamNewSource with App argument in due course
2015-12-04 14:20:23 +00:00
Henry Weller
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
Henry Weller
c1d3fbaee8 etc/codeTemplates/foamScript: Make executable 2015-10-26 16:35:20 +00:00
Henry Weller
09fe6408d3 codeTemplates: Update copyright date 2015-06-23 10:54:51 +01:00
Henry
0ea062816e Correct section comment: there can only be one destructor 2015-02-12 21:57:29 +00:00
william
de75e1f18c BUG: mantis #1338: added compressible coded fvOption template 2014-07-28 09:26:43 +01:00
Sergio Ferraris
59921dfc5c ENH: Updating codedFvOptionTemplate 2013-12-20 11:53:13 +00:00
mattijs
1aefea9df7 BUG: codedFunctionObject: add timeSet functionality 2013-06-10 11:18:17 +01:00