carputils
Doxygen code documentation for the python framework controlling openCARP
Functions
carputils.model.protocols.PSD_algorithm Namespace Reference

Functions

def PSD_algorithm (args, job, cmd, meshname, xyz, triangles, centre)
 Phase Singularity Distribution: More...
 
def eikonal_solver (nodes, triangles, knownNodes, phi0)
 
def local_bicstab (LinearOperator A_sol, LinearOperator M, f, rtol, maxiter)
 
def csr_row_set_nz_to_val (csr, row, value=0)
 Set all nonzero elements (elements currently in the sparsity pattern) to the given value. More...
 
def assign_wall_values (surface_points, all_points, surface_values)
 assignWallValues transfers phase data from the surface mesh to the volumetric mesh. More...
 
def deflate (x)
 
def planeInfo (coordinate, nodes, triangles)
 
def assignPhaseValues (seeds, originalCoord, directions, normV, point1, point2, nodes)
 
def makeCircle3D (startCoord, radius, seedNum, normV, point1, point2, nodes)
 

Function Documentation

◆ assign_wall_values()

def carputils.model.protocols.PSD_algorithm.assign_wall_values (   surface_points,
  all_points,
  surface_values 
)

assignWallValues transfers phase data from the surface mesh to the volumetric mesh.

Parameters
surface_pointsthe coordinates of all of the nodes on the surface mesh.
all_pointsthe coordinates of all of the nodes on the volumetric mesh.
surface_valuesthe phase values corresponding with the nodes on the surface mesh.
Returns
returns a phi matrix which contains phase values for every point on the volumetric mesh.

◆ assignPhaseValues()

def carputils.model.protocols.PSD_algorithm.assignPhaseValues (   seeds,
  originalCoord,
  directions,
  normV,
  point1,
  point2,
  nodes 
)

◆ csr_row_set_nz_to_val()

def carputils.model.protocols.PSD_algorithm.csr_row_set_nz_to_val (   csr,
  row,
  value = 0 
)

Set all nonzero elements (elements currently in the sparsity pattern) to the given value.

Useful to set to 0 mostly.

◆ deflate()

def carputils.model.protocols.PSD_algorithm.deflate (   x)

◆ eikonal_solver()

def carputils.model.protocols.PSD_algorithm.eikonal_solver (   nodes,
  triangles,
  knownNodes,
  phi0 
)

◆ local_bicstab()

def carputils.model.protocols.PSD_algorithm.local_bicstab ( LinearOperator  A_sol,
LinearOperator  M,
  f,
  rtol,
  maxiter 
)

◆ makeCircle3D()

def carputils.model.protocols.PSD_algorithm.makeCircle3D (   startCoord,
  radius,
  seedNum,
  normV,
  point1,
  point2,
  nodes 
)

◆ planeInfo()

def carputils.model.protocols.PSD_algorithm.planeInfo (   coordinate,
  nodes,
  triangles 
)

◆ PSD_algorithm()

def carputils.model.protocols.PSD_algorithm.PSD_algorithm (   args,
  job,
  cmd,
  meshname,
  xyz,
  triangles,
  centre 
)

Phase Singularity Distribution:

It consists of manually placing phase singularities on the geometrical model and then solving the Eikonal equation to estimate the activation time map. Based on this initial state, you can simulate electrical wave propagation by solving the monodomain equation.

Input parser arguments (args), output directory (job.ID), struct containing imp_regions and gregions (cmd_ref), meshname, stimulation point location (x,y,z) and prepacing directory (steady_state_dir)

'--M_lump',
type=int,
default='1',
help='set 1 for mass lumping, 0 otherwise. Mass lumping will speed up the simulation. Use with regular meshes.'
'--cv',
type=float,
default=0.3,
help='conduction velocity in m/s'
'--PSD_bcl',
type=float,
default=160,
help='BCL in ms'
'--radius',
type=float,
default=10000.0,
help='radius of circles in which to set the phase from -pi to +pi'
'--seeds',
type=int,
default=50,
help='# of initial seeds in which to set the phase from -pi to +pi'
'--chirality',
type=int,
default=-1,
help='Chirality of the rotation: -1 for counterclockwise, 1 for clockwise'