Skip to main content
Version: v0.3.0

Parameter Tree

Reference Keys#

A parameter tree is a collection of key–value pairs that may be grouped by sections. We call it a tree because sections may contain also other sections. Here, we follow the DUNE ini file convention to refer to sections and keyords. In addition, keywords between angle brackets (i.e. <key>) refer to multiple user defined keywords.

[grid]#

The grid is entred by a GMSH file and should be formed by triangles and recangles in 2D, tetraedra and hexahedra in 3D. It must define physical groups each refering to a different compartment. Each physical group can only be formed the same collection of geometric types.

Bug in GMSH reader

The GMSH file should not contain the $PhysicalGroup section at the begining of the file (this is a knwon bug in the dune-grid GMSH reader).

KeyTypeDescription
dimensionintegerThe dimension of the grid
filepathGMSH v2 file directory absolute or relative to the executable
initial_levelintegerThe refinement level to start the simulation with

[model]#

This section is the one that contains most of the aspects for simulation.

KeyTypeDescription
orderintegerFinite Element polynomial order. if order==0 FV else CG
[data]subsectionList of input files
[writer]subsectionOptions for vtk writer
[time_stepping]subsectionOptions for time-stepping
[compartment]subsectionList of compartmentes to simulate
[<compartment>]subsectionOptions for equations per each compartment

Whenever a compartment is coposed by cubes (2D) or hexahedra (3D), then such compartment is modeled using Finite Volumes. These compartments are suitable to model membranes processes.

The subsection [<compartment>] is a placeholder for the name of all compartment given in [compartment]. See [model.compartment] subsection for more information.

[model.data]#

This section will contain all the input files for the initial conditions of the model.

KeyTypeDescription
[<data_name>]path16-bit grayscale TIFF file

See Input Data section for more information about usage.

[model.output]#

The model ouput is controlled by the following parameters:

KeyTypeDescription
file_pathstringName used to output VTK files

[model.time_stepping]#

This section sets the settings for the evolution in time of the forward model.

KeyTypeDescription
rk_methodrk_idRunge-Kutta method
beginfloatInitial time of the forward simulation
endfloatFinal time of the forward simulation
initial_stepfloatTime step at the beginning of the simulation
min_stepfloatMaxumum time step allowed
max_stepfloatMinimum time step allowed
decrease_factorfloatTime step decrease factor when time step fails
increase_factorfloatTime step increase factor when time step succeds

The possible rk_ids can be found at the end of this document.

[model.compartment]#

The compartment section is filled with key=value pairs that assign a phisical group id (value) to an compartment name (key).

KeyTypeDescription
<compartment>integerPhisical group id assigned to <compartment> subdomain

Each compartment id maps to a physical group in the gmsh identifiers. Although the gmsh format allows you to name such physical groups. Notice that dune-copasi uses 0-based indices while gmsh uses 1-based indices. In other words, <gmsh_physical_group> = <dune_copasi_compartment> + 1.

For example, let's say that there is two physical groups in our gmsh file and we are going to name them as nucleous and cytoplasm compartments:

[model.compartments]
# nucleous corresponds to the physical group 1 in the gmsh file
nucleous = 0
# cytoplasm corresponds to the physical group 2 in the gmsh file
cytoplasm = 1
# They then become available as new compartment subsections
[model.nucleous]
# Parameters for the nucleous compartment
[model.cytoplasm]
# Parameters for the nucleous compartment

[model.<compartment>]#

Each compartment will define its own initial conditions, its diffusion-reaction system, etc. A set of variables is be assigned to each compartment. The amount variables may be different on each compartment, but the same namings must be used on all the [model.<compartment>] subsections.

KeyTypeDescription
[initial]subsectionList of variables and their initial conditions
[diffusion]subsectionList of variables and their diffusion coefficient
[reaction]subsectionList of variables and their reaction networks
[outflux]subsectionDefinition of output fluxes on this <compartment>
[model.<compartment>.initial]#

