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


I have read a mesh file (opencarp format) using

meshname = "myMeshPath"

But when I want to define an electrode for a stimulation, the code was something like

electrode = mesh.block_region(geom,'stimulus', 0, E1_lower_bound, E1_upper_bound, False)

geom should be the geometry of the mesh, but how could I get the geometry from the mesh model I just read?


1 Answer

0 votes
by (12.1k points)
by (380 points)
If possible, could you provide an example on how to use it?
by (380 points)
But in the reentry induction example, isn't the sinus node still defined by this block_boundary_condition function that only works with block meshes? How could I set the electrode or the sinus node on non-block meshes?
by (12.1k points)
Yes, it is.
You can set almost arbitrary stimuli by directly using openCARP's Stim parameter group as done on the part of the reentry example referred to above:

Stim is described in Section 23.3 of the openCARP manual:

PS: Our terms of service require the use of your full name on all openCARP infrastructure (Q&A, GitLab...)
by (380 points)
I tied to use the Stim parameter group parameters yet I still received the error L5 : error: Empty stimulus[0] electrode def! Aborting!

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,
            '-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]

Would you mind letting me know where this error message was defined so I could check what exactly is wrong with it? Or perhaps if you have any suggestions on how to fix such problem?

I saw on another q&a posts that this error message could have something to do with ExtraTags and IntraTags, but not sure how it was relevant, could you help me clear that up? Thanks
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