21 class parabolic_solver_emi
26 enum parabolic_t {SEMI_IMPLICIT = 0};
49 sf_vec* vb_one_face =
nullptr;
50 sf_vec* vb_both_face =
nullptr;
51 sf_vec* vb_unique_face =
nullptr;
53 sf_vec* Ib_one_face =
nullptr;
54 sf_vec* Ib_both_face =
nullptr;
55 sf_vec* Ib_unique_face =
nullptr;
56 sf_vec* Iij_stim =
nullptr;
57 sf_vec* Iij_temp =
nullptr;
60 sf_mat* mass_emi =
nullptr;
61 sf_mat* mass_surf_emi =
nullptr;
63 sf_mat* stiffness_emi =
nullptr;
69 sf_mat* operator_unique_to_both_faces =
nullptr;
70 sf_mat* operator_both_to_unique_face =
nullptr;
73 std::pair<SF::emi_face<mesh_int_t,SF::tuple<mesh_int_t>>,
74 SF::emi_face<mesh_int_t,SF::tuple<mesh_int_t>>>> line_face;
76 std::pair<SF::emi_face<mesh_int_t,SF::triple<mesh_int_t>>,
77 SF::emi_face<mesh_int_t,SF::triple<mesh_int_t>>>> tri_face;
79 std::pair<SF::emi_face<mesh_int_t,SF::quadruple<mesh_int_t>>,
80 SF::emi_face<mesh_int_t,SF::quadruple<mesh_int_t>>>> quad_face;
109 sf_sol* lin_solver =
nullptr;
112 lin_solver_stats stats;
115 dbc_manager* dbc =
nullptr;
116 bool phie_mat_has_nullspace =
false;
117 bool fem_matrices_exact_preallocated =
false;
122 parabolic_t parab_tech = SEMI_IMPLICIT;
125 double final_residual = -1.0;
128 ~parabolic_solver_emi()
131 if (lin_solver)
delete lin_solver;
133 if (mass_emi)
delete mass_emi;
134 if (mass_surf_emi)
delete mass_surf_emi;
135 if (lhs_emi)
delete lhs_emi;
136 if (stiffness_emi)
delete stiffness_emi;
141 if (operator_unique_to_both_faces)
delete operator_unique_to_both_faces;
142 if (operator_both_to_unique_face)
delete operator_both_to_unique_face;
147 if (ui_pre)
delete ui_pre;
150 if (vb_both_face)
delete vb_both_face;
151 if (vb_unique_face)
delete vb_unique_face;
154 if (Ib_both_face)
delete Ib_both_face;
155 if (Ib_unique_face)
delete Ib_unique_face;
156 if (Iij_stim)
delete Iij_stim;
157 if (Iij_temp)
delete Iij_temp;
158 if (Irhs)
delete Irhs;
175 void setup_linear_solver(
FILE_SPEC logger);
177 void solve_semiImplicit();
180 class EMI :
public Basic_physic
185 MaterialType mtype_vol[1];
186 MaterialType_EMI mtype_face;
197 parabolic_solver_emi parab_solver;
200 gvec_data_OnFace gvec;
203 igb_output_manager output_manager;
211 phie_recovery_data phie_rcv;
213 generic_timing_stats IO_stats;
244 inline void output_timings()
247 compute_time -= ion.compute_time;
248 initialize_time -= ion.initialize_time;
253 ion.output_timings();
261 double timer_val(
const int timer_id);
264 std::string timer_unit(
const int timer_id);
305 void setup_stimuli();
330 void apply_current_stimulus();
340 void setup_itm_faces();
361 void apply_dbc_stimulus();
398 void balance_electrodes();
454 void setup_solvers();
457 void setup_mappings();
463 void dump_matrices();
465 void checkpointing();
469 void dump_field_state(
const char* roe_fnm);
473 void restore_field_state(
const char* roe_fnm);
476 void setup_EMI_mesh();
486 void log_mesh_local_element_ranges(
const sf_mesh& emi_mesh,
487 const sf_mesh& emi_surfmesh_w_counter_face,
488 const sf_mesh& emi_surfmesh_unique_face);
501 void partition_based_tags(
int num_tags,
512 int expected_num_tags,
opencarp::local_index_t mesh_int_t
virtual void output_timings()
Tissue level electrics, main Electrics physics class.
LIMPET ionics and gap-junction models on the EMI unique-face interface mesh.
SF::abstract_linear_solver< SF_int, SF_real > sf_sol
SF::meshdata< mesh_int_t, mesh_real_t > sf_mesh
@ emi_surface_unique_face_msh
SF::abstract_vector< SF_int, SF_real > sf_vec
SF::abstract_matrix< SF_int, SF_real > sf_mat