diff --git a/.doctrees/environment.pickle b/.doctrees/environment.pickle index 86bcd4858..a160da72f 100644 Binary files a/.doctrees/environment.pickle and b/.doctrees/environment.pickle differ diff --git a/.doctrees/nbsphinx/notebooks/nmodl-kinetic-schemes.ipynb b/.doctrees/nbsphinx/notebooks/nmodl-kinetic-schemes.ipynb index 9423ac0c3..cad158aba 100644 --- a/.doctrees/nbsphinx/notebooks/nmodl-kinetic-schemes.ipynb +++ b/.doctrees/nbsphinx/notebooks/nmodl-kinetic-schemes.ipynb @@ -152,10 +152,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:11.343181Z", - "iopub.status.busy": "2024-07-08T14:19:11.342948Z", - "iopub.status.idle": "2024-07-08T14:19:12.142002Z", - "shell.execute_reply": "2024-07-08T14:19:12.141214Z" + "iopub.execute_input": "2024-07-09T13:27:18.879666Z", + "iopub.status.busy": "2024-07-09T13:27:18.879113Z", + "iopub.status.idle": "2024-07-09T13:27:19.619276Z", + "shell.execute_reply": "2024-07-09T13:27:19.618410Z" } }, "outputs": [], @@ -169,10 +169,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:12.145153Z", - "iopub.status.busy": "2024-07-08T14:19:12.144926Z", - "iopub.status.idle": "2024-07-08T14:19:12.173471Z", - "shell.execute_reply": "2024-07-08T14:19:12.172816Z" + "iopub.execute_input": "2024-07-09T13:27:19.622702Z", + "iopub.status.busy": "2024-07-09T13:27:19.622278Z", + "iopub.status.idle": "2024-07-09T13:27:19.648873Z", + "shell.execute_reply": "2024-07-09T13:27:19.648278Z" } }, "outputs": [], @@ -277,10 +277,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:12.176565Z", - "iopub.status.busy": "2024-07-08T14:19:12.176282Z", - "iopub.status.idle": "2024-07-08T14:19:12.181063Z", - "shell.execute_reply": "2024-07-08T14:19:12.180392Z" + "iopub.execute_input": "2024-07-09T13:27:19.651570Z", + "iopub.status.busy": "2024-07-09T13:27:19.651308Z", + "iopub.status.idle": "2024-07-09T13:27:19.655905Z", + "shell.execute_reply": "2024-07-09T13:27:19.655225Z" } }, "outputs": [ @@ -323,10 +323,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:12.212484Z", - "iopub.status.busy": "2024-07-08T14:19:12.212210Z", - "iopub.status.idle": "2024-07-08T14:19:12.217225Z", - "shell.execute_reply": "2024-07-08T14:19:12.216517Z" + "iopub.execute_input": "2024-07-09T13:27:19.684875Z", + "iopub.status.busy": "2024-07-09T13:27:19.684393Z", + "iopub.status.idle": "2024-07-09T13:27:19.688190Z", + "shell.execute_reply": "2024-07-09T13:27:19.687532Z" } }, "outputs": [ @@ -367,10 +367,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:12.219699Z", - "iopub.status.busy": "2024-07-08T14:19:12.219477Z", - "iopub.status.idle": "2024-07-08T14:19:12.223731Z", - "shell.execute_reply": "2024-07-08T14:19:12.223002Z" + "iopub.execute_input": "2024-07-09T13:27:19.690618Z", + "iopub.status.busy": "2024-07-09T13:27:19.690173Z", + "iopub.status.idle": "2024-07-09T13:27:19.693903Z", + "shell.execute_reply": "2024-07-09T13:27:19.693249Z" }, "scrolled": true }, @@ -412,10 +412,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:12.226274Z", - "iopub.status.busy": "2024-07-08T14:19:12.226063Z", - "iopub.status.idle": "2024-07-08T14:19:12.230139Z", - "shell.execute_reply": "2024-07-08T14:19:12.229453Z" + "iopub.execute_input": "2024-07-09T13:27:19.696347Z", + "iopub.status.busy": "2024-07-09T13:27:19.695905Z", + "iopub.status.idle": "2024-07-09T13:27:19.699730Z", + "shell.execute_reply": "2024-07-09T13:27:19.699051Z" }, "scrolled": true }, @@ -459,10 +459,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:12.233438Z", - "iopub.status.busy": "2024-07-08T14:19:12.232862Z", - "iopub.status.idle": "2024-07-08T14:19:12.238022Z", - "shell.execute_reply": "2024-07-08T14:19:12.237325Z" + "iopub.execute_input": "2024-07-09T13:27:19.702048Z", + "iopub.status.busy": "2024-07-09T13:27:19.701710Z", + "iopub.status.idle": "2024-07-09T13:27:19.706028Z", + "shell.execute_reply": "2024-07-09T13:27:19.705375Z" } }, "outputs": [ diff --git a/.doctrees/nbsphinx/notebooks/nmodl-python-tutorial.ipynb b/.doctrees/nbsphinx/notebooks/nmodl-python-tutorial.ipynb index 6bbe2e92e..29a8f495a 100644 --- a/.doctrees/nbsphinx/notebooks/nmodl-python-tutorial.ipynb +++ b/.doctrees/nbsphinx/notebooks/nmodl-python-tutorial.ipynb @@ -30,10 +30,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:17.773745Z", - "iopub.status.busy": "2024-07-08T14:19:17.773508Z", - "iopub.status.idle": "2024-07-08T14:19:18.583317Z", - "shell.execute_reply": "2024-07-08T14:19:18.582499Z" + "iopub.execute_input": "2024-07-09T13:27:24.565006Z", + "iopub.status.busy": "2024-07-09T13:27:24.564810Z", + "iopub.status.idle": "2024-07-09T13:27:25.307028Z", + "shell.execute_reply": "2024-07-09T13:27:25.306162Z" } }, "outputs": [], @@ -63,10 +63,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.586574Z", - "iopub.status.busy": "2024-07-08T14:19:18.586304Z", - "iopub.status.idle": "2024-07-08T14:19:18.613678Z", - "shell.execute_reply": "2024-07-08T14:19:18.612926Z" + "iopub.execute_input": "2024-07-09T13:27:25.310263Z", + "iopub.status.busy": "2024-07-09T13:27:25.310058Z", + "iopub.status.idle": "2024-07-09T13:27:25.334976Z", + "shell.execute_reply": "2024-07-09T13:27:25.334393Z" } }, "outputs": [], @@ -86,10 +86,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.616835Z", - "iopub.status.busy": "2024-07-08T14:19:18.616603Z", - "iopub.status.idle": "2024-07-08T14:19:18.620503Z", - "shell.execute_reply": "2024-07-08T14:19:18.619909Z" + "iopub.execute_input": "2024-07-09T13:27:25.337629Z", + "iopub.status.busy": "2024-07-09T13:27:25.337237Z", + "iopub.status.idle": "2024-07-09T13:27:25.340859Z", + "shell.execute_reply": "2024-07-09T13:27:25.340321Z" } }, "outputs": [], @@ -152,10 +152,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.623065Z", - "iopub.status.busy": "2024-07-08T14:19:18.622848Z", - "iopub.status.idle": "2024-07-08T14:19:18.627437Z", - "shell.execute_reply": "2024-07-08T14:19:18.626783Z" + "iopub.execute_input": "2024-07-09T13:27:25.343141Z", + "iopub.status.busy": "2024-07-09T13:27:25.342828Z", + "iopub.status.idle": "2024-07-09T13:27:25.346646Z", + "shell.execute_reply": "2024-07-09T13:27:25.346093Z" } }, "outputs": [], @@ -183,10 +183,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.630025Z", - "iopub.status.busy": "2024-07-08T14:19:18.629756Z", - "iopub.status.idle": "2024-07-08T14:19:18.633773Z", - "shell.execute_reply": "2024-07-08T14:19:18.633051Z" + "iopub.execute_input": "2024-07-09T13:27:25.349113Z", + "iopub.status.busy": "2024-07-09T13:27:25.348659Z", + "iopub.status.idle": "2024-07-09T13:27:25.352244Z", + "shell.execute_reply": "2024-07-09T13:27:25.351628Z" } }, "outputs": [ @@ -235,10 +235,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.636311Z", - "iopub.status.busy": "2024-07-08T14:19:18.636114Z", - "iopub.status.idle": "2024-07-08T14:19:18.640682Z", - "shell.execute_reply": "2024-07-08T14:19:18.640124Z" + "iopub.execute_input": "2024-07-09T13:27:25.354849Z", + "iopub.status.busy": "2024-07-09T13:27:25.354394Z", + "iopub.status.idle": "2024-07-09T13:27:25.358702Z", + "shell.execute_reply": "2024-07-09T13:27:25.358079Z" } }, "outputs": [], @@ -260,10 +260,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.643170Z", - "iopub.status.busy": "2024-07-08T14:19:18.642970Z", - "iopub.status.idle": "2024-07-08T14:19:18.646781Z", - "shell.execute_reply": "2024-07-08T14:19:18.646083Z" + "iopub.execute_input": "2024-07-09T13:27:25.361370Z", + "iopub.status.busy": "2024-07-09T13:27:25.360884Z", + "iopub.status.idle": "2024-07-09T13:27:25.364571Z", + "shell.execute_reply": "2024-07-09T13:27:25.363943Z" } }, "outputs": [ @@ -297,10 +297,10 @@ "execution_count": 8, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.649463Z", - "iopub.status.busy": "2024-07-08T14:19:18.649062Z", - "iopub.status.idle": "2024-07-08T14:19:18.656877Z", - "shell.execute_reply": "2024-07-08T14:19:18.656192Z" + "iopub.execute_input": "2024-07-09T13:27:25.366962Z", + "iopub.status.busy": "2024-07-09T13:27:25.366605Z", + "iopub.status.idle": "2024-07-09T13:27:25.373828Z", + "shell.execute_reply": "2024-07-09T13:27:25.373168Z" } }, "outputs": [ @@ -365,10 +365,10 @@ "execution_count": 9, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.659462Z", - "iopub.status.busy": "2024-07-08T14:19:18.659251Z", - "iopub.status.idle": "2024-07-08T14:19:18.663832Z", - "shell.execute_reply": "2024-07-08T14:19:18.663176Z" + "iopub.execute_input": "2024-07-09T13:27:25.376286Z", + "iopub.status.busy": "2024-07-09T13:27:25.375921Z", + "iopub.status.idle": "2024-07-09T13:27:25.380482Z", + "shell.execute_reply": "2024-07-09T13:27:25.379789Z" } }, "outputs": [ @@ -416,10 +416,10 @@ "execution_count": 10, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.666269Z", - "iopub.status.busy": "2024-07-08T14:19:18.666074Z", - "iopub.status.idle": "2024-07-08T14:19:18.669857Z", - "shell.execute_reply": "2024-07-08T14:19:18.669188Z" + "iopub.execute_input": "2024-07-09T13:27:25.383083Z", + "iopub.status.busy": "2024-07-09T13:27:25.382725Z", + "iopub.status.idle": "2024-07-09T13:27:25.385884Z", + "shell.execute_reply": "2024-07-09T13:27:25.385371Z" } }, "outputs": [], @@ -441,10 +441,10 @@ "execution_count": 11, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.672469Z", - "iopub.status.busy": "2024-07-08T14:19:18.672262Z", - "iopub.status.idle": "2024-07-08T14:19:18.676241Z", - "shell.execute_reply": "2024-07-08T14:19:18.675532Z" + "iopub.execute_input": "2024-07-09T13:27:25.388228Z", + "iopub.status.busy": "2024-07-09T13:27:25.387868Z", + "iopub.status.idle": "2024-07-09T13:27:25.391851Z", + "shell.execute_reply": "2024-07-09T13:27:25.391164Z" } }, "outputs": [ @@ -510,10 +510,10 @@ "execution_count": 12, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.678863Z", - "iopub.status.busy": "2024-07-08T14:19:18.678417Z", - "iopub.status.idle": "2024-07-08T14:19:18.682345Z", - "shell.execute_reply": "2024-07-08T14:19:18.681608Z" + "iopub.execute_input": "2024-07-09T13:27:25.394094Z", + "iopub.status.busy": "2024-07-09T13:27:25.393897Z", + "iopub.status.idle": "2024-07-09T13:27:25.397165Z", + "shell.execute_reply": "2024-07-09T13:27:25.396508Z" } }, "outputs": [ @@ -548,10 +548,10 @@ "execution_count": 13, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.684840Z", - "iopub.status.busy": "2024-07-08T14:19:18.684633Z", - "iopub.status.idle": "2024-07-08T14:19:18.688452Z", - "shell.execute_reply": "2024-07-08T14:19:18.687745Z" + "iopub.execute_input": "2024-07-09T13:27:25.399613Z", + "iopub.status.busy": "2024-07-09T13:27:25.399257Z", + "iopub.status.idle": "2024-07-09T13:27:25.402695Z", + "shell.execute_reply": "2024-07-09T13:27:25.402051Z" } }, "outputs": [ @@ -584,10 +584,10 @@ "execution_count": 14, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.690987Z", - "iopub.status.busy": "2024-07-08T14:19:18.690790Z", - "iopub.status.idle": "2024-07-08T14:19:18.694530Z", - "shell.execute_reply": "2024-07-08T14:19:18.693795Z" + "iopub.execute_input": "2024-07-09T13:27:25.405242Z", + "iopub.status.busy": "2024-07-09T13:27:25.404893Z", + "iopub.status.idle": "2024-07-09T13:27:25.408544Z", + "shell.execute_reply": "2024-07-09T13:27:25.407900Z" } }, "outputs": [ @@ -622,10 +622,10 @@ "execution_count": 15, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.696897Z", - "iopub.status.busy": "2024-07-08T14:19:18.696703Z", - "iopub.status.idle": "2024-07-08T14:19:18.701003Z", - "shell.execute_reply": "2024-07-08T14:19:18.700285Z" + "iopub.execute_input": "2024-07-09T13:27:25.410988Z", + "iopub.status.busy": "2024-07-09T13:27:25.410510Z", + "iopub.status.idle": "2024-07-09T13:27:25.414659Z", + "shell.execute_reply": "2024-07-09T13:27:25.414021Z" } }, "outputs": [ @@ -669,10 +669,10 @@ "execution_count": 16, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.703593Z", - "iopub.status.busy": "2024-07-08T14:19:18.703371Z", - "iopub.status.idle": "2024-07-08T14:19:18.709089Z", - "shell.execute_reply": "2024-07-08T14:19:18.708371Z" + "iopub.execute_input": "2024-07-09T13:27:25.417169Z", + "iopub.status.busy": "2024-07-09T13:27:25.416737Z", + "iopub.status.idle": "2024-07-09T13:27:25.422069Z", + "shell.execute_reply": "2024-07-09T13:27:25.421431Z" } }, "outputs": [ @@ -733,10 +733,10 @@ "execution_count": 17, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.711847Z", - "iopub.status.busy": "2024-07-08T14:19:18.711608Z", - "iopub.status.idle": "2024-07-08T14:19:18.715630Z", - "shell.execute_reply": "2024-07-08T14:19:18.714908Z" + "iopub.execute_input": "2024-07-09T13:27:25.424400Z", + "iopub.status.busy": "2024-07-09T13:27:25.424062Z", + "iopub.status.idle": "2024-07-09T13:27:25.427587Z", + "shell.execute_reply": "2024-07-09T13:27:25.426950Z" } }, "outputs": [], @@ -761,10 +761,10 @@ "execution_count": 18, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.718205Z", - "iopub.status.busy": "2024-07-08T14:19:18.717990Z", - "iopub.status.idle": "2024-07-08T14:19:18.728725Z", - "shell.execute_reply": "2024-07-08T14:19:18.728117Z" + "iopub.execute_input": "2024-07-09T13:27:25.429846Z", + "iopub.status.busy": "2024-07-09T13:27:25.429512Z", + "iopub.status.idle": "2024-07-09T13:27:25.439668Z", + "shell.execute_reply": "2024-07-09T13:27:25.439009Z" } }, "outputs": [], @@ -857,10 +857,10 @@ "execution_count": 19, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.731260Z", - "iopub.status.busy": "2024-07-08T14:19:18.731026Z", - "iopub.status.idle": "2024-07-08T14:19:18.735329Z", - "shell.execute_reply": "2024-07-08T14:19:18.734631Z" + "iopub.execute_input": "2024-07-09T13:27:25.442305Z", + "iopub.status.busy": "2024-07-09T13:27:25.441864Z", + "iopub.status.idle": "2024-07-09T13:27:25.445493Z", + "shell.execute_reply": "2024-07-09T13:27:25.444848Z" } }, "outputs": [ @@ -897,10 +897,10 @@ "execution_count": 20, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.737758Z", - "iopub.status.busy": "2024-07-08T14:19:18.737554Z", - "iopub.status.idle": "2024-07-08T14:19:18.743435Z", - "shell.execute_reply": "2024-07-08T14:19:18.742749Z" + "iopub.execute_input": "2024-07-09T13:27:25.447825Z", + "iopub.status.busy": "2024-07-09T13:27:25.447490Z", + "iopub.status.idle": "2024-07-09T13:27:25.452827Z", + "shell.execute_reply": "2024-07-09T13:27:25.452173Z" } }, "outputs": [ diff --git a/.doctrees/nbsphinx/notebooks/nmodl-sympy-conductance.ipynb b/.doctrees/nbsphinx/notebooks/nmodl-sympy-conductance.ipynb index 6e10fa6ad..dfc8325fb 100644 --- a/.doctrees/nbsphinx/notebooks/nmodl-sympy-conductance.ipynb +++ b/.doctrees/nbsphinx/notebooks/nmodl-sympy-conductance.ipynb @@ -86,10 +86,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:21.317356Z", - "iopub.status.busy": "2024-07-08T14:19:21.316786Z", - "iopub.status.idle": "2024-07-08T14:19:22.121495Z", - "shell.execute_reply": "2024-07-08T14:19:22.120676Z" + "iopub.execute_input": "2024-07-09T13:27:27.777219Z", + "iopub.status.busy": "2024-07-09T13:27:27.776676Z", + "iopub.status.idle": "2024-07-09T13:27:28.520529Z", + "shell.execute_reply": "2024-07-09T13:27:28.519763Z" } }, "outputs": [], @@ -103,10 +103,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:22.125074Z", - "iopub.status.busy": "2024-07-08T14:19:22.124482Z", - "iopub.status.idle": "2024-07-08T14:19:22.153146Z", - "shell.execute_reply": "2024-07-08T14:19:22.152468Z" + "iopub.execute_input": "2024-07-09T13:27:28.523640Z", + "iopub.status.busy": "2024-07-09T13:27:28.523224Z", + "iopub.status.idle": "2024-07-09T13:27:28.550057Z", + "shell.execute_reply": "2024-07-09T13:27:28.549480Z" } }, "outputs": [], @@ -149,10 +149,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:22.156578Z", - "iopub.status.busy": "2024-07-08T14:19:22.156052Z", - "iopub.status.idle": "2024-07-08T14:19:22.440666Z", - "shell.execute_reply": "2024-07-08T14:19:22.439889Z" + "iopub.execute_input": "2024-07-09T13:27:28.552827Z", + "iopub.status.busy": "2024-07-09T13:27:28.552470Z", + "iopub.status.idle": "2024-07-09T13:27:28.813885Z", + "shell.execute_reply": "2024-07-09T13:27:28.813179Z" } }, "outputs": [ @@ -196,10 +196,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:22.443723Z", - "iopub.status.busy": "2024-07-08T14:19:22.443084Z", - "iopub.status.idle": "2024-07-08T14:19:22.597116Z", - "shell.execute_reply": "2024-07-08T14:19:22.596399Z" + "iopub.execute_input": "2024-07-09T13:27:28.816535Z", + "iopub.status.busy": "2024-07-09T13:27:28.816245Z", + "iopub.status.idle": "2024-07-09T13:27:28.944724Z", + "shell.execute_reply": "2024-07-09T13:27:28.944134Z" } }, "outputs": [ @@ -243,10 +243,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:22.599924Z", - "iopub.status.busy": "2024-07-08T14:19:22.599697Z", - "iopub.status.idle": "2024-07-08T14:19:22.608506Z", - "shell.execute_reply": "2024-07-08T14:19:22.607749Z" + "iopub.execute_input": "2024-07-09T13:27:28.947449Z", + "iopub.status.busy": "2024-07-09T13:27:28.947044Z", + "iopub.status.idle": "2024-07-09T13:27:28.954909Z", + "shell.execute_reply": "2024-07-09T13:27:28.954257Z" } }, "outputs": [ @@ -290,10 +290,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:22.611253Z", - "iopub.status.busy": "2024-07-08T14:19:22.611025Z", - "iopub.status.idle": "2024-07-08T14:19:22.629729Z", - "shell.execute_reply": "2024-07-08T14:19:22.629073Z" + "iopub.execute_input": "2024-07-09T13:27:28.957318Z", + "iopub.status.busy": "2024-07-09T13:27:28.956974Z", + "iopub.status.idle": "2024-07-09T13:27:28.974112Z", + "shell.execute_reply": "2024-07-09T13:27:28.973449Z" } }, "outputs": [ @@ -337,10 +337,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:22.632430Z", - "iopub.status.busy": "2024-07-08T14:19:22.632200Z", - "iopub.status.idle": "2024-07-08T14:19:22.762561Z", - "shell.execute_reply": "2024-07-08T14:19:22.761830Z" + "iopub.execute_input": "2024-07-09T13:27:28.976838Z", + "iopub.status.busy": "2024-07-09T13:27:28.976422Z", + "iopub.status.idle": "2024-07-09T13:27:29.095599Z", + "shell.execute_reply": "2024-07-09T13:27:29.094930Z" } }, "outputs": [ @@ -400,10 +400,10 @@ "execution_count": 8, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:22.765393Z", - "iopub.status.busy": "2024-07-08T14:19:22.765161Z", - "iopub.status.idle": "2024-07-08T14:19:22.870422Z", - "shell.execute_reply": "2024-07-08T14:19:22.869740Z" + "iopub.execute_input": "2024-07-09T13:27:29.098318Z", + "iopub.status.busy": "2024-07-09T13:27:29.097913Z", + "iopub.status.idle": "2024-07-09T13:27:29.191411Z", + "shell.execute_reply": "2024-07-09T13:27:29.190802Z" } }, "outputs": [ @@ -456,10 +456,10 @@ "execution_count": 9, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:22.873175Z", - "iopub.status.busy": "2024-07-08T14:19:22.872935Z", - "iopub.status.idle": "2024-07-08T14:19:22.948171Z", - "shell.execute_reply": "2024-07-08T14:19:22.947424Z" + "iopub.execute_input": "2024-07-09T13:27:29.194044Z", + "iopub.status.busy": "2024-07-09T13:27:29.193566Z", + "iopub.status.idle": "2024-07-09T13:27:29.267305Z", + "shell.execute_reply": "2024-07-09T13:27:29.266647Z" } }, "outputs": [ diff --git a/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-cnexp.ipynb b/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-cnexp.ipynb index 012809611..cab0fdb71 100644 --- a/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-cnexp.ipynb +++ b/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-cnexp.ipynb @@ -62,10 +62,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:24.812751Z", - "iopub.status.busy": "2024-07-08T14:19:24.812436Z", - "iopub.status.idle": "2024-07-08T14:19:25.623956Z", - "shell.execute_reply": "2024-07-08T14:19:25.623195Z" + "iopub.execute_input": "2024-07-09T13:27:30.919502Z", + "iopub.status.busy": "2024-07-09T13:27:30.918912Z", + "iopub.status.idle": "2024-07-09T13:27:31.702525Z", + "shell.execute_reply": "2024-07-09T13:27:31.701626Z" } }, "outputs": [], @@ -79,10 +79,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:25.627345Z", - "iopub.status.busy": "2024-07-08T14:19:25.627111Z", - "iopub.status.idle": "2024-07-08T14:19:25.658122Z", - "shell.execute_reply": "2024-07-08T14:19:25.657332Z" + "iopub.execute_input": "2024-07-09T13:27:31.706530Z", + "iopub.status.busy": "2024-07-09T13:27:31.705877Z", + "iopub.status.idle": "2024-07-09T13:27:31.741957Z", + "shell.execute_reply": "2024-07-09T13:27:31.741225Z" } }, "outputs": [], @@ -123,10 +123,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:25.661405Z", - "iopub.status.busy": "2024-07-08T14:19:25.661126Z", - "iopub.status.idle": "2024-07-08T14:19:26.125710Z", - "shell.execute_reply": "2024-07-08T14:19:26.124931Z" + "iopub.execute_input": "2024-07-09T13:27:31.745171Z", + "iopub.status.busy": "2024-07-09T13:27:31.744648Z", + "iopub.status.idle": "2024-07-09T13:27:32.154787Z", + "shell.execute_reply": "2024-07-09T13:27:32.154053Z" } }, "outputs": [ @@ -165,10 +165,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:26.128804Z", - "iopub.status.busy": "2024-07-08T14:19:26.128316Z", - "iopub.status.idle": "2024-07-08T14:19:26.268524Z", - "shell.execute_reply": "2024-07-08T14:19:26.267745Z" + "iopub.execute_input": "2024-07-09T13:27:32.157331Z", + "iopub.status.busy": "2024-07-09T13:27:32.157083Z", + "iopub.status.idle": "2024-07-09T13:27:32.267475Z", + "shell.execute_reply": "2024-07-09T13:27:32.266883Z" } }, "outputs": [ @@ -207,10 +207,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:26.271283Z", - "iopub.status.busy": "2024-07-08T14:19:26.271054Z", - "iopub.status.idle": "2024-07-08T14:19:26.510893Z", - "shell.execute_reply": "2024-07-08T14:19:26.510102Z" + "iopub.execute_input": "2024-07-09T13:27:32.270004Z", + "iopub.status.busy": "2024-07-09T13:27:32.269616Z", + "iopub.status.idle": "2024-07-09T13:27:32.465938Z", + "shell.execute_reply": "2024-07-09T13:27:32.465298Z" } }, "outputs": [ @@ -255,10 +255,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:26.513860Z", - "iopub.status.busy": "2024-07-08T14:19:26.513445Z", - "iopub.status.idle": "2024-07-08T14:19:26.712459Z", - "shell.execute_reply": "2024-07-08T14:19:26.711798Z" + "iopub.execute_input": "2024-07-09T13:27:32.468624Z", + "iopub.status.busy": "2024-07-09T13:27:32.468244Z", + "iopub.status.idle": "2024-07-09T13:27:32.626132Z", + "shell.execute_reply": "2024-07-09T13:27:32.625531Z" } }, "outputs": [ @@ -266,7 +266,13 @@ "name": "stdout", "output_type": "stream", "text": [ - "exact solution:\t m = minf+(m-minf)*exp(dt/mtau)\n", + "exact solution:\t m = minf+(m-minf)*exp(dt/mtau)\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ "pade approx:\t m = (-dt*m+2.0*dt*minf-2.0*m*mtau)/(dt-2.0*mtau)\n" ] } @@ -297,10 +303,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:26.715318Z", - "iopub.status.busy": "2024-07-08T14:19:26.714907Z", - "iopub.status.idle": "2024-07-08T14:19:28.190861Z", - "shell.execute_reply": "2024-07-08T14:19:28.190133Z" + "iopub.execute_input": "2024-07-09T13:27:32.628646Z", + "iopub.status.busy": "2024-07-09T13:27:32.628279Z", + "iopub.status.idle": "2024-07-09T13:27:34.367276Z", + "shell.execute_reply": "2024-07-09T13:27:34.366563Z" } }, "outputs": [ @@ -345,10 +351,10 @@ "execution_count": 8, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:28.193841Z", - "iopub.status.busy": "2024-07-08T14:19:28.193380Z", - "iopub.status.idle": "2024-07-08T14:19:30.056617Z", - "shell.execute_reply": "2024-07-08T14:19:30.055913Z" + "iopub.execute_input": "2024-07-09T13:27:34.370079Z", + "iopub.status.busy": "2024-07-09T13:27:34.369583Z", + "iopub.status.idle": "2024-07-09T13:27:36.631315Z", + "shell.execute_reply": "2024-07-09T13:27:36.630600Z" } }, "outputs": [ diff --git a/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-derivimplicit.ipynb b/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-derivimplicit.ipynb index 4a707599d..09270d192 100644 --- a/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-derivimplicit.ipynb +++ b/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-derivimplicit.ipynb @@ -39,10 +39,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:32.049185Z", - "iopub.status.busy": "2024-07-08T14:19:32.048967Z", - "iopub.status.idle": "2024-07-08T14:19:32.852052Z", - "shell.execute_reply": "2024-07-08T14:19:32.851318Z" + "iopub.execute_input": "2024-07-09T13:27:38.260239Z", + "iopub.status.busy": "2024-07-09T13:27:38.259777Z", + "iopub.status.idle": "2024-07-09T13:27:39.005106Z", + "shell.execute_reply": "2024-07-09T13:27:39.004375Z" } }, "outputs": [], @@ -56,10 +56,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:32.855192Z", - "iopub.status.busy": "2024-07-08T14:19:32.854969Z", - "iopub.status.idle": "2024-07-08T14:19:32.884763Z", - "shell.execute_reply": "2024-07-08T14:19:32.883964Z" + "iopub.execute_input": "2024-07-09T13:27:39.008134Z", + "iopub.status.busy": "2024-07-09T13:27:39.007923Z", + "iopub.status.idle": "2024-07-09T13:27:39.035527Z", + "shell.execute_reply": "2024-07-09T13:27:39.034845Z" } }, "outputs": [], @@ -100,10 +100,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:32.888300Z", - "iopub.status.busy": "2024-07-08T14:19:32.887833Z", - "iopub.status.idle": "2024-07-08T14:19:33.384183Z", - "shell.execute_reply": "2024-07-08T14:19:33.383395Z" + "iopub.execute_input": "2024-07-09T13:27:39.038193Z", + "iopub.status.busy": "2024-07-09T13:27:39.037988Z", + "iopub.status.idle": "2024-07-09T13:27:39.493003Z", + "shell.execute_reply": "2024-07-09T13:27:39.492291Z" } }, "outputs": [ @@ -165,10 +165,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:33.387641Z", - "iopub.status.busy": "2024-07-08T14:19:33.387030Z", - "iopub.status.idle": "2024-07-08T14:19:33.615481Z", - "shell.execute_reply": "2024-07-08T14:19:33.614713Z" + "iopub.execute_input": "2024-07-09T13:27:39.495638Z", + "iopub.status.busy": "2024-07-09T13:27:39.495386Z", + "iopub.status.idle": "2024-07-09T13:27:39.714694Z", + "shell.execute_reply": "2024-07-09T13:27:39.714018Z" } }, "outputs": [ diff --git a/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-sparse.ipynb b/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-sparse.ipynb index 558fe9452..8e25af2a8 100644 --- a/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-sparse.ipynb +++ b/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-sparse.ipynb @@ -39,10 +39,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:35.091365Z", - "iopub.status.busy": "2024-07-08T14:19:35.091139Z", - "iopub.status.idle": "2024-07-08T14:19:35.902205Z", - "shell.execute_reply": "2024-07-08T14:19:35.901295Z" + "iopub.execute_input": "2024-07-09T13:27:41.020838Z", + "iopub.status.busy": "2024-07-09T13:27:41.020291Z", + "iopub.status.idle": "2024-07-09T13:27:41.767497Z", + "shell.execute_reply": "2024-07-09T13:27:41.766709Z" } }, "outputs": [], @@ -56,10 +56,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:35.906761Z", - "iopub.status.busy": "2024-07-08T14:19:35.905989Z", - "iopub.status.idle": "2024-07-08T14:19:35.935381Z", - "shell.execute_reply": "2024-07-08T14:19:35.934578Z" + "iopub.execute_input": "2024-07-09T13:27:41.770825Z", + "iopub.status.busy": "2024-07-09T13:27:41.770403Z", + "iopub.status.idle": "2024-07-09T13:27:41.800087Z", + "shell.execute_reply": "2024-07-09T13:27:41.799399Z" } }, "outputs": [], @@ -100,10 +100,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:35.938636Z", - "iopub.status.busy": "2024-07-08T14:19:35.938316Z", - "iopub.status.idle": "2024-07-08T14:19:36.446881Z", - "shell.execute_reply": "2024-07-08T14:19:36.446144Z" + "iopub.execute_input": "2024-07-09T13:27:41.803463Z", + "iopub.status.busy": "2024-07-09T13:27:41.803241Z", + "iopub.status.idle": "2024-07-09T13:27:42.278312Z", + "shell.execute_reply": "2024-07-09T13:27:42.277529Z" } }, "outputs": [ @@ -165,10 +165,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:36.449568Z", - "iopub.status.busy": "2024-07-08T14:19:36.449291Z", - "iopub.status.idle": "2024-07-08T14:19:36.672354Z", - "shell.execute_reply": "2024-07-08T14:19:36.671576Z" + "iopub.execute_input": "2024-07-09T13:27:42.281288Z", + "iopub.status.busy": "2024-07-09T13:27:42.280840Z", + "iopub.status.idle": "2024-07-09T13:27:42.499162Z", + "shell.execute_reply": "2024-07-09T13:27:42.498413Z" } }, "outputs": [ diff --git a/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html b/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html index 49977151b..acc76f90f 100644 --- a/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html +++ b/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html @@ -1826,7 +1826,7 @@

-

Definition at line 1725 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1731 of file codegen_neuron_cpp_visitor.cpp.

@@ -1853,7 +1853,7 @@

-

Definition at line 1730 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1736 of file codegen_neuron_cpp_visitor.cpp.

@@ -2119,7 +2119,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2064 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2070 of file codegen_neuron_cpp_visitor.cpp.

@@ -2151,7 +2151,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2047 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2053 of file codegen_neuron_cpp_visitor.cpp.

@@ -2189,7 +2189,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2015 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2021 of file codegen_neuron_cpp_visitor.cpp.

@@ -2221,7 +2221,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1879 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1885 of file codegen_neuron_cpp_visitor.cpp.

@@ -2417,7 +2417,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2037 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2043 of file codegen_neuron_cpp_visitor.cpp.

@@ -2465,7 +2465,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1472 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1478 of file codegen_neuron_cpp_visitor.cpp.

@@ -2494,7 +2494,7 @@

Definition at line 1949 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1955 of file codegen_neuron_cpp_visitor.cpp.

@@ -2527,7 +2527,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 981 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 987 of file codegen_neuron_cpp_visitor.cpp.

@@ -2558,7 +2558,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1931 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1937 of file codegen_neuron_cpp_visitor.cpp.

@@ -2653,7 +2653,7 @@

Definition at line 1450 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1456 of file codegen_neuron_cpp_visitor.cpp.

@@ -2682,7 +2682,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2085 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2091 of file codegen_neuron_cpp_visitor.cpp.

@@ -2711,7 +2711,7 @@

Definition at line 1941 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1947 of file codegen_neuron_cpp_visitor.cpp.

@@ -2740,7 +2740,7 @@

Definition at line 1334 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1340 of file codegen_neuron_cpp_visitor.cpp.

@@ -2769,7 +2769,7 @@

Definition at line 1399 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1405 of file codegen_neuron_cpp_visitor.cpp.

@@ -2808,7 +2808,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 827 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 833 of file codegen_neuron_cpp_visitor.cpp.

@@ -2846,7 +2846,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1294 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1300 of file codegen_neuron_cpp_visitor.cpp.

@@ -2884,7 +2884,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1101 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1107 of file codegen_neuron_cpp_visitor.cpp.

@@ -2914,7 +2914,7 @@

Definition at line 1966 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1972 of file codegen_neuron_cpp_visitor.cpp.

@@ -2945,7 +2945,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2005 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2011 of file codegen_neuron_cpp_visitor.cpp.

@@ -2976,7 +2976,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2010 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2016 of file codegen_neuron_cpp_visitor.cpp.

@@ -3076,7 +3076,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2124 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2130 of file codegen_neuron_cpp_visitor.cpp.

@@ -3114,7 +3114,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2114 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2120 of file codegen_neuron_cpp_visitor.cpp.

@@ -3143,7 +3143,7 @@

Definition at line 2162 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2168 of file codegen_neuron_cpp_visitor.cpp.

@@ -3208,7 +3208,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2090 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2096 of file codegen_neuron_cpp_visitor.cpp.

@@ -3238,7 +3238,7 @@

Definition at line 1287 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1293 of file codegen_neuron_cpp_visitor.cpp.

@@ -3295,7 +3295,7 @@

Definition at line 1385 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1391 of file codegen_neuron_cpp_visitor.cpp.

@@ -3328,7 +3328,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1561 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1567 of file codegen_neuron_cpp_visitor.cpp.

@@ -3360,7 +3360,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1549 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1555 of file codegen_neuron_cpp_visitor.cpp.

@@ -3392,7 +3392,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1885 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1891 of file codegen_neuron_cpp_visitor.cpp.

@@ -3432,7 +3432,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1772 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1778 of file codegen_neuron_cpp_visitor.cpp.

@@ -3471,7 +3471,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1846 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1852 of file codegen_neuron_cpp_visitor.cpp.

@@ -3504,7 +3504,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1811 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1817 of file codegen_neuron_cpp_visitor.cpp.

@@ -3544,7 +3544,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1753 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1759 of file codegen_neuron_cpp_visitor.cpp.

@@ -3576,7 +3576,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1555 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1561 of file codegen_neuron_cpp_visitor.cpp.

@@ -3612,7 +3612,7 @@

Definition at line 1495 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1501 of file codegen_neuron_cpp_visitor.cpp.

@@ -3641,7 +3641,7 @@

Definition at line 1515 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1521 of file codegen_neuron_cpp_visitor.cpp.

@@ -3674,7 +3674,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1675 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1681 of file codegen_neuron_cpp_visitor.cpp.

@@ -3865,7 +3865,7 @@

Definition at line 1253 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1259 of file codegen_neuron_cpp_visitor.cpp.

@@ -3887,7 +3887,7 @@

Definition at line 1418 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1424 of file codegen_neuron_cpp_visitor.cpp.

@@ -3918,7 +3918,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2025 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2031 of file codegen_neuron_cpp_visitor.cpp.

@@ -4189,7 +4189,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 2205 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2211 of file codegen_neuron_cpp_visitor.cpp.

diff --git a/doxygen/codegen__neuron__cpp__visitor_8hpp_source.html b/doxygen/codegen__neuron__cpp__visitor_8hpp_source.html index 2b2e453b0..0e826e5ba 100644 --- a/doxygen/codegen__neuron__cpp__visitor_8hpp_source.html +++ b/doxygen/codegen__neuron__cpp__visitor_8hpp_source.html @@ -832,24 +832,24 @@
736 } // namespace nmodl
-
void print_nrn_destructor() override
Print nrn_destructor function definition.
-
void print_nrn_cur_non_conductance_kernel() override
Print the nrn_cur kernel without NMODL conductance keyword provisions.
+
void print_nrn_destructor() override
Print nrn_destructor function definition.
+
void print_nrn_cur_non_conductance_kernel() override
Print the nrn_cur kernel without NMODL conductance keyword provisions.
std::string py_function_signature(const std::string &function_or_procedure_name) const
Get the signature of the npy <func_or_proc_name> function.
Helper to represent information about index/int variables.
-
void print_nrn_cur() override
Print nrn_cur / current update function definition.
-
void print_macro_definitions()
Print all NEURON macros.
+
void print_nrn_cur() override
Print nrn_cur / current update function definition.
+
void print_macro_definitions()
Print all NEURON macros.
CodegenCppVisitor(std::string mod_filename, const std::string &output_dir, std::string float_type, const bool optimize_ionvar_copies, std::unique_ptr< nmodl::utils::Blame > blame)
Constructs the C++ code generator visitor.
-
void print_net_event_call(const ast::FunctionCall &node) override
Print call to net_event.
+
void print_net_event_call(const ast::FunctionCall &node) override
Print call to net_event.
void print_neuron_includes()
Print includes from NEURON.
-
void print_nrn_init(bool skip_init_check=true)
Print the nrn_init function definition.
+
void print_nrn_init(bool skip_init_check=true)
Print the nrn_init function definition.
void print_hoc_py_wrapper_function_body(const ast::Block *function_or_procedure_block, InterpreterWrapper wrapper_type)
std::string internal_method_arguments() override
Arguments for functions that are defined and used internally.
-
void print_nrn_alloc() override
Print nrn_alloc function definition.
+
void print_nrn_alloc() override
Print nrn_alloc function definition.
std::string register_mechanism_arguments() const override
Arguments for register_mech or point_register_mech function.
int position_of_int_var(const std::string &name) const override
Determine the position in the data array for a given int variable.
- +
std::string table_thread_function_name() const
Name of the threaded table checking function.
bool optimize_ion_variable_copies() const override
Check if ion variable copies should be avoided.
std::string hoc_function_name(const std::string &function_or_procedure_name) const
All functions and procedures need a hoc <func_or_proc_name> to be available to the HOC interpreter.
@@ -859,22 +859,22 @@
Implement classes for representing symbol table at block and file scope.
std::string backend_name() const override
Name of the code generation backend.
std::string process_verbatim_text(std::string const &text) override
Process a verbatim block for possible variable renaming.
- -
void print_g_unused() const override
Set g_unused (conductance) for NRN_PRCELLSTATE feature.
-
void visit_watch_statement(const ast::WatchStatement &node) override
TODO: Edit for NEURON.
-
void print_net_send_call(const ast::FunctionCall &node) override
Print call to net_send.
-
void print_namespace_end() override
Print end of namespaces.
-
void print_net_move_call(const ast::FunctionCall &node) override
Print call to net_move.
+ +
void print_g_unused() const override
Set g_unused (conductance) for NRN_PRCELLSTATE feature.
+
void visit_watch_statement(const ast::WatchStatement &node) override
TODO: Edit for NEURON.
+
void print_net_send_call(const ast::FunctionCall &node) override
Print call to net_send.
+
void print_namespace_end() override
Print end of namespaces.
+
void print_net_move_call(const ast::FunctionCall &node) override
Print call to net_move.
std::string thread_variable_name(const ThreadVariableInfo &var_info, bool use_instance=true) const
Determine the C++ string to print for thread variables.
parser::NmodlParser::symbol_type SymbolType
Definition: nmodl_utils.hpp:26
-
void print_nrn_state() override
Print nrn_state / state update function definition.
-
void print_initial_block(const ast::InitialBlock *node)
Print the initial block.
-
void print_global_function_common_code(BlockType type, const std::string &function_name="") override
Print common code for global functions like nrn_init, nrn_cur and nrn_state.
+
void print_nrn_state() override
Print nrn_state / state update function definition.
+
void print_initial_block(const ast::InitialBlock *node)
Print the initial block.
+
void print_global_function_common_code(BlockType type, const std::string &function_name="") override
Print common code for global functions like nrn_init, nrn_cur and nrn_state.
std::string float_variable_name(const SymbolType &symbol, bool use_instance) const override
Determine the name of a float variable given its symbol.
void print_function(const ast::FunctionBlock &node) override
Print NMODL function in target backend code.
-
void print_v_unused() const override
Set v_unused (voltage) for NRN_PRCELLSTATE feature.
- +
void print_v_unused() const override
Set v_unused (voltage) for NRN_PRCELLSTATE feature.
+
ParamVector functor_params() override
The parameters of the Newton solver "functor".
Visitor for printing C++ code compatible with legacy api of CoreNEURON
@@ -882,72 +882,72 @@
Represents a INITIAL block in the NMODL.
void print_point_process_function_definitions()
Print POINT_PROCESS related functions Wrap external NEURON functions related to POINT_PROCESS mechani...
Represent WATCH statement in NMODL.
-
void print_neuron_global_variable_declarations()
Print extern declarations for neuron global variables.
+
void print_neuron_global_variable_declarations()
Print extern declarations for neuron global variables.
Represents a BREAKPOINT block in NMODL.
-
void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node) override
Print the nrn_cur kernel with NMODL conductance keyword provisions.
+
void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node) override
Print the nrn_cur kernel with NMODL conductance keyword provisions.
std::string int_variable_name(const IndexVariableInfo &symbol, const std::string &name, bool use_instance) const override
Determine the name of an int variable given its symbol.
InterpreterWrapper
Enum to switch between HOC and Python wrappers for functions and procedures defined in mechanisms.
-
void print_namespace_begin() override
Print start of namespaces.
+
void print_namespace_begin() override
Print start of namespaces.
-
void print_global_variables_for_hoc() override
Print byte arrays that register scalar and vector variables for hoc interface.
+
void print_global_variables_for_hoc() override
Print byte arrays that register scalar and vector variables for hoc interface.
void print_standard_includes() override
Print standard C/C++ includes.
std::vector< ThreadVariableInfo > codegen_thread_variables
GLOBAL variables in THREADSAFE MOD files that are not read-only are converted to thread variables.
-
void print_mechanism_range_var_structure(bool print_initializers) override
Print the structure that wraps all range and int variables required for the NMODL.
+
void print_mechanism_range_var_structure(bool print_initializers) override
Print the structure that wraps all range and int variables required for the NMODL.
void print_procedure(const ast::ProcedureBlock &node) override
Print NMODL procedure in target backend code.
void add_variable_tqitem(std::vector< IndexVariableInfo > &variables) override
Add the variable tqitem during get_int_variables.
Helper class for printing C/C++ code.
std::string hoc_function_signature(const std::string &function_or_procedure_name) const
Get the signature of the hoc <func_or_proc_name> function.
void print_namespace_start() override
Prints the start of the neuron namespace.
-
void print_thread_variables_structure(bool print_initializers)
Print the data structure used to access thread variables.
-
void print_compute_functions() override
Print all compute functions for every backend.
-
void print_thread_memory_callbacks()
Print thread variable (de-)initialization functions.
-
void print_nrn_cur_kernel(const ast::BreakpointBlock &node) override
Print main body of nrn_cur function.
+
void print_thread_variables_structure(bool print_initializers)
Print the data structure used to access thread variables.
+
void print_compute_functions() override
Print all compute functions for every backend.
+
void print_thread_memory_callbacks()
Print thread variable (de-)initialization functions.
+
void print_nrn_cur_kernel(const ast::BreakpointBlock &node) override
Print main body of nrn_cur function.
std::string conc_write_statement(const std::string &ion_name, const std::string &concentration, int index) override
Generate Function call statement for nrn_wrote_conc.
-
void print_mechanism_register() override
Print the mechanism registration function.
-
void print_nrn_jacob()
Print nrn_jacob function definition.
+
void print_mechanism_register() override
Print the mechanism registration function.
+
void print_nrn_jacob()
Print nrn_jacob function definition.
Various types to store code generation specific information.
-
void print_fast_imem_calculation() override
Print fast membrane current calculation code.
-
void print_data_structures(bool print_initializers) override
Print all classes.
+
void print_fast_imem_calculation() override
Print fast membrane current calculation code.
+
void print_data_structures(bool print_initializers) override
Print all classes.
void print_sdlists_init(bool print_initializers) override
const std::string external_method_arguments() noexcept override
Arguments for external functions called from generated code.
std::string py_function_name(const std::string &function_or_procedure_name) const
In non POINT_PROCESS mechanisms all functions and procedures need a py <func_or_proc_name> to be avai...
size_t offset
The global variables ahead of this one require offset doubles to store.
-
void print_node_data_structure(bool print_initializers)
Print the structure that wraps all node variables required for the NMODL.
+
void print_node_data_structure(bool print_initializers)
Print the structure that wraps all node variables required for the NMODL.
-
void print_make_instance() const
Print make_*_instance.
+
void print_make_instance() const
Print make_*_instance.
void print_atomic_reduction_pragma() override
Print atomic update pragma for reduction statements.
void print_namespace_stop() override
Prints the end of the neuron namespace.
void print_setdata_functions()
Print NEURON functions related to setting global variables of the mechanism.
-
void print_mechanism_variables_macros()
Print mechanism variables' related macros.
+
void print_mechanism_variables_macros()
Print mechanism variables' related macros.
Visitor for printing C++ code compatible with legacy api of NEURON
-
void print_nrn_constructor() override
Print nrn_constructor function definition.
+
void print_nrn_constructor() override
Print nrn_constructor function definition.
void print_check_table_function_prototypes()
Print all check_* function declarations.
Implement logger based on spdlog library.
BlockType
Helper to represent various block types.
size_t index
There index global variables ahead of this one.
-
void print_headers_include() override
Print all includes.
+
void print_headers_include() override
Print all includes.
const ParamVector external_method_parameters(bool table=false) noexcept override
Parameters for functions in generated code that are called back from external code.
void print_function_or_procedure(const ast::Block &node, const std::string &name, const std::unordered_set< CppObjectSpecifier > &specifiers={ CppObjectSpecifier::Inline}) override
Print nmodl function or procedure (common code)
const std::shared_ptr< symtab::Symbol > symbol
-
void print_nrn_current(const ast::BreakpointBlock &node) override
Print the nrn_current kernel.
+
void print_nrn_current(const ast::BreakpointBlock &node) override
Print the nrn_current kernel.
int position_of_float_var(const std::string &name) const override
Determine the position in the data array for a given float variable.
std::string get_variable_name(const std::string &name, bool use_instance=true) const override
Determine variable name in the structure of mechanism properties.
Visitor for printing C++ code compatible with legacy api of CoreNEURON
-
void print_make_node_data() const
Print make_*_node_data.
+
void print_make_node_data() const
Print make_*_node_data.
std::string simulator_name() override
Name of the simulator the code was generated for.
void print_function_procedure_helper(const ast::Block &node) override
Common helper function to help printing function or procedure blocks.
void add_variable_point_process(std::vector< IndexVariableInfo > &variables) override
Add the variable point_process during get_int_variables.
std::string nrn_thread_arguments() const override
Arguments for "_threadargs_" macro in neuron implementation.
void print_net_receive_registration()
Print code to register the call-back for the NET_RECEIVE block.
-
void print_codegen_routines() override
Print entry point to code generation.
+
void print_codegen_routines() override
Print entry point to code generation.
ParamVector internal_method_parameters() override
Parameters for internally defined functions.
-
void print_net_receive()
Print net_receive call-back.
+
void print_net_receive()
Print net_receive call-back.
void print_function_prototypes() override
Print function and procedures prototype declaration.
-
void print_mechanism_global_var_structure(bool print_initializers) override
Print the structure that wraps all global variables used in the NMODL.
-
void print_global_macros()
Print NEURON global variable macros.
+
void print_mechanism_global_var_structure(bool print_initializers) override
Print the structure that wraps all global variables used in the NMODL.
+
void print_global_macros()
Print NEURON global variable macros.
std::vector< std::tuple< std::string, std::string, std::string, std::string > > ParamVector
A vector of parameters represented by a 4-tuple of strings:
Concrete visitor for all AST classes.
diff --git a/doxygen/namespacenmodl_1_1codegen.html b/doxygen/namespacenmodl_1_1codegen.html index fcea82992..782c59076 100644 --- a/doxygen/namespacenmodl_1_1codegen.html +++ b/doxygen/namespacenmodl_1_1codegen.html @@ -315,7 +315,7 @@

