Input Data
This documentation page is intended for the Command Line Interface (CLI). If you're new to DuneCopasi, we recommend starting with our Tutorials.
Several input data files in the dune-copasi program are possible:
Config Options (INI Format)
--config={path}
An extensive set of configuration options can be customized via the DUNE ini file convention.
The options in the configuration file may be overridden by passing --{key}={value} to the command line of the program.
Grid (GMSH Format)
grid.path={path}
Reads gmsh format v2.0 and constructs the grid with it.
Additionally, the token gmsh_id will be added to the math parsers for each entity of the grid. It will contain the physical id in the gmsh file.
Assuming that path/to/grid.msh contains a gmsh file with physical entities 1 and 2, then, the example below will create compartments inner and outer. The pysical entities with index 1 will be assigned to compartment outer whereas the pysical entities with index 2 will be assigned to compartment inner.
[grid]
path = path/to/grid.msh
[compartments]
outer.expression = (gmsh_id == 1)
inner.expression = (gmsh_id == 2)
Grid Cell Data (TXT Format)
grid.cell_data.{dtkn}.path={prefix}
The cell data file needs to provide the values of the entities to which the values needs to be assigned.
The first entry in the file should contain the total number of cells to assign data to.
The subsequent entries should contain the data, starting with the grid_cell_id,
followed by the n floatss and terminating with a end of line character:
'scalar': n := 1'vector': n :=grid.dimension'tensor': n :=grid.dimension*grid.dimension
Lines starting with # are not read. A simple example for a 'scalar' case is:
# this line is ignored
2
50 +0.5
51 -0.5
This example would assign the values +0.5 and -0.5 to the cells 50 and 51 respectively for the coarsest entities of the grid.
Note that the indexation of the entities starts with 0, whereas file formats like gmsh start their indices with 1.
Images (TIFF Format)
parser_context.{tkn}.type=tiffparser_context.{tkn}.path={path}
Reads an image file with tiff format and makes it available as a 2D function expression with the {tkn} token.
Images with grayscale values of 8, 16, 32, and 64 bits are supported.
Assuming that path/to/image.tif contains a tiff file with values 1 and 2, then, the example below will create compartments inner and outer. The grid cells where their center evaluated in alpha results in index 1 will be assigned to compartment outer whereas the grid cells where their center evaluated in alpha results in index 2 will be assigned to compartment inner.
[parser_context.alpha]
type = tiff
path = path/to/image.tif
[compartments]
outer.expression = (alpha(position_x, position_y) <= 1.5)
inner.expression = (alpha(position_x, position_y) > 1.5)
Notice how position_x and position_y are assigned on each grid cell to determine the value of the expression.
If the resulting function {tkn} is evaluated outside the domain of the tiff image, the
arguments will be clamped to
the nearest valid point in the domain.