stimulus.vtx_file does not work with stim_type 0
Summary
When using the command "-stimulus[0].vtx_file", it is not possible to use -stim_type = 0, while this is possible when selecting a stimulus region with -stimulus[0].x0, xd, y0, yd, z0, zd. When using stim type = 0 with a vtx file (independent from intra or extra specified in the file), we get the error message "L5 : Stimulus 0: Specified vertices are not in stimulus domain! Aborting!". This does not occur for stim_type = 1.
What version of openCARP are you using?
commit ff3849ce (HEAD -> master, origin/master, origin/HEAD) Author: Yung-Lin Huang yung-lin.huang@universitaets-herzzentrum.de Date: Wed Oct 27 09:17:36 2021 +0000
What operating system and processor architecture are you using?
Linux 5.11.0-46-generic #51 (closed)~20.04.1-Ubuntu SMP Fri Jan 7 06:51:40 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux amd64
Steps to reproduce
Use the code below to define stimulus. Then change "'-stimulus[0].stimtype', 1" to "'-stimulus[0].stimtype', 0" to get the error.
size = args.size_block
stim = ['num_stim', 2,
'-stimulus[0].name','WF',
'-stimulus[0].vtx_file','/home/user/Data2/openCARP_vtx_files/stimulus_WF_45',
'-stimulus[0].stimtype', 1,
'-stimulus[0].strength', 100.0,
'-stimulus[0].duration', 1.0,
'-stimulus[0].npls', 1,
'-stimulus[1].name','ground',
'-stimulus[1].stimtype', 3,
'-stimulus[1].x0',(0.5*size[0]+args.size_bath - 1)*1e3,
'-stimulus[1].xd', 1*1e3,
'-stimulus[1].y0',(-0.5*size[1] - args.size_bath)*1e3,
'-stimulus[1].yd',(size[1]+2*args.size_bath)*1e3,
'-stimulus[1].z0',-(0.5*size[2] + args.size_bath)*1e3,
'-stimulus[1].zd',(size[2]+2*args.size_bath)*1e3]
What is the current bug behavior?
Get the error
L5 : Stimulus 0: Specified vertices are not in stimulus domain! Aborting!
What is the expected correct behavior?
From this error, it is not clear that the stim type is the problem. It does not really make sense to me either why this stim type 0 does not work in these circumstances.
Relevant logs and/or screenshots
Please feel free to ask me when something more is needed
Possible fixes
The error comes from openCARP/physics/stimulate.cc