First time here? Checkout the FAQ!
x
0 votes
by (420 points)

Hi,

I am trying to add electrodes to start stimulation on a 2D mesh. The main code I am using is from the reentry induction example. It was successful in some areas of the mesh, but in some other area of the mesh, when I tried to add electrodes, I got this error message:

L3 : Warning: openCARP requires input vtx indices to be of from the input mesh, i.e. of type "extra".

L5 : Stimulus 0: Specified vertices are not in stimulus domain! Aborting!

Could you help me understand why this error occurred? Also, I wonder what the stimulus domain means, was it defined somewhere?

Here are some parameters I used:

cmd = tools.carp_cmd(os.path.join(EXAMPLE_DIR, 'parameters.par'))

cmd += ['-num_gregions', 2,

        '-gregion[0].num_IDs ', 2,

        '-gregion[0].ID[0]', 1,

        '-gregion[0].ID[1]', 2,

        '-gregion[0].g_il ', args.giL,

        '-gregion[0].g_it ', args.giL,

        '-gregion[0].g_in ', args.giL,

        '-gregion[0].g_el ', args.geL,

        '-gregion[0].g_et ', args.geL,

        '-gregion[0].g_en ', args.geL,

        '-gregion[1].num_IDs ', 1,

        '-gregion[1].ID[0]', 3,

        '-gregion[1].g_il ', 0.0001

        '-gregion[1].g_it ', 0.0001

        '-gregion[1].g_in ', 0.0001

        '-gregion[1].g_el ', 0.0001

        '-gregion[1].g_et ', 0.0001

        '-gregion[1].g_en ', 0.0001

stimNum = ['-num_stim',1]

stim_test = ['-stimulus[0].stimtype', 0,         

        '-stimulus[0].strength', 2500.0,    

        '-stimulus[0].duration', 5.0,      

        '-stimulus[0].start', 0,            

        '-stimulus[0].npls', 1,            

        '-stimulus[0].vtx_file', 'stim_test']

In parameters.par: 

dt                       = 20   # in microseconds

timedt                   = 50 # console dt

spacedt                  = 1 # output dt

tend                     = 10000.1

experiment               = 0

parab_solve              = 1

mass_lumping             = 0

bidomain = 0

num_imp_regions = 2

imp_region[0].name = "LA" 

imp_region[0].im = Courtemanche

imp_region[0].im_param = "GCaL*75%,GK1+100%,factorGKur-50%,Gto*75%,GKs*67%,maxIpCa+50%,maxINaCa+60%,GKr*2.4"

imp_region[0].num_IDs = 1

imp_region[0].ID = 1

imp_region[1].name = "Fibrotic tissue with ionic changes" 

imp_region[1].im = Courtemanche

imp_region[1].im_param = "GCaL*0.225,GNa*0.6,factorGKur-50%,Gto-65%,GKs+100%,maxIpCa+50%,maxINaCa+60%,GKr*1.6" 

imp_region[1].num_IDs = 2

imp_region[1].ID = 2 3

In stim_test.vtx:

1

intra

26000 13600 0

Additionally, is there a function where I could get the coordinates of certain points on the mesh? How are the coordinates defined in a mesh?

1 Answer

0 votes
by (570 points)
Hi Zhoulin, 

I think that you are trying to stimulate points outside of your mesh -- check the first line of your mesh *.pts file for the upper bound (i.e. that number -1), that you can define in your `stim_test.vtx` file.

 

I guess that the stimulus domain refers to the nodes which you define as being stimulated in your file.
 
Additionally, is there a function where I could get the coordinates of certain points on the mesh? How are the coordinates defined in a mesh?

The points coordinates are defined in the *.pts file of your mesh. The first line defines the number N of points in the mesh, and from the second line on are the coordinates (x_n, y_n, z_n) of the point n (for n=0,..., N-1)

So, to get the coordinates of point n, you can refer to the line $n+2$. For instance using a command line tool `awk`.
```
awk 'FNR==<line_number>' <mesh_name>.pts
```
(replace the placeholders in <> brackets by the values)

More details about the mesh definition can be found in section 4.1.3 of the openCARP manual [1].

[1] https://opencarp.org/user/pages/05.documentation/04.user-manual/opencarp-manual-latest.pdf

Welcome to openCARP Q&A. Ask questions and receive answers from other members of the community. For best support, please use appropriate TAGS!
architecture, carputils, documentation, experiments, installation-containers-packages, limpet, slimfem, website, governance
...