88 void setup_linear_solver(
FILE_SPEC logger);
128 double final_residual = -1.0;
135 if (u_mass_i)
delete u_mass_i;
136 if (mass_i)
delete mass_i;
137 if (rhs_parab)
delete rhs_parab;
138 if (lhs_parab)
delete lhs_parab;
139 if (phie_recov_mat)
delete phie_recov_mat;
142 if (old_vm)
delete old_vm;
143 if (kappa_i)
delete kappa_i;
144 if (tmp_i1)
delete tmp_i1;
145 if (tmp_i2)
delete tmp_i2;
146 if (Irhs)
delete Irhs;
147 if (inv_mass_diag)
delete inv_mass_diag;
155 void setup_linear_solver(
FILE_SPEC logger);
157 void solve_CN(
sf_vec & phie_i);
158 void solve_O2dT(
sf_vec & phie_i);
159 void solve_EF(
sf_vec & phie_i);
175 double *actbuf =
nullptr;
180 char *fname =
nullptr;
182 char *prv_fname =
nullptr;
190 bool activated =
false;
191 double t_start = -1.0;
192 double t_window = -1.0;
193 double t_quiesc = -1.0;
201 int check_cross_threshold(
sf_vec & vm,
sf_vec & vmp,
double tm,
202 int *ibuf,
double *actbuf,
float threshold,
int mode);
205 int check_mx_derivative(
sf_vec & vm,
sf_vec & vmp,
double tm,
206 int *ibuf,
double *actbuf,
sf_vec & dvp0,
sf_vec & dvp1,
207 float threshold,
int mode);
221 int check_acts(
double tm);
224 int check_quiescence(
double tm,
double dt);
227 void output_initial_activations();
248 enum grid_t {intra_grid = 0, extra_grid};
318 double timer_val(
const int timer_id);
321 std::string timer_unit(
const int timer_id);
327 void setup_stimuli();
330 void stimulate_intracellular();
336 void stimulate_extracellular();
339 void setup_solvers();
342 void setup_mappings();
348 void dump_matrices();
350 void checkpointing();
352 void balance_electrodes();
390 name =
"Laplace solver";
398 double timer_val(
const int timer_id);
400 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()