1"use strict";(self.webpackChunkdune_copasi_docusaurus=self.webpackChunkdune_copasi_docusaurus||[]).push([[6743],{5843:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>m,contentTitle:()=>p,default:()=>v,frontMatter:()=>d,metadata:()=>h,toc:()=>f});var i=t(4848),a=t(8453),r=t(1470),o=t(9365),s=t(1302);const l='#########################################################################\n# HEAT EQUATION:\n#\n# \u2202\u209cu = \u2202\u2093(T\xb7\u2202\u2093u) + \u2202\u1d67(T\xb7\u2202\u1d67u)\n#\n# where u(x,y,t) is the temperature at a time t on the domain for a\n# thermal conductivity T.\n#\n# See: https://en.wikipedia.org/wiki/Heat_equation\n#\n#########################################################################\n\n[grid]\n# extensions of the grid in x and y directions\nextensions = 1 0.1\n# where the grid left-bottom corner starts\norigin = 0.0 0.0\n# number of cells of the initial grid in x and y directions\ncells = 10 1\n# number of times to refine the grid\nrefinement_level = 5\n\n# defines a compartment with the name "domain"\n[compartments.domain]\nexpression = 1\n\n# Define a constant with name "T" to use in the equations\n[parser_context.T]\ntype = constant\nvalue = 0.005\n\n# our model is linear because there is no reaction\n[model]\nis_linear = true\n\n##### Definition of the equation to solve function u(x,y,t) ######\n\n# Declares the compartment where this function is defined\n[model.scalar_field.u]\ncompartment = domain\n\n# Declares that the equation is transient\n[model.scalar_field.u.storage]\nexpression = 1\n\n# Declares the diffusion part on the diffusion-reaction equation\n[model.scalar_field.u.cross_diffusion.u]\nexpression = T\n\n[model.scalar_field.u.initial]\n# Declares the value of the function at the initial time: u(x,y,0)\n# Try changing this to be a function of x and y: use "position_x" and "position_y"\n# to represents its values, for example:\n# "expression = position_x^2"\n# represents the case where u(x,y,0) := x^2\n# ...\n# function for u(x,y,0)\nexpression = 10\n\n# Declares the diffusion part on the diffusion-reaction equation\n# Here we use the following ExprTk syntax to constraint the left and right parts of\n# the compartment: "condition ? if_true : if_false"\n# the "if_true" part contains the values set on the left and right boundaries\n[model.scalar_field.u.constrain.boundary]\nexpression = (position_x <= 0. or position_x >= 1.) ? 0. : no_value\nparser_type = ExprTk\n\n[model.time_step_operator]\n# initial time of the simulation\ntime_begin = 0\n# final time of the simulation\ntime_end = 10\n',c='#########################################################################\n# VOLKA-TERRA EQUATIONS:\n#\n# \u2202\u209cu = \u03b1\xb7u - \u03b2\xb7u\xb7v\n# \u2202\u209cv = \u03b4\xb7u\xb7v - \u03b3\xb7v\n#\n# See: https://en.wikipedia.org/wiki/Lotka%E2%80%93Volterra_equations\n#\n# Note that there is not derivative on the positions x or y, so the\n# functions are the same on every point in x and y for a given time t.\n# Hence, we do not refine the grid at all.\n#\n#########################################################################\n\n[grid]\n# extensions of the grid in x and y directions\nextensions = 1 1\n# number of cells of the initial grid in x and y directions\ncells = 1 1\n\n# defines a compartment with the name "domain"\n[compartments.domain]\nexpression = 1\n\n# Define constants with name "alpha", "beta", "delta", and "gamma"\n# representing \u03b1, \u03b2, \u03b4, and \u03b3 respectively\n[parser_context.alpha]\ntype = constant\nvalue = 0.666666\n[parser_context.beta]\ntype = constant\nvalue = 1.33333\n[parser_context.delta]\ntype = constant\nvalue = 1\n[parser_context.gamma]\ntype = constant\nvalue = 1\n\n# our model is linear because there is a non-linear reaction part\n[model]\nis_linear = false\n\n##### Definition of the equation to solve function u(x,y,t) ######\n\n# Declares the compartment where this function is defined\n[model.scalar_field.u]\ncompartment = domain\n\n# Declares that the equation is transient\n[model.scalar_field.u.storage]\nexpression = 1\n\n# Declares the reaction part on the diffusion-reaction equation for equation for u\n[model.scalar_field.u.reaction]\nexpression = alpha*u - beta*u*v\n\n# Declares the jacobian of the reaction of u\n[model.scalar_field.u.reaction.jacobian.u]\n# \u2202\u1d64(\u03b1\xb7u - \u03b2\xb7u\xb7v) = \u03b1 - \u03b2\xb7v\nexpression = alpha - beta*v\n[model.scalar_field.u.reaction.jacobian.v]\n# \u2202\u1d65(\u03b1\xb7u - \u03b2\xb7u\xb7v) = - \u03b2\xb7u\nexpression = -beta*u\n\n[model.scalar_field.u.initial]\n# function for u(x,y,0)\nexpression = 1\n\n##### Definition of the equation to solve function v(x,y,t) ######\n\n# Declares the compartment where this function is defined\n[model.scalar_field.v]\ncompartment = domain\n\n# Declares that the equation is transient\n[model.scalar_field.v.storage]\nexpression = 1\n\n# Declares the reaction part on the diffusion-reaction equation for equation for v\n[model.scalar_field.v.reaction]\nexpression = delta*u*v - gamma*v\n\n# Declares the jacobian of the reaction of v\n[model.scalar_field.v.reaction.jacobian.u]\n# \u2202\u1d64(\u03b4\xb7u\xb7v - \u03b3\xb7v) = \u03b4\xb7v\nexpression = delta*v\n[model.scalar_field.v.reaction.jacobian.v]\n# \u2202\u1d65(\u03b4\xb7u\xb7v - \u03b3\xb7v) = \u03b4\xb7u - \u03b3\nexpression = delta*u-gamma\n\n[model.scalar_field.v.initial]\n# function for v(x,y,0)\nexpression = 1\n\n[model.time_step_operator]\n# initial time of the simulation\ntime_begin = 0\n# final time of the simulation\ntime_end = 20\n# limit the maximum time-step\ntime_step_max = 0.25\n',u="#########################################################################\n# GREY-SCOTT EQUATIONS:\n#\n# \u2202\u209cu = 2\xb7D\xb7\u2202\u2093\u2202\u2093u + f\xb7(1-u) - u\xb7v\xb2\n# \u2202\u209cv = D\xb7\u2202\u2093\u2202\u2093u - (f+k)\xb7v + u\xb7v\xb2\n#\n# See: https://groups.csail.mit.edu/mac/projects/amorphous/GrayScott/\n#\n#########################################################################\n\n[grid]\nextensions = 1 1\ndimension = 2\nrefinement_level = 7\n\n[parser_context.bump]\ntype = function\nexpression = x, y: 0.5*exp(-100*(x^2 + y^2))\nparser_t
1ype = ExprTk\n\n[parser_context.F]\ntype = constant\nvalue = 0.0420\n\n[parser_context.k]\ntype = constant\nvalue = 0.0610\n\n[parser_context.D]\ntype = constant\nvalue = 1e-5\n\n[model]\norder = 1\nparser_type = ExprTk\n\n[model.time_step_operator]\ntime_begin = 0\ntime_end = 10000\ntime_step_initial = 0.1\ntime_step_max = 50\n\n[model.time_step_operator.linear_solver]\ntype = RestartedGMRes\npreconditioner.type = Jacobi\n\n[model.time_step_operator.nonlinear_solver]\ntype = Alexander2\nconvergence_condition.relative_tolerance = 1.00000000000000002e-08\nconvergence_condition.absolute_tolerance = 0\n\n[model.writer.vtk]\npath = vtk\n\n[compartments]\ncompartment.expression = 1\n\n[model.scalar_field.U]\ncompartment = compartment\ninitial.expression = 0.7\nstorage.expression = 1\nreaction.expression = F*(1-U) - U*V^2\nreaction.jacobian.U.expression = -F - V^2\nreaction.jacobian.V.expression = -2*U*V\ncross_diffusion.U.expression = D*2\n\n[model.scalar_field.V]\ncompartment = compartment\ninitial.expression = bump(0.25-position_x, 0.25-position_y) + bump(0.25-position_x, 0.75-position_y) + bump(0.75-position_x, 0.25-position_y) + bump(0.75-position_x, 0.75-position_y)\nstorage.expression = 1\nreaction.expression = -(F+k)*V + U*V^2\nreaction.jacobian.U.expression = V^2\nreaction.jacobian.V.expression = -(F+k) + 2*U*V\ncross_diffusion.V.expression = D\n",d={id:"ini_file",title:"Config File",description:"Syntax of INI file",sidebar_label:"Config File",tags:["API","CLI"]},p=void 0,h={id:"ini_file",title:"Config File",description:"Syntax of INI file",s
1ource:"@site/docs/ini_file.mdx",sourceDirName:".",slug:"/ini_file",permalink:"/docs/next/ini_file",draft:!1,unlisted:!1,editUrl:"https://gitlab.dune-project.org/copasi/dune-copasi/-/edit/master/doc/docusaurus/docs/ini_file.mdx",tags:[{inline:!0,label:"API",permalink:"/docs/next/tags/api"},{inline:!0,label:"CLI",permalink:"/docs/next/tags/cli"}],version:"current",lastUpdatedBy:"Santiago Ospina De Los R\xedos",lastUpdatedAt:1732665958e3,frontMatter:{id:"ini_file",title:"Config File",description:"Syntax of INI file",sidebar_label:"Config File",tags:["API","CLI"]},sidebar:"docs",previous:{title:"Configuration Options",permalink:"/docs/next/config"},next:{title:"Options",permalink:"/docs/next/param_tree"}},m={},f=[];function x(e){const n={a:"a",admonition:"admonition",code:"code",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,a.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.admonition,{title:"CLI Usage",type:"note",children:(0,i.jsxs)(n.p,{children:["This documentation page is intended for the ",(0,i.jsx)(n.a,{href:"use_cli",children:"Command Line Interface (CLI)"}),". If you're new to DuneCopasi, we recommend starting with our ",(0,i.jsx)(n.a,{href:"/tutorials",children:"Tutorials"}),"."]})}),"\n",(0,i.jsxs)(n.p,{children:["To express different ",(0,i.jsx)(n.a,{href:"/math_model",children:"mathematical problems"})," we typically write a configuration file (with ",(0,i.jsx)(n.code,{children:".ini"})," extension by convention) which entails all the information that is needed for the DuneCopasi solver to construct the problem at hand.\nThe configuration file consists of a parameter tree containing the ",(0,i.jsx)(n.a,{href:"param_tree",children:"simulation options"}),". The nodes at the top level can be divided in 4 categories:"]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Category"}),(0,i.jsx)(n.th,{children:"Description"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"grid"})}),(0,i.jsx)(n.td,{children:"The nodes under the grid header describe the basic properties of the grid. For example the dimension, extension, origin, etc."})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"parser_context"})}),(0,i.jsx)(n.td,{children:"Under this node we are able to define constant and functions that can be used to define the mathematical model."})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"compartments"})}),(0,i.jsx)(n.td,{children:"In this category we define the properties related to division of the problem to multiple compartments."})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"model"})}),(0,i.jsx)(n.td,{children:"This is the heart of the mathematical problem where we define the reaction terms, diffusion, etc."})]})]})]}),"\n",(0,i.jsxs)(n.p,{children:["The ini files we use follow the DUNE convention. In short, the data is composed of a key\u2013value pairs on the form ",(0,i.jsx)(n.code,{children:"key = value"}),". For example, to define a ",(0,i.jsx)(n.code,{children:"property"})," of the category ",(0,i.jsx)(n.code,{children:"grid"})," we write"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ini",metastring:'title="config.ini"',children:"grid.property = value\n"})}),"\n",(0,i.jsxs)(n.p,{children:["In essence the ini file is nothing else than a parameter tree of key-value pairs. For convenience one can use sections to avoid rewriting the leading part and provide more structure. This is done by using ",(0,i.jsx)(n.code,{children:"[section.subsection]"})," syntax. The keys below will now be within the designated subsection. As an example, the three following ini files, are equivalent"]}),"\n",(0,i.jsxs)(r.A,{defaultValue:"form1",values:[{label:"No grouping",value:"form1"},{label:"Grouping",value:"form2"},{label:"Nested grouping",value:"form3"}],children:[(0,i.jsx)(o.A,{value:"form1",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ini",metastring:'title="config.ini"',children:"# No preceding section (everything after a '#' will be ignored)\nsection.subsection.first = 1.0\nsection.subsection.second = 2.0\n"})})}),(0,i.jsx)(o.A,{value:"form2",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ini",metastring:'title="config.ini"',children:"[section]\nsubsection.first = 1.0\nsubsection.second = 2.0\n"})})}),(0,i.jsx)(o.A,{value:"form3",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ini",metastring:'title="config.ini"',children:"[section.subsection]\nfirst = 1.0\nsecond = 2.0\n"})})})]}),"\n",(0,i.jsx)(n.admonition,{title:"Examples",type:"tip",children:(0,i.jsxs)(r.A,{groupId:"config-examples",defaultValue:"heat",values:[{label:"Heat Eqs",value:"heat"},{label:"Volka-Terra Eqs",value:"volka_terra"},{label:"Grey-Scott Eqs",value:"grey_scott"}],children:[(0,i.jsx)(o.A,{value:"heat",children:(0,i.jsx)(s.A,{language:"ini",title:"heat.ini",showLineNumbers:!0,children:l})}),(0,i.jsx)(o.A,{value:"volka_terra",children:(0,i.jsx)(s.A,{language:"ini",title:"volka_terra.ini",showLineNumbers:!0,children:c})}),(0,i.jsx)(o.A,{value:"grey_scott",children:(0,i.jsx)(s.A,{language:"ini",title:"grey_scott.ini",showLineNumbers:!0,children:u})})]})})]})}function v(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(x,{...e})}):x(e)}},9365:(e,n,t)=>{t.d(n,{A:()=>o});t(6540);var i=t(8215);const a={tabItem:"tabItem_Ymn6"};var r=t(4848);function o(e){let{children:n,hidden:t,className:o}=e;return(0,r.jsx)("div",{role:"tabpanel",className:(0,i.A)(a.tabItem,o),hidden:t,children:n})}},1470:(e,n,t)=>{t.d(n,{A:()=>j});var i=t(6540),a=t(8215),r=t(3104),o=t(6347),s=t(205),l=t(7485),c=t(1682),u=t(679);function d(e){return i.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,i.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad <Tabs>
1 child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:n,children:t}=e;return(0,i.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:t,attributes:i,default:a}}=e;return{value:n,label:t,attributes:i,default:a}}))}(t);return function(e){const n=(0,c.XI)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in <Tabs>. Every value needs to be unique.`)}(e),e}),[n,t])}function h(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function m(e){let{queryString:n=!1,groupId:t}=e;const a=(0,o.W6)(),r=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw new Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,l.aZ)(r),(0,i.useCallback)((e=>{if(!r)return;const n=new URLSearchParams(a.location.search);n.set(r,e),a.replace({...a.location,search:n.toString()})}),[r,a])]}function f(e){const{defaultValue:n,queryString:t=!1,groupId:a}=e,r=p(e),[o,l]=(0,i.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(n){if(!h({value:n,tabValues:t}))throw new Error(`Docusaurus error: The <Tabs> has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const i=t.find((e=>e.default))??t[0];if(!i)throw new Error("Unexpected error: 0 tabValues");return i.value}({defaultValue:n,tabValues:r}))),[c,d]=m({queryString:t,groupId:a}),[f,x]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[a,r]=(0,u.Dv)(t);return[a,(0,i.useCallback)((e=>{t&&r.set(e)}),[t,r])]}({groupId:a}),v=(()=>{const e=c??f;return h({value:e,tabValues:r})?e:null})();(0,s.A)((()=>{v&&l(v)}),[v]);return{selectedValue:o,selectValue:(0,i.useCallback)((e=>{if(!h({value:e,tabValues:r}))throw new Error(`Can't select invalid tab value=${e}`);l(e),d(e),x(e)}),[d,x,r]),tabValues:r}}var x=t(2303);const v={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var b=t(4848);function g(e){let{className:n,block:t,selectedValue:i,selectValue:o,tabValues:s}=e;const l=[],{blockElementScrollPositionUntilNextRender:c}=(0,r.a_)(),u=e=>{const n=e.currentTarget,t=l.indexOf(n),a=s[t].value;a!==i&&(c(n),o(a))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const t=l.indexOf(e.currentTarget)+1;n=l[t]??l[0];break}case"ArrowLeft":{const t=l.indexOf(e.currentTarget)-1;n=l[t]??l[l.length-1];break}}n?.focus()};return(0,b.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.A)("tabs",{"tabs--block":t},n),children:s.map((e=>{let{value:n,label:t,attributes:r}=e;return(0,b.jsx)("li",{role:"tab",tabIndex:i===n?0:-1,"aria-selected":i===n,ref:e=>l.push(e),onKeyDown:d,onClick:u,...r,className:(0,a.A)("tabs__item",v.tabItem,r?.className,{"tabs__item--active":i===n}),children:t??n},n)}))})}function _(e){let{lazy:n,children:t,selectedValue:r}=e;const o=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=o.find((e=>e.props.value===r));return e?(0,i.cloneElement)(e,{className:(0,a.A)("margin-top--md",e.props.className)}):null}return(0,b.jsx)("div",{className:"margin-top--md",children:o.map(((e,n)=>(0,i.cloneElement)(e,{key:n,hidden:e.props.value!==r})))})}function y(e){const n=f(e);return(0,b.jsxs)("div",{className:(0,a.A)("tabs-container",v.tabList),
1children:[(0,b.jsx)(g,{...n,...e}),(0,b.jsx)(_,{...n,...e})]})}function j(e){const n=(0,x.A)();return(0,b.jsx)(y,{...e,children:d(e.children)},String(n))}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.