93 void setup_linear_solver(
FILE_SPEC logger);
164 void setup_linear_solver(
FILE_SPEC logger);
166 void solve_CN(
sf_vec & phie_i);
167 void solve_O2dT(
sf_vec & phie_i);
168 void solve_EF(
sf_vec & phie_i);
210 int check_cross_threshold(
sf_vec & vm,
sf_vec & vmp,
double tm,
211 int *ibuf,
double *actbuf,
float threshold,
int mode);
214 int check_mx_derivative(
sf_vec & vm,
sf_vec & vmp,
double tm,
215 int *ibuf,
double *actbuf,
sf_vec & dvp0,
sf_vec & dvp1,
216 float threshold,
int mode);
336 void setup_stimuli();
339 void stimulate_intracellular();
345 void stimulate_extracellular();
348 void setup_solvers();
351 void setup_mappings();
357 void dump_matrices();
359 void checkpointing();
361 void balance_electrodes();
399 name =
"Laplace solver";
double SF_real
Use the general double as real type.
A vector storing arbitrary data.
The abstract physics interface we can use to trigger all physics.
virtual void output_timings()
const char * name
The name of the physic, each physic should have one.
SF::vector< stimulus > stimuli
the electrical stimuli
LAT_detector lat
the activation time detector
grid_t
An electrics grid identifier to distinguish between intra and extra grids.
phie_recovery_data phie_rcv
struct holding helper data for phie recovery
generic_timing_stats IO_stats
void destroy()
Currently we only need to close the file logger.
gvec_data gvec
datastruct holding global IMP state variable output
elliptic_solver ellip_solver
Solver for the elliptic bidomain equation.
MaterialType mtype[2]
the material types of intra_grid and extra_grid grids.
std::string timer_unit(const int timer_id)
figure out units of a signal linked to a given timer
parabolic_solver parab_solver
Solver for the parabolic bidomain equation.
double timer_val(const int timer_id)
figure out current value of a signal linked to a given timer
void initialize()
Initialize the Electrics.
igb_output_manager output_manager
class handling the igb output
Electrics()
Most of the initialization is done with initialize()
SF::index_mapping< mesh_int_t > petsc_to_nodal
int check_quiescence(double tm, double dt)
check for quiescence
void output_initial_activations()
output one nodal vector of initial activation time
void init(sf_vec &vm, sf_vec &phie, int offset, enum physic_t=elec_phys)
initializes all datastructs after electric solver setup
int check_acts(double tm)
check activations at sim time tm
SF::vector< Activation > acts
LAT_detector()
constructor, sets up basic datastructs from global_params
SF::vector< stimulus > stimuli
the electrical stimuli
elliptic_solver ellip_solver
Solver for the elliptic bidomain equation.
double timer_val(const int timer_id)
figure out current value of a signal linked to a given timer
std::string timer_unit(const int timer_id)
figure out units of a signal linked to a given timer
MaterialType mtype[2]
the material types of intra_grid and extra_grid grids.
igb_output_manager output_manager
class handling the igb output
manager for dirichlet boundary conditions
sf_mat * phie_mat
lhs matrix to solve elliptic
void rebuild_stiffness(MaterialType *mtype, SF::vector< stimulus > &stimuli, FILE_SPEC logger)
void rebuild_matrices(MaterialType *mtype, SF::vector< stimulus > &stimuli, FILE_SPEC logger)
sf_vec * phie_i
phi_e on intracellular grid
void solve(sf_mat &Ki, sf_vec &Vmv, sf_vec &tmp_i)
sf_sol * lin_solver
petsc or ginkgo lin_solver
sf_mat * mass_e
mass matrix for RHS elliptic calc
double tol
CG stopping tolerance.
bool phie_mat_has_nullspace
sf_vec * currtmp
temp vector for phiesrc
dbc_manager * dbc
dbcs require a dbc manager
int max_it
maximum number of iterations
void rebuild_mass(FILE_SPEC logger)
sf_vec * Ivol
global Vm vector
double tol
CG stopping tolerance.
sf_vec * Iact
global Vm vector
sf_vec * Diff_term
Diffusion current.
double final_residual
Holds the residual after convergence.
sf_mat * rhs_parab
rhs matrix to solve parabolic
sf_vec * kappa_i
scaling vector for intracellular mass matrix, M
void rebuild_matrices(MaterialType *mtype, limpet::MULTI_IF &miif, FILE_SPEC logger)
parabolic_t parab_tech
manner in which parabolic equations are solved
void solve(sf_vec &phie_i)
int niter
number of iterations
sf_vec * inv_mass_diag
inverse diagonal of mass matrix, for EXPLICIT solving
sf_mat * mass_i
lumped for parabolic problem
sf_vec * Ic
global Vm vector
sf_mat * u_mass_i
unscaled mass matrix, M
sf_vec * tmp_i2
scratch vector for i-grid
int max_it
maximum number of iterations
sf_mat * phie_recov_mat
rhs for phie recovery with pseudo bidomain
sf_vec * tmp_i1
scratch vector for i-grid
sf_mat * lhs_parab
lhs matrix (CN) to solve parabolic
sf_vec * Vmv
global Vm vector
sf_vec * Irhs
weighted transmembrane currents
sf_vec * old_vm
older Vm needed for 2nd order dT
sf_sol * lin_solver
petsc or ginkgo lin_solver
sf_vec * IIon
ionic currents
Electrical ionics functions and LIMPET wrappers.
physic_t
Identifier for the different physics we want to set up.
int stimidx_from_timeridx(const SF::vector< stimulus > &stimuli, const int timer_id)
determine link between timer and stimulus
void set_cond_type(MaterialType &m, cond_t type)
cond_t
description of electrical tissue properties
void compute_restr_idx_async(sf_mesh &mesh, SF::vector< mesh_int_t > &inp_idx, SF::vector< mesh_int_t > &idx)
void apply_stim_to_vector(const stimulus &s, sf_vec &vec, bool add)
void recover_phie_std(sf_vec &vm, phie_recovery_data &rcv)
bool have_dbc_stims(const SF::vector< stimulus > &stimuli)
return wheter any stimuli require dirichlet boundary conditions
void setup_dataout(const int dataout, std::string dataout_vtx, mesh_t grid, SF::vector< mesh_int_t > *&restr, bool async)
void constant_total_stimulus_current(SF::vector< stimulus > &stimuli, sf_mat &mass_i, sf_mat &mass_e, limpet::MULTI_IF *miif, FILE_SPEC logger)
Scales stimulus current to maintain constant total current across affected regions.
int postproc_recover_phie()
void balance_electrode(elliptic_solver &ellip, SF::vector< stimulus > &stimuli, int balance_from, int balance_to)
void set_elec_tissue_properties(MaterialType *mtype, Electrics::grid_t g, FILE_SPEC logger)
Fill the RegionSpec of an electrics grid with the associated inputs from the param parameters.
void compute_restr_idx(sf_mesh &mesh, SF::vector< mesh_int_t > &inp_idx, SF::vector< mesh_int_t > &idx)
mesh_t
The enum identifying the different meshes we might want to load.
void setup_phie_recovery_data(phie_recovery_data &data)
const char * get_tsav_ext(double time)
SF::abstract_matrix< SF_int, SF_real > sf_mat
Simulator-level utility execution control functions.
Electrical stimulation functions.
event detection data structures
char * ID
ID used to name output file.
sf_vec * dvp0
additional vector for derivative
sf_vec * dvp1
additional vector for derivative
char * prv_fname
file name of previous run when restarting
int nacts
number of events detected over time step
int all
determine all or first instants of activation
ActMethod method
method to check whether activation occured
PotType measurand
quantity being monitored
FILE_SPEC fout
output file
sf_vec * tm
activation times
int init
true if intialized
int * ibuf
buffer indices where activation occured
int mode
toggle mode from standard to reverse
int offset
node number offset (used for PS)
float threshold
threshold for detection of activation
double * actbuf
buffer activation times if method==all
char * fname
output file name
sf_vec * phip
previous value of signal
description of materal properties in a mesh
sentinel for checking activity in the tissue
bool activated
flag sentinel activation
int ID
ID of LAT detector used as sentinel.
double t_start
start of observation window
double t_window
duration of observation window
double t_quiesc
measure current duration of quiescence
for analysis of the #iterations to solve CG
for analysis of the #iterations to solve CG
sf_vec * dphi
Auxiliary vectors.
sf_vec * phie_rec
The phie recovery output vector buffer.
SF::vector< mesh_real_t > pts
The phie recovery locations.
SF_real gBath
Bath conductivity.