mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: codeStream.org: updated with system/codeDict
This commit is contained in:
@ -76,6 +76,21 @@
|
|||||||
It by default always includes =fvCFD.H= and adds the =finiteVolume= library to
|
It by default always includes =fvCFD.H= and adds the =finiteVolume= library to
|
||||||
the include search path.
|
the include search path.
|
||||||
|
|
||||||
|
A special form is where the code is not supplied in-line but instead comes
|
||||||
|
from the =codeDict= dictionary in the =system= directory. It should contain
|
||||||
|
a =fixedValue10= entry:
|
||||||
|
#+BEGIN_SRC c++
|
||||||
|
fixedValue10
|
||||||
|
{
|
||||||
|
code
|
||||||
|
#{
|
||||||
|
operator==(min(10, 0.1*this->db().time().value()));
|
||||||
|
#};
|
||||||
|
}
|
||||||
|
#+END_SRC
|
||||||
|
The advantage of using this indirect way is that it supports
|
||||||
|
runTimeModifiable so any change of the code will be picked up next iteration.
|
||||||
|
|
||||||
* Security
|
* Security
|
||||||
Allowing the case to execute C++ code does introduce security risks. A
|
Allowing the case to execute C++ code does introduce security risks. A
|
||||||
third-party case might have a =#codeStream{#code system("rm -rf .");};= hidden
|
third-party case might have a =#codeStream{#code system("rm -rf .");};= hidden
|
||||||
|
|||||||
Reference in New Issue
Block a user