The basic computing code wrapper is composed of a unique
.ioplugin ASCII files in “properties” format (i.e. “key=values” lines).
A typical
.ioplugin file for APOLLO2 calculation:
information=Apollo plugin made by IRSN/Yann Richet\nLesser General Public License
variableStartSymbol=$
variableLimit=(...)
formulaStartSymbol=@
formulaLimit={...}
commentLineChar=*
roundOff=10
datasetFilter=contains("(.*)","DEBUT_APOLLO") & contains("(.*)","SN KEFF")
keywords.BLUE=DEBUT_APOLLO2 FIN_APOLLO2 TITRE WRITE ARRET EDTIME FERMER QUADRATURE NGROUP_FINAL ANISOTROPIE
keywords.GREEN=nom_mil nom_calc
keywords.RED=TOPT TSTR TRES TOPT.'STMIL'.nom_mil. TSTR.nom_calc.'GEO' TOPT.'STCRI'.'
outputlist=keff kinf slowing_down M2 B2
outputfunctions=Numeric:keff
output.keff.if=true
output.keff.get=grep("(.*)listing"," KEFF") >> get(0) >> between("KEFF","| ") >> asNumeric()
output.keff.default=1.0
output.kinf.if=true
output.kinf.get=grep("(.*)listing"," KINF") >> get(0) >> between("KINF","| ") >> asNumeric()
output.kinf.default=1.0
output.slowing_down.if=true
output.slowing_down.get=grep("(.*)listing"," RALENTISSEMENT") >> get(0) >> between("RALENTISSEMENT","| ") >> asNumeric()
output.slowing_down.default=0.5
output.M2.if=true
output.M2.get=grep("(.*)listing"," M2") >> get(0) >> between("M2","cm2 |") >> asNumeric()
output.M2.default=40
output.B2.if=true
output.B2.get=grep("(.*)listing"," B2") >> get(0) >> between("B2","|") >> asNumeric()
output.B2.default=0.01
This
.ioplugin file
1) may content following properties lines (one “key=value” per line):
General information
E.g. Apollo parser:
information=Apollo plugin made by IRSN/Yann Richet\nLesser General Public License
Parametrization
variableStartSymbol= choose a variable start character between: $
,#
,*
,&
,@
,!
,?
,:
,%
,
variableLimit= choose variable delimiter characters between: (…)
,{…}
,[…]
,<…>
,
formulaStartSymbol= choose a formula start character between unused variable ones,
formulaLimit= choose a formula delimiter characters between unused variable ones,
E.g. Apollo parser:
variableStartSymbol=$
variableLimit=(...)
formulaStartSymbol=@
formulaLimit={...}
Syntax
[optional] commentLineChar= provide a line comment character of the code,
[optional] roundOff= provide a math rounding for varibales and formulas,
E.g. Apollo parser:
commentLineChar=*
roundOff=10
Input file filter test
[optional]
datasetFilter= give here a
parser expression to test if an input
ASCII file is compatible with this code
E.g. Apollo parser:
datasetFilter=contains("(.*)","DEBUT_APOLLO") & contains("(.*)","SN KEFF")
Keywords
[optional] keywords.BLUE= give here a list of keywords which will be colorized in blue
[optional] keywords.RED= give here a list of keywords which will be colorized in red (it is suggested to reserve red color for keywords close to variables or formulas)
[optional] keywords.GREEN= give here a list of keywords which will be colorized in green
E.g. Apollo parser:
keywords.BLUE=DEBUT_APOLLO2 FIN_APOLLO2 TITRE WRITE ARRET EDTIME FERMER QUADRATURE NGROUP_FINAL ANISOTROPIE
keywords.GREEN=nom_mil nom_calc
keywords.RED=TOPT TSTR TRES TOPT.'STMIL'.nom_mil. TSTR.nom_calc.'GEO' TOPT.'STCRI'.'
Output
outputlist= list here supported output objects (String, numeric, or arrays) to parse in output files
[optional]
outputfunctions= suggested expressions to box output objects in mathematical expression (the user can also create these expressions in the
GUI):
Numeric:abcd
means “abcd” output will be interpreted as a numeric,
GaussianDensity:abcd,efgh
means “abcd” output will be interpreted as the mean and “efgh” as the standard deviation of a gaussian random number,
NumericArray:abcd
means “abcd” output will be interpreted as a numeric array,
Sequence:abcd
means “abcd” output will be interpreted as an array of ordered numerics,
Numeric2D:abcd,efgh
means “abcd” output will be interpreted as the first coordinate of a 2D numeric, and “efgh” as the second (for instance in a x-y coordinate),
Numeric2DArray:abcd,efgh
means “abcd” output will be interpreted as the first coordinates of a 2D array, and “efgh” as the second (for instance in a X-Y coordinates array),
Numeric3D:abcd,efgh,ijkl
means “abcd” output will be interpreted as the first coordinate of a 3D numeric, “efgh” as the second, and “ijkl” as the third (for instance in a x-y-z coordinate),
Numeric3DArray:abcd,efgh,ijkl
means “abcd” output will be interpreted as the first coordinates of a 3D array, “efgh” as the second, and “ijkl” as the third (for instance in a X-Y-Z coordinates array)
output.abcd.if= provides a test filter to check if the output object “abcd” will be available or not in code output (for instance the test checks if a defined keyword is present or not in input dataset using
parser methods)
output.abcd.default= gives a default value for “abcd” output object
output.abcd.get= gives a regexp methods chain to access “abcd” string inside output
ASCII files. Using grep/get/cut/substring/… methods implemented in
parser, and chaining it using
»
separator.
This
»
separator is similar to unix shell pipe “|”, which means the first argument of next method is set as result of previous one (except for first one):
a(x,y) » b(z)
is exactly the same as
b(a(x,y),z)
.
For instance:
grep(”(.*)listing”,” B2”) » get(0) » between(“B2”,”|”) » asNumeric()
reads the last line (get(0)
) containing ” B2” of ”.listing” file (grep(”(.*)listing”,” B2”)
), then cut this line to get only string between “B2” and “|” (between(“B2”,”|”)
), finally convert in an float number (asNumeric()
)
grep(”(.*).listing”,”FAIBLE SIGMA”) » get(2) » cut(“SIGMA”,2) » substring(”+/-”,”##”) » substring(3) » asNumeric()
reads the second line (get(2)
) containing “FAIBLE SIGMA” of ”.listing” file (grep(”(.*)listing”,” B2”)
), then cut this line to get only string after “SIGMA” (cut(“SIGMA”,2)
), finally convert in an float number (asNumeric()
)
E.g. Apollo parser:
outputlist=keff kinf slowing_down M2 B2
outputfunctions=Numeric:keff
output.keff.if=true
output.keff.get=grep("(.*)listing"," KEFF") >> get(0) >> between("KEFF","| ") >> asNumeric()
output.keff.default=1.0
output.kinf.if=true
output.kinf.get=grep("(.*)listing"," KINF") >> get(0) >> between("KINF","| ") >> asNumeric()
output.kinf.default=1.0
...
To write your own
.ioplugin file, you can just use your favorite
ASCII file editor.
Note: all these features are designed to be as flexible as possible, but in many cases, it does not match need for output parsing for instance. In such cases, it is possible to switch to extended wrapping to provide much more flexible support for input/output of codes.