Commit Graph

53 Commits

Author SHA1 Message Date
Mark Olesen
2f2dcdcf6f ENH: Function1 and PatchFunction1 improvements (#1917)
- easier support for non-mandatory functions.

  In some boundary conditions it can be desirable to support
  additional functions, but not necessarily require them. Make this
  easier to support with a Function1, PatchFunction1 NewIfPresent()
  selector.

- support for compatibility lookups

- harmonize branching logic and error handling between Function1 and
  PatchFunction1.

ENH: refactor a base class for Function1, PatchFunction1

- includes base characteristics, patch or scalar information

ENH: additional creation macros

- makeConcreteFunction1, makeConcretePatchFunction1Type for adding a
  non-templated function into the correct templated selection table.
  makeScalarPatchFunction1 for similarity with makeScalarFunction1
2020-11-19 16:57:45 +01:00
Mark Olesen
e11c072bc4 CONFIG: incorrect BC code templates (fixes #1885)
- autoPtr to Function requires clone() method, not optional copy/move
  argument.

- fix bad character range for 'sed'
2020-10-20 14:23:40 +02:00
Mark Olesen
09d9c5cc03 ENH: consistent autoPtr handling in PatchFunction1 2020-05-23 16:02:35 +02:00
mattijs
7f936ad01f ENH: coded version of PatchFunction1. See #1709. 2020-05-20 10:38:39 +01:00
Andrew Heather
fdf8d10ab4 Merge commit 'e9219558d7' into develop-v1906 2019-12-05 11:47:19 +00:00
OpenFOAM bot
e9219558d7 GIT: Header file updates 2019-10-31 14:48:44 +00:00
Mark Olesen
c5ed28d0e3 STYLE: extraneous space in template parameter 2019-10-30 12:54:06 +01:00
Mark Olesen
a85c55bbb5 ENH: ensure that content changes in coded objects are noticed (#1293)
- for codedFunctionObject and CodedSource the main code snippets
  were not included in the SHA1 calculation, which meant that many
  changes would not be noticed and no new library would be compiled.

  As a workaround, a dummy 'code' entry could be used solely for the
  purposes of generating a SHA1, but this is easily forgotten.

  We now allow tracking of the dynamicCodeContext for the coded
  objects and append to the SHA1 hasher with specific entries.
  This should solve the previous misbehaviour.

  We additionally add information about the ordering of the code
  sections. Suppose we have a coded function object (all code
  segments are optional) with the following:

      codeExecute "";
      codeWrite   #{ Info<< "Called\n"; #};

  which we subsequently change to this:

      codeExecute #{ Info<< "Called\n"; #};
      codeWrite   "";

  If the code strings are simply concatenated together, the SHA1 hashes
  will be identical. We thus 'salt' with their semantic locations,
  choosing tags that are unlikely to occur within the code strings
  themselves.

- simplify the coded templates with constexpr for the SHA1sum
  information.

- Correct the CodedSource to use 'codeConstrain' instead of
  'codeSetValue' for consistency with the underlying functions.
2019-05-01 14:00:54 +02:00
OpenFOAM bot
154029ddd0 BOT: Cleaned up header files 2019-02-06 12:28:23 +00:00
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
ef922b6917 STYLE: adjust codeTemplates to use '= delete' 2018-04-19 07:38:31 +02: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
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
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
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
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
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
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
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
mattijs
b35f0f0620 STYLE: functionObjectTemplate: modification date 2013-01-15 12:39:31 +00:00
mattijs
3d8a083c40 STYLE: codedMixed: changed className to be consistent with function 2012-09-25 11:35:18 +01:00
mattijs
2e760a3453 ENH: codedBasicSource: coded version of sources 2012-05-04 11:36:47 +01:00
mattijs
747ba9dd29 ENH: functionObjectTemplate: moved include files to header file since $codeData might need them 2012-03-30 12:02:43 +01:00
mattijs
ed87e54618 ENH: codedFixedValuePointPatchField: coded version for point fields 2012-03-09 10:06:22 +00:00
mattijs
50b2b78d83 ENH: codedMixed: coded variant of mixed 2011-12-01 15:56:13 +00:00
mattijs
0143ef82ea ENH: dynamicCode: include unitConversion by default 2011-11-14 15:11:30 +00:00
Henry
c2dd153a14 Copyright transfered to the OpenFOAM Foundation 2011-08-14 12:17:30 +01:00
mattijs
b60866d98c ENH: coded functionObject: added mesh() 2011-03-23 09:34:51 +00:00
mattijs
889b0a0488 ENH: Release-notes-dev: updated for coded functionObject 2011-03-23 04:58:00 +00:00
mattijs
e24dd4fe2a ENH: codedFunctionObject: initial version. 2011-03-22 22:16:48 +00:00
Mark Olesen
7a0d3ebd64 ENH: refactor fixedValueFvPatchFieldTemplate
- can be reused for other (vector, tensor, ...) field types
2011-03-11 17:28:51 +01:00
Mark Olesen
12d965ead9 STYLE: more constness on const char* values 2011-03-11 09:08:45 +01:00
Mark Olesen
e8a3587df4 ENH: support file-scope 'localCode' in dynamicCode 2011-03-08 11:08:42 +01:00
Mark Olesen
3d34c5146c BUG: codedFixedValueFvPatchScalarField oldLibPath_ not copied
- prevented the reloading from working properly (thanks Mattijs!)
2011-03-08 08:48:27 +01:00
Mark Olesen
336fa74478 ENH: add static const char* SHA1sum to fixedValueFvPatchScalarFieldTemplate
- useful for debugging purposes
2011-03-07 18:10:29 +01:00
Mark Olesen
7cd3c926bd ENH: discard codeProperties in favour of using sha1-encoded library names 2011-03-03 09:06:14 +01:00
Mark Olesen
815a806be7 ENH: allow verbose output for fixedValueFvPatchScalarFieldTemplate 2011-03-02 14:28:22 +01:00