88 void setup_linear_solver(
FILE_SPEC logger);
126 double final_residual = -1.0;
133 if (u_mass_i)
delete u_mass_i;
134 if (mass_i)
delete mass_i;
135 if (rhs_parab)
delete rhs_parab;
136 if (lhs_parab)
delete lhs_parab;
137 if (phie_recov_mat)
delete phie_recov_mat;
140 if (old_vm)
delete old_vm;
141 if (kappa_i)
delete kappa_i;
142 if (tmp_i1)
delete tmp_i1;
143 if (tmp_i2)
delete tmp_i2;
144 if (Irhs)
delete Irhs;
145 if (inv_mass_diag)
delete inv_mass_diag;
153 void setup_linear_solver(
FILE_SPEC logger);
155 void solve_CN(
sf_vec & phie_i);
156 void solve_O2dT(
sf_vec & phie_i);
157 void solve_EF(
sf_vec & phie_i);
173 double *actbuf =
nullptr;
178 char *fname =
nullptr;
180 char *prv_fname =
nullptr;
188 bool activated =
false;
189 double t_start = -1.0;
190 double t_window = -1.0;
191 double t_quiesc = -1.0;
199 int check_cross_threshold(
sf_vec & vm,
sf_vec & vmp,
double tm,
200 int *ibuf,
double *actbuf,
float threshold,
int mode);
203 int check_mx_derivative(
sf_vec & vm,
sf_vec & vmp,
double tm,
204 int *ibuf,
double *actbuf,
sf_vec & dvp0,
sf_vec & dvp1,
205 float threshold,
int mode);
219 int check_acts(
double tm);
222 int check_quiescence(
double tm,
double dt);
225 void output_initial_activations();
246 enum grid_t {intra_grid = 0, extra_grid};
316 double timer_val(
const int timer_id);
319 std::string timer_unit(
const int timer_id);
325 void setup_stimuli();
328 void stimulate_intracellular();
334 void stimulate_extracellular();
337 void setup_solvers();
340 void setup_mappings();
346 void dump_matrices();
348 void checkpointing();
350 void balance_electrodes();
388 name =
"Laplace solver";
396 double timer_val(
const int timer_id);
398 std::string timer_unit(
const int timer_id);
int nacts
number of events detected over time step
SF_real gBath
Bath conductivity.
bool have_dbc_stims(const SF::vector< stimulus > &stimuli)
return wheter any stimuli require dirichlet boundary conditions
dbc_manager * dbc
dbcs require a dbc manager
igb_output_manager output_manager
class handling the igb output
gvec_data gvec
datastruct holding global IMP state variable output
description of materal properties in a mesh
void setup_phie_recovery_data(phie_recovery_data &data)
void recover_phie_std(sf_vec &vm, phie_recovery_data &rcv)
SF::vector< mesh_real_t > pts
The phie recovery locations.
sf_vec * currtmp
temp vector for phiesrc
cond_t
description of electrical tissue properties
void solve(sf_mat &Ki, sf_vec &Vmv, sf_vec &tmp_i)
SF::vector< stimulus > stimuli
the electrical stimuli
elliptic_solver ellip_solver
Solver for the elliptic bidomain equation.
SF::index_mapping< mesh_int_t > petsc_to_nodal
int all
determine all or first instants of activation
SF::vector< Activation > acts
void constant_total_stimulus_current(SF::vector< stimulus > &stimuli, sf_mat &mass_i, sf_mat &mass_e, limpet::MULTI_IF *miif, FILE_SPEC logger)
PotType measurand
quantity being monitored
generic_timing_stats IO_stats
void rebuild_mass(FILE_SPEC logger)
int mode
toggle mode from standard to reverse
sf_mat * phie_mat
lhs matrix to solve elliptic
igb_output_manager output_manager
class handling the igb output
parabolic_solver parab_solver
Solver for the parabolic bidomain equation.
Electrics()
Most of the initialization is done with initialize()
event detection data structures
for analysis of the #iterations to solve CG
The abstract physics interface we can use to trigger all physics.
int init
true if intialized
ActMethod method
method to check whether activation occured
sf_sol * lin_solver
petsc or ginkgo lin_solver
float threshold
threshold for detection of activation
sentinel for checking activity in the tissue
int max_it
maximum number of iterations
manager for dirichlet boundary conditions
Electrical ionics functions and LIMPET wrappers.
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 set_cond_type(MaterialType &m, cond_t type)
elliptic_solver ellip_solver
Solver for the elliptic bidomain equation.
int offset
node number offset (used for PS)
SF::vector< stimulus > stimuli
the electrical stimuli
bool phie_mat_has_nullspace
virtual void output_timings()
sf_mat * mass_e
mass matrix for RHS elliptic calc
double tol
CG stopping tolerance.
void rebuild_stiffness(MaterialType *mtype, SF::vector< stimulus > &stimuli, FILE_SPEC logger)
Electrical stimulation functions.
A vector storing arbitrary data.
grid_t
An electrics grid identifier to distinguish between intra and extra grids.
void balance_electrode(SF::vector< stimulus > &stimuli, int balance_from, int balance_to)
sf_vec * phie_i
phi_e on intracellular grid
for analysis of the #iterations to solve CG
LAT_detector lat
the activation time detector
FILE_SPEC fout
output file
void rebuild_matrices(MaterialType *mtype, SF::vector< stimulus > &stimuli, FILE_SPEC logger)
double SF_real
Use the general double as real type.
void apply_stim_to_vector(const stimulus &s, sf_vec &vec, bool add)
int stimidx_from_timeridx(const SF::vector< stimulus > &stimuli, const int timer_id)
determine link between timer and stimulus
Simulator-level utility execution control functions.
phie_recovery_data phie_rcv
struct holding helper data for phie recovery
int postproc_recover_phie()