Yes, here is a detailed description of the issue.
I am doing following modifications to the simple example (
https://opencarp.org/documentation/examples/02_ep_tissue/00_simple) run.py code:
1. Rather than generating the mesh in the code, I am loading an external mesh by adding the following line:
meshname = 'ellipsoid'
Note: The mesh ellipsoid is the structure given in the example folder by meshalyzer. I am including all *.pts, *.Ion, *.elem files.
2. Since the stimulation code 'stim = mesh.block_bc_opencarp(geom, 'stim', 0, 'x', T' only works with block meshes (referring to:
https://opencarp.org/q2a/902/how-to-get-geometry-from-existing-mesh?show=913#c913) I am trying to change it using stim class. Changing it as:
stim = ['-num_stim', 1,
'-stimulus[0].stimtype', 0,
'-stimulus[0].strength', 120.0,
'-stimulus[0].duration', 2.0,
'-stimulus[0].start', 0,
'-stimulus[0].x0', 2100,
'-stimulus[0].xd', 32000,
'-stimulus[0].y0', 2100,
'-stimulus[0].yd', 310,
'-stimulus[0].z0', 2100,
'-stimulus[0].zd', 4200,
'-stimulus[0].npls', 1,
'-stimulus[0].ctr_def',1,
'-stim[0].elec.dump_vtx_file',0,
'-stim[0].elec.geom_type',5,
'-stim[0].elec.geomID', 0,
'-stim[0].elec.p0[0]', 1,
'-stim[0].elec.p0[1]', 1,
'-stim[0].elec.p0[2]', 1,
'-floating_ground', 1]
With above modifications I am running the simulation successfully however when I want to display the results, I am getting point mismatch error in meshalyzer. Also, what I want is to stimulate the heart from a vertex. Therefore, I switch to using the *.vtx file as in the link:
https://opencarp.org/q2a/830/how-define-stimulus-through-vtx-file-22_simple-experiment?show=830#q830
So, I modify the stimulation code as:
stim = ["-num_stim", 1,
"-stimulus[0].vtx_file", "path/to/vtx/file"]
And getting the same error:
L5 : error: Empty stimulus[0] electrode def! Aborting!
Using the suggestions in the following link, I am modifying the simple.par folder for the stimulation definition by changing stim[0].crct.type = 2 (referring to:
https://opencarp.org/q2a/804/prescribed-epicardial-potential?show=808#a808) and by adding the following lines:
stim[0].elec.vtx_file = stimulationvtxfile.vtx
stim[0].elec.vtx_fcn = 1
And finally I am getting this error:
L5 : get_mesh error: mesh of type "Extracellular Electric" not found! Aborting!