Configuration options#
Introduction#
Fesslix can be configured using a configuration file. By default, Fesslix checks on start-up if the configuration file fesslix.yaml exists in the current working directory. The format of the file is YAML.
The following sections list all options that can be specified within the configuration file.
Configuration options available in Fesslix#
General options#
flx:
## prgbar » The execution of some objects might require some time. Some ojects can output a progress-bar
## to indicate how much of the work has already been completed. If this option is set to no,
## such a progress-bar is not shown.
## type » bool
## default value » True
prgbar: True
## usescreen » In case output to the standard output stream (the screen) is undesirable, it can be suppressed
## by setting this option to 'False'.
## If this option is set to 'False', output to ’cout’ is redirected to the log-file
## specified in configuration option 'log.file' (which must not be set to '{screen}').
## type » bool
## default value » True
usescreen: True
## leak-check » Run Fesslix, aware that leak-checking is done.
## For debbugging purposes only!!!
## type » bool
## default value » False
leak-check: False
Configuration option TOL#
A floating-point number is checked against TOL at various points in the code. In this check, if the
number is smaller or equal to the value of TOL, the number is considered zero.
Caution
Setting the value of TOL equal to zero might cause numerical problems.
Setting TOL too large is also not a good idea.
## TOL » If checked against TOL, a number with an absolute value smaller or equal
## than this threshold is considered to be zero.
## type » double
## default value » 1e-14
TOL: !!float 1e-14 ## the !!float is required to ensure the value is not interpreted as a string
Floating-point conversion#
Todo
Write this section.
fpc:
## prec » Set the precision of floating point conversions.
## Sets the default value of the parameter flxoutput::float::prec.
## type » unsigned integer
## default value » 6
prec: 6
## type » Set the type of floating point conversions.
## Sets the default value of the parameter flxoutput::float::type.
## type » unsigned integer
## default value » 2
type: 2
## bvalu » Set the upper bound (type 2) of floating point conversions.
## Sets the default value of the parameter flxoutput::float::bvalu.
## type » double
## default value » 1e4
bvalu: !!float 1e4 ## the !!float is required to ensure the value is not interpreted as a string
## bvall » Set the lower bound (type 2) of floating point conversions.
## Sets the default value of the parameter flxoutput::float::bvall.
## type » double
## default value » 1e-2
bvall: !!float 1e-2 ## the !!float is required to ensure the value is not interpreted as a string
## del0 » Set removing of zeros in case of floating point conversions.
## Sets the default value of the parameter flxoutput::float::del0.
## type » bool
## default value » True
del0: True
## delp » Set removing of the leading plus in case of floating point conversions.
## Sets the default value of the parameter flxoutput::float::delp.
## type » bool
## default value » True
delp: True
Gauss points#
When Fesslix starts, a file with Gauss points is loaded. By default, a file containing up to 45 Gauss points is installed with Fesslix.
gauss:
## file » Set a specific file to load the Gauss points from.
## Setting this option to "{no}" forces Fesslix not to load any Gauss-file.
## Setting this option to "{default}" will load the default Gauss-file.
## type » string
## default value » "{default}"
file: "{default}"
## maxnumb » Maximum number of Gauss points to input - from the file containing the Gauss points.
## type » unsigned integer
## default value » 45
maxnumb: 45
## numb » Number of Gauss points to load from the file already at the start of Fesslix.
## type » unsigned integer
## default value » 20
numb: 20
Control the logging behavior#
The Logging behavior of Fesslix can be controlled by means of the following configuration options:
log:
## input » Output the input of Fesslix (i.e., the content of the parameter file) to the log.
## type » bool
## default value » True
input: True
## file » Set a specific log-file for the output of logs.
## By means of the keyword "{screen}" you can output the log directly to cout (the screen).
## type » string
## default value » "fesslix.log"
file: "fesslix.log"
## level » Set the initial log-level.
## type » integer
## default value » 4
level: 4
## output » Send the output of Fesslix (which is written to cout) also to the log.
## type » bool
## default value » True
output: True
## trunc » If the logging information is written into a file,
## setting this option to 'True' will overwrite an already existing file that has the same name.
## If this option is set to 'False', the output will be appended in case a
## file with the same name already exists.
## type » bool
## default value » True
trunc: True
Pseudorandom number generator#
Fesslix uses the Mersenne Twister algorithm that is based on the Mersenne prime \(2^{19937} − 1\) as pseudorandom number generator.
MT19937:
init:
## calls » number of initial calls of MT19937 after initization
## type » unsigned integer
## default value » 1000
calls: 1000
## rand » Initializes the Mersenne twister pseudorandom number generator MT19937
## with the rand-function instead of the function time(0).
## type » bool
## default value » True
rand: True
## seed » Initializes the Mersenne twister pseudorandom number generator MT19937
## with the seed value specified in MT19937.init.seedvalue.
## type » bool
## default value » False
seed: False
## seedvalue » Initial seed value in case MT19937.init.seed=yes
## type » unsigned integer
## default value » 0
seedvalue: 0
All other options#
Legendre:
## numb » Number of Legendre polynomials to initialize
## type » unsigned integer
## default value » 10
numb: 10
Manually loading configuration options#
- flx.process_config()#
- Syntax:
flx.process_config(config_dict)- Description:
Load configuration options from a dictionary.
- Parameters:
config_dict (dict) – A dictionary containing the configuration options.
- Return type:
None
For example, you can manually load a configuration file with an arbitrary name; e.g. to load my_flx_test.yaml with content:
%%writefile my_flx_test.yaml
MT19937:
init:
calls: 2000
seed: True
seedvalue: 12345
Overwriting my_flx_test.yaml
import fesslix as flx
import yaml
## NOTE: replace "my_flx_test.yaml" with your user-defined configuration file
with open("my_flx_test.yaml", "r") as fs:
flx.process_config( yaml.safe_load(fs) )
flx.load_engine()
Random Number Generator: MT19937 - initialized with user seed (12345)
Random Number Generator: MT19937 - initialized with 2000 initial calls.
0
Alternatively, you can also specify the configuration options directly inline:
flx.process_config( { 'MT19937': { 'init': { 'calls': 3000 } } } )
flx.load_engine()
Random Number Generator: MT19937 - initialized with user seed (12345)
Random Number Generator: MT19937 - initialized with 3000 initial calls.
0
Output of the configuration#
- flx.print_info()#
- Syntax:
flx.print_info()- Description:
Outputs all configuration options used by Fesslix.
- Return type:
None
## Use flx.print_info() to output configuration options of Fesslix
flx.print_info()