The initial subsection allows the initialization for each of the variables. Expressions in this section may contain Input Data functions.

KeyTypeDescription
<var>math_exprMath expression to initializate variable <var>
[model.<compartment>.diffusion]#

The diffusion subsection defines the diffusion associated with each variable.

KeyTypeDescription
<var>math_exprDiffusion math expression assigned to <var>
[model.<compartment>.reaction]#

This subsection defines the reaction network associated with each variable.

KeyTypeDescription
<var>math_exprReaction network expression assigned to <var>
[jacobian]subsectionJacobian expressions for compartment reaction networks

Variables (<var>s) in this section differ from other math expressions in that all variables names on this <compartment> are available to form the expression. E.g.

[model.nucleous.reaction]
u = u*v
v = u*v
[model.<compartment>.reaction.jacobian]#

This subsection lists the jacobian matrix entries for the reaction section. It must follow the syntax of d<var_i>__d<var_j>, which reads as the partial derivative of <var_i> with respect to <var_j>.

KeyTypeDescription
d<var_i>__d<var_j>math_exprReaction network jacobian entry

Similar to [model.<compartment>.reaction], math expressions here allow all compartmenet variables to be used. For example, the section [model.nucleous] for a Gray-Scott model with F=0.0420 and k=0.0610 may look like this:

[model.nucleous.initial]
u = 0.5
v = (x>0) && (x<0.5) && (y>0.) && (y<0.5) ? 1 : 0
[model.nucleous.diffusion]
u = 2e-5
v = 2e-5/2
[model.nucleous.reaction]
u = -u*v^2+0.0420*(1-u)
v = u*v^2-(0.0420+0.0610)*v
[model.nucleous.reaction.jacobian]
du__du = -v^2-0.0420
du__dv = -2*u*v
dv__du = v^2
dv__dv = 2*u*v-(0.0420+0.0610)
[model.<compartment>.outflux]#

The fluxes are set automatically to dirichlet-dirichlet boundary conditions if the variable is shared between the two intersecting domains. No key is required for this.

Comming feature

Custom fluxes will be available in upcoming releases.

[logging]#

Work in progress

The logging settings are directly forwarded to the dune-logging module. Please check its doxygen documentation for detailed information. A simple configuration is the following:

[logging]
# possible levels: off, critical, error, waring, notice, info, debug, trace, all
default.level = trace
[logging.sinks.stdout]
pattern = [{reldays:0>2}-{reltime:8%T}] [{backend}] {msg}

Runge-Kutta methods (rk_id)#

The following are the accepted Runge-Kutta methods in our time stepping schemes

Method
explicit_euler
implicit_euler
heun
shu_3
runge_kutta_4
alexander_2
fractional_step_theta
alexander_3

Example#

A example of an ini file with all the parameters required by DuneCopasi for the Gray-Scott model is

[grid]
dimension = 2
file = path/to/grid.msh
initial_level = 1
[model]
order = 1
[model.data]
input_data = path/to/image.tiff
[model.time_stepping]
rk_method = alexander_2
begin = 0
end = 1
initial_step = 0.3
min_step = 1e-3
max_step = 0.35
decrease_factor = 0.5
increase_factor = 1.5
[model.compartments]
domain = 0
[model.domain.initial]
u = 0.5 + input_data(x,y)
v = (x>0) && (x<0.5) && (y>0.) && (y<0.5) ? 1 : 0
[model.domain.diffusion]
u = 2e-5
v = 2e-5/2
[model.domain.reaction]
u = -u*v^2+0.0420*(1-u)
v = u*v^2-(0.0420+0.0610)*v
[model.domain.reaction.jacobian]
du__du = -v^2-0.0420
du__dv = -2*u*v
dv__du = v^2
dv__dv = 2*u*v-(0.0420+0.0610)
[model.writer]
file_path = gray_scott