Graphics
The ‘graphics’ parameter category contains parameters specifying the look of 2D and 3D renders, as well as of the general terminal output.
terminal_width
Description |
Specifies the maximum width of the terminal output |
||
Default |
80
|
||
Elaboration |
Long lines of terminal output from CONCEPT is generally wrapped into multiple lines before they are printed. This is preferable to having the wrapping done automatically by the terminal emulator, as these often do not care about e.g. splitting sentences at word boundaries. This parameter sets the width of the terminal in characters, beyond which line-wrapping should occur. |
||
Example 0 |
Use a larger, more modern terminal width: terminal_width = 120
|
enable_terminal_formatting
Description |
Specifies whether to use formatted text in terminal output |
||
Default |
True
|
||
Elaboration |
By default, CONCEPT makes use of various formatting when printing to the terminal, e.g. bold red text for warnings and errors. This can be disabled by this parameter. |
||
Example 0 |
Do not make use of terminal formatting: enable_terminal_formatting = False
This can be helpful if you e.g. want to programmatically search the generated log files. Note Though this disables the majority of the terminal formatting, a few bits and pieces remain |
render2D_options
Description |
Specifications for 2D render computations |
||
Default |
{
'upstream gridsize': {
'particles': 'cbrt(Ñ)',
'fluid' : 'gridsize',
},
'global gridsize': {},
'terminal resolution': {},
'interpolation': {
'default': 'PCS',
},
'deconvolve': {
'default': False,
},
'interlace': {
'default': False,
},
'axis': {
'default': 'z',
},
'extent': {
'default': (0, 0.1*boxsize),
},
'colormap': {
'default': 'inferno',
},
'enhance': {
'default': True,
},
}
|
||
Elaboration |
This is a For constructing a 2D render, the energy density of one
or more components is first interpolated onto individual
upstream grids, possibly using deconvolution and
interlacing, after which they are added together,
producing a global grid. This scheme is similar to the
one used for potentials, except that here nothing is
interpolate back to the particles. See the
Each sub-parameter is described below:
|
||
Example 0 |
Do the projection along the render2D_options = {
'axis': {
'all' : 'x',
'all combinations': ...,
},
'extent': {
'all' : boxsize/4,
'all combinations': ...,
},
}
Note When only specifying a single number (the slab
thickness) for |
||
Example 1 |
Apply different colormaps to the two components with
names/species of render2D_options = {
'colormap': {
'matter' : 'cool',
'neutrino': 'hot',
},
'enhance': {
'matter' : False,
'neutrino': True,
},
}
Note The colormaps are applied for both the saved PNG and for the terminal renders. The colours in the terminal are however defined using global state, meaning that only a single colormap can be applied within the terminal at any given time. When playing back the 2D terminal renders of a given component from a simulation using the play utility, the proper colormap will be applied. |
render3D_options
Description |
Specifications for 3D render computations |
||
Default |
{
'upstream gridsize': {
'particles': 'cbrt(Ñ)',
'fluid' : 'gridsize',
},
'global gridsize': {},
'interpolation': {
'default': 'PCS',
},
'deconvolve': {
'default': False,
},
'interlace': {
'default': False,
},
'elevation': {
'default': π/6,
},
'azimuth': {
'default': -π/3,
},
'roll': {
'default': 0,
},
'zoom': {
'default': 1.05,
},
'projection': {
'default': 'perspective',
},
'color': {},
'depthshade': {
'default': True,
},
'enhancement': {
'default': {
'contrast' : 0.5,
'clip' : lambda a: (0.45, 1 - 1e-6*a),
'α' : 1,
'brightness': 0.35,
},
},
'background': {
'default': 'black',
},
'fontsize': {
'default': '0.022*resolution',
},
'resolution': {
'default': 1080,
},
}
|
||
Elaboration |
This is a For constructing a 3D render, the energy density of one
or more components is first interpolated onto individual
upstream grids, possibly using deconvolution and
interlacing, after which they are added together,
producing a global grid. This scheme is similar to the
one used for potentials, except that here nothing is
interpolate back to the particles. See the
Most of the sub-parameters dealing with the
interpolation of particles onto the grid for the
The above sub-parameters are
component selections
and may be specified for a single or multiple
components. However, a given component will look the
same across all 3D renders, meaning that certain options
apply directly to the components and not the render. To
illustrate this, consider the below specification of 3D
renders for a render3D_select = {
'matter' : True, # single-component render
'neutrino': True, # single-component render
('matter', 'neutrino'): True, # multi-component render
}
render3D_options = {
'color': {
'matter' : 'red',
'neutrino' : 'green',
('matter', 'neutrino'): 'blue', # ❌
},
'background': {
'matter' : 'black',
'neutrino' : 'white',
('matter', 'neutrino'): 'silver',
},
}
The above specifies that we want three renders; one with
just The full list of sub-parameters can thus be split into two categories, depending on whether they behave as render attributes or component attributes, where the latter should only be assigned to single components:
An exception from the above clean categorization is the
|
||
Example 0 |
Give the component with a name/species of render3D_options = {
'color': {
'matter' : 'lawngreen',
'neutrino': 'cool',
},
}
We might instead specify the single colour as an RGB value: render3D_options = {
'color': {
'matter' : (124/255, 252/255, 0),
'neutrino': 'cool',
},
}
Tip To quickly convert any Matplotlib colour to the RGB representation, you can use python -c "import matplotlib; \
print(matplotlib.colors.ColorConverter().to_rgb('lawngreen'))"
|
||
Example 1 |
Use a white background: render3D_options = {
'background': {
'all': 'white',
},
}
Note The text labels for the time \(t\) and scale factor \(a\) will always be either white or black; white for dark backgrounds and black for light backgrounds. The above render3D_options = {
'background': {
'all' : 'white',
'all combinations': ...,
},
}
|
||
Example 2 |
For renders of the component with a name/species of
render3D_options = {
'azimuth': {
'matter': lambda a: 2*π*(a - a_begin)/(1 - a_begin),
},
}
Combined with frequent renders linearly spaced in \(a\), the resulting renders can be combined into a nifty animation. |
||
Example 3 |
Do not interpolate particles of the component with a
name/species of render3D_options = {
'interpolation': {
'matter': 0,
},
}
Though this disables the colormap and enhancement features, this has the benefit of being able to better represent small structures, as the particle resolution is not limited to the grid spacing. |