carputils
Doxygen code documentation for the python framework controlling openCARP
Classes | Functions
carputils.model.general Namespace Reference

The core infrastructure of the model component classes. More...

Classes

class  AbstractIonicModel
 
class  AbstractMechanicsMaterial
 
class  AbstractModelComponent
 Describes an abstract model component. More...
 
class  AbstractPlugin
 
class  AddModifier
 Describes a parameter add modifier. More...
 
class  ExternalIonicModel
 Describes the passive ionic model configuration. More...
 
class  ModelMixin
 More concrete version of the ParameterSetMixin for ep/mechanics models. More...
 
class  Modifier
 Describes a parameter assigment modifier. More...
 
class  MultModifier
 Describes a parameter multiply modifier. More...
 
class  NoPlugin
 Placeholder representing no plugin to be used. More...
 
class  ParameterSet
 Describes a set of parameters that can be generated into a single string. More...
 
class  ParameterSetMixin
 A mixin to add a parameter set field to a model component class. More...
 
class  RegionMixin
 A mixin to add region fields to a model component class. More...
 
class  SingleIDRegionMixin
 A mixin to add fields for a single-ID region to a model component class. More...
 

Functions

def ensure_set (obj, attributes)
 Check that the named attributes are not None on an object. More...
 
def optionlist (components)
 Generate a list of command line options from the specified components. More...
 
def convert_param_dict (params)
 convert parameter dict to comma separated string list More...
 

Detailed Description

The core infrastructure of the model component classes.

Concepts

model component Model components are some aspect of an openCARP simulation setup that can be mapped onto a particular part of the command line. These can be things like ionic model regions, conductivity regions and stimuli. param The tool used to generate the openCARP command line. param structure A structure in param that forms part of an array within the command line options and has attributes that can be set by dot notation e.g. -stim[0].name. field A single attribute of a param structure, e.g. 'name' in the stimulus example above. parameter set A set of options that are passed to openCARP as a single field in a single string in a p1=0,p2=4 format.

Implementation Information

This module makes use of Python's multiple class inheritance functionality to combine features in a modular way. An important aspect of this is are the 'Mixin' classes - these are classes which are not intended to be used directly, but are intended to add additional functionality by being combined with other classes through multiple inheritance.

Multiple inheritance is used in the classes of this module in their __init__ initialiser methods and opt methods. Note the use of super in these methods

Function Documentation

◆ convert_param_dict()

def carputils.model.general.convert_param_dict (   params)

convert parameter dict to comma separated string list

◆ ensure_set()

def carputils.model.general.ensure_set (   obj,
  attributes 
)

Check that the named attributes are not None on an object.

◆ optionlist()

def carputils.model.general.optionlist (   components)

Generate a list of command line options from the specified components.