x[id] = _args[1];

So, the R in AST needs to be renamed with _args[1].

-

Definition at line 2147 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2153 of file codegen_neuron_cpp_visitor.cpp.

diff --git a/doxygen/src_2codegen_2codegen__neuron__cpp__visitor_8cpp_source.html b/doxygen/src_2codegen_2codegen__neuron__cpp__visitor_8cpp_source.html index 30f4fb7fd..dd481f245 100644 --- a/doxygen/src_2codegen_2codegen__neuron__cpp__visitor_8cpp_source.html +++ b/doxygen/src_2codegen_2codegen__neuron__cpp__visitor_8cpp_source.html @@ -913,1425 +913,1431 @@
817 }
818 
-
820  return ParamVector{{"", "NrnThread*", "", "nt"},
-
821  {"", fmt::format("{}&", instance_struct()), "", "inst"},
-
822  {"", "int", "", "id"},
-
823  {"", "double", "", "v"},
-
824  {"", "Datum*", "", "_thread"}};
-
825 }
-
826 
- -
828  const auto value_initialize = print_initializers ? "{}" : "";
-
829 
-
830  /// TODO: Print only global variables printed in NEURON
-
831  printer->add_newline(2);
-
832  printer->add_line("/* NEURON global variables */");
-
833  if (info.primes_size != 0) {
-
834  printer->fmt_line("static neuron::container::field_index _slist1[{0}], _dlist1[{0}];",
-
835  info.primes_size);
-
836  }
-
837 
-
838  for (const auto& ion: info.ions) {
-
839  printer->fmt_line("static Symbol* _{}_sym;", ion.name);
-
840  }
-
841 
-
842  printer->add_line("static int mech_type;");
+
820  auto params = ParamVector{};
+
821  params.push_back({"", "NrnThread*", "", "nt"});
+
822  params.push_back({"", fmt::format("{}&", instance_struct()), "", "inst"});
+
823  params.push_back({"", "int", "", "id"});
+
824  params.push_back({"", "double", "", "v"});
+
825  params.push_back({"", "Datum*", "", "_thread"});
+
826  if (!codegen_thread_variables.empty()) {
+
827  params.push_back({"", fmt::format("{}&", thread_variables_struct()), "", "_thread_vars"});
+
828  }
+
829 
+
830  return params;
+
831 }
+
832 
+ +
834  const auto value_initialize = print_initializers ? "{}" : "";
+
835 
+
836  /// TODO: Print only global variables printed in NEURON
+
837  printer->add_newline(2);
+
838  printer->add_line("/* NEURON global variables */");
+
839  if (info.primes_size != 0) {
+
840  printer->fmt_line("static neuron::container::field_index _slist1[{0}], _dlist1[{0}];",
+
841  info.primes_size);
+
842  }
843 
-
844  if (info.point_process) {
-
845  printer->add_line("static int _pointtype;");
-
846  } else {
-
847  printer->add_multi_line(R"CODE(
-
848  static Prop* _extcall_prop;
-
849  /* _prop_id kind of shadows _extcall_prop to allow validity checking. */
-
850  static _nrn_non_owning_id_without_container _prop_id{};)CODE");
-
851  }
-
852 
-
853  printer->fmt_line("static int {} = {};",
- -
855  info.pointer_variables.size() > 0
-
856  ? static_cast<int>(info.pointer_variables.size())
-
857  : -1);
-
858 
-
859  printer->add_line("static _nrn_mechanism_std_vector<Datum> _extcall_thread;");
-
860 
-
861  // Start printing the CNRN-style global variables.
-
862  auto float_type = default_float_data_type();
-
863  printer->add_newline(2);
-
864  printer->add_line("/** all global variables */");
-
865  printer->fmt_push_block("struct {}", global_struct());
+
844  for (const auto& ion: info.ions) {
+
845  printer->fmt_line("static Symbol* _{}_sym;", ion.name);
+
846  }
+
847 
+
848  printer->add_line("static int mech_type;");
+
849 
+
850  if (info.point_process) {
+
851  printer->add_line("static int _pointtype;");
+
852  } else {
+
853  printer->add_multi_line(R"CODE(
+
854  static Prop* _extcall_prop;
+
855  /* _prop_id kind of shadows _extcall_prop to allow validity checking. */
+
856  static _nrn_non_owning_id_without_container _prop_id{};)CODE");
+
857  }
+
858 
+
859  printer->fmt_line("static int {} = {};",
+ +
861  info.pointer_variables.size() > 0
+
862  ? static_cast<int>(info.pointer_variables.size())
+
863  : -1);
+
864 
+
865  printer->add_line("static _nrn_mechanism_std_vector<Datum> _extcall_thread;");
866 
-
867  if (!info.ions.empty()) {
-
868  // TODO implement these when needed.
-
869  }
-
870 
-
871  if (!info.vectorize && !info.top_local_variables.empty()) {
-
872  throw std::runtime_error("Not implemented, global vectorize something.");
-
873  }
-
874 
-
875  if (!info.thread_variables.empty()) {
-
876  size_t prefix_sum = 0;
-
877  for (size_t i = 0; i < info.thread_variables.size(); ++i) {
-
878  const auto& var = info.thread_variables[i];
-
879  codegen_thread_variables.push_back({var, i, prefix_sum});
+
867  // Start printing the CNRN-style global variables.
+
868  auto float_type = default_float_data_type();
+
869  printer->add_newline(2);
+
870  printer->add_line("/** all global variables */");
+
871  printer->fmt_push_block("struct {}", global_struct());
+
872 
+
873  if (!info.ions.empty()) {
+
874  // TODO implement these when needed.
+
875  }
+
876 
+
877  if (!info.vectorize && !info.top_local_variables.empty()) {
+
878  throw std::runtime_error("Not implemented, global vectorize something.");
+
879  }
880 
-
881  prefix_sum += var->get_length();
-
882  }
-
883  }
-
884 
-
885  if (!info.top_local_variables.empty()) {
-
886  size_t prefix_sum = info.thread_var_data_size;
-
887  size_t n_thread_vars = codegen_thread_variables.size();
-
888  for (size_t i = 0; i < info.top_local_variables.size(); ++i) {
-
889  const auto& var = info.top_local_variables[i];
-
890  codegen_thread_variables.push_back({var, n_thread_vars + i, prefix_sum});
-
891 
-
892  prefix_sum += var->get_length();
-
893  }
-
894  }
-
895 
-
896  if (!codegen_thread_variables.empty()) {
-
897  auto thread_data_size = info.thread_var_data_size + info.top_local_thread_size;
-
898  printer->fmt_line("int thread_data_in_use{};", value_initialize);
-
899  printer->fmt_line("{} thread_data[{}];", float_type, thread_data_size);
-
900 
-
901  codegen_global_variables.push_back(make_symbol("thread_data_in_use"));
-
902 
-
903  auto symbol = make_symbol("thread_data");
-
904  symbol->set_as_array(thread_data_size);
-
905  codegen_global_variables.push_back(symbol);
-
906  }
-
907 
+
881  if (!info.thread_variables.empty()) {
+
882  size_t prefix_sum = 0;
+
883  for (size_t i = 0; i < info.thread_variables.size(); ++i) {
+
884  const auto& var = info.thread_variables[i];
+
885  codegen_thread_variables.push_back({var, i, prefix_sum});
+
886 
+
887  prefix_sum += var->get_length();
+
888  }
+
889  }
+
890 
+
891  if (!info.top_local_variables.empty()) {
+
892  size_t prefix_sum = info.thread_var_data_size;
+
893  size_t n_thread_vars = codegen_thread_variables.size();
+
894  for (size_t i = 0; i < info.top_local_variables.size(); ++i) {
+
895  const auto& var = info.top_local_variables[i];
+
896  codegen_thread_variables.push_back({var, n_thread_vars + i, prefix_sum});
+
897 
+
898  prefix_sum += var->get_length();
+
899  }
+
900  }
+
901 
+
902  if (!codegen_thread_variables.empty()) {
+
903  auto thread_data_size = info.thread_var_data_size + info.top_local_thread_size;
+
904  printer->fmt_line("int thread_data_in_use{};", value_initialize);
+
905  printer->fmt_line("{} thread_data[{}];", float_type, thread_data_size);
+
906 
+
907  codegen_global_variables.push_back(make_symbol("thread_data_in_use"));
908 
-
909  if (info.table_count > 0) {
-
910  // basically the same code as coreNEURON uses
-
911  printer->fmt_line("double usetable{};", print_initializers ? "{1}" : "");
-
912  codegen_global_variables.push_back(make_symbol(naming::USE_TABLE_VARIABLE));
+
909  auto symbol = make_symbol("thread_data");
+
910  symbol->set_as_array(thread_data_size);
+
911  codegen_global_variables.push_back(symbol);
+
912  }
913 
-
914  for (const auto& block: info.functions_with_table) {
-
915  const auto& name = block->get_node_name();
-
916  printer->fmt_line("{} tmin_{}{};", float_type, name, value_initialize);
-
917  printer->fmt_line("{} mfac_{}{};", float_type, name, value_initialize);
-
918  codegen_global_variables.push_back(make_symbol("tmin_" + name));
-
919  codegen_global_variables.push_back(make_symbol("mfac_" + name));
-
920  }
-
921 
-
922  for (const auto& variable: info.table_statement_variables) {
-
923  auto const name = "t_" + variable->get_name();
-
924  auto const num_values = variable->get_num_values();
-
925  if (variable->is_array()) {
-
926  int array_len = variable->get_length();
-
927  printer->fmt_line(
-
928  "{} {}[{}][{}]{};", float_type, name, array_len, num_values, value_initialize);
-
929  } else {
-
930  printer->fmt_line("{} {}[{}]{};", float_type, name, num_values, value_initialize);
-
931  }
-
932  codegen_global_variables.push_back(make_symbol(name));
-
933  }
-
934  }
-
935 
-
936  for (const auto& var: info.state_vars) {
-
937  auto name = var->get_name() + "0";
-
938  auto symbol = program_symtab->lookup(name);
-
939  if (symbol == nullptr) {
-
940  printer->fmt_line("{} {}{};", float_type, name, value_initialize);
-
941  codegen_global_variables.push_back(make_symbol(name));
-
942  }
-
943  }
-
944 
-
945  for (const auto& var: info.global_variables) {
-
946  auto name = var->get_name();
-
947  auto length = var->get_length();
-
948  if (var->is_array()) {
-
949  printer->fmt_line("{} {}[{}] /* TODO init const-array */;", float_type, name, length);
-
950  } else {
-
951  double value{};
-
952  if (auto const& value_ptr = var->get_value()) {
-
953  value = *value_ptr;
-
954  }
-
955  printer->fmt_line("{} {}{};",
-
956  float_type,
-
957  name,
-
958  print_initializers ? fmt::format("{{{:g}}}", value) : std::string{});
-
959  }
-
960  codegen_global_variables.push_back(var);
-
961  }
-
962 
-
963 
-
964  // for (const auto& f: info.function_tables) {
-
965  if (!info.function_tables.empty()) {
-
966  throw std::runtime_error("Not implemented, global function tables.");
+
914 
+
915  if (info.table_count > 0) {
+
916  // basically the same code as coreNEURON uses
+
917  printer->fmt_line("double usetable{};", print_initializers ? "{1}" : "");
+
918  codegen_global_variables.push_back(make_symbol(naming::USE_TABLE_VARIABLE));
+
919 
+
920  for (const auto& block: info.functions_with_table) {
+
921  const auto& name = block->get_node_name();
+
922  printer->fmt_line("{} tmin_{}{};", float_type, name, value_initialize);
+
923  printer->fmt_line("{} mfac_{}{};", float_type, name, value_initialize);
+
924  codegen_global_variables.push_back(make_symbol("tmin_" + name));
+
925  codegen_global_variables.push_back(make_symbol("mfac_" + name));
+
926  }
+
927 
+
928  for (const auto& variable: info.table_statement_variables) {
+
929  auto const name = "t_" + variable->get_name();
+
930  auto const num_values = variable->get_num_values();
+
931  if (variable->is_array()) {
+
932  int array_len = variable->get_length();
+
933  printer->fmt_line(
+
934  "{} {}[{}][{}]{};", float_type, name, array_len, num_values, value_initialize);
+
935  } else {
+
936  printer->fmt_line("{} {}[{}]{};", float_type, name, num_values, value_initialize);
+
937  }
+
938  codegen_global_variables.push_back(make_symbol(name));
+
939  }
+
940  }
+
941 
+
942  for (const auto& var: info.state_vars) {
+
943  auto name = var->get_name() + "0";
+
944  auto symbol = program_symtab->lookup(name);
+
945  if (symbol == nullptr) {
+
946  printer->fmt_line("{} {}{};", float_type, name, value_initialize);
+
947  codegen_global_variables.push_back(make_symbol(name));
+
948  }
+
949  }
+
950 
+
951  for (const auto& var: info.global_variables) {
+
952  auto name = var->get_name();
+
953  auto length = var->get_length();
+
954  if (var->is_array()) {
+
955  printer->fmt_line("{} {}[{}] /* TODO init const-array */;", float_type, name, length);
+
956  } else {
+
957  double value{};
+
958  if (auto const& value_ptr = var->get_value()) {
+
959  value = *value_ptr;
+
960  }
+
961  printer->fmt_line("{} {}{};",
+
962  float_type,
+
963  name,
+
964  print_initializers ? fmt::format("{{{:g}}}", value) : std::string{});
+
965  }
+
966  codegen_global_variables.push_back(var);
967  }
968 
-
969  if (info.vectorize && info.thread_data_index) {
-
970  // TODO compare CoreNEURON something extcall stuff.
-
971  // throw std::runtime_error("Not implemented, global vectorize something else.");
-
972  }
-
973 
-
974  printer->pop_block(";");
-
975 
-
976  print_global_var_struct_assertions();
-
977  print_global_var_struct_decl();
-
978 }
-
979 
-
980 /// TODO: Same as CoreNEURON?
- -
982  /// TODO: Write HocParmLimits and other HOC global variables (delta_t)
-
983  // Probably needs more changes
-
984  auto variable_printer =
-
985  [&](const std::vector<SymbolType>& variables, bool if_array, bool if_vector) {
-
986  for (const auto& variable: variables) {
-
987  if (variable->is_array() == if_array) {
-
988  // false => do not use the instance struct, which is not
-
989  // defined in the global declaration that we are printing
-
990  auto name = get_variable_name(variable->get_name(), false);
-
991  auto ename = add_escape_quote(variable->get_name() + "_" + info.mod_suffix);
-
992  auto length = variable->get_length();
-
993  if (if_vector) {
-
994  printer->fmt_line("{{{}, {}, {}}},", ename, name, length);
-
995  } else {
-
996  printer->fmt_line("{{{}, &{}}},", ename, name);
-
997  }
-
998  }
-
999  }
-
1000  };
-
1001 
-
1002  auto globals = info.global_variables;
-
1003  auto thread_vars = info.thread_variables;
-
1004 
-
1005  if (info.table_count > 0) {
-
1006  globals.push_back(make_symbol(naming::USE_TABLE_VARIABLE));
-
1007  }
-
1008 
-
1009  printer->add_newline(2);
-
1010  printer->add_line("/** connect global (scalar) variables to hoc -- */");
-
1011  printer->add_line("static DoubScal hoc_scalar_double[] = {");
-
1012  printer->increase_indent();
-
1013  variable_printer(globals, false, false);
-
1014  variable_printer(thread_vars, false, false);
-
1015  printer->add_line("{nullptr, nullptr}");
-
1016  printer->decrease_indent();
-
1017  printer->add_line("};");
-
1018 
-
1019  printer->add_newline(2);
-
1020  printer->add_line("/** connect global (array) variables to hoc -- */");
-
1021  printer->add_line("static DoubVec hoc_vector_double[] = {");
-
1022  printer->increase_indent();
-
1023  variable_printer(globals, true, true);
-
1024  variable_printer(thread_vars, true, true);
-
1025  printer->add_line("{nullptr, nullptr, 0}");
-
1026  printer->decrease_indent();
-
1027  printer->add_line("};");
-
1028 
-
1029  printer->add_newline(2);
-
1030  printer->add_line("/* declaration of user functions */");
-
1031  for (const auto& procedure: info.procedures) {
-
1032  const auto proc_name = procedure->get_node_name();
-
1033  printer->fmt_line("{};", hoc_function_signature(proc_name));
-
1034  }
-
1035  for (const auto& function: info.functions) {
-
1036  const auto func_name = function->get_node_name();
-
1037  printer->fmt_line("{};", hoc_function_signature(func_name));
-
1038  }
-
1039  if (!info.point_process) {
-
1040  for (const auto& procedure: info.procedures) {
-
1041  const auto proc_name = procedure->get_node_name();
-
1042  printer->fmt_line("{};", py_function_signature(proc_name));
-
1043  }
-
1044  for (const auto& function: info.functions) {
-
1045  const auto func_name = function->get_node_name();
-
1046  printer->fmt_line("{};", py_function_signature(func_name));
-
1047  }
-
1048  }
-
1049 
-
1050  printer->add_newline(2);
-
1051  printer->add_line("/* connect user functions to hoc names */");
-
1052  printer->add_line("static VoidFunc hoc_intfunc[] = {");
-
1053  printer->increase_indent();
-
1054  if (info.point_process) {
-
1055  printer->add_line("{0, 0}");
-
1056  printer->decrease_indent();
-
1057  printer->add_line("};");
-
1058  printer->add_line("static Member_func _member_func[] = {");
-
1059  printer->increase_indent();
-
1060  printer->add_multi_line(R"CODE(
-
1061  {"loc", _hoc_loc_pnt},
-
1062  {"has_loc", _hoc_has_loc},
-
1063  {"get_loc", _hoc_get_loc_pnt},)CODE");
-
1064  } else {
-
1065  printer->fmt_line("{{\"setdata_{}\", _hoc_setdata}},", info.mod_suffix);
-
1066  }
-
1067 
-
1068  for (const auto& procedure: info.procedures) {
-
1069  const auto proc_name = procedure->get_node_name();
-
1070  printer->fmt_line("{{\"{}{}\", {}}},",
-
1071  proc_name,
-
1072  info.rsuffix,
-
1073  hoc_function_name(proc_name));
-
1074  }
-
1075  for (const auto& function: info.functions) {
-
1076  const auto func_name = function->get_node_name();
-
1077  printer->fmt_line("{{\"{}{}\", {}}},",
-
1078  func_name,
-
1079  info.rsuffix,
-
1080  hoc_function_name(func_name));
-
1081  }
-
1082 
-
1083  printer->add_line("{nullptr, nullptr}");
-
1084  printer->decrease_indent();
-
1085  printer->add_line("};");
-
1086  if (!info.point_process) {
-
1087  printer->push_block("static NPyDirectMechFunc npy_direct_func_proc[] =");
-
1088  for (const auto& procedure: info.procedures) {
-
1089  const auto proc_name = procedure->get_node_name();
-
1090  printer->fmt_line("{{\"{}\", {}}},", proc_name, py_function_name(proc_name));
-
1091  }
-
1092  for (const auto& function: info.functions) {
-
1093  const auto func_name = function->get_node_name();
-
1094  printer->fmt_line("{{\"{}\", {}}},", func_name, py_function_name(func_name));
-
1095  }
-
1096  printer->add_line("{nullptr, nullptr}");
-
1097  printer->pop_block(";");
-
1098  }
-
1099 }
-
1100 
- -
1102  /// TODO: Write this according to NEURON
-
1103  printer->add_newline(2);
-
1104  printer->add_line("/** register channel with the simulator */");
-
1105  printer->fmt_push_block("extern \"C\" void _{}_reg()", info.mod_file);
-
1106  printer->add_line("_initlists();");
-
1107  printer->add_newline();
-
1108 
-
1109  for (const auto& ion: info.ions) {
-
1110  printer->fmt_line("ion_reg(\"{}\", {});", ion.name, "-10000.");
-
1111  }
-
1112  if (!info.ions.empty()) {
-
1113  printer->add_newline();
-
1114  }
-
1115 
-
1116  for (const auto& ion: info.ions) {
-
1117  printer->fmt_line("_{0}_sym = hoc_lookup(\"{0}_ion\");", ion.name);
-
1118  }
-
1119  if (!info.ions.empty()) {
-
1120  printer->add_newline();
-
1121  }
-
1122 
-
1123  const auto compute_functions_parameters =
-
1124  breakpoint_exist()
-
1125  ? fmt::format("{}, {}, {}",
-
1126  nrn_cur_required() ? method_name(naming::NRN_CUR_METHOD) : "nullptr",
-
1127  method_name(naming::NRN_JACOB_METHOD),
-
1128  nrn_state_required() ? method_name(naming::NRN_STATE_METHOD) : "nullptr")
-
1129  : "nullptr, nullptr, nullptr";
-
1130  const auto register_mech_args = fmt::format("{}, {}, {}, {}, {}, {}",
-
1131  get_channel_info_var_name(),
-
1132  method_name(naming::NRN_ALLOC_METHOD),
-
1133  compute_functions_parameters,
-
1134  method_name(naming::NRN_INIT_METHOD),
- -
1136  1 + info.thread_data_index);
-
1137  if (info.point_process) {
-
1138  printer->fmt_line(
-
1139  "_pointtype = point_register_mech({}, _hoc_create_pnt, _hoc_destroy_pnt, "
-
1140  "_member_func);",
-
1141  register_mech_args);
-
1142  } else {
-
1143  printer->fmt_line("register_mech({});", register_mech_args);
-
1144  }
-
1145 
-
1146  /// type related information
-
1147  printer->add_newline();
-
1148  printer->fmt_line("mech_type = nrn_get_mechtype({}[1]);", get_channel_info_var_name());
-
1149 
-
1150  // register the table-checking function
-
1151  if (info.table_count > 0) {
-
1152  printer->fmt_line("_nrn_thread_table_reg(mech_type, {});", table_thread_function_name());
-
1153  }
-
1154 
-
1155  /// Call _nrn_mechanism_register_data_fields() with the correct arguments
-
1156  /// Geenerated code follows the style underneath
-
1157  ///
-
1158  /// _nrn_mechanism_register_data_fields(mech_type,
-
1159  /// _nrn_mechanism_field<double>{"var_name"}, /* float var index 0 */
-
1160  /// ...
-
1161  /// );
-
1162  ///
-
1163  /// TODO: More things to add here
-
1164  printer->add_line("_nrn_mechanism_register_data_fields(mech_type,");
-
1165  printer->increase_indent();
-
1166 
-
1167  const auto codegen_float_variables_size = codegen_float_variables.size();
-
1168  std::vector<std::string> mech_register_args;
-
1169 
-
1170  for (int i = 0; i < codegen_float_variables_size; ++i) {
-
1171  const auto& float_var = codegen_float_variables[i];
-
1172  if (float_var->is_array()) {
-
1173  mech_register_args.push_back(
-
1174  fmt::format("_nrn_mechanism_field<double>{{\"{}\", {}}} /* {} */",
-
1175  float_var->get_name(),
-
1176  float_var->get_length(),
-
1177  i));
-
1178  } else {
-
1179  mech_register_args.push_back(fmt::format(
-
1180  "_nrn_mechanism_field<double>{{\"{}\"}} /* {} */", float_var->get_name(), i));
-
1181  }
-
1182  }
-
1183 
-
1184  const auto codegen_int_variables_size = codegen_int_variables.size();
-
1185  for (int i = 0; i < codegen_int_variables_size; ++i) {
-
1186  const auto& int_var = codegen_int_variables[i];
-
1187  const auto& name = int_var.symbol->get_name();
-
1188  if (i != info.semantics[i].index) {
-
1189  throw std::runtime_error("Broken logic.");
-
1190  }
-
1191 
-
1192  auto type = "double*";
-
1193  if (name == naming::POINT_PROCESS_VARIABLE) {
-
1194  type = "Point_process*";
-
1195  } else if (name == naming::TQITEM_VARIABLE) {
-
1196  type = "void*";
-
1197  }
-
1198  mech_register_args.push_back(
-
1199  fmt::format("_nrn_mechanism_field<{}>{{\"{}\", \"{}\"}} /* {} */",
-
1200  type,
-
1201  name,
-
1202  info.semantics[i].name,
-
1203  i));
-
1204  }
-
1205  if (info.emit_cvode) {
-
1206  mech_register_args.push_back(
-
1207  "_nrn_mechanism_field<int>{\"_cvode_ieq\", \"cvodeieq\"} /* 0 */");
-
1208  }
-
1209 
-
1210  printer->add_multi_line(fmt::format("{}", fmt::join(mech_register_args, ",\n")));
-
1211 
-
1212  printer->decrease_indent();
-
1213  printer->add_line(");");
-
1214  printer->add_newline();
+
969 
+
970  // for (const auto& f: info.function_tables) {
+
971  if (!info.function_tables.empty()) {
+
972  throw std::runtime_error("Not implemented, global function tables.");
+
973  }
+
974 
+
975  if (info.vectorize && info.thread_data_index) {
+
976  // TODO compare CoreNEURON something extcall stuff.
+
977  // throw std::runtime_error("Not implemented, global vectorize something else.");
+
978  }
+
979 
+
980  printer->pop_block(";");
+
981 
+
982  print_global_var_struct_assertions();
+
983  print_global_var_struct_decl();
+
984 }
+
985 
+
986 /// TODO: Same as CoreNEURON?
+ +
988  /// TODO: Write HocParmLimits and other HOC global variables (delta_t)
+
989  // Probably needs more changes
+
990  auto variable_printer =
+
991  [&](const std::vector<SymbolType>& variables, bool if_array, bool if_vector) {
+
992  for (const auto& variable: variables) {
+
993  if (variable->is_array() == if_array) {
+
994  // false => do not use the instance struct, which is not
+
995  // defined in the global declaration that we are printing
+
996  auto name = get_variable_name(variable->get_name(), false);
+
997  auto ename = add_escape_quote(variable->get_name() + "_" + info.mod_suffix);
+
998  auto length = variable->get_length();
+
999  if (if_vector) {
+
1000  printer->fmt_line("{{{}, {}, {}}},", ename, name, length);
+
1001  } else {
+
1002  printer->fmt_line("{{{}, &{}}},", ename, name);
+
1003  }
+
1004  }
+
1005  }
+
1006  };
+
1007 
+
1008  auto globals = info.global_variables;
+
1009  auto thread_vars = info.thread_variables;
+
1010 
+
1011  if (info.table_count > 0) {
+
1012  globals.push_back(make_symbol(naming::USE_TABLE_VARIABLE));
+
1013  }
+
1014 
+
1015  printer->add_newline(2);
+
1016  printer->add_line("/** connect global (scalar) variables to hoc -- */");
+
1017  printer->add_line("static DoubScal hoc_scalar_double[] = {");
+
1018  printer->increase_indent();
+
1019  variable_printer(globals, false, false);
+
1020  variable_printer(thread_vars, false, false);
+
1021  printer->add_line("{nullptr, nullptr}");
+
1022  printer->decrease_indent();
+
1023  printer->add_line("};");
+
1024 
+
1025  printer->add_newline(2);
+
1026  printer->add_line("/** connect global (array) variables to hoc -- */");
+
1027  printer->add_line("static DoubVec hoc_vector_double[] = {");
+
1028  printer->increase_indent();
+
1029  variable_printer(globals, true, true);
+
1030  variable_printer(thread_vars, true, true);
+
1031  printer->add_line("{nullptr, nullptr, 0}");
+
1032  printer->decrease_indent();
+
1033  printer->add_line("};");
+
1034 
+
1035  printer->add_newline(2);
+
1036  printer->add_line("/* declaration of user functions */");
+
1037  for (const auto& procedure: info.procedures) {
+
1038  const auto proc_name = procedure->get_node_name();
+
1039  printer->fmt_line("{};", hoc_function_signature(proc_name));
+
1040  }
+
1041  for (const auto& function: info.functions) {
+
1042  const auto func_name = function->get_node_name();
+
1043  printer->fmt_line("{};", hoc_function_signature(func_name));
+
1044  }
+
1045  if (!info.point_process) {
+
1046  for (const auto& procedure: info.procedures) {
+
1047  const auto proc_name = procedure->get_node_name();
+
1048  printer->fmt_line("{};", py_function_signature(proc_name));
+
1049  }
+
1050  for (const auto& function: info.functions) {
+
1051  const auto func_name = function->get_node_name();
+
1052  printer->fmt_line("{};", py_function_signature(func_name));
+
1053  }
+
1054  }
+
1055 
+
1056  printer->add_newline(2);
+
1057  printer->add_line("/* connect user functions to hoc names */");
+
1058  printer->add_line("static VoidFunc hoc_intfunc[] = {");
+
1059  printer->increase_indent();
+
1060  if (info.point_process) {
+
1061  printer->add_line("{0, 0}");
+
1062  printer->decrease_indent();
+
1063  printer->add_line("};");
+
1064  printer->add_line("static Member_func _member_func[] = {");
+
1065  printer->increase_indent();
+
1066  printer->add_multi_line(R"CODE(
+
1067  {"loc", _hoc_loc_pnt},
+
1068  {"has_loc", _hoc_has_loc},
+
1069  {"get_loc", _hoc_get_loc_pnt},)CODE");
+
1070  } else {
+
1071  printer->fmt_line("{{\"setdata_{}\", _hoc_setdata}},", info.mod_suffix);
+
1072  }
+
1073 
+
1074  for (const auto& procedure: info.procedures) {
+
1075  const auto proc_name = procedure->get_node_name();
+
1076  printer->fmt_line("{{\"{}{}\", {}}},",
+
1077  proc_name,
+
1078  info.rsuffix,
+
1079  hoc_function_name(proc_name));
+
1080  }
+
1081  for (const auto& function: info.functions) {
+
1082  const auto func_name = function->get_node_name();
+
1083  printer->fmt_line("{{\"{}{}\", {}}},",
+
1084  func_name,
+
1085  info.rsuffix,
+
1086  hoc_function_name(func_name));
+
1087  }
+
1088 
+
1089  printer->add_line("{nullptr, nullptr}");
+
1090  printer->decrease_indent();
+
1091  printer->add_line("};");
+
1092  if (!info.point_process) {
+
1093  printer->push_block("static NPyDirectMechFunc npy_direct_func_proc[] =");
+
1094  for (const auto& procedure: info.procedures) {
+
1095  const auto proc_name = procedure->get_node_name();
+
1096  printer->fmt_line("{{\"{}\", {}}},", proc_name, py_function_name(proc_name));
+
1097  }
+
1098  for (const auto& function: info.functions) {
+
1099  const auto func_name = function->get_node_name();
+
1100  printer->fmt_line("{{\"{}\", {}}},", func_name, py_function_name(func_name));
+
1101  }
+
1102  printer->add_line("{nullptr, nullptr}");
+
1103  printer->pop_block(";");
+
1104  }
+
1105 }
+
1106 
+ +
1108  /// TODO: Write this according to NEURON
+
1109  printer->add_newline(2);
+
1110  printer->add_line("/** register channel with the simulator */");
+
1111  printer->fmt_push_block("extern \"C\" void _{}_reg()", info.mod_file);
+
1112  printer->add_line("_initlists();");
+
1113  printer->add_newline();
+
1114 
+
1115  for (const auto& ion: info.ions) {
+
1116  printer->fmt_line("ion_reg(\"{}\", {});", ion.name, "-10000.");
+
1117  }
+
1118  if (!info.ions.empty()) {
+
1119  printer->add_newline();
+
1120  }
+
1121 
+
1122  for (const auto& ion: info.ions) {
+
1123  printer->fmt_line("_{0}_sym = hoc_lookup(\"{0}_ion\");", ion.name);
+
1124  }
+
1125  if (!info.ions.empty()) {
+
1126  printer->add_newline();
+
1127  }
+
1128 
+
1129  const auto compute_functions_parameters =
+
1130  breakpoint_exist()
+
1131  ? fmt::format("{}, {}, {}",
+
1132  nrn_cur_required() ? method_name(naming::NRN_CUR_METHOD) : "nullptr",
+
1133  method_name(naming::NRN_JACOB_METHOD),
+
1134  nrn_state_required() ? method_name(naming::NRN_STATE_METHOD) : "nullptr")
+
1135  : "nullptr, nullptr, nullptr";
+
1136  const auto register_mech_args = fmt::format("{}, {}, {}, {}, {}, {}",
+
1137  get_channel_info_var_name(),
+
1138  method_name(naming::NRN_ALLOC_METHOD),
+
1139  compute_functions_parameters,
+
1140  method_name(naming::NRN_INIT_METHOD),
+ +
1142  1 + info.thread_data_index);
+
1143  if (info.point_process) {
+
1144  printer->fmt_line(
+
1145  "_pointtype = point_register_mech({}, _hoc_create_pnt, _hoc_destroy_pnt, "
+
1146  "_member_func);",
+
1147  register_mech_args);
+
1148  } else {
+
1149  printer->fmt_line("register_mech({});", register_mech_args);
+
1150  }
+
1151 
+
1152  /// type related information
+
1153  printer->add_newline();
+
1154  printer->fmt_line("mech_type = nrn_get_mechtype({}[1]);", get_channel_info_var_name());
+
1155 
+
1156  // register the table-checking function
+
1157  if (info.table_count > 0) {
+
1158  printer->fmt_line("_nrn_thread_table_reg(mech_type, {});", table_thread_function_name());
+
1159  }
+
1160 
+
1161  /// Call _nrn_mechanism_register_data_fields() with the correct arguments
+
1162  /// Geenerated code follows the style underneath
+
1163  ///
+
1164  /// _nrn_mechanism_register_data_fields(mech_type,
+
1165  /// _nrn_mechanism_field<double>{"var_name"}, /* float var index 0 */
+
1166  /// ...
+
1167  /// );
+
1168  ///
+
1169  /// TODO: More things to add here
+
1170  printer->add_line("_nrn_mechanism_register_data_fields(mech_type,");
+
1171  printer->increase_indent();
+
1172 
+
1173  const auto codegen_float_variables_size = codegen_float_variables.size();
+
1174  std::vector<std::string> mech_register_args;
+
1175 
+
1176  for (int i = 0; i < codegen_float_variables_size; ++i) {
+
1177  const auto& float_var = codegen_float_variables[i];
+
1178  if (float_var->is_array()) {
+
1179  mech_register_args.push_back(
+
1180  fmt::format("_nrn_mechanism_field<double>{{\"{}\", {}}} /* {} */",
+
1181  float_var->get_name(),
+
1182  float_var->get_length(),
+
1183  i));
+
1184  } else {
+
1185  mech_register_args.push_back(fmt::format(
+
1186  "_nrn_mechanism_field<double>{{\"{}\"}} /* {} */", float_var->get_name(), i));
+
1187  }
+
1188  }
+
1189 
+
1190  const auto codegen_int_variables_size = codegen_int_variables.size();
+
1191  for (int i = 0; i < codegen_int_variables_size; ++i) {
+
1192  const auto& int_var = codegen_int_variables[i];
+
1193  const auto& name = int_var.symbol->get_name();
+
1194  if (i != info.semantics[i].index) {
+
1195  throw std::runtime_error("Broken logic.");
+
1196  }
+
1197 
+
1198  auto type = "double*";
+
1199  if (name == naming::POINT_PROCESS_VARIABLE) {
+
1200  type = "Point_process*";
+
1201  } else if (name == naming::TQITEM_VARIABLE) {
+
1202  type = "void*";
+
1203  }
+
1204  mech_register_args.push_back(
+
1205  fmt::format("_nrn_mechanism_field<{}>{{\"{}\", \"{}\"}} /* {} */",
+
1206  type,
+
1207  name,
+
1208  info.semantics[i].name,
+
1209  i));
+
1210  }
+
1211  if (info.emit_cvode) {
+
1212  mech_register_args.push_back(
+
1213  "_nrn_mechanism_field<int>{\"_cvode_ieq\", \"cvodeieq\"} /* 0 */");
+
1214  }
1215 
-
1216 
-
1217  printer->fmt_line("hoc_register_prop_size(mech_type, {}, {});",
-
1218  float_variables_size(),
-
1219  int_variables_size());
-
1220 
-
1221  for (int i = 0; i < codegen_int_variables_size; ++i) {
-
1222  if (i != info.semantics[i].index) {
-
1223  throw std::runtime_error("Broken logic.");
-
1224  }
-
1225 
-
1226  printer->fmt_line("hoc_register_dparam_semantics(mech_type, {}, \"{}\");",
-
1227  i,
-
1228  info.semantics[i].name);
-
1229  }
-
1230 
-
1231  if (info.artificial_cell) {
-
1232  printer->fmt_line("add_nrn_artcell(mech_type, {});", info.tqitem_index);
-
1233  }
-
1234 
-
1235  printer->add_line("hoc_register_var(hoc_scalar_double, hoc_vector_double, hoc_intfunc);");
-
1236  if (!info.point_process) {
-
1237  printer->add_line("hoc_register_npy_direct(mech_type, npy_direct_func_proc);");
-
1238  }
-
1239  if (info.net_receive_node) {
-
1240  printer->fmt_line("pnt_receive[mech_type] = nrn_net_receive_{};", info.mod_suffix);
-
1241  printer->fmt_line("pnt_receive_size[mech_type] = {};", info.num_net_receive_parameters);
-
1242  }
-
1243 
-
1244  if (info.thread_callback_register) {
-
1245  printer->add_line("_nrn_thread_reg(mech_type, 1, thread_mem_init);");
-
1246  printer->add_line("_nrn_thread_reg(mech_type, 0, thread_mem_cleanup);");
-
1247  }
-
1248 
-
1249  printer->pop_block();
-
1250 }
-
1251 
-
1252 
- -
1254  if (!info.thread_callback_register) {
-
1255  return;
-
1256  }
+
1216  printer->add_multi_line(fmt::format("{}", fmt::join(mech_register_args, ",\n")));
+
1217 
+
1218  printer->decrease_indent();
+
1219  printer->add_line(");");
+
1220  printer->add_newline();
+
1221 
+
1222 
+
1223  printer->fmt_line("hoc_register_prop_size(mech_type, {}, {});",
+
1224  float_variables_size(),
+
1225  int_variables_size());
+
1226 
+
1227  for (int i = 0; i < codegen_int_variables_size; ++i) {
+
1228  if (i != info.semantics[i].index) {
+
1229  throw std::runtime_error("Broken logic.");
+
1230  }
+
1231 
+
1232  printer->fmt_line("hoc_register_dparam_semantics(mech_type, {}, \"{}\");",
+
1233  i,
+
1234  info.semantics[i].name);
+
1235  }
+
1236 
+
1237  if (info.artificial_cell) {
+
1238  printer->fmt_line("add_nrn_artcell(mech_type, {});", info.tqitem_index);
+
1239  }
+
1240 
+
1241  printer->add_line("hoc_register_var(hoc_scalar_double, hoc_vector_double, hoc_intfunc);");
+
1242  if (!info.point_process) {
+
1243  printer->add_line("hoc_register_npy_direct(mech_type, npy_direct_func_proc);");
+
1244  }
+
1245  if (info.net_receive_node) {
+
1246  printer->fmt_line("pnt_receive[mech_type] = nrn_net_receive_{};", info.mod_suffix);
+
1247  printer->fmt_line("pnt_receive_size[mech_type] = {};", info.num_net_receive_parameters);
+
1248  }
+
1249 
+
1250  if (info.thread_callback_register) {
+
1251  printer->add_line("_nrn_thread_reg(mech_type, 1, thread_mem_init);");
+
1252  printer->add_line("_nrn_thread_reg(mech_type, 0, thread_mem_cleanup);");
+
1253  }
+
1254 
+
1255  printer->pop_block();
+
1256 }
1257 
-
1258  auto static_thread_data = get_variable_name("thread_data", false);
-
1259  auto inuse = get_variable_name("thread_data_in_use", false);
-
1260  auto thread_data_index = info.thread_var_thread_id;
-
1261  printer->push_block("static void thread_mem_init(Datum* _thread) ");
-
1262  printer->push_block(fmt::format("if({})", inuse));
-
1263  printer->fmt_line("_thread[{}] = {{neuron::container::do_not_search, new double[{}]{{}}}};",
-
1264  thread_data_index,
-
1265  info.thread_var_data_size + info.top_local_thread_size);
-
1266  printer->pop_block();
-
1267  printer->push_block("else");
-
1268  printer->fmt_line("_thread[{}] = {{neuron::container::do_not_search, {}}};",
-
1269  thread_data_index,
-
1270  static_thread_data);
-
1271  printer->fmt_line("{} = 1;", inuse);
+
1258 
+ +
1260  if (!info.thread_callback_register) {
+
1261  return;
+
1262  }
+
1263 
+
1264  auto static_thread_data = get_variable_name("thread_data", false);
+
1265  auto inuse = get_variable_name("thread_data_in_use", false);
+
1266  auto thread_data_index = info.thread_var_thread_id;
+
1267  printer->push_block("static void thread_mem_init(Datum* _thread) ");
+
1268  printer->push_block(fmt::format("if({})", inuse));
+
1269  printer->fmt_line("_thread[{}] = {{neuron::container::do_not_search, new double[{}]{{}}}};",
+
1270  thread_data_index,
+
1271  info.thread_var_data_size + info.top_local_thread_size);
1272  printer->pop_block();
-
1273  printer->pop_block();
-
1274 
-
1275  printer->push_block("static void thread_mem_cleanup(Datum* _thread) ");
-
1276  printer->fmt_line("double * _thread_data_ptr = _thread[{}].get<double*>();", thread_data_index);
-
1277  printer->push_block(fmt::format("if(_thread_data_ptr == {})", static_thread_data));
-
1278  printer->fmt_line("{} = 0;", inuse);
+
1273  printer->push_block("else");
+
1274  printer->fmt_line("_thread[{}] = {{neuron::container::do_not_search, {}}};",
+
1275  thread_data_index,
+
1276  static_thread_data);
+
1277  printer->fmt_line("{} = 1;", inuse);
+
1278  printer->pop_block();
1279  printer->pop_block();
-
1280  printer->push_block("else");
-
1281  printer->add_line("delete[] _thread_data_ptr;");
-
1282  printer->pop_block();
-
1283  printer->pop_block();
-
1284 }
-
1285 
-
1286 
- -
1288  for (auto const& [var, type]: info.neuron_global_variables) {
-
1289  auto const name = var->get_name();
-
1290  printer->fmt_line("extern {} {};", type, name);
-
1291  }
-
1292 }
-
1293 
- -
1295  auto const value_initialize = print_initializers ? "{}" : "";
-
1296  auto int_type = default_int_data_type();
-
1297  printer->add_newline(2);
-
1298  printer->add_line("/** all mechanism instance variables and global variables */");
-
1299  printer->fmt_push_block("struct {} ", instance_struct());
-
1300 
-
1301  for (auto const& [var, type]: info.neuron_global_variables) {
-
1302  auto const name = var->get_name();
-
1303  printer->fmt_line("{}* {}{};",
-
1304  type,
-
1305  name,
-
1306  print_initializers ? fmt::format("{{&::{}}}", name) : std::string{});
-
1307  }
-
1308  for (auto& var: codegen_float_variables) {
-
1309  const auto& name = var->get_name();
-
1310  printer->fmt_line("double* {}{};", name, value_initialize);
-
1311  }
-
1312  for (auto& var: codegen_int_variables) {
-
1313  const auto& name = var.symbol->get_name();
-
1314  if (name == naming::POINT_PROCESS_VARIABLE) {
-
1315  continue;
-
1316  } else if (var.is_index || var.is_integer) {
-
1317  auto qualifier = var.is_constant ? "const " : "";
-
1318  printer->fmt_line("{}{}* const* {}{};", qualifier, int_type, name, value_initialize);
-
1319  } else {
-
1320  auto qualifier = var.is_constant ? "const " : "";
-
1321  auto type = var.is_vdata ? "void*" : default_float_data_type();
-
1322  printer->fmt_line("{}{}* const* {}{};", qualifier, type, name, value_initialize);
-
1323  }
-
1324  }
-
1325 
-
1326  printer->fmt_line("{}* {}{};",
-
1327  global_struct(),
- -
1329  print_initializers ? fmt::format("{{&{}}}", global_struct_instance())
-
1330  : std::string{});
-
1331  printer->pop_block(";");
-
1332 }
-
1333 
- -
1335  printer->add_newline(2);
-
1336  printer->fmt_push_block("static {} make_instance_{}(_nrn_mechanism_cache_range& _lmc)",
-
1337  instance_struct(),
-
1338  info.mod_suffix);
-
1339  printer->fmt_push_block("return {}", instance_struct());
-
1340 
-
1341  std::vector<std::string> make_instance_args;
-
1342 
-
1343 
-
1344  for (auto const& [var, type]: info.neuron_global_variables) {
-
1345  auto const name = var->get_name();
-
1346  make_instance_args.push_back(fmt::format("&::{}", name));
-
1347  }
+
1280 
+
1281  printer->push_block("static void thread_mem_cleanup(Datum* _thread) ");
+
1282  printer->fmt_line("double * _thread_data_ptr = _thread[{}].get<double*>();", thread_data_index);
+
1283  printer->push_block(fmt::format("if(_thread_data_ptr == {})", static_thread_data));
+
1284  printer->fmt_line("{} = 0;", inuse);
+
1285  printer->pop_block();
+
1286  printer->push_block("else");
+
1287  printer->add_line("delete[] _thread_data_ptr;");
+
1288  printer->pop_block();
+
1289  printer->pop_block();
+
1290 }
+
1291 
+
1292 
+ +
1294  for (auto const& [var, type]: info.neuron_global_variables) {
+
1295  auto const name = var->get_name();
+
1296  printer->fmt_line("extern {} {};", type, name);
+
1297  }
+
1298 }
+
1299 
+ +
1301  auto const value_initialize = print_initializers ? "{}" : "";
+
1302  auto int_type = default_int_data_type();
+
1303  printer->add_newline(2);
+
1304  printer->add_line("/** all mechanism instance variables and global variables */");
+
1305  printer->fmt_push_block("struct {} ", instance_struct());
+
1306 
+
1307  for (auto const& [var, type]: info.neuron_global_variables) {
+
1308  auto const name = var->get_name();
+
1309  printer->fmt_line("{}* {}{};",
+
1310  type,
+
1311  name,
+
1312  print_initializers ? fmt::format("{{&::{}}}", name) : std::string{});
+
1313  }
+
1314  for (auto& var: codegen_float_variables) {
+
1315  const auto& name = var->get_name();
+
1316  printer->fmt_line("double* {}{};", name, value_initialize);
+
1317  }
+
1318  for (auto& var: codegen_int_variables) {
+
1319  const auto& name = var.symbol->get_name();
+
1320  if (name == naming::POINT_PROCESS_VARIABLE) {
+
1321  continue;
+
1322  } else if (var.is_index || var.is_integer) {
+
1323  auto qualifier = var.is_constant ? "const " : "";
+
1324  printer->fmt_line("{}{}* const* {}{};", qualifier, int_type, name, value_initialize);
+
1325  } else {
+
1326  auto qualifier = var.is_constant ? "const " : "";
+
1327  auto type = var.is_vdata ? "void*" : default_float_data_type();
+
1328  printer->fmt_line("{}{}* const* {}{};", qualifier, type, name, value_initialize);
+
1329  }
+
1330  }
+
1331 
+
1332  printer->fmt_line("{}* {}{};",
+
1333  global_struct(),
+ +
1335  print_initializers ? fmt::format("{{&{}}}", global_struct_instance())
+
1336  : std::string{});
+
1337  printer->pop_block(";");
+
1338 }
+
1339 
+ +
1341  printer->add_newline(2);
+
1342  printer->fmt_push_block("static {} make_instance_{}(_nrn_mechanism_cache_range& _lmc)",
+
1343  instance_struct(),
+
1344  info.mod_suffix);
+
1345  printer->fmt_push_block("return {}", instance_struct());
+
1346 
+
1347  std::vector<std::string> make_instance_args;
1348 
1349 
-
1350  const auto codegen_float_variables_size = codegen_float_variables.size();
-
1351  for (int i = 0; i < codegen_float_variables_size; ++i) {
-
1352  const auto& float_var = codegen_float_variables[i];
-
1353  if (float_var->is_array()) {
-
1354  make_instance_args.push_back(
-
1355  fmt::format("_lmc.template data_array_ptr<{}, {}>()", i, float_var->get_length()));
-
1356  } else {
-
1357  make_instance_args.push_back(fmt::format("_lmc.template fpfield_ptr<{}>()", i));
-
1358  }
-
1359  }
-
1360 
-
1361  const auto codegen_int_variables_size = codegen_int_variables.size();
-
1362  for (size_t i = 0; i < codegen_int_variables_size; ++i) {
-
1363  const auto& var = codegen_int_variables[i];
-
1364  auto name = var.symbol->get_name();
-
1365  auto const variable = [&var, i]() -> std::string {
-
1366  if (var.is_index || var.is_integer) {
-
1367  return "";
-
1368  } else if (var.is_vdata) {
-
1369  return "";
-
1370  } else {
-
1371  return fmt::format("_lmc.template dptr_field_ptr<{}>()", i);
-
1372  }
-
1373  }();
-
1374  if (variable != "") {
-
1375  make_instance_args.push_back(variable);
-
1376  }
-
1377  }
-
1378 
-
1379  printer->add_multi_line(fmt::format("{}", fmt::join(make_instance_args, ",\n")));
-
1380 
-
1381  printer->pop_block(";");
-
1382  printer->pop_block();
-
1383 }
+
1350  for (auto const& [var, type]: info.neuron_global_variables) {
+
1351  auto const name = var->get_name();
+
1352  make_instance_args.push_back(fmt::format("&::{}", name));
+
1353  }
+
1354 
+
1355 
+
1356  const auto codegen_float_variables_size = codegen_float_variables.size();
+
1357  for (int i = 0; i < codegen_float_variables_size; ++i) {
+
1358  const auto& float_var = codegen_float_variables[i];
+
1359  if (float_var->is_array()) {
+
1360  make_instance_args.push_back(
+
1361  fmt::format("_lmc.template data_array_ptr<{}, {}>()", i, float_var->get_length()));
+
1362  } else {
+
1363  make_instance_args.push_back(fmt::format("_lmc.template fpfield_ptr<{}>()", i));
+
1364  }
+
1365  }
+
1366 
+
1367  const auto codegen_int_variables_size = codegen_int_variables.size();
+
1368  for (size_t i = 0; i < codegen_int_variables_size; ++i) {
+
1369  const auto& var = codegen_int_variables[i];
+
1370  auto name = var.symbol->get_name();
+
1371  auto const variable = [&var, i]() -> std::string {
+
1372  if (var.is_index || var.is_integer) {
+
1373  return "";
+
1374  } else if (var.is_vdata) {
+
1375  return "";
+
1376  } else {
+
1377  return fmt::format("_lmc.template dptr_field_ptr<{}>()", i);
+
1378  }
+
1379  }();
+
1380  if (variable != "") {
+
1381  make_instance_args.push_back(variable);
+
1382  }
+
1383  }
1384 
- -
1386  printer->add_newline(2);
-
1387  printer->fmt_push_block("struct {} ", node_data_struct());
-
1388 
-
1389  // Pointers to node variables
-
1390  printer->add_line("int const * nodeindices;");
-
1391  printer->add_line("double const * node_voltages;");
-
1392  printer->add_line("double * node_diagonal;");
-
1393  printer->add_line("double * node_rhs;");
-
1394  printer->add_line("int nodecount;");
-
1395 
-
1396  printer->pop_block(";");
-
1397 }
-
1398 
- -
1400  printer->add_newline(2);
-
1401  printer->fmt_push_block("static {} make_node_data_{}(NrnThread& nt, Memb_list& _ml_arg)",
-
1402  node_data_struct(),
-
1403  info.mod_suffix);
+
1385  printer->add_multi_line(fmt::format("{}", fmt::join(make_instance_args, ",\n")));
+
1386 
+
1387  printer->pop_block(";");
+
1388  printer->pop_block();
+
1389 }
+
1390 
+ +
1392  printer->add_newline(2);
+
1393  printer->fmt_push_block("struct {} ", node_data_struct());
+
1394 
+
1395  // Pointers to node variables
+
1396  printer->add_line("int const * nodeindices;");
+
1397  printer->add_line("double const * node_voltages;");
+
1398  printer->add_line("double * node_diagonal;");
+
1399  printer->add_line("double * node_rhs;");
+
1400  printer->add_line("int nodecount;");
+
1401 
+
1402  printer->pop_block(";");
+
1403 }
1404 
-
1405  std::vector<std::string> make_node_data_args = {"_ml_arg.nodeindices",
-
1406  "nt.node_voltage_storage()",
-
1407  "nt.node_d_storage()",
-
1408  "nt.node_rhs_storage()",
-
1409  "_ml_arg.nodecount"};
+ +
1406  printer->add_newline(2);
+
1407  printer->fmt_push_block("static {} make_node_data_{}(NrnThread& nt, Memb_list& _ml_arg)",
+
1408  node_data_struct(),
+
1409  info.mod_suffix);
1410 
-
1411  printer->fmt_push_block("return {}", node_data_struct());
-
1412  printer->add_multi_line(fmt::format("{}", fmt::join(make_node_data_args, ",\n")));
-
1413 
-
1414  printer->pop_block(";");
-
1415  printer->pop_block();
-
1416 }
-
1417 
- -
1419  if (codegen_thread_variables.empty()) {
-
1420  return;
-
1421  }
-
1422 
-
1423  printer->add_newline(2);
-
1424  printer->fmt_push_block("struct {} ", thread_variables_struct());
-
1425  printer->add_line("double * thread_data;");
-
1426  printer->add_newline();
-
1427 
-
1428  std::string simd_width = "1";
-
1429 
-
1430 
-
1431  for (const auto& var_info: codegen_thread_variables) {
-
1432  printer->fmt_push_block("double * {}_ptr(size_t id)", var_info.symbol->get_name());
-
1433  printer->fmt_line("return thread_data + {} + (id % {});", var_info.offset, simd_width);
-
1434  printer->pop_block();
+
1411  std::vector<std::string> make_node_data_args = {"_ml_arg.nodeindices",
+
1412  "nt.node_voltage_storage()",
+
1413  "nt.node_d_storage()",
+
1414  "nt.node_rhs_storage()",
+
1415  "_ml_arg.nodecount"};
+
1416 
+
1417  printer->fmt_push_block("return {}", node_data_struct());
+
1418  printer->add_multi_line(fmt::format("{}", fmt::join(make_node_data_args, ",\n")));
+
1419 
+
1420  printer->pop_block(";");
+
1421  printer->pop_block();
+
1422 }
+
1423 
+ +
1425  if (codegen_thread_variables.empty()) {
+
1426  return;
+
1427  }
+
1428 
+
1429  printer->add_newline(2);
+
1430  printer->fmt_push_block("struct {} ", thread_variables_struct());
+
1431  printer->add_line("double * thread_data;");
+
1432  printer->add_newline();
+
1433 
+
1434  std::string simd_width = "1";
1435 
-
1436  printer->fmt_push_block("double & {}(size_t id)", var_info.symbol->get_name());
-
1437  printer->fmt_line("return thread_data[{} + (id % {})];", var_info.offset, simd_width);
-
1438  printer->pop_block();
-
1439  }
-
1440  printer->add_newline();
+
1436 
+
1437  for (const auto& var_info: codegen_thread_variables) {
+
1438  printer->fmt_push_block("double * {}_ptr(size_t id)", var_info.symbol->get_name());
+
1439  printer->fmt_line("return thread_data + {} + (id % {});", var_info.offset, simd_width);
+
1440  printer->pop_block();
1441 
-
1442  printer->push_block(fmt::format("{}(double * const thread_data)", thread_variables_struct()));
-
1443  printer->fmt_line("this->thread_data = thread_data;");
-
1444  printer->pop_block();
-
1445 
-
1446  printer->pop_block(";");
-
1447 }
-
1448 
-
1449 
- -
1451  // read ion statements
-
1452  auto read_statements = ion_read_statements(BlockType::Initial);
-
1453  for (auto& statement: read_statements) {
-
1454  printer->add_line(statement);
-
1455  }
-
1456 
-
1457  // initial block
-
1458  if (node != nullptr) {
-
1459  const auto& block = node->get_statement_block();
-
1460  print_statement_block(*block, false, false);
+
1442  printer->fmt_push_block("double & {}(size_t id)", var_info.symbol->get_name());
+
1443  printer->fmt_line("return thread_data[{} + (id % {})];", var_info.offset, simd_width);
+
1444  printer->pop_block();
+
1445  }
+
1446  printer->add_newline();
+
1447 
+
1448  printer->push_block(fmt::format("{}(double * const thread_data)", thread_variables_struct()));
+
1449  printer->fmt_line("this->thread_data = thread_data;");
+
1450  printer->pop_block();
+
1451 
+
1452  printer->pop_block(";");
+
1453 }
+
1454 
+
1455 
+ +
1457  // read ion statements
+
1458  auto read_statements = ion_read_statements(BlockType::Initial);
+
1459  for (auto& statement: read_statements) {
+
1460  printer->add_line(statement);
1461  }
1462 
-
1463  // write ion statements
-
1464  auto write_statements = ion_write_statements(BlockType::Initial);
-
1465  for (auto& statement: write_statements) {
-
1466  auto text = process_shadow_update_statement(statement, BlockType::Initial);
-
1467  printer->add_line(text);
-
1468  }
-
1469 }
-
1470 
-
1471 
- -
1473  const std::string& function_name) {
-
1474  std::string method = function_name.empty() ? compute_method_name(type) : function_name;
-
1475  ParamVector args = {{"", "const _nrn_model_sorted_token&", "", "_sorted_token"},
-
1476  {"", "NrnThread*", "", "nt"},
-
1477  {"", "Memb_list*", "", "_ml_arg"},
-
1478  {"", "int", "", "_type"}};
-
1479  printer->fmt_push_block("void {}({})", method, get_parameter_str(args));
-
1480 
-
1481  printer->add_line("_nrn_mechanism_cache_range _lmc{_sorted_token, *nt, *_ml_arg, _type};");
-
1482  printer->fmt_line("auto inst = make_instance_{}(_lmc);", info.mod_suffix);
-
1483  printer->fmt_line("auto node_data = make_node_data_{}(*nt, *_ml_arg);", info.mod_suffix);
-
1484 
-
1485  printer->add_line("auto nodecount = _ml_arg->nodecount;");
-
1486  printer->add_line("auto* _thread = _ml_arg->_thread;");
-
1487  if (!codegen_thread_variables.empty()) {
-
1488  printer->fmt_line("auto _thread_vars = {}(_thread[{}].get<double*>());",
-
1489  thread_variables_struct(),
-
1490  info.thread_var_thread_id);
-
1491  }
-
1492 }
-
1493 
-
1494 
-
1495 void CodegenNeuronCppVisitor::print_nrn_init(bool skip_init_check) {
-
1496  printer->add_newline(2);
-
1497 
-
1498  print_global_function_common_code(BlockType::Initial);
+
1463  // initial block
+
1464  if (node != nullptr) {
+
1465  const auto& block = node->get_statement_block();
+
1466  print_statement_block(*block, false, false);
+
1467  }
+
1468 
+
1469  // write ion statements
+
1470  auto write_statements = ion_write_statements(BlockType::Initial);
+
1471  for (auto& statement: write_statements) {
+
1472  auto text = process_shadow_update_statement(statement, BlockType::Initial);
+
1473  printer->add_line(text);
+
1474  }
+
1475 }
+
1476 
+
1477 
+ +
1479  const std::string& function_name) {
+
1480  std::string method = function_name.empty() ? compute_method_name(type) : function_name;
+
1481  ParamVector args = {{"", "const _nrn_model_sorted_token&", "", "_sorted_token"},
+
1482  {"", "NrnThread*", "", "nt"},
+
1483  {"", "Memb_list*", "", "_ml_arg"},
+
1484  {"", "int", "", "_type"}};
+
1485  printer->fmt_push_block("void {}({})", method, get_parameter_str(args));
+
1486 
+
1487  printer->add_line("_nrn_mechanism_cache_range _lmc{_sorted_token, *nt, *_ml_arg, _type};");
+
1488  printer->fmt_line("auto inst = make_instance_{}(_lmc);", info.mod_suffix);
+
1489  printer->fmt_line("auto node_data = make_node_data_{}(*nt, *_ml_arg);", info.mod_suffix);
+
1490 
+
1491  printer->add_line("auto nodecount = _ml_arg->nodecount;");
+
1492  printer->add_line("auto* _thread = _ml_arg->_thread;");
+
1493  if (!codegen_thread_variables.empty()) {
+
1494  printer->fmt_line("auto _thread_vars = {}(_thread[{}].get<double*>());",
+
1495  thread_variables_struct(),
+
1496  info.thread_var_thread_id);
+
1497  }
+
1498 }
1499 
-
1500  printer->push_block("for (int id = 0; id < nodecount; id++)");
-
1501 
-
1502  printer->add_line("auto* _ppvar = _ml_arg->pdata[id];");
-
1503  if (!info.artificial_cell) {
-
1504  printer->add_line("int node_id = node_data.nodeindices[id];");
-
1505  printer->add_line("auto v = node_data.node_voltages[node_id];");
-
1506  printer->fmt_line("inst.{}[id] = v;", naming::VOLTAGE_UNUSED_VARIABLE);
-
1507  }
-
1508 
-
1509  print_initial_block(info.initial_node);
-
1510  printer->pop_block();
-
1511 
-
1512  printer->pop_block();
-
1513 }
+
1500 
+
1501 void CodegenNeuronCppVisitor::print_nrn_init(bool skip_init_check) {
+
1502  printer->add_newline(2);
+
1503 
+
1504  print_global_function_common_code(BlockType::Initial);
+
1505 
+
1506  printer->push_block("for (int id = 0; id < nodecount; id++)");
+
1507 
+
1508  printer->add_line("auto* _ppvar = _ml_arg->pdata[id];");
+
1509  if (!info.artificial_cell) {
+
1510  printer->add_line("int node_id = node_data.nodeindices[id];");
+
1511  printer->add_line("auto v = node_data.node_voltages[node_id];");
+
1512  printer->fmt_line("inst.{}[id] = v;", naming::VOLTAGE_UNUSED_VARIABLE);
+
1513  }
1514 
- -
1516  printer->add_newline(2);
+
1515  print_initial_block(info.initial_node);
+
1516  printer->pop_block();
1517 
-
1518  ParamVector args = {{"", "const _nrn_model_sorted_token&", "", "_sorted_token"},
-
1519  {"", "NrnThread*", "", "nt"},
-
1520  {"", "Memb_list*", "", "_ml_arg"},
-
1521  {"", "int", "", "_type"}};
-
1522 
-
1523  printer->fmt_push_block("static void {}({})",
-
1524  method_name(naming::NRN_JACOB_METHOD),
-
1525  get_parameter_str(args)); // begin function
-
1526 
-
1527 
-
1528  printer->add_multi_line(
-
1529  "_nrn_mechanism_cache_range _lmc{_sorted_token, *nt, *_ml_arg, _type};");
-
1530 
-
1531  printer->fmt_line("auto inst = make_instance_{}(_lmc);", info.mod_suffix);
-
1532  printer->fmt_line("auto node_data = make_node_data_{}(*nt, *_ml_arg);", info.mod_suffix);
-
1533  printer->fmt_line("auto nodecount = _ml_arg->nodecount;");
-
1534  printer->push_block("for (int id = 0; id < nodecount; id++)"); // begin for
-
1535 
-
1536  if (breakpoint_exist()) {
-
1537  printer->add_line("int node_id = node_data.nodeindices[id];");
-
1538  printer->fmt_line("node_data.node_diagonal[node_id] += inst.{}[id];",
-
1539  info.vectorize ? naming::CONDUCTANCE_UNUSED_VARIABLE
- -
1541  }
-
1542 
-
1543  printer->pop_block(); // end for
-
1544  printer->pop_block(); // end function
-
1545 }
-
1546 
-
1547 
-
1548 /// TODO: Edit for NEURON
- -
1550  return;
+
1518  printer->pop_block();
+
1519 }
+
1520 
+ +
1522  printer->add_newline(2);
+
1523 
+
1524  ParamVector args = {{"", "const _nrn_model_sorted_token&", "", "_sorted_token"},
+
1525  {"", "NrnThread*", "", "nt"},
+
1526  {"", "Memb_list*", "", "_ml_arg"},
+
1527  {"", "int", "", "_type"}};
+
1528 
+
1529  printer->fmt_push_block("static void {}({})",
+
1530  method_name(naming::NRN_JACOB_METHOD),
+
1531  get_parameter_str(args)); // begin function
+
1532 
+
1533 
+
1534  printer->add_multi_line(
+
1535  "_nrn_mechanism_cache_range _lmc{_sorted_token, *nt, *_ml_arg, _type};");
+
1536 
+
1537  printer->fmt_line("auto inst = make_instance_{}(_lmc);", info.mod_suffix);
+
1538  printer->fmt_line("auto node_data = make_node_data_{}(*nt, *_ml_arg);", info.mod_suffix);
+
1539  printer->fmt_line("auto nodecount = _ml_arg->nodecount;");
+
1540  printer->push_block("for (int id = 0; id < nodecount; id++)"); // begin for
+
1541 
+
1542  if (breakpoint_exist()) {
+
1543  printer->add_line("int node_id = node_data.nodeindices[id];");
+
1544  printer->fmt_line("node_data.node_diagonal[node_id] += inst.{}[id];",
+
1545  info.vectorize ? naming::CONDUCTANCE_UNUSED_VARIABLE
+ +
1547  }
+
1548 
+
1549  printer->pop_block(); // end for
+
1550  printer->pop_block(); // end function
1551 }
1552 
1553 
1554 /// TODO: Edit for NEURON
- +
1556  return;
1557 }
1558 
1559 
-
1560 /// TODO: Print the equivalent of `nrn_alloc_<mech_name>`
- -
1562  printer->add_newline(2);
-
1563 
-
1564  auto method = method_name(naming::NRN_ALLOC_METHOD);
-
1565  printer->fmt_push_block("static void {}(Prop* _prop)", method);
-
1566  printer->add_multi_line(R"CODE(
-
1567  Prop *prop_ion{};
-
1568  Datum *_ppvar{};
-
1569  )CODE");
-
1570 
-
1571  if (info.point_process) {
-
1572  printer->push_block("if (nrn_point_prop_)");
-
1573  printer->add_multi_line(R"CODE(
-
1574  _nrn_mechanism_access_alloc_seq(_prop) = _nrn_mechanism_access_alloc_seq(nrn_point_prop_);
-
1575  _ppvar = _nrn_mechanism_access_dparam(nrn_point_prop_);
-
1576  )CODE");
-
1577  printer->chain_block("else");
-
1578  }
-
1579  if (info.semantic_variable_count) {
-
1580  printer->fmt_line("_ppvar = nrn_prop_datum_alloc(mech_type, {}, _prop);",
-
1581  info.semantic_variable_count);
-
1582  printer->add_line("_nrn_mechanism_access_dparam(_prop) = _ppvar;");
-
1583  }
-
1584  printer->add_multi_line(R"CODE(
-
1585  _nrn_mechanism_cache_instance _lmc{_prop};
-
1586  size_t const _iml{};
-
1587  )CODE");
-
1588  printer->fmt_line("assert(_nrn_mechanism_get_num_vars(_prop) == {});",
-
1589  codegen_float_variables.size());
-
1590  if (float_variables_size()) {
-
1591  printer->add_line("/*initialize range parameters*/");
-
1592  for (const auto& var: info.range_parameter_vars) {
-
1593  if (var->is_array()) {
-
1594  continue;
-
1595  }
-
1596  const auto& var_name = var->get_name();
-
1597  auto var_pos = position_of_float_var(var_name);
-
1598  double var_value = var->get_value() == nullptr ? 0.0 : *var->get_value();
-
1599 
-
1600  printer->fmt_line("_lmc.template fpfield<{}>(_iml) = {}; /* {} */",
-
1601  var_pos,
-
1602  var_value,
-
1603  var_name);
-
1604  }
-
1605  }
-
1606  if (info.point_process) {
-
1607  printer->pop_block();
-
1608  }
-
1609 
-
1610  if (info.semantic_variable_count) {
-
1611  printer->add_line("_nrn_mechanism_access_dparam(_prop) = _ppvar;");
-
1612  }
-
1613 
-
1614  const auto codegen_int_variables_size = codegen_int_variables.size();
+
1560 /// TODO: Edit for NEURON
+ +
1562  return;
+
1563 }
+
1564 
+
1565 
+
1566 /// TODO: Print the equivalent of `nrn_alloc_<mech_name>`
+ +
1568  printer->add_newline(2);
+
1569 
+
1570  auto method = method_name(naming::NRN_ALLOC_METHOD);
+
1571  printer->fmt_push_block("static void {}(Prop* _prop)", method);
+
1572  printer->add_multi_line(R"CODE(
+
1573  Prop *prop_ion{};
+
1574  Datum *_ppvar{};
+
1575  )CODE");
+
1576 
+
1577  if (info.point_process) {
+
1578  printer->push_block("if (nrn_point_prop_)");
+
1579  printer->add_multi_line(R"CODE(
+
1580  _nrn_mechanism_access_alloc_seq(_prop) = _nrn_mechanism_access_alloc_seq(nrn_point_prop_);
+
1581  _ppvar = _nrn_mechanism_access_dparam(nrn_point_prop_);
+
1582  )CODE");
+
1583  printer->chain_block("else");
+
1584  }
+
1585  if (info.semantic_variable_count) {
+
1586  printer->fmt_line("_ppvar = nrn_prop_datum_alloc(mech_type, {}, _prop);",
+
1587  info.semantic_variable_count);
+
1588  printer->add_line("_nrn_mechanism_access_dparam(_prop) = _ppvar;");
+
1589  }
+
1590  printer->add_multi_line(R"CODE(
+
1591  _nrn_mechanism_cache_instance _lmc{_prop};
+
1592  size_t const _iml{};
+
1593  )CODE");
+
1594  printer->fmt_line("assert(_nrn_mechanism_get_num_vars(_prop) == {});",
+
1595  codegen_float_variables.size());
+
1596  if (float_variables_size()) {
+
1597  printer->add_line("/*initialize range parameters*/");
+
1598  for (const auto& var: info.range_parameter_vars) {
+
1599  if (var->is_array()) {
+
1600  continue;
+
1601  }
+
1602  const auto& var_name = var->get_name();
+
1603  auto var_pos = position_of_float_var(var_name);
+
1604  double var_value = var->get_value() == nullptr ? 0.0 : *var->get_value();
+
1605 
+
1606  printer->fmt_line("_lmc.template fpfield<{}>(_iml) = {}; /* {} */",
+
1607  var_pos,
+
1608  var_value,
+
1609  var_name);
+
1610  }
+
1611  }
+
1612  if (info.point_process) {
+
1613  printer->pop_block();
+
1614  }
1615 
-
1616  if (info.diam_used || info.area_used) {
-
1617  for (size_t i = 0; i < codegen_int_variables.size(); ++i) {
-
1618  auto var_info = codegen_int_variables[i];
-
1619  if (var_info.symbol->get_name() == naming::DIAM_VARIABLE) {
-
1620  printer->add_line("Symbol * morphology_sym = hoc_lookup(\"morphology\");");
-
1621  printer->fmt_line("Prop * morphology_prop = need_memb(morphology_sym);");
-
1622 
-
1623  printer->fmt_line(
-
1624  "_ppvar[{}] = _nrn_mechanism_get_param_handle(morphology_prop, 0);", i);
-
1625  }
-
1626  if (var_info.symbol->get_name() == naming::AREA_VARIABLE) {
-
1627  printer->fmt_line("_ppvar[{}] = _nrn_mechanism_get_area_handle(nrn_alloc_node_);",
-
1628  i);
-
1629  }
-
1630  }
-
1631  }
-
1632 
-
1633  for (const auto& ion: info.ions) {
-
1634  printer->fmt_line("Symbol * {}_sym = hoc_lookup(\"{}_ion\");", ion.name, ion.name);
-
1635  printer->fmt_line("Prop * {}_prop = need_memb({}_sym);", ion.name, ion.name);
-
1636 
-
1637  for (size_t i = 0; i < codegen_int_variables_size; ++i) {
-
1638  const auto& var = codegen_int_variables[i];
-
1639 
-
1640  // if(var.symbol->has_any_property(NmodlType::useion)) {
-
1641  const std::string& var_name = var.symbol->get_name();
-
1642  if (var_name.rfind("ion_", 0) != 0) {
-
1643  continue;
-
1644  }
+
1616  if (info.semantic_variable_count) {
+
1617  printer->add_line("_nrn_mechanism_access_dparam(_prop) = _ppvar;");
+
1618  }
+
1619 
+
1620  const auto codegen_int_variables_size = codegen_int_variables.size();
+
1621 
+
1622  if (info.diam_used || info.area_used) {
+
1623  for (size_t i = 0; i < codegen_int_variables.size(); ++i) {
+
1624  auto var_info = codegen_int_variables[i];
+
1625  if (var_info.symbol->get_name() == naming::DIAM_VARIABLE) {
+
1626  printer->add_line("Symbol * morphology_sym = hoc_lookup(\"morphology\");");
+
1627  printer->fmt_line("Prop * morphology_prop = need_memb(morphology_sym);");
+
1628 
+
1629  printer->fmt_line(
+
1630  "_ppvar[{}] = _nrn_mechanism_get_param_handle(morphology_prop, 0);", i);
+
1631  }
+
1632  if (var_info.symbol->get_name() == naming::AREA_VARIABLE) {
+
1633  printer->fmt_line("_ppvar[{}] = _nrn_mechanism_get_area_handle(nrn_alloc_node_);",
+
1634  i);
+
1635  }
+
1636  }
+
1637  }
+
1638 
+
1639  for (const auto& ion: info.ions) {
+
1640  printer->fmt_line("Symbol * {}_sym = hoc_lookup(\"{}_ion\");", ion.name, ion.name);
+
1641  printer->fmt_line("Prop * {}_prop = need_memb({}_sym);", ion.name, ion.name);
+
1642 
+
1643  for (size_t i = 0; i < codegen_int_variables_size; ++i) {
+
1644  const auto& var = codegen_int_variables[i];
1645 
-
1646  std::string ion_var_name = std::string(var_name.begin() + 4, var_name.end());
-
1647  if (ion.is_ionic_variable(ion_var_name)) {
-
1648  printer->fmt_line("_ppvar[{}] = _nrn_mechanism_get_param_handle({}_prop, {});",
-
1649  i,
-
1650  ion.name,
-
1651  ion.variable_index(ion_var_name));
-
1652  }
-
1653  // assign derivatives of the current as well
-
1654  else if (ion.is_current_derivative(ion_var_name)) {
-
1655  printer->fmt_line("_ppvar[{}] = _nrn_mechanism_get_param_handle({}_prop, {});",
-
1656  i,
-
1657  ion.name,
-
1658  ion.variable_index(ion_var_name));
-
1659  }
-
1660  //}
-
1661  }
-
1662  }
-
1663 
-
1664  /// TODO: CONSTRUCTOR call
-
1665 
-
1666  printer->pop_block();
-
1667 }
-
1668 
-
1669 
-
1670 /****************************************************************************************/
-
1671 /* Print nrn_state routine */
-
1672 /****************************************************************************************/
-
1673 
-
1674 /// TODO: Edit for NEURON
- -
1676  if (!nrn_state_required()) {
-
1677  return;
-
1678  }
-
1679 
-
1680  printer->add_newline(2);
-
1681  print_global_function_common_code(BlockType::State);
-
1682 
-
1683  printer->push_block("for (int id = 0; id < nodecount; id++)");
-
1684  printer->add_line("int node_id = node_data.nodeindices[id];");
-
1685  printer->add_line("auto* _ppvar = _ml_arg->pdata[id];");
-
1686  printer->add_line("auto v = node_data.node_voltages[node_id];");
-
1687 
-
1688  /**
-
1689  * \todo Eigen solver node also emits IonCurVar variable in the functor
-
1690  * but that shouldn't update ions in derivative block
-
1691  */
-
1692  if (ion_variable_struct_required()) {
-
1693  throw std::runtime_error("Not implemented.");
-
1694  }
-
1695 
-
1696  auto read_statements = ion_read_statements(BlockType::State);
-
1697  for (auto& statement: read_statements) {
-
1698  printer->add_line(statement);
-
1699  }
-
1700 
-
1701  if (info.nrn_state_block) {
-
1702  info.nrn_state_block->visit_children(*this);
-
1703  }
-
1704 
-
1705  if (info.currents.empty() && info.breakpoint_node != nullptr) {
-
1706  auto block = info.breakpoint_node->get_statement_block();
-
1707  print_statement_block(*block, false, false);
-
1708  }
-
1709 
-
1710  const auto& write_statements = ion_write_statements(BlockType::State);
-
1711  for (auto& statement: write_statements) {
-
1712  const auto& text = process_shadow_update_statement(statement, BlockType::State);
-
1713  printer->add_line(text);
+
1646  // if(var.symbol->has_any_property(NmodlType::useion)) {
+
1647  const std::string& var_name = var.symbol->get_name();
+
1648  if (var_name.rfind("ion_", 0) != 0) {
+
1649  continue;
+
1650  }
+
1651 
+
1652  std::string ion_var_name = std::string(var_name.begin() + 4, var_name.end());
+
1653  if (ion.is_ionic_variable(ion_var_name)) {
+
1654  printer->fmt_line("_ppvar[{}] = _nrn_mechanism_get_param_handle({}_prop, {});",
+
1655  i,
+
1656  ion.name,
+
1657  ion.variable_index(ion_var_name));
+
1658  }
+
1659  // assign derivatives of the current as well
+
1660  else if (ion.is_current_derivative(ion_var_name)) {
+
1661  printer->fmt_line("_ppvar[{}] = _nrn_mechanism_get_param_handle({}_prop, {});",
+
1662  i,
+
1663  ion.name,
+
1664  ion.variable_index(ion_var_name));
+
1665  }
+
1666  //}
+
1667  }
+
1668  }
+
1669 
+
1670  /// TODO: CONSTRUCTOR call
+
1671 
+
1672  printer->pop_block();
+
1673 }
+
1674 
+
1675 
+
1676 /****************************************************************************************/
+
1677 /* Print nrn_state routine */
+
1678 /****************************************************************************************/
+
1679 
+
1680 /// TODO: Edit for NEURON
+ +
1682  if (!nrn_state_required()) {
+
1683  return;
+
1684  }
+
1685 
+
1686  printer->add_newline(2);
+
1687  print_global_function_common_code(BlockType::State);
+
1688 
+
1689  printer->push_block("for (int id = 0; id < nodecount; id++)");
+
1690  printer->add_line("int node_id = node_data.nodeindices[id];");
+
1691  printer->add_line("auto* _ppvar = _ml_arg->pdata[id];");
+
1692  printer->add_line("auto v = node_data.node_voltages[node_id];");
+
1693 
+
1694  /**
+
1695  * \todo Eigen solver node also emits IonCurVar variable in the functor
+
1696  * but that shouldn't update ions in derivative block
+
1697  */
+
1698  if (ion_variable_struct_required()) {
+
1699  throw std::runtime_error("Not implemented.");
+
1700  }
+
1701 
+
1702  auto read_statements = ion_read_statements(BlockType::State);
+
1703  for (auto& statement: read_statements) {
+
1704  printer->add_line(statement);
+
1705  }
+
1706 
+
1707  if (info.nrn_state_block) {
+
1708  info.nrn_state_block->visit_children(*this);
+
1709  }
+
1710 
+
1711  if (info.currents.empty() && info.breakpoint_node != nullptr) {
+
1712  auto block = info.breakpoint_node->get_statement_block();
+
1713  print_statement_block(*block, false, false);
1714  }
1715 
-
1716  printer->pop_block();
-
1717  printer->pop_block();
-
1718 }
-
1719 
-
1720 
-
1721 /****************************************************************************************/
-
1722 /* Print nrn_cur related routines */
-
1723 /****************************************************************************************/
-
1724 
- -
1726  return get_arg_str(nrn_current_parameters());
-
1727 }
-
1728 
-
1729 
- -
1731  if (ion_variable_struct_required()) {
-
1732  throw std::runtime_error("Not implemented.");
-
1733  }
+
1716  const auto& write_statements = ion_write_statements(BlockType::State);
+
1717  for (auto& statement: write_statements) {
+
1718  const auto& text = process_shadow_update_statement(statement, BlockType::State);
+
1719  printer->add_line(text);
+
1720  }
+
1721 
+
1722  printer->pop_block();
+
1723  printer->pop_block();
+
1724 }
+
1725 
+
1726 
+
1727 /****************************************************************************************/
+
1728 /* Print nrn_cur related routines */
+
1729 /****************************************************************************************/
+
1730 
+ +
1732  return get_arg_str(nrn_current_parameters());
+
1733 }
1734 
-
1735  ParamVector params = {{"", "_nrn_mechanism_cache_range&", "", "_lmc"},
-
1736  {"", "NrnThread*", "", "nt"},
-
1737  {"", "Datum*", "", "_ppvar"},
-
1738  {"", "Datum*", "", "_thread"}};
-
1739 
-
1740  if (info.thread_callback_register) {
-
1741  auto type_name = fmt::format("{}&", thread_variables_struct());
-
1742  params.emplace_back("", type_name, "", "_thread_vars");
-
1743  }
-
1744  params.emplace_back("", "size_t", "", "id");
-
1745  params.emplace_back("", fmt::format("{}&", instance_struct()), "", "inst");
-
1746  params.emplace_back("", fmt::format("{}&", node_data_struct()), "", "node_data");
-
1747  params.emplace_back("", "double", "", "v");
-
1748  return params;
-
1749 }
-
1750 
-
1751 
-
1752 /// TODO: Edit for NEURON
- -
1754  const auto& args = nrn_current_parameters();
-
1755  const auto& block = node.get_statement_block();
-
1756  printer->add_newline(2);
-
1757  printer->fmt_push_block("inline double nrn_current_{}({})",
-
1758  info.mod_suffix,
-
1759  get_parameter_str(args));
-
1760  printer->add_line("double current = 0.0;");
-
1761  print_statement_block(*block, false, false);
-
1762  for (auto& current: info.currents) {
-
1763  const auto& name = get_variable_name(current);
-
1764  printer->fmt_line("current += {};", name);
-
1765  }
-
1766  printer->add_line("return current;");
-
1767  printer->pop_block();
-
1768 }
-
1769 
-
1770 
-
1771 /// TODO: Edit for NEURON
- -
1773  const auto& block = node.get_statement_block();
-
1774  print_statement_block(*block, false, false);
-
1775  if (!info.currents.empty()) {
-
1776  std::string sum;
-
1777  for (const auto& current: info.currents) {
-
1778  auto var = breakpoint_current(current);
-
1779  sum += get_variable_name(var);
-
1780  if (&current != &info.currents.back()) {
-
1781  sum += "+";
-
1782  }
-
1783  }
-
1784  printer->fmt_line("double rhs = {};", sum);
-
1785  }
-
1786 
-
1787  std::string sum;
-
1788  for (const auto& conductance: info.conductances) {
-
1789  auto var = breakpoint_current(conductance.variable);
-
1790  sum += get_variable_name(var);
-
1791  if (&conductance != &info.conductances.back()) {
-
1792  sum += "+";
-
1793  }
-
1794  }
-
1795  printer->fmt_line("double g = {};", sum);
-
1796 
-
1797  for (const auto& conductance: info.conductances) {
-
1798  if (!conductance.ion.empty()) {
-
1799  const auto& lhs = std::string(naming::ION_VARNAME_PREFIX) + "di" + conductance.ion +
-
1800  "dv";
-
1801  const auto& rhs = get_variable_name(conductance.variable);
-
1802  const ShadowUseStatement statement{lhs, "+=", rhs};
-
1803  const auto& text = process_shadow_update_statement(statement, BlockType::Equation);
-
1804  printer->add_line(text);
-
1805  }
-
1806  }
-
1807 }
-
1808 
-
1809 
-
1810 /// TODO: Edit for NEURON
- -
1812  printer->fmt_line("double I1 = nrn_current_{}({}+0.001);",
-
1813  info.mod_suffix,
-
1814  nrn_current_arguments());
-
1815  for (auto& ion: info.ions) {
-
1816  for (auto& var: ion.writes) {
-
1817  if (ion.is_ionic_current(var)) {
-
1818  const auto& name = get_variable_name(var);
-
1819  printer->fmt_line("double di{} = {};", ion.name, name);
-
1820  }
-
1821  }
-
1822  }
-
1823  printer->fmt_line("double I0 = nrn_current_{}({});", info.mod_suffix, nrn_current_arguments());
-
1824  printer->add_line("double rhs = I0;");
-
1825 
-
1826  printer->add_line("double g = (I1-I0)/0.001;");
-
1827  for (auto& ion: info.ions) {
-
1828  for (auto& var: ion.writes) {
-
1829  if (ion.is_ionic_current(var)) {
-
1830  const auto& lhs = std::string(naming::ION_VARNAME_PREFIX) + "di" + ion.name + "dv";
-
1831  auto rhs = fmt::format("(di{}-{})/0.001", ion.name, get_variable_name(var));
-
1832  if (info.point_process) {
-
1833  auto area = get_variable_name(naming::NODE_AREA_VARIABLE);
-
1834  rhs += fmt::format("*1.e2/{}", area);
-
1835  }
-
1836  const ShadowUseStatement statement{lhs, "+=", rhs};
-
1837  const auto& text = process_shadow_update_statement(statement, BlockType::Equation);
-
1838  printer->add_line(text);
-
1839  }
-
1840  }
-
1841  }
-
1842 }
-
1843 
-
1844 
-
1845 /// TODO: Edit for NEURON
- -
1847  printer->add_line("int node_id = node_data.nodeindices[id];");
-
1848  printer->add_line("double v = node_data.node_voltages[node_id];");
-
1849  printer->add_line("auto* _ppvar = _ml_arg->pdata[id];");
-
1850  const auto& read_statements = ion_read_statements(BlockType::Equation);
-
1851  for (auto& statement: read_statements) {
-
1852  printer->add_line(statement);
-
1853  }
-
1854 
-
1855  if (info.conductances.empty()) {
-
1856  print_nrn_cur_non_conductance_kernel();
-
1857  } else {
-
1858  print_nrn_cur_conductance_kernel(node);
+
1735 
+ +
1737  if (ion_variable_struct_required()) {
+
1738  throw std::runtime_error("Not implemented.");
+
1739  }
+
1740 
+
1741  ParamVector params = {{"", "_nrn_mechanism_cache_range&", "", "_lmc"},
+
1742  {"", "NrnThread*", "", "nt"},
+
1743  {"", "Datum*", "", "_ppvar"},
+
1744  {"", "Datum*", "", "_thread"}};
+
1745 
+
1746  if (info.thread_callback_register) {
+
1747  auto type_name = fmt::format("{}&", thread_variables_struct());
+
1748  params.emplace_back("", type_name, "", "_thread_vars");
+
1749  }
+
1750  params.emplace_back("", "size_t", "", "id");
+
1751  params.emplace_back("", fmt::format("{}&", instance_struct()), "", "inst");
+
1752  params.emplace_back("", fmt::format("{}&", node_data_struct()), "", "node_data");
+
1753  params.emplace_back("", "double", "", "v");
+
1754  return params;
+
1755 }
+
1756 
+
1757 
+
1758 /// TODO: Edit for NEURON
+ +
1760  const auto& args = nrn_current_parameters();
+
1761  const auto& block = node.get_statement_block();
+
1762  printer->add_newline(2);
+
1763  printer->fmt_push_block("inline double nrn_current_{}({})",
+
1764  info.mod_suffix,
+
1765  get_parameter_str(args));
+
1766  printer->add_line("double current = 0.0;");
+
1767  print_statement_block(*block, false, false);
+
1768  for (auto& current: info.currents) {
+
1769  const auto& name = get_variable_name(current);
+
1770  printer->fmt_line("current += {};", name);
+
1771  }
+
1772  printer->add_line("return current;");
+
1773  printer->pop_block();
+
1774 }
+
1775 
+
1776 
+
1777 /// TODO: Edit for NEURON
+ +
1779  const auto& block = node.get_statement_block();
+
1780  print_statement_block(*block, false, false);
+
1781  if (!info.currents.empty()) {
+
1782  std::string sum;
+
1783  for (const auto& current: info.currents) {
+
1784  auto var = breakpoint_current(current);
+
1785  sum += get_variable_name(var);
+
1786  if (&current != &info.currents.back()) {
+
1787  sum += "+";
+
1788  }
+
1789  }
+
1790  printer->fmt_line("double rhs = {};", sum);
+
1791  }
+
1792 
+
1793  std::string sum;
+
1794  for (const auto& conductance: info.conductances) {
+
1795  auto var = breakpoint_current(conductance.variable);
+
1796  sum += get_variable_name(var);
+
1797  if (&conductance != &info.conductances.back()) {
+
1798  sum += "+";
+
1799  }
+
1800  }
+
1801  printer->fmt_line("double g = {};", sum);
+
1802 
+
1803  for (const auto& conductance: info.conductances) {
+
1804  if (!conductance.ion.empty()) {
+
1805  const auto& lhs = std::string(naming::ION_VARNAME_PREFIX) + "di" + conductance.ion +
+
1806  "dv";
+
1807  const auto& rhs = get_variable_name(conductance.variable);
+
1808  const ShadowUseStatement statement{lhs, "+=", rhs};
+
1809  const auto& text = process_shadow_update_statement(statement, BlockType::Equation);
+
1810  printer->add_line(text);
+
1811  }
+
1812  }
+
1813 }
+
1814 
+
1815 
+
1816 /// TODO: Edit for NEURON
+ +
1818  printer->fmt_line("double I1 = nrn_current_{}({}+0.001);",
+
1819  info.mod_suffix,
+
1820  nrn_current_arguments());
+
1821  for (auto& ion: info.ions) {
+
1822  for (auto& var: ion.writes) {
+
1823  if (ion.is_ionic_current(var)) {
+
1824  const auto& name = get_variable_name(var);
+
1825  printer->fmt_line("double di{} = {};", ion.name, name);
+
1826  }
+
1827  }
+
1828  }
+
1829  printer->fmt_line("double I0 = nrn_current_{}({});", info.mod_suffix, nrn_current_arguments());
+
1830  printer->add_line("double rhs = I0;");
+
1831 
+
1832  printer->add_line("double g = (I1-I0)/0.001;");
+
1833  for (auto& ion: info.ions) {
+
1834  for (auto& var: ion.writes) {
+
1835  if (ion.is_ionic_current(var)) {
+
1836  const auto& lhs = std::string(naming::ION_VARNAME_PREFIX) + "di" + ion.name + "dv";
+
1837  auto rhs = fmt::format("(di{}-{})/0.001", ion.name, get_variable_name(var));
+
1838  if (info.point_process) {
+
1839  auto area = get_variable_name(naming::NODE_AREA_VARIABLE);
+
1840  rhs += fmt::format("*1.e2/{}", area);
+
1841  }
+
1842  const ShadowUseStatement statement{lhs, "+=", rhs};
+
1843  const auto& text = process_shadow_update_statement(statement, BlockType::Equation);
+
1844  printer->add_line(text);
+
1845  }
+
1846  }
+
1847  }
+
1848 }
+
1849 
+
1850 
+
1851 /// TODO: Edit for NEURON
+ +
1853  printer->add_line("int node_id = node_data.nodeindices[id];");
+
1854  printer->add_line("double v = node_data.node_voltages[node_id];");
+
1855  printer->add_line("auto* _ppvar = _ml_arg->pdata[id];");
+
1856  const auto& read_statements = ion_read_statements(BlockType::Equation);
+
1857  for (auto& statement: read_statements) {
+
1858  printer->add_line(statement);
1859  }
1860 
-
1861  const auto& write_statements = ion_write_statements(BlockType::Equation);
-
1862  for (auto& statement: write_statements) {
-
1863  auto text = process_shadow_update_statement(statement, BlockType::Equation);
-
1864  printer->add_line(text);
+
1861  if (info.conductances.empty()) {
+
1862  print_nrn_cur_non_conductance_kernel();
+
1863  } else {
+
1864  print_nrn_cur_conductance_kernel(node);
1865  }
1866 
-
1867  if (info.point_process) {
-
1868  const auto& area = get_variable_name(naming::NODE_AREA_VARIABLE);
-
1869  printer->fmt_line("double mfactor = 1.e2/{};", area);
-
1870  printer->add_line("g = g*mfactor;");
-
1871  printer->add_line("rhs = rhs*mfactor;");
-
1872  }
-
1873 
-
1874  // print_g_unused();
-
1875 }
-
1876 
-
1877 
-
1878 /// TODO: Edit for NEURON
- -
1880  return;
+
1867  const auto& write_statements = ion_write_statements(BlockType::Equation);
+
1868  for (auto& statement: write_statements) {
+
1869  auto text = process_shadow_update_statement(statement, BlockType::Equation);
+
1870  printer->add_line(text);
+
1871  }
+
1872 
+
1873  if (info.point_process) {
+
1874  const auto& area = get_variable_name(naming::NODE_AREA_VARIABLE);
+
1875  printer->fmt_line("double mfactor = 1.e2/{};", area);
+
1876  printer->add_line("g = g*mfactor;");
+
1877  printer->add_line("rhs = rhs*mfactor;");
+
1878  }
+
1879 
+
1880  // print_g_unused();
1881 }
1882 
1883 
1884 /// TODO: Edit for NEURON
- -
1886  if (!nrn_cur_required()) {
-
1887  return;
-
1888  }
-
1889 
-
1890  if (info.conductances.empty()) {
-
1891  print_nrn_current(*info.breakpoint_node);
-
1892  }
-
1893 
-
1894  printer->add_newline(2);
-
1895  printer->add_line("/** update current */");
-
1896  print_global_function_common_code(BlockType::Equation);
-
1897  // print_channel_iteration_block_parallel_hint(BlockType::Equation, info.breakpoint_node);
-
1898  printer->push_block("for (int id = 0; id < nodecount; id++)");
-
1899  print_nrn_cur_kernel(*info.breakpoint_node);
-
1900  // print_nrn_cur_matrix_shadow_update();
-
1901  // if (!nrn_cur_reduction_loop_required()) {
-
1902  // print_fast_imem_calculation();
-
1903  // }
-
1904 
-
1905 
-
1906  printer->add_line("node_data.node_rhs[node_id] -= rhs;");
-
1907 
-
1908  if (breakpoint_exist()) {
-
1909  printer->fmt_line("inst.{}[id] = g;",
-
1910  info.vectorize ? naming::CONDUCTANCE_UNUSED_VARIABLE
- -
1912  }
-
1913  printer->pop_block();
-
1914 
-
1915  // if (nrn_cur_reduction_loop_required()) {
-
1916  // printer->push_block("for (int id = 0; id < nodecount; id++)");
-
1917  // print_nrn_cur_matrix_shadow_reduction();
-
1918  // printer->pop_block();
-
1919  // print_fast_imem_calculation();
-
1920  // }
-
1921 
-
1922  // print_kernel_data_present_annotation_block_end();
-
1923  printer->pop_block();
-
1924 }
-
1925 
-
1926 
-
1927 /****************************************************************************************/
-
1928 /* Main code printing entry points */
-
1929 /****************************************************************************************/
-
1930 
- -
1932  print_standard_includes();
-
1933  print_neuron_includes();
-
1934 
-
1935  if (info.thread_callback_register) {
-
1936  printer->add_line("extern void _nrn_thread_reg(int, int, void(*)(Datum*));");
-
1937  }
-
1938 }
-
1939 
+ +
1886  return;
+
1887 }
+
1888 
+
1889 
+
1890 /// TODO: Edit for NEURON
+ +
1892  if (!nrn_cur_required()) {
+
1893  return;
+
1894  }
+
1895 
+
1896  if (info.conductances.empty()) {
+
1897  print_nrn_current(*info.breakpoint_node);
+
1898  }
+
1899 
+
1900  printer->add_newline(2);
+
1901  printer->add_line("/** update current */");
+
1902  print_global_function_common_code(BlockType::Equation);
+
1903  // print_channel_iteration_block_parallel_hint(BlockType::Equation, info.breakpoint_node);
+
1904  printer->push_block("for (int id = 0; id < nodecount; id++)");
+
1905  print_nrn_cur_kernel(*info.breakpoint_node);
+
1906  // print_nrn_cur_matrix_shadow_update();
+
1907  // if (!nrn_cur_reduction_loop_required()) {
+
1908  // print_fast_imem_calculation();
+
1909  // }
+
1910 
+
1911 
+
1912  printer->add_line("node_data.node_rhs[node_id] -= rhs;");
+
1913 
+
1914  if (breakpoint_exist()) {
+
1915  printer->fmt_line("inst.{}[id] = g;",
+
1916  info.vectorize ? naming::CONDUCTANCE_UNUSED_VARIABLE
+ +
1918  }
+
1919  printer->pop_block();
+
1920 
+
1921  // if (nrn_cur_reduction_loop_required()) {
+
1922  // printer->push_block("for (int id = 0; id < nodecount; id++)");
+
1923  // print_nrn_cur_matrix_shadow_reduction();
+
1924  // printer->pop_block();
+
1925  // print_fast_imem_calculation();
+
1926  // }
+
1927 
+
1928  // print_kernel_data_present_annotation_block_end();
+
1929  printer->pop_block();
+
1930 }
+
1931 
+
1932 
+
1933 /****************************************************************************************/
+
1934 /* Main code printing entry points */
+
1935 /****************************************************************************************/
+
1936 
+ +
1938  print_standard_includes();
+
1939  print_neuron_includes();
1940 
- -
1942  print_global_macros();
-
1943  print_mechanism_variables_macros();
-
1944 
-
1945  printer->add_line("extern Node* nrn_alloc_node_;");
-
1946 }
-
1947 
-
1948 
- -
1950  printer->add_newline();
-
1951  printer->add_line("/* NEURON global macro definitions */");
-
1952  if (info.vectorize) {
-
1953  printer->add_multi_line(R"CODE(
-
1954  /* VECTORIZED */
-
1955  #define NRN_VECTORIZED 1
-
1956  )CODE");
-
1957  } else {
-
1958  printer->add_multi_line(R"CODE(
-
1959  /* NOT VECTORIZED */
-
1960  #define NRN_VECTORIZED 0
-
1961  )CODE");
-
1962  }
-
1963 }
-
1964 
-
1965 
- -
1967  printer->add_newline();
-
1968  printer->add_line("static constexpr auto number_of_datum_variables = ",
-
1969  std::to_string(int_variables_size()),
-
1970  ";");
-
1971  printer->add_line("static constexpr auto number_of_floating_point_variables = ",
-
1972  std::to_string(codegen_float_variables.size()),
-
1973  ";");
-
1974  printer->add_newline();
-
1975  printer->add_multi_line(R"CODE(
-
1976  namespace {
-
1977  template <typename T>
-
1978  using _nrn_mechanism_std_vector = std::vector<T>;
-
1979  using _nrn_model_sorted_token = neuron::model_sorted_token;
-
1980  using _nrn_mechanism_cache_range = neuron::cache::MechanismRange<number_of_floating_point_variables, number_of_datum_variables>;
-
1981  using _nrn_mechanism_cache_instance = neuron::cache::MechanismInstance<number_of_floating_point_variables, number_of_datum_variables>;
-
1982  using _nrn_non_owning_id_without_container = neuron::container::non_owning_identifier_without_container;
+
1941  if (info.thread_callback_register) {
+
1942  printer->add_line("extern void _nrn_thread_reg(int, int, void(*)(Datum*));");
+
1943  }
+
1944 }
+
1945 
+
1946 
+ +
1948  print_global_macros();
+
1949  print_mechanism_variables_macros();
+
1950 
+
1951  printer->add_line("extern Node* nrn_alloc_node_;");
+
1952 }
+
1953 
+
1954 
+ +
1956  printer->add_newline();
+
1957  printer->add_line("/* NEURON global macro definitions */");
+
1958  if (info.vectorize) {
+
1959  printer->add_multi_line(R"CODE(
+
1960  /* VECTORIZED */
+
1961  #define NRN_VECTORIZED 1
+
1962  )CODE");
+
1963  } else {
+
1964  printer->add_multi_line(R"CODE(
+
1965  /* NOT VECTORIZED */
+
1966  #define NRN_VECTORIZED 0
+
1967  )CODE");
+
1968  }
+
1969 }
+
1970 
+
1971 
+ +
1973  printer->add_newline();
+
1974  printer->add_line("static constexpr auto number_of_datum_variables = ",
+
1975  std::to_string(int_variables_size()),
+
1976  ";");
+
1977  printer->add_line("static constexpr auto number_of_floating_point_variables = ",
+
1978  std::to_string(codegen_float_variables.size()),
+
1979  ";");
+
1980  printer->add_newline();
+
1981  printer->add_multi_line(R"CODE(
+
1982  namespace {
1983  template <typename T>
-
1984  using _nrn_mechanism_field = neuron::mechanism::field<T>;
-
1985  template <typename... Args>
-
1986  void _nrn_mechanism_register_data_fields(Args&&... args) {
-
1987  neuron::mechanism::register_data_fields(std::forward<Args>(args)...);
-
1988  }
-
1989  } // namespace
-
1990  )CODE");
-
1991 
-
1992  if (info.point_process) {
-
1993  printer->add_line("extern Prop* nrn_point_prop_;");
-
1994  } else {
-
1995  printer->add_line("Prop* hoc_getdata_range(int type);");
-
1996  }
-
1997  /// TODO: More prints here?
-
1998  // for registration of tables
-
1999  if (info.table_count > 0) {
-
2000  printer->add_line("void _nrn_thread_table_reg(int, nrn_thread_table_check_t);");
-
2001  }
-
2002 }
-
2003 
-
2004 
- -
2006  print_namespace_start();
-
2007 }
-
2008 
+
1984  using _nrn_mechanism_std_vector = std::vector<T>;
+
1985  using _nrn_model_sorted_token = neuron::model_sorted_token;
+
1986  using _nrn_mechanism_cache_range = neuron::cache::MechanismRange<number_of_floating_point_variables, number_of_datum_variables>;
+
1987  using _nrn_mechanism_cache_instance = neuron::cache::MechanismInstance<number_of_floating_point_variables, number_of_datum_variables>;
+
1988  using _nrn_non_owning_id_without_container = neuron::container::non_owning_identifier_without_container;
+
1989  template <typename T>
+
1990  using _nrn_mechanism_field = neuron::mechanism::field<T>;
+
1991  template <typename... Args>
+
1992  void _nrn_mechanism_register_data_fields(Args&&... args) {
+
1993  neuron::mechanism::register_data_fields(std::forward<Args>(args)...);
+
1994  }
+
1995  } // namespace
+
1996  )CODE");
+
1997 
+
1998  if (info.point_process) {
+
1999  printer->add_line("extern Prop* nrn_point_prop_;");
+
2000  } else {
+
2001  printer->add_line("Prop* hoc_getdata_range(int type);");
+
2002  }
+
2003  /// TODO: More prints here?
+
2004  // for registration of tables
+
2005  if (info.table_count > 0) {
+
2006  printer->add_line("void _nrn_thread_table_reg(int, nrn_thread_table_check_t);");
+
2007  }
+
2008 }
2009 
- -
2011  print_namespace_stop();
-
2012 }
-
2013 
+
2010 
+ +
2012  print_namespace_start();
+
2013 }
2014 
-
2015 void CodegenNeuronCppVisitor::print_data_structures(bool print_initializers) {
-
2016  print_mechanism_global_var_structure(print_initializers);
-
2017  print_mechanism_range_var_structure(print_initializers);
-
2018  print_node_data_structure(print_initializers);
-
2019  print_thread_variables_structure(print_initializers);
-
2020  print_make_instance();
-
2021  print_make_node_data();
-
2022 }
-
2023 
-
2024 
- -
2026  if (!info.vectorize) {
-
2027  return;
-
2028  }
-
2029  printer->add_multi_line(R"CODE(
-
2030  #if NRN_PRCELLSTATE
-
2031  inst->v_unused[id] = v;
-
2032  #endif
-
2033  )CODE");
-
2034 }
-
2035 
-
2036 
- -
2038  printer->add_multi_line(R"CODE(
-
2039  #if NRN_PRCELLSTATE
-
2040  inst->g_unused[id] = g;
-
2041  #endif
-
2042  )CODE");
-
2043 }
-
2044 
-
2045 
-
2046 /// TODO: Edit for NEURON
- -
2048  print_hoc_py_wrapper_function_definitions();
-
2049  for (const auto& procedure: info.procedures) {
-
2050  print_procedure(*procedure);
-
2051  }
-
2052  for (const auto& function: info.functions) {
-
2053  print_function(*function);
-
2054  }
-
2055  print_nrn_init();
-
2056  print_nrn_cur();
-
2057  print_nrn_state();
-
2058  print_nrn_jacob();
-
2059  print_net_receive();
-
2060 }
-
2061 
-
2062 
-
2063 /// TODO: Edit for NEURON
- -
2065  print_backend_info();
-
2066  print_headers_include();
-
2067  print_macro_definitions();
-
2068  print_neuron_global_variable_declarations();
-
2069  print_namespace_begin();
-
2070  print_nmodl_constants();
-
2071  print_prcellstate_macros();
-
2072  print_mechanism_info();
-
2073  print_data_structures(true);
-
2074  print_nrn_alloc();
-
2075  print_function_prototypes();
-
2076  print_functors_definitions();
-
2077  print_global_variables_for_hoc();
-
2078  print_thread_memory_callbacks();
-
2079  print_compute_functions(); // only nrn_cur and nrn_state
-
2080  print_sdlists_init(true);
-
2081  print_mechanism_register();
-
2082  print_namespace_end();
-
2083 }
-
2084 
- -
2086  throw std::runtime_error("Not implemented.");
-
2087 }
-
2088 
-
2089 
- -
2091  auto const& arguments = node.get_arguments();
-
2092 
-
2093  if (printing_net_init) {
-
2094  throw std::runtime_error("Not implemented. [jfiwoei]");
-
2095  }
-
2096 
-
2097  std::string weight_pointer = "nullptr";
-
2098  auto point_process = get_variable_name(naming::POINT_PROCESS_VARIABLE,
-
2099  /* use_instance */ false);
-
2100  if (!printing_net_receive) {
-
2101  point_process += ".get<Point_process*>()";
-
2102  }
-
2103  const auto& tqitem = get_variable_name("tqitem", /* use_instance */ false);
-
2104 
-
2105  printer->fmt_text("net_send(/* tqitem */ &{}, {}, {}, {} + ",
-
2106  tqitem,
-
2107  weight_pointer,
-
2108  point_process,
-
2109  get_variable_name("t"));
-
2110  print_vector_elements(arguments, ", ");
-
2111  printer->add_text(')');
-
2112 }
-
2113 
- -
2115  const auto& point_process = get_variable_name("point_process", /* use_instance */ false);
-
2116  const auto& tqitem = get_variable_name("tqitem", /* use_instance */ false);
-
2117 
-
2118  printer->fmt_text("net_move(/* tqitem */ &{}, {}, ", tqitem, point_process);
+
2015 
+ +
2017  print_namespace_stop();
+
2018 }
+
2019 
+
2020 
+
2021 void CodegenNeuronCppVisitor::print_data_structures(bool print_initializers) {
+
2022  print_mechanism_global_var_structure(print_initializers);
+
2023  print_mechanism_range_var_structure(print_initializers);
+
2024  print_node_data_structure(print_initializers);
+
2025  print_thread_variables_structure(print_initializers);
+
2026  print_make_instance();
+
2027  print_make_node_data();
+
2028 }
+
2029 
+
2030 
+ +
2032  if (!info.vectorize) {
+
2033  return;
+
2034  }
+
2035  printer->add_multi_line(R"CODE(
+
2036  #if NRN_PRCELLSTATE
+
2037  inst->v_unused[id] = v;
+
2038  #endif
+
2039  )CODE");
+
2040 }
+
2041 
+
2042 
+ +
2044  printer->add_multi_line(R"CODE(
+
2045  #if NRN_PRCELLSTATE
+
2046  inst->g_unused[id] = g;
+
2047  #endif
+
2048  )CODE");
+
2049 }
+
2050 
+
2051 
+
2052 /// TODO: Edit for NEURON
+ +
2054  print_hoc_py_wrapper_function_definitions();
+
2055  for (const auto& procedure: info.procedures) {
+
2056  print_procedure(*procedure);
+
2057  }
+
2058  for (const auto& function: info.functions) {
+
2059  print_function(*function);
+
2060  }
+
2061  print_nrn_init();
+
2062  print_nrn_cur();
+
2063  print_nrn_state();
+
2064  print_nrn_jacob();
+
2065  print_net_receive();
+
2066 }
+
2067 
+
2068 
+
2069 /// TODO: Edit for NEURON
+ +
2071  print_backend_info();
+
2072  print_headers_include();
+
2073  print_macro_definitions();
+
2074  print_neuron_global_variable_declarations();
+
2075  print_namespace_begin();
+
2076  print_nmodl_constants();
+
2077  print_prcellstate_macros();
+
2078  print_mechanism_info();
+
2079  print_data_structures(true);
+
2080  print_nrn_alloc();
+
2081  print_function_prototypes();
+
2082  print_functors_definitions();
+
2083  print_global_variables_for_hoc();
+
2084  print_thread_memory_callbacks();
+
2085  print_compute_functions(); // only nrn_cur and nrn_state
+
2086  print_sdlists_init(true);
+
2087  print_mechanism_register();
+
2088  print_namespace_end();
+
2089 }
+
2090 
+ +
2092  throw std::runtime_error("Not implemented.");
+
2093 }
+
2094 
+
2095 
+ +
2097  auto const& arguments = node.get_arguments();
+
2098 
+
2099  if (printing_net_init) {
+
2100  throw std::runtime_error("Not implemented. [jfiwoei]");
+
2101  }
+
2102 
+
2103  std::string weight_pointer = "nullptr";
+
2104  auto point_process = get_variable_name(naming::POINT_PROCESS_VARIABLE,
+
2105  /* use_instance */ false);
+
2106  if (!printing_net_receive) {
+
2107  point_process += ".get<Point_process*>()";
+
2108  }
+
2109  const auto& tqitem = get_variable_name("tqitem", /* use_instance */ false);
+
2110 
+
2111  printer->fmt_text("net_send(/* tqitem */ &{}, {}, {}, {} + ",
+
2112  tqitem,
+
2113  weight_pointer,
+
2114  point_process,
+
2115  get_variable_name("t"));
+
2116  print_vector_elements(arguments, ", ");
+
2117  printer->add_text(')');
+
2118 }
2119 
-
2120  print_vector_elements(node.get_arguments(), ", ");
-
2121  printer->add_text(')');
-
2122 }
+ +
2121  const auto& point_process = get_variable_name("point_process", /* use_instance */ false);
+
2122  const auto& tqitem = get_variable_name("tqitem", /* use_instance */ false);
2123 
- -
2125  const auto& point_process = get_variable_name(naming::POINT_PROCESS_VARIABLE,
-
2126  /* use_instance */ false);
-
2127  printer->fmt_text("net_event({}, t)", point_process);
+
2124  printer->fmt_text("net_move(/* tqitem */ &{}, {}, ", tqitem, point_process);
+
2125 
+
2126  print_vector_elements(node.get_arguments(), ", ");
+
2127  printer->add_text(')');
2128 }
-
2129 
-
2130 /**
-
2131  * Rename arguments to NET_RECEIVE block with corresponding pointer variable
-
2132  *
-
2133  * \code{.mod}
-
2134  * NET_RECEIVE (weight, R){
-
2135  * x = R
-
2136  * }
-
2137  * \endcode
+
2129 
+ +
2131  const auto& point_process = get_variable_name(naming::POINT_PROCESS_VARIABLE,
+
2132  /* use_instance */ false);
+
2133  printer->fmt_text("net_event({}, t)", point_process);
+
2134 }
+
2135 
+
2136 /**
+
2137  * Rename arguments to NET_RECEIVE block with corresponding pointer variable
2138  *
-
2139  * then generated code should be:
-
2140  *
-
2141  * \code{.cpp}
-
2142  * x[id] = _args[1];
+
2139  * \code{.mod}
+
2140  * NET_RECEIVE (weight, R){
+
2141  * x = R
+
2142  * }
2143  * \endcode
2144  *
-
2145  * So, the `R` in AST needs to be renamed with `_args[1]`.
-
2146  */
-
2147 static void rename_net_receive_arguments(const ast::NetReceiveBlock& net_receive_node,
-
2148  const ast::Node& node) {
-
2149  const auto& parameters = net_receive_node.get_parameters();
-
2150 
-
2151  auto n_parameters = parameters.size();
-
2152  for (size_t i = 0; i < n_parameters; ++i) {
-
2153  const auto& name = parameters[i]->get_node_name();
-
2154  auto var_used = VarUsageVisitor().variable_used(node, name);
-
2155  if (var_used) {
-
2156  RenameVisitor vr(name, fmt::format("_args[{}]", i));
-
2157  node.get_statement_block()->visit_children(vr);
-
2158  }
-
2159  }
-
2160 }
-
2161 
- -
2163  printing_net_receive = true;
-
2164  auto node = info.net_receive_node;
-
2165  if (!node) {
-
2166  return;
-
2167  }
-
2168 
-
2169  ParamVector args = {{"", "Point_process*", "", "_pnt"},
-
2170  {"", "double*", "", "_args"},
-
2171  {"", "double", "", "flag"}};
-
2172 
-
2173  printer->fmt_push_block("static void nrn_net_receive_{}({})",
-
2174  info.mod_suffix,
-
2175  get_parameter_str(args));
-
2176 
-
2177  rename_net_receive_arguments(*node, *node);
+
2145  * then generated code should be:
+
2146  *
+
2147  * \code{.cpp}
+
2148  * x[id] = _args[1];
+
2149  * \endcode
+
2150  *
+
2151  * So, the `R` in AST needs to be renamed with `_args[1]`.
+
2152  */
+
2153 static void rename_net_receive_arguments(const ast::NetReceiveBlock& net_receive_node,
+
2154  const ast::Node& node) {
+
2155  const auto& parameters = net_receive_node.get_parameters();
+
2156 
+
2157  auto n_parameters = parameters.size();
+
2158  for (size_t i = 0; i < n_parameters; ++i) {
+
2159  const auto& name = parameters[i]->get_node_name();
+
2160  auto var_used = VarUsageVisitor().variable_used(node, name);
+
2161  if (var_used) {
+
2162  RenameVisitor vr(name, fmt::format("_args[{}]", i));
+
2163  node.get_statement_block()->visit_children(vr);
+
2164  }
+
2165  }
+
2166 }
+
2167 
+ +
2169  printing_net_receive = true;
+
2170  auto node = info.net_receive_node;
+
2171  if (!node) {
+
2172  return;
+
2173  }
+
2174 
+
2175  ParamVector args = {{"", "Point_process*", "", "_pnt"},
+
2176  {"", "double*", "", "_args"},
+
2177  {"", "double", "", "flag"}};
2178 
-
2179  printer->add_line("_nrn_mechanism_cache_instance _lmc{_pnt->prop};");
-
2180  printer->add_line("auto * nt = static_cast<NrnThread*>(_pnt->_vnt);");
-
2181  printer->add_line("auto * _ppvar = _nrn_mechanism_access_dparam(_pnt->prop);");
+
2179  printer->fmt_push_block("static void nrn_net_receive_{}({})",
+
2180  info.mod_suffix,
+
2181  get_parameter_str(args));
2182 
-
2183  printer->fmt_line("auto inst = make_instance_{}(_lmc);", info.mod_suffix);
-
2184  printer->fmt_line("// nocmodl has a nullptr dereference for thread variables.");
-
2185  printer->fmt_line("// NMODL will fail to compile at a later point, because of");
-
2186  printer->fmt_line("// missing '_thread_vars'.");
-
2187  printer->fmt_line("Datum * _thread = nullptr;");
+
2183  rename_net_receive_arguments(*node, *node);
+
2184 
+
2185  printer->add_line("_nrn_mechanism_cache_instance _lmc{_pnt->prop};");
+
2186  printer->add_line("auto * nt = static_cast<NrnThread*>(_pnt->_vnt);");
+
2187  printer->add_line("auto * _ppvar = _nrn_mechanism_access_dparam(_pnt->prop);");
2188 
-
2189  printer->add_line("size_t id = 0;");
-
2190  printer->add_line("double t = nt->_t;");
-
2191 
-
2192  print_statement_block(*node->get_statement_block(), false, false);
-
2193 
-
2194  printer->add_newline();
-
2195  printer->pop_block();
-
2196  printing_net_receive = false;
-
2197 }
-
2198 
+
2189  printer->fmt_line("auto inst = make_instance_{}(_lmc);", info.mod_suffix);
+
2190  printer->fmt_line("// nocmodl has a nullptr dereference for thread variables.");
+
2191  printer->fmt_line("// NMODL will fail to compile at a later point, because of");
+
2192  printer->fmt_line("// missing '_thread_vars'.");
+
2193  printer->fmt_line("Datum * _thread = nullptr;");
+
2194 
+
2195  printer->add_line("size_t id = 0;");
+
2196  printer->add_line("double t = nt->_t;");
+
2197 
+
2198  print_statement_block(*node->get_statement_block(), false, false);
2199 
-
2200 /****************************************************************************************/
-
2201 /* Overloaded visitor routines */
-
2202 /****************************************************************************************/
-
2203 
-
2204 /// TODO: Edit for NEURON
- -
2206  return;
-
2207 }
-
2208 
-
2209 
-
2210 } // namespace codegen
-
2211 } // namespace nmodl
+
2200  printer->add_newline();
+
2201  printer->pop_block();
+
2202  printing_net_receive = false;
+
2203 }
+
2204 
+
2205 
+
2206 /****************************************************************************************/
+
2207 /* Overloaded visitor routines */
+
2208 /****************************************************************************************/
+
2209 
+
2210 /// TODO: Edit for NEURON
+ +
2212  return;
+
2213 }
+
2214 
+
2215 
+
2216 } // namespace codegen
+
2217 } // namespace nmodl
-
void print_nrn_destructor() override
Print nrn_destructor function definition.
+
void print_nrn_destructor() override
Print nrn_destructor function definition.
Base class for all AST node.
Definition: node.hpp:40
bool is_index
if this is pure index (e.g.
-
void print_nrn_cur_non_conductance_kernel() override
Print the nrn_cur kernel without NMODL conductance keyword provisions.
+
void print_nrn_cur_non_conductance_kernel() override
Print the nrn_cur kernel without NMODL conductance keyword provisions.
std::string py_function_signature(const std::string &function_or_procedure_name) const
Get the signature of the npy <func_or_proc_name> function.
Helper to represent information about index/int variables.
-
void print_nrn_cur() override
Print nrn_cur / current update function definition.
-
void print_macro_definitions()
Print all NEURON macros.
+
void print_nrn_cur() override
Print nrn_cur / current update function definition.
+
void print_macro_definitions()
Print all NEURON macros.
-
void print_net_event_call(const ast::FunctionCall &node) override
Print call to net_event.
+
void print_net_event_call(const ast::FunctionCall &node) override
Print call to net_event.
static constexpr char POINT_PROCESS_VARIABLE[]
inbuilt neuron variable for point process
void print_neuron_includes()
Print includes from NEURON.
static constexpr char NRN_JACOB_METHOD[]
nrn_jacob method in generated code
-
void print_nrn_init(bool skip_init_check=true)
Print the nrn_init function definition.
+
void print_nrn_init(bool skip_init_check=true)
Print the nrn_init function definition.
void print_hoc_py_wrapper_function_body(const ast::Block *function_or_procedure_block, InterpreterWrapper wrapper_type)
std::string internal_method_arguments() override
Arguments for functions that are defined and used internally.
std::shared_ptr< symtab::Symbol > SymbolType
-
void print_nrn_alloc() override
Print nrn_alloc function definition.
+
void print_nrn_alloc() override
Print nrn_alloc function definition.
static constexpr char VOLTAGE_UNUSED_VARIABLE[]
range variable for voltage when unused (for vectorized model)
std::string register_mechanism_arguments() const override
Arguments for register_mech or point_register_mech function.
int position_of_int_var(const std::string &name) const override
Determine the position in the data array for a given int variable.
const ArgumentVector & get_parameters() const noexcept override
Getter for member variable NetReceiveBlock::parameters.
- +
std::string table_thread_function_name() const
Name of the threaded table checking function.
bool optimize_ion_variable_copies() const override
Check if ion variable copies should be avoided.
std::string hoc_function_name(const std::string &function_or_procedure_name) const
All functions and procedures need a hoc <func_or_proc_name> to be available to the HOC interpreter.
@@ -2342,30 +2348,30 @@
Visitor for printing C++ code compatible with legacy api of NEURON
std::string backend_name() const override
Name of the code generation backend.
std::string process_verbatim_text(std::string const &text) override
Process a verbatim block for possible variable renaming.
- +
static constexpr char NTHREAD_DT_VARIABLE[]
dt variable in neuron thread structure
-
void print_g_unused() const override
Set g_unused (conductance) for NRN_PRCELLSTATE feature.
-
void visit_watch_statement(const ast::WatchStatement &node) override
TODO: Edit for NEURON.
+
void print_g_unused() const override
Set g_unused (conductance) for NRN_PRCELLSTATE feature.
+
void visit_watch_statement(const ast::WatchStatement &node) override
TODO: Edit for NEURON.
virtual bool is_procedure_block() const noexcept
Check if the ast node is an instance of ast::ProcedureBlock.
Definition: ast.cpp:144
-
void print_net_send_call(const ast::FunctionCall &node) override
Print call to net_send.
+
void print_net_send_call(const ast::FunctionCall &node) override
Print call to net_send.
Check if variable is used in given block.
Implement string manipulation functions.
-
void print_namespace_end() override
Print end of namespaces.
-
void print_net_move_call(const ast::FunctionCall &node) override
Print call to net_move.
+
void print_namespace_end() override
Print end of namespaces.
+
void print_net_move_call(const ast::FunctionCall &node) override
Print call to net_move.
std::string thread_variable_name(const ThreadVariableInfo &var_info, bool use_instance=true) const
Determine the C++ string to print for thread variables.
static constexpr char NODE_AREA_VARIABLE[]
inbuilt neuron variable for area of the compartment
-
void print_nrn_state() override
Print nrn_state / state update function definition.
+
void print_nrn_state() override
Print nrn_state / state update function definition.
virtual bool is_function_block() const noexcept
Check if the ast node is an instance of ast::FunctionBlock.
Definition: ast.cpp:142
static constexpr char NRN_ALLOC_METHOD[]
nrn_alloc method in generated code
-
void print_initial_block(const ast::InitialBlock *node)
Print the initial block.
+
void print_initial_block(const ast::InitialBlock *node)
Print the initial block.
bool is_integer
if this is an integer (e.g.
-
void print_global_function_common_code(BlockType type, const std::string &function_name="") override
Print common code for global functions like nrn_init, nrn_cur and nrn_state.
+
void print_global_function_common_code(BlockType type, const std::string &function_name="") override
Print common code for global functions like nrn_init, nrn_cur and nrn_state.
std::string float_variable_name(const SymbolType &symbol, bool use_instance) const override
Determine the name of a float variable given its symbol.
void print_function(const ast::FunctionBlock &node) override
Print NMODL function in target backend code.
std::shared_ptr< StatementBlock > get_statement_block() const noexcept override
Getter for member variable BreakpointBlock::statement_block.
-
void print_v_unused() const override
Set v_unused (voltage) for NRN_PRCELLSTATE feature.
- +
void print_v_unused() const override
Set v_unused (voltage) for NRN_PRCELLSTATE feature.
+
static constexpr char CONDUCTANCE_VARIABLE[]
range variable for conductance
ParamVector functor_params() override
The parameters of the Newton solver "functor".
Visitor for printing C++ code compatible with legacy api of CoreNEURON
@@ -2378,69 +2384,69 @@
@ Equation
breakpoint block
static constexpr char USE_TABLE_VARIABLE[]
global variable to indicate if table is used
Represent WATCH statement in NMODL.
-
void print_neuron_global_variable_declarations()
Print extern declarations for neuron global variables.
+
void print_neuron_global_variable_declarations()
Print extern declarations for neuron global variables.
Represents a BREAKPOINT block in NMODL.
-
void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node) override
Print the nrn_cur kernel with NMODL conductance keyword provisions.
+
void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node) override
Print the nrn_cur kernel with NMODL conductance keyword provisions.
std::string int_variable_name(const IndexVariableInfo &symbol, const std::string &name, bool use_instance) const override
Determine the name of an int variable given its symbol.
InterpreterWrapper
Enum to switch between HOC and Python wrappers for functions and procedures defined in mechanisms.
-
void print_namespace_begin() override
Print start of namespaces.
+
void print_namespace_begin() override
Print start of namespaces.
-
void print_global_variables_for_hoc() override
Print byte arrays that register scalar and vector variables for hoc interface.
+
void print_global_variables_for_hoc() override
Print byte arrays that register scalar and vector variables for hoc interface.
void print_standard_includes() override
Print standard C/C++ includes.
-
void print_mechanism_range_var_structure(bool print_initializers) override
Print the structure that wraps all range and int variables required for the NMODL.
+
void print_mechanism_range_var_structure(bool print_initializers) override
Print the structure that wraps all range and int variables required for the NMODL.
void print_procedure(const ast::ProcedureBlock &node) override
Print NMODL procedure in target backend code.
void add_variable_tqitem(std::vector< IndexVariableInfo > &variables) override
Add the variable tqitem during get_int_variables.
std::string hoc_function_signature(const std::string &function_or_procedure_name) const
Get the signature of the hoc <func_or_proc_name> function.
void print_namespace_start() override
Prints the start of the neuron namespace.
-
void print_thread_variables_structure(bool print_initializers)
Print the data structure used to access thread variables.
+
void print_thread_variables_structure(bool print_initializers)
Print the data structure used to access thread variables.
std::string to_string(const T &obj)
-
void print_compute_functions() override
Print all compute functions for every backend.
+
void print_compute_functions() override
Print all compute functions for every backend.
static constexpr char NRN_INIT_METHOD[]
nrn_init method in generated code
const ExpressionVector & get_arguments() const noexcept
Getter for member variable FunctionCall::arguments.
-
void print_thread_memory_callbacks()
Print thread variable (de-)initialization functions.
+
void print_thread_memory_callbacks()
Print thread variable (de-)initialization functions.
static void rename_net_receive_arguments(const ast::NetReceiveBlock &net_receive_node, const ast::Node &node)
Rename arguments to NET_RECEIVE block with corresponding pointer variable.
-
void print_nrn_cur_kernel(const ast::BreakpointBlock &node) override
Print main body of nrn_cur function.
+
void print_nrn_cur_kernel(const ast::BreakpointBlock &node) override
Print main body of nrn_cur function.
Blindly rename given variable to new name
static constexpr char NRN_CUR_METHOD[]
nrn_cur method in generated code
std::string conc_write_statement(const std::string &ion_name, const std::string &concentration, int index) override
Generate Function call statement for nrn_wrote_conc.
-
void print_mechanism_register() override
Print the mechanism registration function.
+
void print_mechanism_register() override
Print the mechanism registration function.
Implement utility functions for codegen visitors.
static constexpr char TQITEM_VARIABLE[]
inbuilt neuron variable for tqitem process
-
void print_nrn_jacob()
Print nrn_jacob function definition.
+
void print_nrn_jacob()
Print nrn_jacob function definition.
-
void print_fast_imem_calculation() override
Print fast membrane current calculation code.
-
void print_data_structures(bool print_initializers) override
Print all classes.
+
void print_fast_imem_calculation() override
Print fast membrane current calculation code.
+
void print_data_structures(bool print_initializers) override
Print all classes.
std::string get_node_name() const override
Return name of the node.
Definition: ast.cpp:3963
void print_sdlists_init(bool print_initializers) override
const std::string external_method_arguments() noexcept override
Arguments for external functions called from generated code.
std::string py_function_name(const std::string &function_or_procedure_name) const
In non POINT_PROCESS mechanisms all functions and procedures need a py <func_or_proc_name> to be avai...
size_t offset
The global variables ahead of this one require offset doubles to store.
-
void print_node_data_structure(bool print_initializers)
Print the structure that wraps all node variables required for the NMODL.
+
void print_node_data_structure(bool print_initializers)
Print the structure that wraps all node variables required for the NMODL.
static constexpr char INST_GLOBAL_MEMBER[]
instance struct member pointing to the global variable structure
-
void print_make_instance() const
Print make_*_instance.
+
void print_make_instance() const
Print make_*_instance.
void print_atomic_reduction_pragma() override
Print atomic update pragma for reduction statements.
NmodlType
NMODL variable properties.
void print_namespace_stop() override
Prints the end of the neuron namespace.
void print_setdata_functions()
Print NEURON functions related to setting global variables of the mechanism.
Represents ion write statement during code generation.
-
void print_mechanism_variables_macros()
Print mechanism variables' related macros.
-
void print_nrn_constructor() override
Print nrn_constructor function definition.
+
void print_mechanism_variables_macros()
Print mechanism variables' related macros.
+
void print_nrn_constructor() override
Print nrn_constructor function definition.
void print_check_table_function_prototypes()
Print all check_* function declarations.
std::shared_ptr< StatementBlock > get_statement_block() const noexcept override
Getter for member variable FunctionBlock::statement_block.
BlockType
Helper to represent various block types.
-
void print_headers_include() override
Print all includes.
+
void print_headers_include() override
Print all includes.
const ParamVector external_method_parameters(bool table=false) noexcept override
Parameters for functions in generated code that are called back from external code.
void print_function_or_procedure(const ast::Block &node, const std::string &name, const std::unordered_set< CppObjectSpecifier > &specifiers={ CppObjectSpecifier::Inline}) override
Print nmodl function or procedure (common code)
static constexpr char NRN_STATE_METHOD[]
nrn_state method in generated code
const std::shared_ptr< symtab::Symbol > symbol
Version information and units file path.
-
void print_nrn_current(const ast::BreakpointBlock &node) override
Print the nrn_current kernel.
+
void print_nrn_current(const ast::BreakpointBlock &node) override
Print the nrn_current kernel.
int position_of_float_var(const std::string &name) const override
Determine the position in the data array for a given float variable.
std::string get_variable_name(const std::string &name, bool use_instance=true) const override
Determine variable name in the structure of mechanism properties.
static constexpr char AREA_VARIABLE[]
similar to node_area but user can explicitly declare it as area
-
void print_make_node_data() const
Print make_*_node_data.
+
void print_make_node_data() const
Print make_*_node_data.
virtual std::shared_ptr< StatementBlock > get_statement_block() const
Return associated statement block for the AST node.
Definition: ast.cpp:32
std::string simulator_name() override
Name of the simulator the code was generated for.
void print_function_procedure_helper(const ast::Block &node) override
Common helper function to help printing function or procedure blocks.
@@ -2455,16 +2461,16 @@
std::string nrn_thread_arguments() const override
Arguments for "_threadargs_" macro in neuron implementation.
static constexpr char CONDUCTANCE_UNUSED_VARIABLE[]
range variable when conductance is not used (for vectorized model)
-
void print_codegen_routines() override
Print entry point to code generation.
+
void print_codegen_routines() override
Print entry point to code generation.
static constexpr char NRN_POINTERINDEX[]
hoc_nrnpointerindex name
ParamVector internal_method_parameters() override
Parameters for internally defined functions.
virtual std::string get_node_name() const
Return name of of the node.
Definition: ast.cpp:28
Auto generated AST classes declaration.
-
void print_net_receive()
Print net_receive call-back.
+
void print_net_receive()
Print net_receive call-back.
void print_function_prototypes() override
Print function and procedures prototype declaration.
-
void print_mechanism_global_var_structure(bool print_initializers) override
Print the structure that wraps all global variables used in the NMODL.
-
void print_global_macros()
Print NEURON global variable macros.
+
void print_mechanism_global_var_structure(bool print_initializers) override
Print the structure that wraps all global variables used in the NMODL.
+
void print_global_macros()
Print NEURON global variable macros.
std::vector< std::tuple< std::string, std::string, std::string, std::string > > ParamVector
A vector of parameters represented by a 4-tuple of strings:
static constexpr char ION_VARNAME_PREFIX[]
prefix for ion variable
diff --git a/notebooks/nmodl-kinetic-schemes.ipynb b/notebooks/nmodl-kinetic-schemes.ipynb index 9423ac0c3..cad158aba 100644 --- a/notebooks/nmodl-kinetic-schemes.ipynb +++ b/notebooks/nmodl-kinetic-schemes.ipynb @@ -152,10 +152,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:11.343181Z", - "iopub.status.busy": "2024-07-08T14:19:11.342948Z", - "iopub.status.idle": "2024-07-08T14:19:12.142002Z", - "shell.execute_reply": "2024-07-08T14:19:12.141214Z" + "iopub.execute_input": "2024-07-09T13:27:18.879666Z", + "iopub.status.busy": "2024-07-09T13:27:18.879113Z", + "iopub.status.idle": "2024-07-09T13:27:19.619276Z", + "shell.execute_reply": "2024-07-09T13:27:19.618410Z" } }, "outputs": [], @@ -169,10 +169,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:12.145153Z", - "iopub.status.busy": "2024-07-08T14:19:12.144926Z", - "iopub.status.idle": "2024-07-08T14:19:12.173471Z", - "shell.execute_reply": "2024-07-08T14:19:12.172816Z" + "iopub.execute_input": "2024-07-09T13:27:19.622702Z", + "iopub.status.busy": "2024-07-09T13:27:19.622278Z", + "iopub.status.idle": "2024-07-09T13:27:19.648873Z", + "shell.execute_reply": "2024-07-09T13:27:19.648278Z" } }, "outputs": [], @@ -277,10 +277,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:12.176565Z", - "iopub.status.busy": "2024-07-08T14:19:12.176282Z", - "iopub.status.idle": "2024-07-08T14:19:12.181063Z", - "shell.execute_reply": "2024-07-08T14:19:12.180392Z" + "iopub.execute_input": "2024-07-09T13:27:19.651570Z", + "iopub.status.busy": "2024-07-09T13:27:19.651308Z", + "iopub.status.idle": "2024-07-09T13:27:19.655905Z", + "shell.execute_reply": "2024-07-09T13:27:19.655225Z" } }, "outputs": [ @@ -323,10 +323,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:12.212484Z", - "iopub.status.busy": "2024-07-08T14:19:12.212210Z", - "iopub.status.idle": "2024-07-08T14:19:12.217225Z", - "shell.execute_reply": "2024-07-08T14:19:12.216517Z" + "iopub.execute_input": "2024-07-09T13:27:19.684875Z", + "iopub.status.busy": "2024-07-09T13:27:19.684393Z", + "iopub.status.idle": "2024-07-09T13:27:19.688190Z", + "shell.execute_reply": "2024-07-09T13:27:19.687532Z" } }, "outputs": [ @@ -367,10 +367,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:12.219699Z", - "iopub.status.busy": "2024-07-08T14:19:12.219477Z", - "iopub.status.idle": "2024-07-08T14:19:12.223731Z", - "shell.execute_reply": "2024-07-08T14:19:12.223002Z" + "iopub.execute_input": "2024-07-09T13:27:19.690618Z", + "iopub.status.busy": "2024-07-09T13:27:19.690173Z", + "iopub.status.idle": "2024-07-09T13:27:19.693903Z", + "shell.execute_reply": "2024-07-09T13:27:19.693249Z" }, "scrolled": true }, @@ -412,10 +412,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:12.226274Z", - "iopub.status.busy": "2024-07-08T14:19:12.226063Z", - "iopub.status.idle": "2024-07-08T14:19:12.230139Z", - "shell.execute_reply": "2024-07-08T14:19:12.229453Z" + "iopub.execute_input": "2024-07-09T13:27:19.696347Z", + "iopub.status.busy": "2024-07-09T13:27:19.695905Z", + "iopub.status.idle": "2024-07-09T13:27:19.699730Z", + "shell.execute_reply": "2024-07-09T13:27:19.699051Z" }, "scrolled": true }, @@ -459,10 +459,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:12.233438Z", - "iopub.status.busy": "2024-07-08T14:19:12.232862Z", - "iopub.status.idle": "2024-07-08T14:19:12.238022Z", - "shell.execute_reply": "2024-07-08T14:19:12.237325Z" + "iopub.execute_input": "2024-07-09T13:27:19.702048Z", + "iopub.status.busy": "2024-07-09T13:27:19.701710Z", + "iopub.status.idle": "2024-07-09T13:27:19.706028Z", + "shell.execute_reply": "2024-07-09T13:27:19.705375Z" } }, "outputs": [ diff --git a/notebooks/nmodl-python-tutorial.ipynb b/notebooks/nmodl-python-tutorial.ipynb index 6bbe2e92e..29a8f495a 100644 --- a/notebooks/nmodl-python-tutorial.ipynb +++ b/notebooks/nmodl-python-tutorial.ipynb @@ -30,10 +30,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:17.773745Z", - "iopub.status.busy": "2024-07-08T14:19:17.773508Z", - "iopub.status.idle": "2024-07-08T14:19:18.583317Z", - "shell.execute_reply": "2024-07-08T14:19:18.582499Z" + "iopub.execute_input": "2024-07-09T13:27:24.565006Z", + "iopub.status.busy": "2024-07-09T13:27:24.564810Z", + "iopub.status.idle": "2024-07-09T13:27:25.307028Z", + "shell.execute_reply": "2024-07-09T13:27:25.306162Z" } }, "outputs": [], @@ -63,10 +63,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.586574Z", - "iopub.status.busy": "2024-07-08T14:19:18.586304Z", - "iopub.status.idle": "2024-07-08T14:19:18.613678Z", - "shell.execute_reply": "2024-07-08T14:19:18.612926Z" + "iopub.execute_input": "2024-07-09T13:27:25.310263Z", + "iopub.status.busy": "2024-07-09T13:27:25.310058Z", + "iopub.status.idle": "2024-07-09T13:27:25.334976Z", + "shell.execute_reply": "2024-07-09T13:27:25.334393Z" } }, "outputs": [], @@ -86,10 +86,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.616835Z", - "iopub.status.busy": "2024-07-08T14:19:18.616603Z", - "iopub.status.idle": "2024-07-08T14:19:18.620503Z", - "shell.execute_reply": "2024-07-08T14:19:18.619909Z" + "iopub.execute_input": "2024-07-09T13:27:25.337629Z", + "iopub.status.busy": "2024-07-09T13:27:25.337237Z", + "iopub.status.idle": "2024-07-09T13:27:25.340859Z", + "shell.execute_reply": "2024-07-09T13:27:25.340321Z" } }, "outputs": [], @@ -152,10 +152,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.623065Z", - "iopub.status.busy": "2024-07-08T14:19:18.622848Z", - "iopub.status.idle": "2024-07-08T14:19:18.627437Z", - "shell.execute_reply": "2024-07-08T14:19:18.626783Z" + "iopub.execute_input": "2024-07-09T13:27:25.343141Z", + "iopub.status.busy": "2024-07-09T13:27:25.342828Z", + "iopub.status.idle": "2024-07-09T13:27:25.346646Z", + "shell.execute_reply": "2024-07-09T13:27:25.346093Z" } }, "outputs": [], @@ -183,10 +183,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.630025Z", - "iopub.status.busy": "2024-07-08T14:19:18.629756Z", - "iopub.status.idle": "2024-07-08T14:19:18.633773Z", - "shell.execute_reply": "2024-07-08T14:19:18.633051Z" + "iopub.execute_input": "2024-07-09T13:27:25.349113Z", + "iopub.status.busy": "2024-07-09T13:27:25.348659Z", + "iopub.status.idle": "2024-07-09T13:27:25.352244Z", + "shell.execute_reply": "2024-07-09T13:27:25.351628Z" } }, "outputs": [ @@ -235,10 +235,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.636311Z", - "iopub.status.busy": "2024-07-08T14:19:18.636114Z", - "iopub.status.idle": "2024-07-08T14:19:18.640682Z", - "shell.execute_reply": "2024-07-08T14:19:18.640124Z" + "iopub.execute_input": "2024-07-09T13:27:25.354849Z", + "iopub.status.busy": "2024-07-09T13:27:25.354394Z", + "iopub.status.idle": "2024-07-09T13:27:25.358702Z", + "shell.execute_reply": "2024-07-09T13:27:25.358079Z" } }, "outputs": [], @@ -260,10 +260,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.643170Z", - "iopub.status.busy": "2024-07-08T14:19:18.642970Z", - "iopub.status.idle": "2024-07-08T14:19:18.646781Z", - "shell.execute_reply": "2024-07-08T14:19:18.646083Z" + "iopub.execute_input": "2024-07-09T13:27:25.361370Z", + "iopub.status.busy": "2024-07-09T13:27:25.360884Z", + "iopub.status.idle": "2024-07-09T13:27:25.364571Z", + "shell.execute_reply": "2024-07-09T13:27:25.363943Z" } }, "outputs": [ @@ -297,10 +297,10 @@ "execution_count": 8, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.649463Z", - "iopub.status.busy": "2024-07-08T14:19:18.649062Z", - "iopub.status.idle": "2024-07-08T14:19:18.656877Z", - "shell.execute_reply": "2024-07-08T14:19:18.656192Z" + "iopub.execute_input": "2024-07-09T13:27:25.366962Z", + "iopub.status.busy": "2024-07-09T13:27:25.366605Z", + "iopub.status.idle": "2024-07-09T13:27:25.373828Z", + "shell.execute_reply": "2024-07-09T13:27:25.373168Z" } }, "outputs": [ @@ -365,10 +365,10 @@ "execution_count": 9, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.659462Z", - "iopub.status.busy": "2024-07-08T14:19:18.659251Z", - "iopub.status.idle": "2024-07-08T14:19:18.663832Z", - "shell.execute_reply": "2024-07-08T14:19:18.663176Z" + "iopub.execute_input": "2024-07-09T13:27:25.376286Z", + "iopub.status.busy": "2024-07-09T13:27:25.375921Z", + "iopub.status.idle": "2024-07-09T13:27:25.380482Z", + "shell.execute_reply": "2024-07-09T13:27:25.379789Z" } }, "outputs": [ @@ -416,10 +416,10 @@ "execution_count": 10, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.666269Z", - "iopub.status.busy": "2024-07-08T14:19:18.666074Z", - "iopub.status.idle": "2024-07-08T14:19:18.669857Z", - "shell.execute_reply": "2024-07-08T14:19:18.669188Z" + "iopub.execute_input": "2024-07-09T13:27:25.383083Z", + "iopub.status.busy": "2024-07-09T13:27:25.382725Z", + "iopub.status.idle": "2024-07-09T13:27:25.385884Z", + "shell.execute_reply": "2024-07-09T13:27:25.385371Z" } }, "outputs": [], @@ -441,10 +441,10 @@ "execution_count": 11, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.672469Z", - "iopub.status.busy": "2024-07-08T14:19:18.672262Z", - "iopub.status.idle": "2024-07-08T14:19:18.676241Z", - "shell.execute_reply": "2024-07-08T14:19:18.675532Z" + "iopub.execute_input": "2024-07-09T13:27:25.388228Z", + "iopub.status.busy": "2024-07-09T13:27:25.387868Z", + "iopub.status.idle": "2024-07-09T13:27:25.391851Z", + "shell.execute_reply": "2024-07-09T13:27:25.391164Z" } }, "outputs": [ @@ -510,10 +510,10 @@ "execution_count": 12, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.678863Z", - "iopub.status.busy": "2024-07-08T14:19:18.678417Z", - "iopub.status.idle": "2024-07-08T14:19:18.682345Z", - "shell.execute_reply": "2024-07-08T14:19:18.681608Z" + "iopub.execute_input": "2024-07-09T13:27:25.394094Z", + "iopub.status.busy": "2024-07-09T13:27:25.393897Z", + "iopub.status.idle": "2024-07-09T13:27:25.397165Z", + "shell.execute_reply": "2024-07-09T13:27:25.396508Z" } }, "outputs": [ @@ -548,10 +548,10 @@ "execution_count": 13, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.684840Z", - "iopub.status.busy": "2024-07-08T14:19:18.684633Z", - "iopub.status.idle": "2024-07-08T14:19:18.688452Z", - "shell.execute_reply": "2024-07-08T14:19:18.687745Z" + "iopub.execute_input": "2024-07-09T13:27:25.399613Z", + "iopub.status.busy": "2024-07-09T13:27:25.399257Z", + "iopub.status.idle": "2024-07-09T13:27:25.402695Z", + "shell.execute_reply": "2024-07-09T13:27:25.402051Z" } }, "outputs": [ @@ -584,10 +584,10 @@ "execution_count": 14, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.690987Z", - "iopub.status.busy": "2024-07-08T14:19:18.690790Z", - "iopub.status.idle": "2024-07-08T14:19:18.694530Z", - "shell.execute_reply": "2024-07-08T14:19:18.693795Z" + "iopub.execute_input": "2024-07-09T13:27:25.405242Z", + "iopub.status.busy": "2024-07-09T13:27:25.404893Z", + "iopub.status.idle": "2024-07-09T13:27:25.408544Z", + "shell.execute_reply": "2024-07-09T13:27:25.407900Z" } }, "outputs": [ @@ -622,10 +622,10 @@ "execution_count": 15, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.696897Z", - "iopub.status.busy": "2024-07-08T14:19:18.696703Z", - "iopub.status.idle": "2024-07-08T14:19:18.701003Z", - "shell.execute_reply": "2024-07-08T14:19:18.700285Z" + "iopub.execute_input": "2024-07-09T13:27:25.410988Z", + "iopub.status.busy": "2024-07-09T13:27:25.410510Z", + "iopub.status.idle": "2024-07-09T13:27:25.414659Z", + "shell.execute_reply": "2024-07-09T13:27:25.414021Z" } }, "outputs": [ @@ -669,10 +669,10 @@ "execution_count": 16, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.703593Z", - "iopub.status.busy": "2024-07-08T14:19:18.703371Z", - "iopub.status.idle": "2024-07-08T14:19:18.709089Z", - "shell.execute_reply": "2024-07-08T14:19:18.708371Z" + "iopub.execute_input": "2024-07-09T13:27:25.417169Z", + "iopub.status.busy": "2024-07-09T13:27:25.416737Z", + "iopub.status.idle": "2024-07-09T13:27:25.422069Z", + "shell.execute_reply": "2024-07-09T13:27:25.421431Z" } }, "outputs": [ @@ -733,10 +733,10 @@ "execution_count": 17, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.711847Z", - "iopub.status.busy": "2024-07-08T14:19:18.711608Z", - "iopub.status.idle": "2024-07-08T14:19:18.715630Z", - "shell.execute_reply": "2024-07-08T14:19:18.714908Z" + "iopub.execute_input": "2024-07-09T13:27:25.424400Z", + "iopub.status.busy": "2024-07-09T13:27:25.424062Z", + "iopub.status.idle": "2024-07-09T13:27:25.427587Z", + "shell.execute_reply": "2024-07-09T13:27:25.426950Z" } }, "outputs": [], @@ -761,10 +761,10 @@ "execution_count": 18, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.718205Z", - "iopub.status.busy": "2024-07-08T14:19:18.717990Z", - "iopub.status.idle": "2024-07-08T14:19:18.728725Z", - "shell.execute_reply": "2024-07-08T14:19:18.728117Z" + "iopub.execute_input": "2024-07-09T13:27:25.429846Z", + "iopub.status.busy": "2024-07-09T13:27:25.429512Z", + "iopub.status.idle": "2024-07-09T13:27:25.439668Z", + "shell.execute_reply": "2024-07-09T13:27:25.439009Z" } }, "outputs": [], @@ -857,10 +857,10 @@ "execution_count": 19, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.731260Z", - "iopub.status.busy": "2024-07-08T14:19:18.731026Z", - "iopub.status.idle": "2024-07-08T14:19:18.735329Z", - "shell.execute_reply": "2024-07-08T14:19:18.734631Z" + "iopub.execute_input": "2024-07-09T13:27:25.442305Z", + "iopub.status.busy": "2024-07-09T13:27:25.441864Z", + "iopub.status.idle": "2024-07-09T13:27:25.445493Z", + "shell.execute_reply": "2024-07-09T13:27:25.444848Z" } }, "outputs": [ @@ -897,10 +897,10 @@ "execution_count": 20, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:18.737758Z", - "iopub.status.busy": "2024-07-08T14:19:18.737554Z", - "iopub.status.idle": "2024-07-08T14:19:18.743435Z", - "shell.execute_reply": "2024-07-08T14:19:18.742749Z" + "iopub.execute_input": "2024-07-09T13:27:25.447825Z", + "iopub.status.busy": "2024-07-09T13:27:25.447490Z", + "iopub.status.idle": "2024-07-09T13:27:25.452827Z", + "shell.execute_reply": "2024-07-09T13:27:25.452173Z" } }, "outputs": [ diff --git a/notebooks/nmodl-sympy-conductance.ipynb b/notebooks/nmodl-sympy-conductance.ipynb index 6e10fa6ad..dfc8325fb 100644 --- a/notebooks/nmodl-sympy-conductance.ipynb +++ b/notebooks/nmodl-sympy-conductance.ipynb @@ -86,10 +86,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:21.317356Z", - "iopub.status.busy": "2024-07-08T14:19:21.316786Z", - "iopub.status.idle": "2024-07-08T14:19:22.121495Z", - "shell.execute_reply": "2024-07-08T14:19:22.120676Z" + "iopub.execute_input": "2024-07-09T13:27:27.777219Z", + "iopub.status.busy": "2024-07-09T13:27:27.776676Z", + "iopub.status.idle": "2024-07-09T13:27:28.520529Z", + "shell.execute_reply": "2024-07-09T13:27:28.519763Z" } }, "outputs": [], @@ -103,10 +103,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:22.125074Z", - "iopub.status.busy": "2024-07-08T14:19:22.124482Z", - "iopub.status.idle": "2024-07-08T14:19:22.153146Z", - "shell.execute_reply": "2024-07-08T14:19:22.152468Z" + "iopub.execute_input": "2024-07-09T13:27:28.523640Z", + "iopub.status.busy": "2024-07-09T13:27:28.523224Z", + "iopub.status.idle": "2024-07-09T13:27:28.550057Z", + "shell.execute_reply": "2024-07-09T13:27:28.549480Z" } }, "outputs": [], @@ -149,10 +149,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:22.156578Z", - "iopub.status.busy": "2024-07-08T14:19:22.156052Z", - "iopub.status.idle": "2024-07-08T14:19:22.440666Z", - "shell.execute_reply": "2024-07-08T14:19:22.439889Z" + "iopub.execute_input": "2024-07-09T13:27:28.552827Z", + "iopub.status.busy": "2024-07-09T13:27:28.552470Z", + "iopub.status.idle": "2024-07-09T13:27:28.813885Z", + "shell.execute_reply": "2024-07-09T13:27:28.813179Z" } }, "outputs": [ @@ -196,10 +196,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:22.443723Z", - "iopub.status.busy": "2024-07-08T14:19:22.443084Z", - "iopub.status.idle": "2024-07-08T14:19:22.597116Z", - "shell.execute_reply": "2024-07-08T14:19:22.596399Z" + "iopub.execute_input": "2024-07-09T13:27:28.816535Z", + "iopub.status.busy": "2024-07-09T13:27:28.816245Z", + "iopub.status.idle": "2024-07-09T13:27:28.944724Z", + "shell.execute_reply": "2024-07-09T13:27:28.944134Z" } }, "outputs": [ @@ -243,10 +243,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:22.599924Z", - "iopub.status.busy": "2024-07-08T14:19:22.599697Z", - "iopub.status.idle": "2024-07-08T14:19:22.608506Z", - "shell.execute_reply": "2024-07-08T14:19:22.607749Z" + "iopub.execute_input": "2024-07-09T13:27:28.947449Z", + "iopub.status.busy": "2024-07-09T13:27:28.947044Z", + "iopub.status.idle": "2024-07-09T13:27:28.954909Z", + "shell.execute_reply": "2024-07-09T13:27:28.954257Z" } }, "outputs": [ @@ -290,10 +290,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:22.611253Z", - "iopub.status.busy": "2024-07-08T14:19:22.611025Z", - "iopub.status.idle": "2024-07-08T14:19:22.629729Z", - "shell.execute_reply": "2024-07-08T14:19:22.629073Z" + "iopub.execute_input": "2024-07-09T13:27:28.957318Z", + "iopub.status.busy": "2024-07-09T13:27:28.956974Z", + "iopub.status.idle": "2024-07-09T13:27:28.974112Z", + "shell.execute_reply": "2024-07-09T13:27:28.973449Z" } }, "outputs": [ @@ -337,10 +337,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:22.632430Z", - "iopub.status.busy": "2024-07-08T14:19:22.632200Z", - "iopub.status.idle": "2024-07-08T14:19:22.762561Z", - "shell.execute_reply": "2024-07-08T14:19:22.761830Z" + "iopub.execute_input": "2024-07-09T13:27:28.976838Z", + "iopub.status.busy": "2024-07-09T13:27:28.976422Z", + "iopub.status.idle": "2024-07-09T13:27:29.095599Z", + "shell.execute_reply": "2024-07-09T13:27:29.094930Z" } }, "outputs": [ @@ -400,10 +400,10 @@ "execution_count": 8, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:22.765393Z", - "iopub.status.busy": "2024-07-08T14:19:22.765161Z", - "iopub.status.idle": "2024-07-08T14:19:22.870422Z", - "shell.execute_reply": "2024-07-08T14:19:22.869740Z" + "iopub.execute_input": "2024-07-09T13:27:29.098318Z", + "iopub.status.busy": "2024-07-09T13:27:29.097913Z", + "iopub.status.idle": "2024-07-09T13:27:29.191411Z", + "shell.execute_reply": "2024-07-09T13:27:29.190802Z" } }, "outputs": [ @@ -456,10 +456,10 @@ "execution_count": 9, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:22.873175Z", - "iopub.status.busy": "2024-07-08T14:19:22.872935Z", - "iopub.status.idle": "2024-07-08T14:19:22.948171Z", - "shell.execute_reply": "2024-07-08T14:19:22.947424Z" + "iopub.execute_input": "2024-07-09T13:27:29.194044Z", + "iopub.status.busy": "2024-07-09T13:27:29.193566Z", + "iopub.status.idle": "2024-07-09T13:27:29.267305Z", + "shell.execute_reply": "2024-07-09T13:27:29.266647Z" } }, "outputs": [ diff --git a/notebooks/nmodl-sympy-solver-cnexp.ipynb b/notebooks/nmodl-sympy-solver-cnexp.ipynb index 012809611..cab0fdb71 100644 --- a/notebooks/nmodl-sympy-solver-cnexp.ipynb +++ b/notebooks/nmodl-sympy-solver-cnexp.ipynb @@ -62,10 +62,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:24.812751Z", - "iopub.status.busy": "2024-07-08T14:19:24.812436Z", - "iopub.status.idle": "2024-07-08T14:19:25.623956Z", - "shell.execute_reply": "2024-07-08T14:19:25.623195Z" + "iopub.execute_input": "2024-07-09T13:27:30.919502Z", + "iopub.status.busy": "2024-07-09T13:27:30.918912Z", + "iopub.status.idle": "2024-07-09T13:27:31.702525Z", + "shell.execute_reply": "2024-07-09T13:27:31.701626Z" } }, "outputs": [], @@ -79,10 +79,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:25.627345Z", - "iopub.status.busy": "2024-07-08T14:19:25.627111Z", - "iopub.status.idle": "2024-07-08T14:19:25.658122Z", - "shell.execute_reply": "2024-07-08T14:19:25.657332Z" + "iopub.execute_input": "2024-07-09T13:27:31.706530Z", + "iopub.status.busy": "2024-07-09T13:27:31.705877Z", + "iopub.status.idle": "2024-07-09T13:27:31.741957Z", + "shell.execute_reply": "2024-07-09T13:27:31.741225Z" } }, "outputs": [], @@ -123,10 +123,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:25.661405Z", - "iopub.status.busy": "2024-07-08T14:19:25.661126Z", - "iopub.status.idle": "2024-07-08T14:19:26.125710Z", - "shell.execute_reply": "2024-07-08T14:19:26.124931Z" + "iopub.execute_input": "2024-07-09T13:27:31.745171Z", + "iopub.status.busy": "2024-07-09T13:27:31.744648Z", + "iopub.status.idle": "2024-07-09T13:27:32.154787Z", + "shell.execute_reply": "2024-07-09T13:27:32.154053Z" } }, "outputs": [ @@ -165,10 +165,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:26.128804Z", - "iopub.status.busy": "2024-07-08T14:19:26.128316Z", - "iopub.status.idle": "2024-07-08T14:19:26.268524Z", - "shell.execute_reply": "2024-07-08T14:19:26.267745Z" + "iopub.execute_input": "2024-07-09T13:27:32.157331Z", + "iopub.status.busy": "2024-07-09T13:27:32.157083Z", + "iopub.status.idle": "2024-07-09T13:27:32.267475Z", + "shell.execute_reply": "2024-07-09T13:27:32.266883Z" } }, "outputs": [ @@ -207,10 +207,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:26.271283Z", - "iopub.status.busy": "2024-07-08T14:19:26.271054Z", - "iopub.status.idle": "2024-07-08T14:19:26.510893Z", - "shell.execute_reply": "2024-07-08T14:19:26.510102Z" + "iopub.execute_input": "2024-07-09T13:27:32.270004Z", + "iopub.status.busy": "2024-07-09T13:27:32.269616Z", + "iopub.status.idle": "2024-07-09T13:27:32.465938Z", + "shell.execute_reply": "2024-07-09T13:27:32.465298Z" } }, "outputs": [ @@ -255,10 +255,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:26.513860Z", - "iopub.status.busy": "2024-07-08T14:19:26.513445Z", - "iopub.status.idle": "2024-07-08T14:19:26.712459Z", - "shell.execute_reply": "2024-07-08T14:19:26.711798Z" + "iopub.execute_input": "2024-07-09T13:27:32.468624Z", + "iopub.status.busy": "2024-07-09T13:27:32.468244Z", + "iopub.status.idle": "2024-07-09T13:27:32.626132Z", + "shell.execute_reply": "2024-07-09T13:27:32.625531Z" } }, "outputs": [ @@ -266,7 +266,13 @@ "name": "stdout", "output_type": "stream", "text": [ - "exact solution:\t m = minf+(m-minf)*exp(dt/mtau)\n", + "exact solution:\t m = minf+(m-minf)*exp(dt/mtau)\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ "pade approx:\t m = (-dt*m+2.0*dt*minf-2.0*m*mtau)/(dt-2.0*mtau)\n" ] } @@ -297,10 +303,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:26.715318Z", - "iopub.status.busy": "2024-07-08T14:19:26.714907Z", - "iopub.status.idle": "2024-07-08T14:19:28.190861Z", - "shell.execute_reply": "2024-07-08T14:19:28.190133Z" + "iopub.execute_input": "2024-07-09T13:27:32.628646Z", + "iopub.status.busy": "2024-07-09T13:27:32.628279Z", + "iopub.status.idle": "2024-07-09T13:27:34.367276Z", + "shell.execute_reply": "2024-07-09T13:27:34.366563Z" } }, "outputs": [ @@ -345,10 +351,10 @@ "execution_count": 8, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:28.193841Z", - "iopub.status.busy": "2024-07-08T14:19:28.193380Z", - "iopub.status.idle": "2024-07-08T14:19:30.056617Z", - "shell.execute_reply": "2024-07-08T14:19:30.055913Z" + "iopub.execute_input": "2024-07-09T13:27:34.370079Z", + "iopub.status.busy": "2024-07-09T13:27:34.369583Z", + "iopub.status.idle": "2024-07-09T13:27:36.631315Z", + "shell.execute_reply": "2024-07-09T13:27:36.630600Z" } }, "outputs": [ diff --git a/notebooks/nmodl-sympy-solver-derivimplicit.ipynb b/notebooks/nmodl-sympy-solver-derivimplicit.ipynb index 4a707599d..09270d192 100644 --- a/notebooks/nmodl-sympy-solver-derivimplicit.ipynb +++ b/notebooks/nmodl-sympy-solver-derivimplicit.ipynb @@ -39,10 +39,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:32.049185Z", - "iopub.status.busy": "2024-07-08T14:19:32.048967Z", - "iopub.status.idle": "2024-07-08T14:19:32.852052Z", - "shell.execute_reply": "2024-07-08T14:19:32.851318Z" + "iopub.execute_input": "2024-07-09T13:27:38.260239Z", + "iopub.status.busy": "2024-07-09T13:27:38.259777Z", + "iopub.status.idle": "2024-07-09T13:27:39.005106Z", + "shell.execute_reply": "2024-07-09T13:27:39.004375Z" } }, "outputs": [], @@ -56,10 +56,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:32.855192Z", - "iopub.status.busy": "2024-07-08T14:19:32.854969Z", - "iopub.status.idle": "2024-07-08T14:19:32.884763Z", - "shell.execute_reply": "2024-07-08T14:19:32.883964Z" + "iopub.execute_input": "2024-07-09T13:27:39.008134Z", + "iopub.status.busy": "2024-07-09T13:27:39.007923Z", + "iopub.status.idle": "2024-07-09T13:27:39.035527Z", + "shell.execute_reply": "2024-07-09T13:27:39.034845Z" } }, "outputs": [], @@ -100,10 +100,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:32.888300Z", - "iopub.status.busy": "2024-07-08T14:19:32.887833Z", - "iopub.status.idle": "2024-07-08T14:19:33.384183Z", - "shell.execute_reply": "2024-07-08T14:19:33.383395Z" + "iopub.execute_input": "2024-07-09T13:27:39.038193Z", + "iopub.status.busy": "2024-07-09T13:27:39.037988Z", + "iopub.status.idle": "2024-07-09T13:27:39.493003Z", + "shell.execute_reply": "2024-07-09T13:27:39.492291Z" } }, "outputs": [ @@ -165,10 +165,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:33.387641Z", - "iopub.status.busy": "2024-07-08T14:19:33.387030Z", - "iopub.status.idle": "2024-07-08T14:19:33.615481Z", - "shell.execute_reply": "2024-07-08T14:19:33.614713Z" + "iopub.execute_input": "2024-07-09T13:27:39.495638Z", + "iopub.status.busy": "2024-07-09T13:27:39.495386Z", + "iopub.status.idle": "2024-07-09T13:27:39.714694Z", + "shell.execute_reply": "2024-07-09T13:27:39.714018Z" } }, "outputs": [ diff --git a/notebooks/nmodl-sympy-solver-sparse.ipynb b/notebooks/nmodl-sympy-solver-sparse.ipynb index 558fe9452..8e25af2a8 100644 --- a/notebooks/nmodl-sympy-solver-sparse.ipynb +++ b/notebooks/nmodl-sympy-solver-sparse.ipynb @@ -39,10 +39,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:35.091365Z", - "iopub.status.busy": "2024-07-08T14:19:35.091139Z", - "iopub.status.idle": "2024-07-08T14:19:35.902205Z", - "shell.execute_reply": "2024-07-08T14:19:35.901295Z" + "iopub.execute_input": "2024-07-09T13:27:41.020838Z", + "iopub.status.busy": "2024-07-09T13:27:41.020291Z", + "iopub.status.idle": "2024-07-09T13:27:41.767497Z", + "shell.execute_reply": "2024-07-09T13:27:41.766709Z" } }, "outputs": [], @@ -56,10 +56,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:35.906761Z", - "iopub.status.busy": "2024-07-08T14:19:35.905989Z", - "iopub.status.idle": "2024-07-08T14:19:35.935381Z", - "shell.execute_reply": "2024-07-08T14:19:35.934578Z" + "iopub.execute_input": "2024-07-09T13:27:41.770825Z", + "iopub.status.busy": "2024-07-09T13:27:41.770403Z", + "iopub.status.idle": "2024-07-09T13:27:41.800087Z", + "shell.execute_reply": "2024-07-09T13:27:41.799399Z" } }, "outputs": [], @@ -100,10 +100,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:35.938636Z", - "iopub.status.busy": "2024-07-08T14:19:35.938316Z", - "iopub.status.idle": "2024-07-08T14:19:36.446881Z", - "shell.execute_reply": "2024-07-08T14:19:36.446144Z" + "iopub.execute_input": "2024-07-09T13:27:41.803463Z", + "iopub.status.busy": "2024-07-09T13:27:41.803241Z", + "iopub.status.idle": "2024-07-09T13:27:42.278312Z", + "shell.execute_reply": "2024-07-09T13:27:42.277529Z" } }, "outputs": [ @@ -165,10 +165,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-07-08T14:19:36.449568Z", - "iopub.status.busy": "2024-07-08T14:19:36.449291Z", - "iopub.status.idle": "2024-07-08T14:19:36.672354Z", - "shell.execute_reply": "2024-07-08T14:19:36.671576Z" + "iopub.execute_input": "2024-07-09T13:27:42.281288Z", + "iopub.status.busy": "2024-07-09T13:27:42.280840Z", + "iopub.status.idle": "2024-07-09T13:27:42.499162Z", + "shell.execute_reply": "2024-07-09T13:27:42.498413Z" } }, "outputs": [