ENH: provide dictionary access for coded BCs etc (#1922)

- in some cases, additional dictionary inputs are useful for extending
  the input parameters or functionality of dynamic coded conditions.

  Typically this can be used to provide a simple set of dictionary
  inputs that are used to drive specific code, but allows changing the
  inputs without causing a recompilation.

  Accessed with this type of code:
  ```
  const dictionary& dict = this->codeContext();
  ```

boundary conditions and function objects:

* specify an additional codeContext dictionary entry:
  ```
  codeContext
  {
      ...
  }
  ```

PatchFunction1:

* The code context dictionary is simply the dictionary used to specify
  the PatchFunction1 coefficients.

  To replicated persistant data, use local member static data.
  Eg,
  ```
  code
  #{
      // Persistent (Member) Data
      static autoPtr<Function1<scalar>> baseVel;
      static autoPtr<Function1<vector>> baseDir;
      ...
  #}
  ```

fvOptions:

* currently not applicable
This commit is contained in:
Mark Olesen
2021-06-01 11:27:45 +02:00
parent b0891824fa
commit b59ae32d68
18 changed files with 233 additions and 19 deletions

View File

@ -35,6 +35,7 @@ SourceFiles
#define codedPatchFunction1Template${FieldType}_H
#include "PatchFunction1.H"
#include "dictionaryContent.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -49,12 +50,12 @@ namespace PatchFunction1Types
class ${typeName}PatchFunction1${FieldType}
:
public PatchFunction1<${TemplateType}>
public PatchFunction1<${TemplateType}>,
public dictionaryContent
{
//- The parent PatchFunction1 type
typedef PatchFunction1<${TemplateType}> parent_bctype;
// Private Member Functions
//- Report a message with the SHA1sum
@ -88,7 +89,7 @@ public:
${typeName}PatchFunction1${FieldType}
(
const ${typeName}PatchFunction1${FieldType}& rhs
);
) = default;
//- Copy construct, resetting patch
${typeName}PatchFunction1${FieldType}