Nektar++
|
Public Member Functions | |
def | writeln_hpp (self, *args, **kwargs) |
def | translate (self, *args, **kwargs) |
def | final_configuration_hook (self) |
def | output_includes (self, base_class=None) |
def | set_access (self, access) |
def | output_method_start (self, method_name, args, ret_type, access=None, defaults=[]) |
def | output_derived_quantities (self) |
def | output_serialize_method (self) |
def | output_cell_parameters (self) |
def | output_default_stimulus (self) |
def | output_intracellular_calcium (self) |
def | code_name (self, var, *args, **kwargs) |
def | output_top_boilerplate (self) |
def | unsigned_v_index (self) |
def | output_verify_state_variables (self) |
def | output_constructor (self, params, base_class_params) |
def | output_extra_constructor_content (self) |
def | output_chaste_lut_methods (self) |
def | lut_parameters (self, key) |
def | output_lut_indexing_methods (self) |
def | output_table_index_checking (self, key, idx, call_method=True) |
def | output_table_index_generation_code (self, key, idx, call_method=True) |
def | output_lut_class (self) |
def | output_state_assignments (self, exclude_nonlinear=False, assign_rY=True, nodeset=None, pointer='') |
def | modifier_call (self, var, current_value) |
def | vector_index (self, vector, i) |
def | vector_create (self, vector, size) |
def | vector_initialise (self, vector, size) |
def | output_nonlinear_state_assignments (self, nodeset=None) |
def | get_stimulus_assignment (self) |
def | output_equations (self, nodeset, zero_stimulus=False) |
def | output_assignment (self, expr) |
def | output_mathematics (self) |
def | calculate_lookup_table_indices (self, nodeset, time_name=None) |
def | output_get_i_ionic (self) |
def | output_evaluate_y_derivatives (self, method_name='EvaluateYDerivatives') |
def | output_derivative_calculations (self, state_vars, assign_rY=False, extra_nodes=set(), extra_table_nodes=set()) |
def | output_backward_euler_mathematics (self) |
def | output_rush_larsen_mathematics (self) |
def | output_derivative_calculations_grl (self, var, assign_rY=False, extra_nodes=set(), extra_table_nodes=set()) |
def | find_grl_partial_derivatives (self) |
def | output_grl_compute_partial (self, i, var) |
def | output_grl1_mathematics (self) |
def | output_grl2_mathematics (self) |
def | output_model_attributes (self) |
def | output_bottom_boilerplate (self) |
def | output_lhs (self, expr) |
def | output_variable (self, ci_elt, ode=False) |
def | output_function (self, func_name, args, *posargs, **kwargs) |
Public Member Functions inherited from CellMLToNektar.translators.CellMLTranslator | |
def | register (cls, subclass, name) |
def | __init__ (self, add_timestamp=True, options=None) |
def | error (self, lines, xml=None) |
def | config (self) |
def | translate (self, doc, model_filename, output_filename=None, subsidiary_file_name=None, class_name=None, v_variable=None, continuation=None, lookup_method_prefix='', row_lookup_method=False, lt_index_uses_floor=True, constrain_table_indices=False) |
def | final_configuration_hook (self) |
def | output_file_name (self, model_filename) |
def | subsidiary_file_name (self, output_filename) |
def | send_main_output_to_subsidiary (self, to_subsidiary=True) |
def | writeln (self, *args, **kwargs) |
def | write (self, *args) |
def | capture_output (self) |
def | get_captured_output (self) |
def | output_comment (self, *args, **kwargs) |
def | output_doxygen (self, *args, **kwargs) |
def | set_indent (self, level=None, offset=None) |
def | code_name (self, var, ode=False, prefix=None) |
def | varobj (self, varname) |
def | var_display_name (self, var) |
def | include_guard (self) |
def | output_top_boilerplate (self) |
def | output_mathematics (self) |
def | output_bottom_boilerplate (self) |
def | output_assignment (self, expr) |
def | output_lhs (self, expr) |
def | output_variable (self, ci_elt, ode=False) |
def | output_expr (self, expr, paren) |
def | output_number (self, expr) |
def | eval_number (self, expr) |
def | output_apply (self, expr, paren) |
def | output_function (self, func_name, args, paren, reciprocal=False) |
def | output_nary_operator (self, operator, operands, paren) |
def | output_unary_operator (self, operator, operand, paren) |
def | output_binary_operator (self, operator, operands, paren, expr) |
def | output_root (self, expr, paren) |
def | output_log (self, expr, paren) |
def | output_minus (self, expr, paren) |
def | output_piecewise (self, expr, paren) |
def | open_paren (self, paren) |
def | close_paren (self, paren) |
def | open_block (self, **kwargs) |
def | close_block (self, blank_line=True, **kwargs) |
def | calculate_extended_dependencies (self, nodes, prune=[], prune_deps=[]) |
Dependency related methods #. More... | |
def | output_equations (self, nodeset) |
def | scan_for_lookup_tables (self) |
Lookup table methods #. More... | |
def | lut_access_code (self, table_index, table_name, i) |
def | lut_parameters (self, key) |
def | lut_size_calculation (self, min, max, step) |
def | output_lut_generation (self, only_index=None) |
def | output_lut_deletion (self, only_index=None) |
def | output_lut_declarations (self) |
def | output_lut_index_declarations (self, idx) |
def | output_lut_indices (self) |
def | output_lut_methods (self) |
def | output_single_lookup (self, tidx, tname, result) |
def | output_lut_row_lookup_methods (self) |
def | output_lut_row_lookup_memory (self) |
def | is_lookup_table (self, expr) |
def | contained_table_indices (self, node) |
def | lut_factor (self, idx, include_comma=False, include_type=False) |
def | output_table_lookup (self, expr, paren) |
def | output_table_index_generation (self, time_name, nodeset=set()) |
def | output_table_index_checking (self, key, idx) |
def | output_table_index_generation_code (self, key, idx) |
Static Public Member Functions | |
def | get_current_units_options (model) |
def | add_special_conversions (converter, comp) |
def | generate_interface (doc, solver_info) |
def | generate_interface (doc, solver_info) |
Static Public Attributes | |
bool | USES_SUBSIDIARY_FILE = True |
string | TYPE_VECTOR = 'std::vector<double> ' |
string | TYPE_VECTOR_REF = 'std::vector<double>& ' |
list | NODESET = [] |
string | MEMBRANE_CAPACITANCE_NAME = u'chaste_membrane_capacitance' |
string | INTERFACE_COMPONENT_NAME = u'chaste_interface' |
Static Public Attributes inherited from CellMLToNektar.translators.CellMLTranslator | |
dictionary | translators = {} |
string | STMT_END = ';' |
Various language tokens #. More... | |
string | EQ_ASSIGN = ' = ' |
string | COMMENT_START = '// ' |
string | DOXYGEN_COMMENT_START = '//! ' |
string | TYPE_DOUBLE = 'NekDouble ' |
string | TYPE_VOID = 'void ' |
string | TYPE_CONST_DOUBLE = 'const NekDouble ' |
string | TYPE_CONST_UNSIGNED = 'const unsigned ' |
string | TRUE = 'true' |
string | FALSE = 'false' |
string | PI = 'M_PI' |
string | E = 'M_E' |
string | NOT_A_NUMBER = 'NAN' |
bool | USES_SUBSIDIARY_FILE = False |
dictionary | FILE_EXTENSIONS |
dictionary | function_map |
dictionary | recip_trig |
dictionary | nary_ops |
dictionary | binary_ops |
dictionary | special_roots = {2: 'sqrt', 3: 'cbrt'} |
Private Attributes | |
_last_method_access | |
As CellMLTranslator, but targets more recent Chaste style. Includes the ability to output a cell that can solve itself using backward Euler, if the appropriate analyses have been done on the model. (See the -J and -j options to translate.py.)
Definition at line 21 of file CellMLToNektarTranslator.py.
|
static |
Add special units conversions for ionic currents. Adds conversions for the two other common conventions to/from the units expected by Chaste, uA/cm^2. The cases are: 1. Current in amps/farads. In this case we convert to uA/uF then multiply by Chaste's value for the membrane capacitance (in uF/cm^2). 2. Current in amps, capacitance in farads. We assume the cell model conceptually represents a cell, and hence that its membrane capacitance is supposed to represent the same thing as Chaste's. Thus convert current to uA, capacitance to uF, and return current/capacitance * Chaste's capacitance. comp is a component to which we should add any necessary variables, i.e. Chaste's capacitance.
Definition at line 2324 of file CellMLToNektarTranslator.py.
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.calculate_lookup_table_indices | ( | self, | |
nodeset, | |||
time_name = None |
|||
) |
Output the lookup table index calculations needed for the given equations, if tables are enabled. If time_name is given, it may be used in exception messages for tables out of bounds. Note that it is needed to be passed in, since GetIIonic does not know the time. Returns the subset of nodeset used in calculating the indices.
Definition at line 1295 of file CellMLToNektarTranslator.py.
References CellMLToNektar.translators.CellMLTranslator.output_table_index_generation(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.use_lookup_tables, and CellMLToNektar.translators.CellMLTranslator.use_lookup_tables.
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_backward_euler_mathematics(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derivative_calculations(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derivative_calculations_grl(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derived_quantities(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_get_i_ionic(), and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_grl_compute_partial().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.code_name | ( | self, | |
var, | |||
* | args, | ||
** | kwargs | ||
) |
Return the full name of var in a form suitable for inclusion in a source file. Overrides the base class version to access mParameters for parameters.
Reimplemented from CellMLToNektar.translators.CellMLTranslator.
Definition at line 445 of file CellMLToNektarTranslator.py.
References CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.code_name(), CellMLToNektar.translators.CellMLTranslator.code_name(), CellMLToNektar.translators.CellMLTranslator.free_vars, CellMLToNektar.processors.ModelModifier.model, CellMLToNektar.pycml.cellml_variable.model(), CellMLToNektar.pycml.mathml.model(), CellMLToNektar.translators.CellMLTranslator.model, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.use_modifiers, and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.vector_index().
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.code_name(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.get_stimulus_assignment(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.modifier_call(), CellMLToNektar.translators.CellMLTranslator.output_apply(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_assignment(), CellMLToNektar.translators.CellMLTranslator.output_assignment(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_backward_euler_mathematics(), CellMLToNektar.translators.CellMLTranslator.output_bottom_boilerplate(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derivative_calculations(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derivative_calculations_grl(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derived_quantities(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_equations(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_evaluate_y_derivatives(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_grl1_mathematics(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_grl2_mathematics(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_grl_compute_partial(), CellMLToNektar.translators.CellMLTranslator.output_lhs(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_lut_class(), CellMLToNektar.translators.CellMLTranslator.output_lut_generation(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_lut_indexing_methods(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_nonlinear_state_assignments(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_rush_larsen_mathematics(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_state_assignments(), CellMLToNektar.translators.CellMLTranslator.output_table_index_checking(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_table_index_checking(), CellMLToNektar.translators.CellMLTranslator.output_table_index_generation_code(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_table_index_generation_code(), CellMLToNektar.translators.CellMLTranslator.output_top_boilerplate(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_variable(), and CellMLToNektar.translators.CellMLTranslator.output_variable().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.final_configuration_hook | ( | self | ) |
Set the LT method prefix (requires self.class_name to be set).
Reimplemented from CellMLToNektar.translators.CellMLTranslator.
Definition at line 65 of file CellMLToNektarTranslator.py.
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.find_grl_partial_derivatives | ( | self | ) |
If we have analytic Jacobian information available from Maple, find the terms needed for GRL methods. This caches where the diagonal entries are in the matrix, indexed by the state variable objects currently in use, since the entries in the matrix may reference non-partially-evaluated variables.
Definition at line 1830 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_grl1_mathematics(), and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_grl2_mathematics().
|
static |
Generate an interface component connecting the model to Chaste. On return from this method, Chaste code will only need to interact with variables in the new interface component. It will contain the transmembrane potential, the ionic and stimulus currents, the simulation time, and the derivatives. It may also contain other variables depending on the model, for example the intracellular calcium concentration (if annotated), modifiable parameters, and derived quantities. If the --convert-interfaces option has been supplied, units conversion will then be performed on this component, ensuring that all these variables are in the units expected by Chaste and linked by suitable conversions to the rest of the model. Note that if partial evaluation is then performed, the model will be collapsed into a single component. However, the interface will still be preserved in the correct units.
Reimplemented from CellMLToNektar.translators.CellMLTranslator.
Definition at line 2365 of file CellMLToNektarTranslator.py.
References CellMLToNektar.pycml.dimensionally_equivalent(), and CellMLToNektar.pycml.simplify().
|
static |
Return a list of units objects that give the possibilities for the dimensions of transmembrane ionic currents.
Definition at line 2301 of file CellMLToNektarTranslator.py.
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.get_stimulus_assignment | ( | self | ) |
Return code for getting Chaste's stimulus current.
Definition at line 1136 of file CellMLToNektarTranslator.py.
References CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.code_name(), CellMLToNektar.translators.CellMLTranslator.code_name(), Nektar::LibUtilities::H5DataSource.doc, CellMLToNektar.optimize.PartialEvaluator.doc, CellMLToNektar.optimize.LookupTableAnalyser.doc, CellMLToNektar.translators.CellMLTranslator.doc, CellMLToNektar.translators.ConfigurationStore.doc, CellMLToNektar.translators.CellMLTranslator.EQ_ASSIGN, CellMLToNektar.translators.CellMLTranslator.free_vars, and CellMLToNektar.translators.CellMLTranslator.STMT_END.
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_equations().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.lut_parameters | ( | self, | |
key | |||
) |
Get the bounds and step size for a particular table. key should be a key into self.lookup_table_indices. Returns (min, max, step) suitable for putting in generated code.
Reimplemented from CellMLToNektar.translators.CellMLTranslator.
Definition at line 861 of file CellMLToNektarTranslator.py.
References Nektar::LibUtilities::H5DataSource.doc, CellMLToNektar.optimize.PartialEvaluator.doc, CellMLToNektar.optimize.LookupTableAnalyser.doc, CellMLToNektar.translators.CellMLTranslator.doc, CellMLToNektar.translators.ConfigurationStore.doc, and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.lut_parameters().
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.lut_parameters(), CellMLToNektar.translators.CellMLTranslator.output_lut_generation(), CellMLToNektar.translators.CellMLTranslator.output_table_index_checking(), and CellMLToNektar.translators.CellMLTranslator.output_table_index_generation_code().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.modifier_call | ( | self, | |
var, | |||
current_value | |||
) |
Return code for a call to a modifier function for an oxmeta-annotated variable. The modifier function takes 2 parameters: the current value of the variable, and the current time. It returns a modified value for the variable.
Definition at line 1105 of file CellMLToNektarTranslator.py.
References CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.code_name(), CellMLToNektar.translators.CellMLTranslator.code_name(), and CellMLToNektar.translators.CellMLTranslator.free_vars.
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_state_assignments().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_assignment | ( | self, | |
expr | |||
) |
Output an assignment statement. Has overrides for various special cases.
Reimplemented from CellMLToNektar.translators.CellMLTranslator.
Definition at line 1179 of file CellMLToNektarTranslator.py.
References CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.cell_parameters, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.code_name(), CellMLToNektar.translators.CellMLTranslator.code_name(), CellMLToNektar.optimize.LookupTableAnalyser.config(), CellMLToNektar.translators.CellMLTranslator.config(), CellMLToNektar.translators.CellMLTranslator.EQ_ASSIGN, CellMLToNektar.translators.CellMLTranslator.open_block(), CellMLToNektar.translators.CellMLTranslator.output_comment(), CellMLToNektar.translators.CellMLTranslator.STMT_END, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.TYPE_DOUBLE, CellMLToNektar.translators.CellMLTranslator.TYPE_DOUBLE, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.use_backward_euler, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.use_modifiers, CellMLToNektar.translators.CellMLTranslator.v_variable, and CellMLToNektar.translators.CellMLTranslator.writeln().
Referenced by CellMLToNektar.translators.CellMLTranslator.output_equations(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_equations(), and CellMLToNektar.translators.CellMLTranslator.output_mathematics().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_backward_euler_mathematics | ( | self | ) |
Output the mathematics methods used in a backward Euler cell. Outputs ComputeResidual, ComputeJacobian, UpdateTransmembranePotential and ComputeOneStepExceptVoltage.
Definition at line 1572 of file CellMLToNektarTranslator.py.
References CellMLToNektar.translators.CellMLTranslator._vars_in(), CellMLToNektar.translators.CellMLTranslator.calculate_extended_dependencies(), CellMLToNektar.pycml.cellml_model.calculate_extended_dependencies(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.calculate_lookup_table_indices(), CellMLToNektar.translators.CellMLTranslator.class_name, CellMLToNektar.translators.CellMLTranslator.close_block(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.code_name(), CellMLToNektar.translators.CellMLTranslator.code_name(), CellMLToNektar.translators.CellMLTranslator.COMMENT_START, CellMLToNektar.optimize.LookupTableAnalyser.config(), CellMLToNektar.translators.CellMLTranslator.config(), Nektar::LibUtilities::H5DataSource.doc, CellMLToNektar.optimize.PartialEvaluator.doc, CellMLToNektar.optimize.LookupTableAnalyser.doc, CellMLToNektar.translators.CellMLTranslator.doc, CellMLToNektar.translators.ConfigurationStore.doc, CellMLToNektar.translators.CellMLTranslator.EQ_ASSIGN, CellMLToNektar.translators.CellMLTranslator.free_vars, CellMLToNektar.processors.ModelModifier.model, CellMLToNektar.pycml.cellml_variable.model(), CellMLToNektar.pycml.mathml.model(), CellMLToNektar.translators.CellMLTranslator.model, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.nonlinear_system_size, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.nonlinear_system_vars, CellMLToNektar.translators.CellMLTranslator.open_block(), CellMLToNektar.translators.CellMLTranslator.output_comment(), CellMLToNektar.translators.CellMLTranslator.output_equations(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_equations(), CellMLToNektar.translators.CellMLTranslator.output_expr(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_method_start(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_nonlinear_state_assignments(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_state_assignments(), CellMLToNektar.translators.CellMLTranslator.state_vars, CellMLToNektar.translators.CellMLTranslator.STMT_END, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.TYPE_CONST_DOUBLE, CellMLToNektar.translators.CellMLTranslator.TYPE_CONST_DOUBLE, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.TYPE_DOUBLE, CellMLToNektar.translators.CellMLTranslator.TYPE_DOUBLE, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.v_index, CellMLToNektar.translators.CellMLTranslator.v_index, CellMLToNektar.translators.CellMLTranslator.varobj(), CellMLToNektar.translators.CellMLTranslator.write(), CellMLToNektar.translators.CellMLTranslator.writeln(), and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.writeln_hpp().
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_mathematics().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_bottom_boilerplate | ( | self | ) |
Output bottom boilerplate. End class definition, output ODE system information (to .cpp) and serialization code (to .hpp), and end the file.
Reimplemented from CellMLToNektar.translators.CellMLTranslator.
Definition at line 2147 of file CellMLToNektarTranslator.py.
References CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.cell_parameters, CellMLToNektar.translators.CellMLTranslator.class_name, CellMLToNektar.translators.CellMLTranslator.close_block(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.derived_quantities, CellMLToNektar.translators.CellMLTranslator.NOT_A_NUMBER, CellMLToNektar.translators.CellMLTranslator.open_block(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_model_attributes(), CellMLToNektar.translators.CellMLTranslator.set_indent(), CellMLToNektar.translators.CellMLTranslator.state_vars, CellMLToNektar.translators.CellMLTranslator.TYPE_VOID, CellMLToNektar.translators.CellMLTranslator.var_display_name(), and CellMLToNektar.translators.CellMLTranslator.writeln().
Referenced by CellMLToNektar.translators.CellMLTranslator.translate().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_cell_parameters | ( | self | ) |
Output declarations, set & get methods for cell parameters. Sets self.cell_parameters to be those constant variables annotated with pycml:modifiable-parameter. These use the mParameters functionality in Chaste. Also collects any variables annotated with an RDF oxmeta name into self.metadata_vars. Only constants and state variables are included.
Definition at line 309 of file CellMLToNektarTranslator.py.
References CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.cell_parameters, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.metadata_vars, and CellMLToNektar.translators.ConfigurationStore.metadata_vars.
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_chaste_lut_methods | ( | self | ) |
Output lookup table declarations & methods, if not using a separate class, or output the method to get a pointer to the lookup table collection.
Definition at line 843 of file CellMLToNektarTranslator.py.
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_constructor | ( | self, | |
params, | |||
base_class_params | |||
) |
Output a cell constructor. params is a list of constructor parameters, entries of which should be strings including both type and parameter name, which will be included verbatim in the generated code. base_class_params is a list of parameters to be supplied to the base class constructor. Entries will be converted to strings.
Definition at line 704 of file CellMLToNektarTranslator.py.
References CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.cell_parameters, CellMLToNektar.translators.CellMLTranslator.class_name, CellMLToNektar.translators.CellMLTranslator.COMMENT_START, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.derived_quantities, Nektar::LibUtilities::H5DataSource.doc, CellMLToNektar.optimize.PartialEvaluator.doc, CellMLToNektar.optimize.LookupTableAnalyser.doc, CellMLToNektar.translators.CellMLTranslator.doc, CellMLToNektar.translators.ConfigurationStore.doc, CellMLToNektar.translators.CellMLTranslator.EQ_ASSIGN, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.has_default_stimulus, CellMLToNektar.processors.ModelModifier.model, CellMLToNektar.pycml.cellml_variable.model(), CellMLToNektar.pycml.mathml.model(), CellMLToNektar.translators.CellMLTranslator.model, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.modifier_vars, CellMLToNektar.translators.CellMLTranslator.options, CellMLToNektar.translators.ConfigurationStore.options, CellMLToNektar.translators.CellMLTranslator.output_comment(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_extra_constructor_content(), CellMLToNektar.translators.CellMLTranslator.output_lut_generation(), CellMLToNektar.translators.CellMLTranslator.state_vars, CellMLToNektar.translators.CellMLTranslator.STMT_END, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.use_lookup_tables, CellMLToNektar.translators.CellMLTranslator.use_lookup_tables, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.use_modifiers, CellMLToNektar.translators.CellMLTranslator.var_display_name(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.vector_index(), and CellMLToNektar.translators.CellMLTranslator.writeln().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_default_stimulus | ( | self | ) |
Output a default cell stimulus from the metadata specification as long as the following metadata exists: * membrane_stimulus_current_amplitude * membrane_stimulus_current_duration * membrane_stimulus_current_period and optionally: * membrane_stimulus_current_offset * membrane_stimulus_current_end Ensures that the amplitude of the generated RegularStimulus is negative.
Definition at line 390 of file CellMLToNektarTranslator.py.
References CellMLToNektar.processors.ModelModifier.model, CellMLToNektar.pycml.cellml_variable.model(), CellMLToNektar.pycml.mathml.model(), and CellMLToNektar.translators.CellMLTranslator.model.
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derivative_calculations | ( | self, | |
state_vars, | |||
assign_rY = False , |
|||
extra_nodes = set() , |
|||
extra_table_nodes = set() |
|||
) |
This is used by self.output_evaluate_y_derivatives and self.output_rush_larsen_mathematics to compute the derivatives (and any extra nodes, if given). It contains the special logic to obey the mSetVoltageDerivativeToZero member variable in the generated code. Returns a nodeset containing the equations output.
Definition at line 1475 of file CellMLToNektarTranslator.py.
References CellMLToNektar.translators.CellMLTranslator.calculate_extended_dependencies(), CellMLToNektar.pycml.cellml_model.calculate_extended_dependencies(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.calculate_lookup_table_indices(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.code_name(), CellMLToNektar.translators.CellMLTranslator.code_name(), CellMLToNektar.optimize.LookupTableAnalyser.config(), CellMLToNektar.translators.CellMLTranslator.config(), CellMLToNektar.translators.CellMLTranslator.free_vars, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.NODESET, CellMLToNektar.translators.CellMLTranslator.output_comment(), CellMLToNektar.translators.CellMLTranslator.output_equations(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_equations(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_evaluate_y_derivatives(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_rush_larsen_mathematics(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_state_assignments(), CellMLToNektar.translators.CellMLTranslator.STMT_END, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.TYPE_CONST_DOUBLE, CellMLToNektar.translators.CellMLTranslator.TYPE_CONST_DOUBLE, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.TYPE_DOUBLE, CellMLToNektar.translators.CellMLTranslator.TYPE_DOUBLE, CellMLToNektar.translators.CellMLTranslator.v_variable, and CellMLToNektar.translators.CellMLTranslator.writeln().
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_evaluate_y_derivatives(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_grl1_mathematics(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_grl2_mathematics(), and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_rush_larsen_mathematics().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derivative_calculations_grl | ( | self, | |
var, | |||
assign_rY = False , |
|||
extra_nodes = set() , |
|||
extra_table_nodes = set() |
|||
) |
This is used by self.output_grl?_mathematics to get equations for each variable separately. Returns a node set with the equations output.
Definition at line 1811 of file CellMLToNektarTranslator.py.
References CellMLToNektar.translators.CellMLTranslator.calculate_extended_dependencies(), CellMLToNektar.pycml.cellml_model.calculate_extended_dependencies(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.calculate_lookup_table_indices(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.code_name(), CellMLToNektar.translators.CellMLTranslator.code_name(), CellMLToNektar.translators.CellMLTranslator.free_vars, CellMLToNektar.translators.CellMLTranslator.output_comment(), CellMLToNektar.translators.CellMLTranslator.output_equations(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_equations(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_state_assignments(), CellMLToNektar.translators.CellMLTranslator.state_vars, and CellMLToNektar.translators.CellMLTranslator.writeln().
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_grl1_mathematics(), and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_grl2_mathematics().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derived_quantities | ( | self | ) |
Output a ComputeDerivedQuantities method if any such quantities exist. Looks for variables annotated with pycml:derived-quantity=yes, and generates a method to compute all these variables from a given state.
Definition at line 215 of file CellMLToNektarTranslator.py.
References CellMLToNektar.translators.CellMLTranslator.calculate_extended_dependencies(), CellMLToNektar.pycml.cellml_model.calculate_extended_dependencies(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.calculate_lookup_table_indices(), CellMLToNektar.translators.CellMLTranslator.close_block(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.code_name(), CellMLToNektar.translators.CellMLTranslator.code_name(), CellMLToNektar.optimize.LookupTableAnalyser.config(), CellMLToNektar.translators.CellMLTranslator.config(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.derived_quantities, Nektar::LibUtilities::H5DataSource.doc, CellMLToNektar.optimize.PartialEvaluator.doc, CellMLToNektar.optimize.LookupTableAnalyser.doc, CellMLToNektar.translators.CellMLTranslator.doc, CellMLToNektar.translators.ConfigurationStore.doc, CellMLToNektar.translators.CellMLTranslator.EQ_ASSIGN, CellMLToNektar.translators.CellMLTranslator.free_vars, CellMLToNektar.translators.CellMLTranslator.open_block(), CellMLToNektar.translators.CellMLTranslator.output_comment(), CellMLToNektar.translators.CellMLTranslator.output_equations(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_equations(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_method_start(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_state_assignments(), CellMLToNektar.translators.CellMLTranslator.STMT_END, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.TYPE_DOUBLE, CellMLToNektar.translators.CellMLTranslator.TYPE_DOUBLE, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.TYPE_VECTOR, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.vector_create(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.vector_index(), and CellMLToNektar.translators.CellMLTranslator.writeln().
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_mathematics().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_equations | ( | self, | |
nodeset, | |||
zero_stimulus = False |
|||
) |
Output the mathematics described by nodeset. nodeset represents a subset of the assignments in the model. Output assignments in the order given by a topological sort, but only include those in nodeset.
Reimplemented from CellMLToNektar.translators.CellMLTranslator.
Definition at line 1145 of file CellMLToNektarTranslator.py.
References CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.code_name(), CellMLToNektar.translators.CellMLTranslator.code_name(), Nektar::LibUtilities::H5DataSource.doc, CellMLToNektar.optimize.PartialEvaluator.doc, CellMLToNektar.optimize.LookupTableAnalyser.doc, CellMLToNektar.translators.CellMLTranslator.doc, CellMLToNektar.translators.ConfigurationStore.doc, CellMLToNektar.translators.CellMLTranslator.EQ_ASSIGN, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.get_stimulus_assignment(), CellMLToNektar.processors.ModelModifier.model, CellMLToNektar.pycml.cellml_variable.model(), CellMLToNektar.pycml.mathml.model(), CellMLToNektar.translators.CellMLTranslator.model, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_assignment(), CellMLToNektar.translators.CellMLTranslator.output_assignment(), and CellMLToNektar.translators.CellMLTranslator.STMT_END.
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_backward_euler_mathematics(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derivative_calculations(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derivative_calculations_grl(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derived_quantities(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_get_i_ionic(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_grl_compute_partial(), and CellMLToNektar.translators.CellMLTranslator.output_table_index_generation().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_evaluate_y_derivatives | ( | self, | |
method_name = 'EvaluateYDerivatives' |
|||
) |
Output the EvaluateYDerivatives method.
Definition at line 1356 of file CellMLToNektarTranslator.py.
References CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.alphas, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.betas, CellMLToNektar.translators.CellMLTranslator.class_name, CellMLToNektar.translators.CellMLTranslator.close_block(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.code_name(), CellMLToNektar.translators.CellMLTranslator.code_name(), CellMLToNektar.translators.CellMLTranslator.free_vars, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.infs, CellMLToNektar.translators.CellMLTranslator.open_block(), CellMLToNektar.translators.CellMLTranslator.output_comment(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derivative_calculations(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.state_var_type, CellMLToNektar.translators.CellMLTranslator.state_vars, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.taus, CellMLToNektar.translators.CellMLTranslator.TYPE_VOID, and CellMLToNektar.translators.CellMLTranslator.writeln().
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derivative_calculations(), and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_mathematics().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_extra_constructor_content | ( | self | ) |
Hook for subclasses to add further content to the constructor.
Definition at line 839 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_constructor().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_function | ( | self, | |
func_name, | |||
args, | |||
* | posargs, | ||
** | kwargs | ||
) |
Override base class method for special case of abs with 2 arguments. This comes from Maple's Jacobians, and should generate signum of the second argument.
Reimplemented from CellMLToNektar.translators.CellMLTranslator.
Definition at line 2289 of file CellMLToNektarTranslator.py.
References CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_function().
Referenced by CellMLToNektar.translators.CellMLTranslator.output_apply(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_function(), CellMLToNektar.translators.CellMLTranslator.output_log(), and CellMLToNektar.translators.CellMLTranslator.output_root().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_get_i_ionic | ( | self | ) |
Output the GetIIonic method.
Definition at line 1309 of file CellMLToNektarTranslator.py.
References CellMLToNektar.translators.CellMLTranslator.calculate_extended_dependencies(), CellMLToNektar.pycml.cellml_model.calculate_extended_dependencies(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.calculate_lookup_table_indices(), CellMLToNektar.translators.CellMLTranslator.close_block(), Nektar::LibUtilities::H5DataSource.doc, CellMLToNektar.optimize.PartialEvaluator.doc, CellMLToNektar.optimize.LookupTableAnalyser.doc, CellMLToNektar.translators.CellMLTranslator.doc, CellMLToNektar.translators.ConfigurationStore.doc, CellMLToNektar.translators.CellMLTranslator.EQ_ASSIGN, CellMLToNektar.processors.ModelModifier.model, CellMLToNektar.pycml.cellml_variable.model(), CellMLToNektar.pycml.mathml.model(), CellMLToNektar.translators.CellMLTranslator.model, CellMLToNektar.translators.CellMLTranslator.open_block(), CellMLToNektar.translators.CellMLTranslator.output_equations(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_equations(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_method_start(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_state_assignments(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_variable(), CellMLToNektar.translators.CellMLTranslator.output_variable(), CellMLToNektar.translators.CellMLTranslator.STMT_END, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.TYPE_CONST_DOUBLE, CellMLToNektar.translators.CellMLTranslator.TYPE_CONST_DOUBLE, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.TYPE_DOUBLE, CellMLToNektar.translators.CellMLTranslator.TYPE_DOUBLE, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.use_modifiers, CellMLToNektar.translators.CellMLTranslator.varobj(), CellMLToNektar.translators.CellMLTranslator.write(), and CellMLToNektar.translators.CellMLTranslator.writeln().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_grl1_mathematics | ( | self | ) |
Output the special methods needed for GRL1 style cell models. We generate: * UpdateTransmembranePotential update V_m * ComputeOneStepExceptVoltage does a GRL1 update for variables except voltage * EvaluateYDerivativeI for each variable I
Definition at line 1894 of file CellMLToNektarTranslator.py.
References CellMLToNektar.translators.CellMLTranslator.close_block(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.code_name(), CellMLToNektar.translators.CellMLTranslator.code_name(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.find_grl_partial_derivatives(), CellMLToNektar.translators.CellMLTranslator.free_vars, CellMLToNektar.translators.CellMLTranslator.open_block(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derivative_calculations(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derivative_calculations_grl(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_grl_compute_partial(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_method_start(), CellMLToNektar.translators.CellMLTranslator.state_vars, CellMLToNektar.translators.CellMLTranslator.STMT_END, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.TYPE_DOUBLE, CellMLToNektar.translators.CellMLTranslator.TYPE_DOUBLE, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.v_index, CellMLToNektar.translators.CellMLTranslator.v_index, CellMLToNektar.translators.CellMLTranslator.v_variable, and CellMLToNektar.translators.CellMLTranslator.writeln().
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_mathematics().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_grl2_mathematics | ( | self | ) |
Output the special methods needed for GRL2 style cell models. We generate: * Update TransmembranePotential update V_m * ComputeOneStepExceptVoltage does a GRL2 update for variables except voltage * EvaluateYDerivativeI for each variable I
Definition at line 1990 of file CellMLToNektarTranslator.py.
References CellMLToNektar.translators.CellMLTranslator.close_block(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.code_name(), CellMLToNektar.translators.CellMLTranslator.code_name(), CellMLToNektar.translators.CellMLTranslator.EQ_ASSIGN, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.find_grl_partial_derivatives(), CellMLToNektar.translators.CellMLTranslator.free_vars, CellMLToNektar.translators.CellMLTranslator.open_block(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derivative_calculations(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derivative_calculations_grl(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_grl_compute_partial(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_method_start(), CellMLToNektar.translators.CellMLTranslator.state_vars, CellMLToNektar.translators.CellMLTranslator.STMT_END, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.TYPE_DOUBLE, CellMLToNektar.translators.CellMLTranslator.TYPE_DOUBLE, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.v_index, CellMLToNektar.translators.CellMLTranslator.v_index, CellMLToNektar.translators.CellMLTranslator.v_variable, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.vector_index(), and CellMLToNektar.translators.CellMLTranslator.writeln().
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_mathematics().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_grl_compute_partial | ( | self, | |
i, | |||
var | |||
) |
Compute the partial derivative of f(var) wrt var, the i'th variable in the state vector. This uses an analytic Jacobian if available; otherwise it approximates using finite differences.
Definition at line 1848 of file CellMLToNektarTranslator.py.
References CellMLToNektar.translators.CellMLTranslator._vars_in(), CellMLToNektar.translators.CellMLTranslator.calculate_extended_dependencies(), CellMLToNektar.pycml.cellml_model.calculate_extended_dependencies(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.calculate_lookup_table_indices(), CellMLToNektar.translators.CellMLTranslator.close_block(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.code_name(), CellMLToNektar.translators.CellMLTranslator.code_name(), CellMLToNektar.translators.CellMLTranslator.free_vars, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.jacobian_diagonal, CellMLToNektar.translators.CellMLTranslator.open_block(), CellMLToNektar.translators.CellMLTranslator.output_equations(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_equations(), CellMLToNektar.translators.CellMLTranslator.output_expr(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_method_start(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_state_assignments(), CellMLToNektar.translators.CellMLTranslator.STMT_END, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.TYPE_DOUBLE, CellMLToNektar.translators.CellMLTranslator.TYPE_DOUBLE, and CellMLToNektar.translators.CellMLTranslator.writeln().
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_grl1_mathematics(), and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_grl2_mathematics().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_includes | ( | self, | |
base_class = None |
|||
) |
Output the start of each output file. As well as the #include lines, it also outputs the include guard for the .hpp file, and doxygen comment. If base_class is not None (and self.use_backward_euler isn't set) then includes that class' header instead of AbstractCardiacCell. If self.dynamically_loadable is set, includes extra headers needed for that case. Reads self.include_serialization and self.use_backward_euler. Sets self.base_class_name and self.class_inheritance.
Definition at line 72 of file CellMLToNektarTranslator.py.
References CellMLToNektar.translators.CellMLTranslator.add_timestamp, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.base_class_name, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.class_inheritance, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.include_serialization, CellMLToNektar.processors.ModelModifier.model, CellMLToNektar.pycml.cellml_variable.model(), CellMLToNektar.pycml.mathml.model(), CellMLToNektar.translators.CellMLTranslator.model, CellMLToNektar.translators.CellMLTranslator.output_doxygen(), CellMLToNektar.translators.CellMLTranslator.subsidiary_filename, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.use_backward_euler, CellMLToNektar.translators.version_comment(), CellMLToNektar.translators.CellMLTranslator.writeln(), and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.writeln_hpp().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_intracellular_calcium | ( | self | ) |
If a (state) variable has been annotated as cytosolic_calcium_concentration, generate a GetIntracellularCalciumConcentration method.
Definition at line 431 of file CellMLToNektarTranslator.py.
References CellMLToNektar.translators.CellMLTranslator.close_block(), Nektar::LibUtilities::H5DataSource.doc, CellMLToNektar.optimize.PartialEvaluator.doc, CellMLToNektar.optimize.LookupTableAnalyser.doc, CellMLToNektar.translators.CellMLTranslator.doc, CellMLToNektar.translators.ConfigurationStore.doc, CellMLToNektar.translators.CellMLTranslator.open_block(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_method_start(), CellMLToNektar.translators.CellMLTranslator.state_vars, CellMLToNektar.translators.CellMLTranslator.STMT_END, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.TYPE_DOUBLE, CellMLToNektar.translators.CellMLTranslator.TYPE_DOUBLE, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.vector_index(), and CellMLToNektar.translators.CellMLTranslator.writeln().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_lhs | ( | self, | |
expr | |||
) |
Output the left hand side of an assignment expression.
Reimplemented from CellMLToNektar.translators.CellMLTranslator.
Definition at line 2260 of file CellMLToNektarTranslator.py.
References CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_variable(), and CellMLToNektar.translators.CellMLTranslator.output_variable().
Referenced by CellMLToNektar.translators.CellMLTranslator.output_assignment().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_lut_class | ( | self | ) |
Output a separate class for lookup tables. This will live entirely in the .cpp file.
Definition at line 937 of file CellMLToNektarTranslator.py.
References CellMLToNektar.translators.CellMLTranslator.close_block(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.code_name(), CellMLToNektar.translators.CellMLTranslator.code_name(), CellMLToNektar.optimize.LookupTableAnalyser.config(), CellMLToNektar.translators.CellMLTranslator.config(), Nektar::LibUtilities::H5DataSource.doc, CellMLToNektar.optimize.PartialEvaluator.doc, CellMLToNektar.optimize.LookupTableAnalyser.doc, CellMLToNektar.translators.CellMLTranslator.doc, CellMLToNektar.translators.ConfigurationStore.doc, CellMLToNektar.translators.CellMLTranslator.EQ_ASSIGN, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.lt_class_name, CellMLToNektar.translators.CellMLTranslator.open_block(), CellMLToNektar.translators.CellMLTranslator.output_lut_declarations(), CellMLToNektar.translators.CellMLTranslator.output_lut_deletion(), CellMLToNektar.translators.CellMLTranslator.output_lut_generation(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_lut_indexing_methods(), CellMLToNektar.translators.CellMLTranslator.output_lut_methods(), CellMLToNektar.translators.CellMLTranslator.output_lut_row_lookup_memory(), CellMLToNektar.translators.CellMLTranslator.row_lookup_method, CellMLToNektar.translators.CellMLTranslator.set_indent(), CellMLToNektar.translators.CellMLTranslator.STMT_END, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.TYPE_CONST_DOUBLE, CellMLToNektar.translators.CellMLTranslator.TYPE_CONST_DOUBLE, CellMLToNektar.translators.CellMLTranslator.var_display_name(), and CellMLToNektar.translators.CellMLTranslator.writeln().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_lut_indexing_methods | ( | self | ) |
Output methods in the LT class for indexing the tables, and checking index bounds. These will be methods like const double * const IndexTable0(double index_var); if self.row_lookup_method, or like void IndexTable0(double index_var, unsigned& index, double& factor); otherwise, with bool CheckIndex0(double& index_var); for checking the bounds.
Definition at line 873 of file CellMLToNektarTranslator.py.
References CellMLToNektar.translators.CellMLTranslator.close_block(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.code_name(), CellMLToNektar.translators.CellMLTranslator.code_name(), CellMLToNektar.optimize.LookupTableAnalyser.config(), CellMLToNektar.translators.CellMLTranslator.config(), Nektar::LibUtilities::H5DataSource.doc, CellMLToNektar.optimize.PartialEvaluator.doc, CellMLToNektar.optimize.LookupTableAnalyser.doc, CellMLToNektar.translators.CellMLTranslator.doc, CellMLToNektar.translators.ConfigurationStore.doc, CellMLToNektar.translators.CellMLTranslator.lut_factor(), CellMLToNektar.translators.CellMLTranslator.open_block(), CellMLToNektar.translators.CellMLTranslator.output_table_index_checking(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_table_index_checking(), CellMLToNektar.translators.CellMLTranslator.output_table_index_generation_code(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_table_index_generation_code(), CellMLToNektar.translators.CellMLTranslator.row_lookup_method, CellMLToNektar.translators.CellMLTranslator.STMT_END, and CellMLToNektar.translators.CellMLTranslator.writeln().
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_lut_class().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_mathematics | ( | self | ) |
Output the mathematics in this model. When backward Euler is used, we do so in 5 methods: * UpdateTransmembranePotential does a forward Euler step for V * ComputeOneStepExceptVoltage co-ordinates a backward Euler step * ComputeResidual and ComputeJacobian are used in the Newton iteration * GetIIonic returns the total ionic current Rush-Larsen is implemented similarly, with: * EvaluateEquations evaluate the model derivatives and alpha/beta terms * ComputeOneStepExceptVoltage does a Rush-Larsen update for eligible variables, and a forward Euler step for other non-V state variables Generalised Rush-Larsen methods also have specialised handling; see the individual methods for details. For other solvers, only 2 methods are needed: * EvaluateYDerivatives computes the RHS of the ODE system * GetIIonic is as above Where derived-quantity annotations are present, we also generate a ComputeDerivedQuantities method.
Reimplemented from CellMLToNektar.translators.CellMLTranslator.
Definition at line 1259 of file CellMLToNektarTranslator.py.
References CellMLToNektar.translators.CellMLTranslator.options, CellMLToNektar.translators.ConfigurationStore.options, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_backward_euler_mathematics(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derived_quantities(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_evaluate_y_derivatives(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_grl1_mathematics(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_grl2_mathematics(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_rush_larsen_mathematics(), and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.use_backward_euler.
Referenced by CellMLToNektar.translators.CellMLTranslator.translate().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_method_start | ( | self, | |
method_name, | |||
args, | |||
ret_type, | |||
access = None , |
|||
defaults = [] |
|||
) |
Output the start of a method declaration/definition. Will write to both the .hpp and .cpp file. We keep track of the access of the last method, and only output a new declaration to the header file if it changes. The default is to use the same access specification as last time.
Definition at line 182 of file CellMLToNektarTranslator.py.
References CellMLToNektar.translators.CellMLTranslator.class_name, CellMLToNektar.utilities.DEBUG(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.set_access(), CellMLToNektar.translators.CellMLTranslator.STMT_END, CellMLToNektar.translators.CellMLTranslator.writeln(), and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.writeln_hpp().
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_backward_euler_mathematics(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derived_quantities(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_get_i_ionic(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_grl1_mathematics(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_grl2_mathematics(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_grl_compute_partial(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_intracellular_calcium(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_rush_larsen_mathematics(), and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_verify_state_variables().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_model_attributes | ( | self | ) |
Output any named model attributes defined in metadata. Such attributes are given by compound RDF annotations: model --pycml:named-attribute--> bnode bnode --pycml:name--> Literal(Attribute name, string) bnode --pycml:value--> Literal(Attribute value, double)
Definition at line 2121 of file CellMLToNektarTranslator.py.
References CellMLToNektar.processors.ModelModifier.model, CellMLToNektar.pycml.cellml_variable.model(), CellMLToNektar.pycml.mathml.model(), CellMLToNektar.translators.CellMLTranslator.model, and CellMLToNektar.translators.CellMLTranslator.writeln().
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_bottom_boilerplate().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_nonlinear_state_assignments | ( | self, | |
nodeset = None |
|||
) |
Output assignments for nonlinear state variables.
Definition at line 1126 of file CellMLToNektarTranslator.py.
References CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.code_name(), CellMLToNektar.translators.CellMLTranslator.code_name(), CellMLToNektar.translators.CellMLTranslator.EQ_ASSIGN, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.nonlinear_system_vars, CellMLToNektar.translators.CellMLTranslator.STMT_END, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.TYPE_DOUBLE, CellMLToNektar.translators.CellMLTranslator.TYPE_DOUBLE, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.vector_index(), and CellMLToNektar.translators.CellMLTranslator.writeln().
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_backward_euler_mathematics().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_rush_larsen_mathematics | ( | self | ) |
Output the special methods needed for Rush-Larsen style cell models. We generate: * EvaluateEquations evaluate the model derivatives and alpha/beta terms * ComputeOneStepExceptVoltage does a Rush-Larsen update for eligible variables, and a forward Euler step for other non-V state variables
Definition at line 1732 of file CellMLToNektarTranslator.py.
References CellMLToNektar.translators.CellMLTranslator._vars_in(), CellMLToNektar.translators.CellMLTranslator.close_block(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.code_name(), CellMLToNektar.translators.CellMLTranslator.code_name(), Nektar::LibUtilities::H5DataSource.doc, CellMLToNektar.optimize.PartialEvaluator.doc, CellMLToNektar.optimize.LookupTableAnalyser.doc, CellMLToNektar.translators.CellMLTranslator.doc, CellMLToNektar.translators.ConfigurationStore.doc, CellMLToNektar.translators.CellMLTranslator.EQ_ASSIGN, CellMLToNektar.translators.CellMLTranslator.free_vars, CellMLToNektar.translators.CellMLTranslator.open_block(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derivative_calculations(), CellMLToNektar.translators.CellMLTranslator.output_expr(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_method_start(), CellMLToNektar.translators.CellMLTranslator.state_vars, CellMLToNektar.translators.CellMLTranslator.STMT_END, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.TYPE_CONST_DOUBLE, CellMLToNektar.translators.CellMLTranslator.TYPE_CONST_DOUBLE, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.TYPE_DOUBLE, CellMLToNektar.translators.CellMLTranslator.TYPE_DOUBLE, CellMLToNektar.translators.CellMLTranslator.v_variable, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.vector_index(), and CellMLToNektar.translators.CellMLTranslator.writeln().
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derivative_calculations(), and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_mathematics().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_serialize_method | ( | self | ) |
This method outputs the boost serialize method for the header files that need it.
Definition at line 257 of file CellMLToNektarTranslator.py.
References CellMLToNektar.translators.CellMLTranslator.class_name, CellMLToNektar.translators.CellMLTranslator.close_block(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.include_serialization, CellMLToNektar.translators.CellMLTranslator.open_block(), CellMLToNektar.translators.CellMLTranslator.output_comment(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.use_modifiers, and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.writeln_hpp().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_state_assignments | ( | self, | |
exclude_nonlinear = False , |
|||
assign_rY = True , |
|||
nodeset = None , |
|||
pointer = '' |
|||
) |
Output statements extracting state variables from their vector. If exclude_nonlinear is set to true, state variables appearing in the nonlinear system will not be included. If nodeset is given, only state variables appearing in nodeset will be included. If pointer is given, then the state variables actually appear in the variable given by pointer, which is of type const std::vector<double>*.
Definition at line 1035 of file CellMLToNektarTranslator.py.
References CellMLToNektar.translators.CellMLTranslator.close_block(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.code_name(), CellMLToNektar.translators.CellMLTranslator.code_name(), CellMLToNektar.translators.CellMLTranslator.COMMENT_START, CellMLToNektar.translators.CellMLTranslator.EQ_ASSIGN, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.modifier_call(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.modifier_vars, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.nonlinear_system_vars, CellMLToNektar.translators.CellMLTranslator.open_block(), CellMLToNektar.translators.CellMLTranslator.options, CellMLToNektar.translators.ConfigurationStore.options, CellMLToNektar.translators.CellMLTranslator.output_comment(), CellMLToNektar.translators.CellMLTranslator.state_vars, CellMLToNektar.translators.CellMLTranslator.STMT_END, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.TYPE_DOUBLE, CellMLToNektar.translators.CellMLTranslator.TYPE_DOUBLE, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.TYPE_VECTOR_REF, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.use_modifiers, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.vector_index(), and CellMLToNektar.translators.CellMLTranslator.writeln().
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_backward_euler_mathematics(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derivative_calculations(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derivative_calculations_grl(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derived_quantities(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_get_i_ionic(), and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_grl_compute_partial().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_table_index_checking | ( | self, | |
key, | |||
idx, | |||
call_method = True |
|||
) |
Override base class method to call the methods on the lookup table class if needed.
Reimplemented from CellMLToNektar.translators.CellMLTranslator.
Definition at line 911 of file CellMLToNektarTranslator.py.
References CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.code_name(), CellMLToNektar.translators.CellMLTranslator.code_name(), CellMLToNektar.optimize.LookupTableAnalyser.config(), CellMLToNektar.translators.CellMLTranslator.config(), CellMLToNektar.translators.CellMLTranslator.EQ_ASSIGN, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.lt_class_name, CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_table_index_checking(), CellMLToNektar.translators.CellMLTranslator.STMT_END, and CellMLToNektar.translators.CellMLTranslator.writeln().
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_lut_indexing_methods(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_table_index_checking(), and CellMLToNektar.translators.CellMLTranslator.output_table_index_generation().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_table_index_generation_code | ( | self, | |
key, | |||
idx, | |||
call_method = True |
|||
) |
Override base class method to call the methods on the lookup table class if needed.
Reimplemented from CellMLToNektar.translators.CellMLTranslator.
Definition at line 922 of file CellMLToNektarTranslator.py.
References CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.code_name(), CellMLToNektar.translators.CellMLTranslator.code_name(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.lt_class_name, CellMLToNektar.translators.CellMLTranslator.lut_factor(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_table_index_generation_code(), CellMLToNektar.translators.CellMLTranslator.row_lookup_method, and CellMLToNektar.translators.CellMLTranslator.writeln().
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_lut_indexing_methods(), CellMLToNektar.translators.CellMLTranslator.output_table_index_generation(), and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_table_index_generation_code().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_top_boilerplate | ( | self | ) |
Output top boilerplate. This method outputs the constructor and destructor of the cell class, and also lookup table declarations and lookup methods. It also calls output_verify_state_variables.
Reimplemented from CellMLToNektar.translators.CellMLTranslator.
Definition at line 464 of file CellMLToNektarTranslator.py.
References CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.include_serialization, CellMLToNektar.processors.ModelModifier.model, CellMLToNektar.pycml.cellml_variable.model(), CellMLToNektar.pycml.mathml.model(), CellMLToNektar.translators.CellMLTranslator.model, and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.use_backward_euler.
Referenced by CellMLToNektar.translators.CellMLTranslator.translate().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_variable | ( | self, | |
ci_elt, | |||
ode = False |
|||
) |
Output a ci element, i.e. a variable lookup.
Reimplemented from CellMLToNektar.translators.CellMLTranslator.
Definition at line 2269 of file CellMLToNektarTranslator.py.
References CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.code_name(), CellMLToNektar.translators.CellMLTranslator.code_name(), CellMLToNektar.translators.CellMLTranslator.varobj(), and CellMLToNektar.translators.CellMLTranslator.write().
Referenced by CellMLToNektar.translators.CellMLTranslator.output_expr(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_get_i_ionic(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_lhs(), and CellMLToNektar.translators.CellMLTranslator.output_lhs().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_verify_state_variables | ( | self | ) |
Output the VerifyStateVariables method. This will look for state variables annotated with pycml:range-low and/or pycml:range-high, which specify allowable ranges for these variables. The generated method will check that they are within the range. Both limits are included, i.e. they specify a closed interval.
Definition at line 639 of file CellMLToNektarTranslator.py.
References CellMLToNektar.processors.ModelModifier.model, CellMLToNektar.pycml.cellml_variable.model(), CellMLToNektar.pycml.mathml.model(), CellMLToNektar.translators.CellMLTranslator.model, CellMLToNektar.translators.CellMLTranslator.open_block(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_method_start(), and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.use_modifiers.
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.set_access | ( | self, | |
access | |||
) |
Set the access specification for subsequent output. We keep track of the last access set, either via this method or output_method_start, and only output a new declaration to the header file if it changes.
Definition at line 170 of file CellMLToNektarTranslator.py.
References CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator._last_method_access, and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.writeln_hpp().
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_method_start().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.translate | ( | self, | |
* | args, | ||
** | kwargs | ||
) |
Generate code for the given model.
Reimplemented from CellMLToNektar.translators.CellMLTranslator.
Definition at line 44 of file CellMLToNektarTranslator.py.
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.unsigned_v_index | ( | self | ) |
Definition at line 633 of file CellMLToNektarTranslator.py.
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.vector_create | ( | self, | |
vector, | |||
size | |||
) |
Return code for creating a new vector with the given size.
Definition at line 1118 of file CellMLToNektarTranslator.py.
References CellMLToNektar.translators.CellMLTranslator.STMT_END, and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.TYPE_VECTOR.
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derived_quantities().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.vector_index | ( | self, | |
vector, | |||
i | |||
) |
Return code for accessing the i'th index of vector.
Definition at line 1114 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.code_name(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_constructor(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derived_quantities(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_grl2_mathematics(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_intracellular_calcium(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_nonlinear_state_assignments(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_rush_larsen_mathematics(), and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_state_assignments().
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.vector_initialise | ( | self, | |
vector, | |||
size | |||
) |
Return code for creating an already-declared vector with the given size.
Definition at line 1122 of file CellMLToNektarTranslator.py.
References CellMLToNektar.translators.CellMLTranslator.STMT_END.
def CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.writeln_hpp | ( | self, | |
* | args, | ||
** | kwargs | ||
) |
Convenience wrapper for writing to the header file.
Definition at line 39 of file CellMLToNektarTranslator.py.
References CellMLToNektar.translators.CellMLTranslator.writeln().
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_backward_euler_mathematics(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_includes(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_method_start(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_serialize_method(), and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.set_access().
|
private |
Definition at line 62 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.set_access().
CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.alphas |
Definition at line 549 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_evaluate_y_derivatives().
CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.base_class_name |
Definition at line 122 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_includes().
CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.betas |
Definition at line 550 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_evaluate_y_derivatives().
CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.cell_parameters |
Definition at line 320 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_assignment(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_bottom_boilerplate(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_cell_parameters(), and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_constructor().
CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.class_inheritance |
Definition at line 146 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_includes().
CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.derived_quantities |
Definition at line 384 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_bottom_boilerplate(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_constructor(), and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derived_quantities().
CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.has_default_stimulus |
Definition at line 407 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_constructor().
CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.include_serialization |
Definition at line 60 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_includes(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_serialize_method(), and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_top_boilerplate().
CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.infs |
Definition at line 548 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_evaluate_y_derivatives().
|
static |
Definition at line 2321 of file CellMLToNektarTranslator.py.
CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.jacobian_diagonal |
Definition at line 1837 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_grl_compute_partial().
CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.lookup_method_prefix |
Definition at line 69 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.translators.CellMLTranslator.output_table_index_generation_code(), and CellMLToNektar.translators.CellMLTranslator.output_table_lookup().
CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.lt_class_name |
Definition at line 68 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_lut_class(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_table_index_checking(), and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_table_index_generation_code().
|
static |
Definition at line 2318 of file CellMLToNektarTranslator.py.
CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.metadata_vars |
Definition at line 338 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.translators.ConfigurationStore.annotate_metadata_for_pe(), CellMLToNektar.translators.ConfigurationStore.expose_variables(), and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_cell_parameters().
CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.modifier_vars |
|
static |
Definition at line 37 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derivative_calculations().
CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.NODESET |
Definition at line 565 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derivative_calculations().
CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.nonlinear_system_size |
Definition at line 480 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_backward_euler_mathematics().
CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.nonlinear_system_vars |
Definition at line 482 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_backward_euler_mathematics(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_nonlinear_state_assignments(), and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_state_assignments().
CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.state_var_type |
Definition at line 592 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_evaluate_y_derivatives().
CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.taus |
Definition at line 547 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_evaluate_y_derivatives().
CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.TYPE_CONST_DOUBLE |
Definition at line 1213 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.translators.CellMLTranslator.output_assignment(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_backward_euler_mathematics(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derivative_calculations(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_get_i_ionic(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_lut_class(), CellMLToNektar.translators.CellMLTranslator.output_lut_generation(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_rush_larsen_mathematics(), CellMLToNektar.translators.CellMLTranslator.output_single_lookup(), and CellMLToNektar.translators.CellMLTranslator.output_table_index_generation_code().
CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.TYPE_DOUBLE |
Definition at line 1213 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.translators.CellMLTranslator.lut_factor(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_assignment(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_backward_euler_mathematics(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derivative_calculations(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derived_quantities(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_get_i_ionic(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_grl1_mathematics(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_grl2_mathematics(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_grl_compute_partial(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_intracellular_calcium(), CellMLToNektar.translators.CellMLTranslator.output_lut_declarations(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_nonlinear_state_assignments(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_rush_larsen_mathematics(), and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_state_assignments().
|
static |
Definition at line 34 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_derived_quantities(), and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.vector_create().
|
static |
Definition at line 35 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_state_assignments().
CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.TYPE_VECTOR_REF |
Definition at line 668 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_state_assignments().
CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.use_analytic_jacobian |
Definition at line 475 of file CellMLToNektarTranslator.py.
CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.use_backward_euler |
Definition at line 59 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_assignment(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_includes(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_mathematics(), and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_top_boilerplate().
CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.use_lookup_tables |
Definition at line 364 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.translators.CellMLTranslator._vars_in(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.calculate_lookup_table_indices(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_constructor(), CellMLToNektar.translators.CellMLTranslator.output_expr(), CellMLToNektar.translators.CellMLTranslator.output_lut_generation(), and CellMLToNektar.translators.CellMLTranslator.output_top_boilerplate().
CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.use_modifiers |
Definition at line 362 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.code_name(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_assignment(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_constructor(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_get_i_ionic(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_serialize_method(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_state_assignments(), and CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_verify_state_variables().
|
static |
Definition at line 31 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.translators.CellMLTranslator.writeln().
CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.v_index |
Definition at line 634 of file CellMLToNektarTranslator.py.
Referenced by CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_backward_euler_mathematics(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_grl1_mathematics(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_grl2_mathematics(), and CellMLToNektar.translators.CellMLTranslator.output_top_boilerplate().