mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -38,6 +38,7 @@ SourceFiles
|
||||
#define coded_fixedValuePointPatchTemplate${FieldType}_H
|
||||
|
||||
#include "fixedValuePointPatchFields.H"
|
||||
#include "dictionaryContent.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -50,7 +51,8 @@ namespace Foam
|
||||
|
||||
class ${typeName}FixedValuePointPatch${FieldType}
|
||||
:
|
||||
public fixedValuePointPatchField<${TemplateType}>
|
||||
public fixedValuePointPatchField<${TemplateType}>,
|
||||
public dictionaryContent
|
||||
{
|
||||
//- The parent boundary condition type
|
||||
typedef fixedValuePointPatchField<${TemplateType}> parent_bctype;
|
||||
@ -141,6 +143,12 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Code context as a dictionary
|
||||
const dictionary& codeContext() const
|
||||
{
|
||||
return dictionaryContent::dict();
|
||||
}
|
||||
|
||||
//- Update the coefficients associated with the patch field
|
||||
virtual void updateCoeffs();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user