Page 7 - Demo
P. 7


                                    Interface to C/C++%uf09f %uf09f RCP Consult 2023-2025 Page 7Finally, for special purposes, the following set of STRUREL information variables will be also definedStrurelMode0 %u2013 initial state of evaluation having global vector state as mean values1 %u2013 intermediate state of evaluation of global vector during run2 %u2013 final state after run having global vector state at %u00df-pointStrurelRun Integer counter of calls of state functionStrurelName Literal value %u2018STRUREL%u2019StrurelModule Literal value %u2018COMREL-TI%u2019 or %u2018COMREL-TV%u2019 or %u2018SYSREL%u2019 or %u2018COSTREL%u2019StrurelVersion Literal value %u20182025%u2019 or corresponding value for future versionsStrurelIMET Literal value with description of method of probaility integrationStrurelIOPT Literal value with description of optimizer for %u00df-point searchStrurelBeta Real value of reliability index %u00df at final stateStrurelPf Real value of failure probability Pf at final stateStrurelPlot Logical variable to switch on/off postprocessing facilitiesStrurelEngine Literal value with information about compiler used in Buildout Add-onThe assigned global vectors, global names and information variables can be explicitly used in definition of any export function in a source file.To illustrate how the Stochastic Model data of STRUREL must be used in communication with the C/C++ Interface the following well known example will be taken (User Manual: Stone example):The assigned global names will have the very same names as in the Stochastic Model: Load, Strength, Diameter, PAR1, PAR2 and corresponding values. Each global vector will have 5 elements with corresponding values as ordered above.The state functions and user defined functions for this example can be expressed in the Symbolic language of STRUREL as shown below. // 1. Use vector input in C/C++ source file FLIM(1){Stone: Circular cross section} = FUNC(1)DEFFUNC(1,CPP,CppStone,\_Circular.cpp\// 2. Use global names in C++ source file FLIM(2){Stone: Circular cross section} = FUNC(2)DEFFUNC(2,CPP,CppStone,\_Circular.cpp\// 3. Use explicit arguments in C++ source fileFLIM(3){Stone: Circular cross section} = FUNC(3)(Load,Strength,Diameter,PAR1,PAR2,PI)DEFFUNC(3,CPP,CppStone,\_Circular.cpp\6. C/C++ source fileThe C/C++ source file must contain at least one double export function prepared by rules described above. In our example three export functions need to be defined in source file %u2018Stone_Circular.cpp%u2019 for processing by selected compiler. The first we need to provide all required definitions for binding with STRUREL placed in an include file %u2018strurel.h%u2019.
                                
   1   2   3   4   5   6   7   8   9   10   11