38 #define Transmembrane_I 0 39 #define Extracellular_I 1 40 #define Extracellular_V 2 41 #define Extracellular_Ground 3 42 #define Intracellular_I 4 43 #define Extracellular_V_OL 5 45 #define Transmembrane_I_Grad 7 46 #define LAT_Triggered 8 48 #define Prescribed_Phie 10 49 #define Ignore_Stim 11 53 #define IsExtraV(A) ((A.stimtype==Extracellular_V) || (A.stimtype==Extracellular_V_OL)) 55 #define IsExtraV_(A) ((A.type==Extracellular_V) || (A.type==Extracellular_V_OL)) 57 #define SELECTED_STIM(A,B) ((A==B) || ((A==Extracellular_V_OL) && (B==Extracellular_V))) 61 #define NO_EXTRA_GND 1 65 #define STM_IGNORE_BIDOMAIN (IGNORE_NONE) // bidomain 66 #define STM_IGNORE_MONODOMAIN (NO_EXTRA_GND | NO_EXTRA_V | NO_EXTRA_I) // monodomain 67 #define STM_IGNORE_PSEUDO_BIDM (NO_EXTRA_V | NO_EXTRA_I) // pseudo-bidomain 68 #define STM_IGNORE_FLOAT_GND (NO_EXTRA_GND | NO_EXTRA_V) // bidomain w/floating ground 71 #define VOL_BASED_ELEC_DEF 0 72 #define FILE_BASED_ELEC_DEF 1 75 #define VOL_BASED_BC_DEF 0 76 #define FILE_BASED_BC_DEF 1 80 const std::string
wfLabels [] = {
"squarePulse",
"truncExpPulse",
"sinePulse",
"arbPulse"};
83 enum stim_t {
I_tm=0,
I_ex=1,
V_ex=2,
GND_ex=3,
I_in=4,
V_ex_ol=5,
Illum=6,
I_tm_grad=7,
I_lat=8,
Vm_clmp=9,
Phie_pre=10,
Ignore_stim=11};
106 strength = _strength;
107 duration = _duration;
136 void setup(
int idx, std::string name);
170 std::string name =
"unnamed";
182 void translate(
int id);
191 bool value(
double & v)
const;
194 bool is_active()
const;
208 if(cntr)
delete cntr;
233 void recompute_dbcs();
235 void enforce_dbc_lhs();
236 void enforce_dbc_rhs(
sf_vec & rhs);
240 inline void clear_active_dbc()
242 for(
auto & d : active_dbc)
stim_electrode electrode
electrode geometry
double scale
internal unit conversion scaling
stim_pulse pulse
stimulus wave form
bool is_voltage(stim_t type)
uses voltage as stimulation
bool is_current(stim_t type)
uses current as stimulation
SF::vector< mesh_int_t > vertices
std::map< int, dbc_data * > active_dbc
the DBCs that are currently active
void assign(double _strength, double _duration, double _dt, waveform_t _wform)
void init_stim_info(void)
waveform_t wform
wave form of stimulus
void setup(int id)
Setup from a param stimulus index.
SF::vector< SF_real > scaling
define the wave form of a stimulation pulse
manager for dirichlet boundary conditions
stim_domain_t domain
applied in intra- or extracellular space
void set_labels(std::string _label)
const std::string wfLabels[]
double duration
duration of stimulus
sig::time_trace wave
wave form of stimulus pulse
sf_mat & mat
the matrix we link the dbc_manager to
const SF::vector< stimulus > & stimuli
the stimuli we link the dbc_manager to
Manage time signals used for stimulation and other time-dependent boundary conditions.
bool total_current
whether we apply total current scaling
std::string input_filename
bool is_extra(stim_t type)
whether stimulus is on extra grid (or on intra)
stim_t type
type of stimulus
void sample_wave_form(stim_pulse &sp, int idx)
sample a signal given in analytic form
double strength
strength of stimulus
stim_protocol ptcl
applied stimulation protocol used
stim_physics phys
physics of stimulus
dbc_manager(sf_mat &im, const SF::vector< stimulus > &is)
bool is_dbc(stim_t type)
whether stimulus is a dirichlet type. implies boundary conditions on matrix
std::string unit
physical units of stimulus