Skip to content

Commit

Permalink
Merge pull request #60 from bergolho/master
Browse files Browse the repository at this point in the history
New "ToRORd_Land" cellular model and minor changes
  • Loading branch information
rsachetto authored Oct 25, 2023
2 parents 167ada0 + baab358 commit 1c09ef8
Show file tree
Hide file tree
Showing 23 changed files with 4,510 additions and 375 deletions.
5 changes: 4 additions & 1 deletion ToDo
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,7 @@ When the minimum number of PMJs is not reached the solver will be in an infinite
<t> <sv_1> <sv_2> <sv_3> ... <sv_n>
. . . . .
. . . . .
. . . . .
. . . . .


Fix the "save_multiple_cell_state_variables". It cannot find the proper cell center.
64 changes: 64 additions & 0 deletions example_configs/activation_time_and_apd_example.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
[main]
num_threads=4
dt_pde=0.01
simulation_time=5000.0
abort_on_no_activity=false
use_adaptivity=false

[update_monodomain]
main_function=update_monodomain_default

[save_result]
print_rate=10
mesh_print_rate=100
mesh_format=ensight
output_dir=./outputs/cable_save_activation_time_and_apd_example
init_function=init_save_with_activation_times
end_function=end_save_with_activation_times
main_function=save_with_activation_times
time_threshold=0.0
activation_threshold=-50.0
apd_threshold=-70.0
save_visible_mask=false
remove_older_simulation=true

[assembly_matrix]
init_function=set_initial_conditions_fvm
sigma_x=0.0000176
sigma_y=0.0000176
sigma_z=0.0000176
library_file=shared_libs/libdefault_matrix_assembly.so
main_function=homogeneous_sigma_assembly_matrix

[linear_system_solver]
tolerance=1e-16
use_preconditioner=no
max_iterations=500
library_file=shared_libs/libdefault_linear_system_solver.so
use_gpu=no
main_function=conjugate_gradient
init_function=init_conjugate_gradient
end_function=end_conjugate_gradient

[domain]
name=Cable Mesh with no fibrosis
start_dx=100.0
start_dy=100.0
start_dz=100.0
cable_length=10000.0
main_function=initialize_grid_with_cable_mesh

[ode_solver]
adaptive=false
dt=0.01
use_gpu=false
gpu_id=0
library_file= shared_libs/libToRORd_dynCl_mixed_endo_mid_epi.so

[stim_plain]
start = 0.0
duration = 2.0
current = -53.0
x_limit = 500.0
period=1000.0
main_function=stim_if_x_less_than
79 changes: 79 additions & 0 deletions example_configs/cable_mesh_with_ToRORd_Land_endo_mid_epi.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# ===========================================================================
# Author: Lucas Berg
# Description: Simple simulation to test the ToRORd_Land model in a cable.
# When no [extra_data] information is provided all cells are
# considered to be control ENDO.
# ============================================================================
[main]
num_threads=6
dt_pde=0.01
simulation_time=1000.0
abort_on_no_activity=false
use_adaptivity=false

[update_monodomain]
main_function=update_monodomain_default

[save_result]
print_rate=100
output_dir=./outputs/cable_ToRORd_Land_endo_baseline_cpu_en
add_timestamp=false
binary=true
main_function=save_as_ensight

;[save_result]
;print_rate=1
;output_dir=./outputs/cable_ToRORd_Land_endo_baseline_cpu
;file_name=./outputs/cable_ToRORd_Land_endo_baseline_cpu/full_trace_first_cell_endo.txt
;output_dir=./outputs/cable_ToRORd_Land_mid_baseline_cpu
;file_name=./outputs/cable_ToRORd_Land_mid_baseline_cpu/full_trace_first_cell_mid.txt
;output_dir=./outputs/cable_ToRORd_Land_epi_baseline_cpu
;file_name=./outputs/cable_ToRORd_Land_epi_baseline_cpu/full_trace_first_cell_epi.txt
;main_function=save_one_cell_state_variables
;init_function=init_save_one_cell_state_variables
;end_function=end_save_one_cell_state_variables
;cell_center_x=50
;cell_center_y=50
;cell_center_z=50
;remove_older_simulation=true

[assembly_matrix]
init_function=set_initial_conditions_fvm
sigma_x=0.000176
sigma_y=0.000176
sigma_z=0.000176
library_file=shared_libs/libdefault_matrix_assembly.so
main_function=homogeneous_sigma_assembly_matrix

[linear_system_solver]
tolerance=1e-16
use_preconditioner=no
max_iterations=500
library_file=shared_libs/libdefault_linear_system_solver.so
use_gpu=yes
main_function=conjugate_gradient
init_function=init_conjugate_gradient
end_function=end_conjugate_gradient

[domain]
name=Cable Mesh with no fibrosis
start_dx=100.0
start_dy=100.0
start_dz=100.0
cable_length=20000.0
main_function=initialize_grid_with_cable_mesh

[ode_solver]
adaptive=false
dt=0.01
use_gpu=no
gpu_id=0
library_file= shared_libs/libToRORd_Land_mixed_endo_mid_epi.so

[stim_plain]
start = 0.0
duration = 1.0
;period = 800.0
current = -53.0
x_limit = 500.0
main_function = stim_if_x_less_than
37 changes: 19 additions & 18 deletions example_configs/cable_mesh_with_ToRORd_fkatp_endo_mid_epi.ini
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@

