37 #define Transmembrane_I 0
38 #define Extracellular_I 1
39 #define Extracellular_V 2
40 #define Extracellular_Ground 3
41 #define Intracellular_I 4
42 #define Extracellular_V_OL 5
43 #define Illumination 6
48 #define Ignore_Stim 11
50 #define IsExtraV(A) ((A.stimtype==Extracellular_V) || (A.stimtype==Extracellular_V_OL))
51 #define SELECTED_STIM(A,B) ((A==B) || ((A==Extracellular_V_OL) && (B==Extracellular_V)))
55 #define NO_EXTRA_GND 1
59 #define STM_IGNORE_BIDOMAIN (IGNORE_NONE)
60 #define STM_IGNORE_MONODOMAIN (NO_EXTRA_GND | NO_EXTRA_V | NO_EXTRA_I)
61 #define STM_IGNORE_PSEUDO_BIDM (NO_EXTRA_V | NO_EXTRA_I)
62 #define STM_IGNORE_FLOAT_GND (NO_EXTRA_GND | NO_EXTRA_V)
65 #define VOL_BASED_ELEC_DEF 0
66 #define FILE_BASED_ELEC_DEF 1
69 #define VOL_BASED_BC_DEF 0
70 #define FILE_BASED_BC_DEF 1
74 const std::string
wfLabels [] = {
"squarePulse",
"truncExpPulse",
"sinePulse",
"arbPulse"};
77 enum stim_t {
I_tm=0,
I_ex=1,
Phi_ex=2,
GND_ex=3,
I_in=4,
Phi_ex_ol=5,
Illum=6,
I_tm_grad=7,
I_lat=8,
Vm_clmp=9,
Phie_pre=10,
Ignore_stim=11};
130 void setup(
int idx, std::string name);
185 bool value(
double & v)
const;
234 inline void clear_active_dbc()
manager for dirichlet boundary conditions
std::map< int, dbc_data * > active_dbc
the DBCs that are currently active
sf_mat & mat
the matrix we link the dbc_manager to
dbc_manager(sf_mat &im, const SF::vector< stimulus > &is)
void enforce_dbc_rhs(sf_vec &rhs)
void recompute_dbcs()
recompute the dbc data.
const SF::vector< stimulus > & stimuli
the stimuli we link the dbc_manager to
bool dbc_update()
check if dbcs have updated
void set_labels(std::string _label)
SF::vector< mesh_int_t > vertices
std::string input_filename
SF::vector< SF_real > scaling
void setup(int idx)
assign stimulus physics parameters
double scale
internal unit conversion scaling
bool total_current
whether we apply total current scaling
stim_t type
type of stimulus
std::string unit
physical units of stimulus
stim_domain_t domain
applied in intra- or extracellular space
int timer_id
timer for stimulus
int npls
number of stimulus pulses
double pcl
pacing cycle length
int xtrg_id
external trigger ID, not used for now
double start
start time of protocol
void setup(int idx, std::string name)
Setup from a param stimulus index.
define the wave form of a stimulation pulse
sig::time_trace wave
wave form of stimulus pulse
void assign(double _strength, double _duration, double _dt, waveform_t _wform)
void setup(int id)
Setup from a param stimulus index.
double duration
duration of stimulus
waveform_t wform
wave form of stimulus
double strength
strength of stimulus
stim_protocol ptcl
applied stimulation protocol used
int idx
index in global input stimulus array
stim_electrode electrode
electrode geometry
stim_pulse pulse
stimulus wave form
void translate(int id)
convert legacy definitions to new format
bool is_active() const
Return whether stim is active.
void setup(int idx)
Setup from a param stimulus index.
stim_physics phys
physics of stimulus
bool value(double &v) const
Get the current value if the stimulus is active.
std::string name
label stimulus
void sample_wave_form(stim_pulse &sp, int idx)
sample a signal given in analytic form
bool is_dbc(stim_t type)
whether stimulus is a dirichlet type. implies boundary conditions on matrix
const std::string wfLabels[]
bool is_potential(stim_t type)
uses current for stimulation
void init_stim_info(void)
uses potential for stimulation
bool is_extra(stim_t type)
whether stimulus is on extra grid (or on intra)
bool is_current(stim_t type)
uses current as stimulation
Manage time signals used for stimulation and other time-dependent boundary conditions.
SF::vector< SF_int > * nod