93 void setup_linear_solver(
FILE_SPEC logger);
137 double final_residual = -1.0;
144 if (u_mass_i)
delete u_mass_i;
145 if (mass_i)
delete mass_i;
146 if (rhs_parab)
delete rhs_parab;
147 if (lhs_parab)
delete lhs_parab;
148 if (phie_recov_mat)
delete phie_recov_mat;
151 if (old_vm)
delete old_vm;
152 if (kappa_i)
delete kappa_i;
153 if (tmp_i1)
delete tmp_i1;
154 if (tmp_i2)
delete tmp_i2;
155 if (Irhs)
delete Irhs;
156 if (inv_mass_diag)
delete inv_mass_diag;
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);
184 double *actbuf =
nullptr;
189 char *fname =
nullptr;
191 char *prv_fname =
nullptr;
199 bool activated =
false;
200 double t_start = -1.0;
201 double t_window = -1.0;
202 double t_quiesc = -1.0;
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);
230 int check_acts(
double tm);
233 int check_quiescence(
double tm,
double dt);
236 void output_initial_activations();
257 enum grid_t {intra_grid = 0, extra_grid};
327 double timer_val(
const int timer_id);
330 std::string timer_unit(
const int timer_id);
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";
407 double timer_val(
const int timer_id);
409 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)
void balance_electrode(elliptic_solver &ellip, SF::vector< stimulus > &stimuli, int balance_from, int balance_to)
mesh_t
The enum identifying the different meshes we might want to load.
physic_t
Identifier for the different physics we want to set up.
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
const char * get_tsav_ext(double time)
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)
void compute_restr_idx(sf_mesh &mesh, SF::vector< mesh_int_t > &inp_idx, SF::vector< mesh_int_t > &idx)
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.
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)
void setup_dataout(const int dataout, std::string dataout_vtx, mesh_t grid, SF::vector< mesh_int_t > *&restr, bool async)
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
void compute_restr_idx_async(sf_mesh &mesh, SF::vector< mesh_int_t > &inp_idx, SF::vector< mesh_int_t > &idx)
int postproc_recover_phie()