# ====================================================================
# Author: Lucas Berg
# Description:
# Description: Simple simulation to test the ToRORd_fkatp model in a cable.
# When no [extra_data] information is provided all cells are
# considered to be control ENDO.
# ====================================================================
[main]
num_threads=4
dt_pde=0.02
simulation_time=600.0
num_threads=6
dt_pde=0.01
simulation_time=500.0
abort_on_no_activity=false
use_adaptivity=false

[update_monodomain]
main_function=update_monodomain_default

; Save using ensight format and store the state variables as CELL_DATA
[save_result]
print_rate=50
output_dir=./outputs/cable_ToRORd_endo_mid_epi_cpu
main_function=save_as_vtu
init_function=init_save_as_vtk_or_vtu
end_function=end_save_as_vtk_or_vtu
save_pvd=true
file_prefix=V
print_rate=100
output_dir=./outputs/cable_ToRORd_fkatp_endo_baseline_cpu_en
add_timestamp=false
binary=true
save_ode_state_variables=true
main_function=save_as_ensight

#[save_result]
#print_rate=1
Expand All @@ -44,7 +45,7 @@ main_function=homogeneous_sigma_assembly_matrix
[linear_system_solver]
tolerance=1e-16
use_preconditioner=no
max_iterations=200
max_iterations=500
library_file=shared_libs/libdefault_linear_system_solver.so
use_gpu=no
main_function=conjugate_gradient
Expand All @@ -60,19 +61,19 @@ cable_length=20000.0
main_function=initialize_grid_with_cable_mesh

[ode_solver]
adaptive=true
dt=0.0001
adaptive=false
dt=0.01
use_gpu=no
gpu_id=0
library_file= shared_libs/libToRORd_fkatp_mixed_endo_mid_epi.so

[stim_plain]
start = 0.0
duration = 2.0
period = 1000.0
duration = 1.0
;period = 1000.0
current = -53.0
x_limit = 500.0
main_function=stim_if_x_less_than

[extra_data]
main_function=set_extra_data_mixed_model_epi_mid_endo
main_function=set_extra_data_mixed_torord_fkatp_epi_mid_endo
66 changes: 66 additions & 0 deletions example_configs/plain_mesh_ToRORd_Land_endo_mid_epi.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
[main]
num_threads=6
dt_pde=0.01
simulation_time=500.0
abort_on_no_activity=false
use_adaptivity=false

[update_monodomain]
main_function=update_monodomain_default

[save_result]
print_rate=100
output_dir=./outputs/plain_ToRORd_Land_endo_mid_epi_gpu_en
add_timestamp=false
binary=true
save_ode_state_variables=false
main_function=save_as_ensight

[assembly_matrix]
init_function=set_initial_conditions_fvm
sigma_x=0.000176
sigma_y=0.000176
sigma_z=0.000176
library_file=shared_libs/libdefault_matrix_assembly.so
main_function=homogeneous_sigma_assembly_matrix

[linear_system_solver]
tolerance=1e-16
use_preconditioner=no
max_iterations=500
library_file=shared_libs/libdefault_linear_system_solver.so
use_gpu=yes
main_function=conjugate_gradient
init_function=init_conjugate_gradient
end_function=end_conjugate_gradient

[domain]
name=Plain Mesh
num_layers=1
start_dx=100.0
start_dy=100.0
start_dz=100.0
side_length=20000
main_function=initialize_grid_with_square_mesh

[ode_solver]
adaptive=false
;reltol=1e-10
;abstol=1e-10
dt=0.01
use_gpu=yes
gpu_id=0
library_file= shared_libs/libToRORd_Land_mixed_endo_mid_epi.so

[stim_corner]
start = 0.0
duration = 1.0
current = -53.0
min_x = 0.0
max_x = 1000.0
min_y = 0.0
max_y = 1000.0
main_function=stim_x_y_limits

[extra_data]
main_function=set_extra_data_mixed_torord_Land_epi_mid_endo
22 changes: 5 additions & 17 deletions example_configs/plain_mesh_ToRORd_fkatp_endo_mid_epi.ini
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
[main]
num_threads=6
dt_pde=0.02
simulation_time=600.0
dt_pde=0.01
simulation_time=500.0
abort_on_no_activity=false
use_adaptivity=false

[update_monodomain]
main_function=update_monodomain_default

#[save_result]
#print_rate=50
#output_dir=./outputs/plain_ToRORd_endo_mid_epi
#main_function=save_as_vtu
#init_function=init_save_as_vtk_or_vtu
#end_function=end_save_as_vtk_or_vtu
#save_pvd=true
#file_prefix=V

[save_result]
print_rate=50
output_dir=./outputs/plain_ToRORd_endo_mid_epi_ensight
print_rate=100
output_dir=./outputs/plain_ToRORd_fkatp_endo_mid_epi_gpu_en
add_timestamp=false
binary=true
save_ode_state_variables=false
Expand All @@ -36,7 +27,7 @@ main_function=homogeneous_sigma_assembly_matrix
[linear_system_solver]
tolerance=1e-16
use_preconditioner=no
max_iterations=200
max_iterations=500
library_file=shared_libs/libdefault_linear_system_solver.so
use_gpu=yes
main_function=conjugate_gradient
Expand All @@ -56,9 +47,6 @@ main_function=initialize_grid_with_square_mesh
dt=0.01
use_gpu=yes
gpu_id=0
;adaptive=false
;abstol=1e-12
;reltol=1e-5
library_file= shared_libs/libToRORd_fkatp_mixed_endo_mid_epi.so

[stim_corner]
Expand Down
Loading

0 comments on commit 1c09ef8

Please sign in to comment.