Nektar++
|
Public Member Functions | |
def | __init__ (self) |
def | clear_dependency_info (self) |
def | __hash__ (self) |
def | fullname (self, cellml=False, debug=False) |
def | __str__ (self) |
def | __repr__ (self) |
def | get_component (self) |
def | model (self) |
def | get_units (self) |
def | get_dependencies (self) |
def | get_ode_dependency (self, independent_var, context=None) |
def | get_all_expr_dependencies (self) |
def | get_source_variable (self, recurse=False) |
def | get_type (self, follow_maps=False) |
def | get_usage_count (self) |
def | add_rdf_annotation (self, property, target, allow_dup=False) |
def | get_rdf_annotation (self, property) |
def | get_rdf_annotations (self, property) |
def | remove_rdf_annotations (self, property=None) |
def | set_rdf_annotation_from_boolean (self, property, is_yes) |
def | is_statically_const (self, ignore_annotations=False) |
def | set_value (self, value, ode=None, follow_maps=True) |
def | unset_values (self) |
def | get_value (self, ode=None) |
def | is_modifiable_parameter (self) |
def | set_is_modifiable_parameter (self, is_param) |
def | is_derived_quantity (self) |
def | set_is_derived_quantity (self, is_dq) |
def | is_output_variable (self) |
def | set_is_output_variable (self, is_ov) |
def | pe_keep (self) |
def | set_pe_keep (self, keep) |
def | oxmeta_name (self) |
def | set_oxmeta_name (self, name) |
Public Member Functions inherited from CellMLToNektar.utilities.Colourable | |
def | __init__ (self, *args, **kwargs) |
def | set_colour (self, colour) |
def | get_colour (self) |
def | clear_colour (self) |
Public Member Functions inherited from CellMLToNektar.pycml.element_base | |
def | __init__ (self) |
def | __delattr__ (self, key) |
def | __setattr__ (self, key, value) |
def | rootNode (self) |
def | cmeta_id (self) |
def | xml_remove_child_at (self, index=-1) |
def | xml_doc (self) |
def | xml_properties (self) |
Static Public Member Functions | |
def | split_name (varname) |
def | get_variable_object (model, varname) |
def | create_new (elt, name, units, id=None, initial_value=None, interfaces={}) |
Public Attributes | |
initial_value | |
Public Attributes inherited from CellMLToNektar.pycml.element_base | |
xml_attributes | |
Properties | |
component = property(get_component) | |
Private Member Functions | |
def | _add_dependency (self, dep) |
def | _add_ode_dependency (self, independent_var, expr) |
def | _update_ode_dependency (self, free_var, defn) |
def | _set_source_variable (self, src_var) |
def | _set_type (self, var_type, _orig=None) |
def | _used (self) |
def | _decrement_usage_count (self, follow_maps=True) |
def | _set_binding_time (self, bt, temporary=False) |
def | _unset_binding_time (self, only_temporary=False) |
def | _get_binding_time (self) |
def | _reduce (self, update_usage=False) |
Private Attributes | |
_cml_var_type | |
_cml_source_var | |
_cml_value | |
_cml_binding_time | |
_cml_depends_on | |
Move the definition to this component defn._unset_cached_links() defn.xml_parent.xml_remove_child(defn) self.component.math.xml_append(defn) Schedule the LHS of the defining expression for update. More... | |
_cml_depends_on_ode | |
_cml_usage_count | |
_cml_saved_bt | |
def CellMLToNektar.pycml.cellml_variable.__init__ | ( | self | ) |
Reimplemented from CellMLToNektar.pycml.element_base.
Definition at line 1652 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable.__init__(), CellMLToNektar.pycml.cellml_variable.clear_dependency_info(), and CellMLToNektar.pycml.mathml_apply.clear_dependency_info().
Referenced by CellMLToNektar.pycml.cellml_variable.__init__().
def CellMLToNektar.pycml.cellml_variable.__hash__ | ( | self | ) |
Hashing function for variables. Hash is based on hashing the full name of the variable, as this must be unique within a model. Unfortunately, when we do partial evaluation, the full name changes! TODO: do we need a hash function?
Definition at line 1673 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable.fullname().
def CellMLToNektar.pycml.cellml_variable.__repr__ | ( | self | ) |
Definition at line 1758 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable.fullname().
def CellMLToNektar.pycml.cellml_variable.__str__ | ( | self | ) |
Definition at line 1755 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable.fullname().
|
private |
Add a dependency of this variable. This could be an expression defining it, or a variable it's mapped from. Triggers a validation error if we already have another dependency, since a variable can't be defined in more than one way.
Definition at line 1773 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable._cml_depends_on, CellMLToNektar.pycml.mathml_apply._cml_depends_on, and CellMLToNektar.pycml.cellml_variable.fullname().
Referenced by CellMLToNektar.pycml.cellml_variable._set_source_variable().
|
private |
Add a dependency of this variable as the dependent variable in an ODE. independent_var is the corresponding independent variable, and expr is the expression defining the ODE. Triggers a validation error if the same ODE is defined by multiple expressions.
Definition at line 1796 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable._cml_depends_on_ode, and CellMLToNektar.pycml.cellml_variable.fullname().
|
private |
Decrement our usage count.
Definition at line 1947 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable._cml_usage_count, CellMLToNektar.pycml.cellml_variable._cml_var_type, CellMLToNektar.pycml.cellml_variable._decrement_usage_count(), CellMLToNektar.utilities.DEBUG(), CellMLToNektar.pycml.cellml_variable.fullname(), and CellMLToNektar.pycml.cellml_variable.get_source_variable().
Referenced by CellMLToNektar.pycml.cellml_variable._decrement_usage_count().
|
private |
Return the binding time of this variable, as a member of the BINDING_TIMES Enum. This method will (try to) compute & cache the binding time if necessary. Variables are classified based on their type: State, Free -> dynamic Constant -> static Mapped -> binding time of source variable Computed -> binding time of defining expression
Definition at line 2074 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable._cml_binding_time, CellMLToNektar.pycml.mathml_apply._cml_binding_time, CellMLToNektar.pycml.mathml_piecewise._cml_binding_time, CellMLToNektar.pycml.cellml_variable._cml_depends_on, CellMLToNektar.pycml.mathml_apply._cml_depends_on, CellMLToNektar.pycml.cellml_variable._get_binding_time(), CellMLToNektar.pycml.cellml_variable._set_binding_time(), CellMLToNektar.utilities.DEBUG(), CellMLToNektar.pycml.cellml_variable.fullname(), CellMLToNektar.pycml.cellml_variable.get_rdf_annotation(), CellMLToNektar.pycml.cellml_variable.get_source_variable(), CellMLToNektar.pycml.cellml_variable.get_type(), and CellMLToNektar.pycml.cellml_variable.pe_keep().
Referenced by CellMLToNektar.pycml.cellml_variable._get_binding_time(), CellMLToNektar.pycml.mathml_ci._reduce(), CellMLToNektar.pycml.mathml_apply._reduce(), CellMLToNektar.pycml.mathml_piecewise._reduce(), CellMLToNektar.pycml.cellml_variable.get_value(), and CellMLToNektar.pycml.cellml_variable.is_statically_const().
|
private |
Reduce this dynamic variable that is being kept. If it has a static source, then turn it into a constant. Otherwise make it depend directly on an appropriate source: either one of its source variables that is also being kept, or the ultimate defining expression. If update_usage is True then this variable is used in an equation, so reduce the usage of any source variables it no longer depends on.
Definition at line 2272 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable._cml_var_type, CellMLToNektar.pycml.cellml_variable.get_source_variable(), and CellMLToNektar.pycml.cellml_variable.pe_keep().
|
private |
Set the binding time of this variable. Options are members of the BINDING_TIMES Enum. If temporary is True, then we're temporarily overriding the normal setting, so save any existing annotation for later replacement.
Definition at line 2042 of file pycml.py.
Referenced by CellMLToNektar.pycml.cellml_variable._get_binding_time(), and CellMLToNektar.pycml.cellml_variable._unset_binding_time().
|
private |
Set this to be a mapped variable which imports its value from src_var. A validation error is generated if we are already mapped.
Definition at line 1851 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable._add_dependency(), CellMLToNektar.pycml.cellml_variable._cml_source_var, CellMLToNektar.pycml.cellml_variable._set_type(), CellMLToNektar.pycml.cellml_variable.fullname(), CellMLToNektar.processors.ModelModifier.model, CellMLToNektar.pycml.cellml_variable.model(), CellMLToNektar.pycml.mathml.model(), and CellMLToNektar.translators.CellMLTranslator.model.
|
private |
Update the type of this variable. The caller should check that the update makes sense. If this variable already has type Mapped, then update the type of our source variable, instead.
Definition at line 1894 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable._cml_usage_count, CellMLToNektar.pycml.cellml_variable._cml_var_type, CellMLToNektar.pycml.cellml_variable._set_type(), and CellMLToNektar.pycml.cellml_variable.get_source_variable().
Referenced by CellMLToNektar.pycml.cellml_variable._set_source_variable(), and CellMLToNektar.pycml.cellml_variable._set_type().
|
private |
Unset any stored binding time. If the stored BT was a temporary setting, replace it with the original value.
Definition at line 2058 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable._cml_binding_time, CellMLToNektar.pycml.mathml_apply._cml_binding_time, CellMLToNektar.pycml.mathml_piecewise._cml_binding_time, CellMLToNektar.pycml.cellml_variable._cml_saved_bt, CellMLToNektar.pycml.cellml_variable._set_binding_time(), and CellMLToNektar.pycml.cellml_variable.remove_rdf_annotations().
|
private |
Update an ODE dependency due to partial evaluation. When the PE processes the LHS of a derivative equation, it alters the independent variable to reference its source directly. If this new source wasn't originally our independent variable's source (e.g. due to a units conversion expression) then this will break lookups of the ODE via _get_ode_dependency, so we need to update the reference.
Definition at line 1813 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable._cml_depends_on_ode, CellMLToNektar.pycml.cellml_variable._update_ode_dependency(), CellMLToNektar.pycml.cellml_variable.get_source_variable(), and CellMLToNektar.pycml.cellml_variable.get_type().
Referenced by CellMLToNektar.pycml.cellml_variable._update_ode_dependency().
|
private |
Note this variable as being used in an expression. Keep track of the usage count. If this is a mapped variable, note its source as being used, as well. Note that if a variable is used in 2 branches of a conditional then this counts as 2 uses.
Definition at line 1924 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable._cml_usage_count, CellMLToNektar.pycml.cellml_variable._cml_var_type, CellMLToNektar.pycml.cellml_variable._used(), and CellMLToNektar.pycml.cellml_variable.get_source_variable().
Referenced by CellMLToNektar.pycml.cellml_variable._used().
def CellMLToNektar.pycml.cellml_variable.add_rdf_annotation | ( | self, | |
property, | |||
target, | |||
allow_dup = False |
|||
) |
Add an RDF annotation about this variable. property must be a tuple (qname, namespace_uri). target may either be a tuple as above, or a unicode string, in which case it is interpreted as a literal RDF node. If the variable does not already have a cmeta:id, one will be created for it with value self.fullname(cellml=True). The actual RDF will be added to the main RDF block in the model, which will be created if it does not exist. Any existing annotations of this variable with the same property will be removed, unless allow_dup=True.
Definition at line 1961 of file pycml.py.
References CellMLToNektar.pycml.element_base.cmeta_id(), CellMLToNektar.pycml.cellml_variable.fullname(), CellMLToNektar.processors.ModelModifier.model, CellMLToNektar.pycml.cellml_variable.model(), CellMLToNektar.pycml.mathml.model(), and CellMLToNektar.translators.CellMLTranslator.model.
Referenced by CellMLToNektar.pycml.cellml_variable.set_oxmeta_name(), and CellMLToNektar.pycml.cellml_variable.set_rdf_annotation_from_boolean().
def CellMLToNektar.pycml.cellml_variable.clear_dependency_info | ( | self | ) |
Clear the type, dependency, etc. information for this variable. This allows us to re-run the type & dependency analysis for the model.
Definition at line 1657 of file pycml.py.
Referenced by CellMLToNektar.pycml.cellml_variable.__init__().
|
static |
Create a new <variable> element with the given name and units. Optionally id, initial_value, and interfaces may also be given. elt may be any existing XML element.
Definition at line 2331 of file pycml.py.
def CellMLToNektar.pycml.cellml_variable.fullname | ( | self, | |
cellml = False , |
|||
debug = False |
|||
) |
Return the full name of this variable, i.e. '(component_name,variable_name)'. If cellml is given as True, return the name in a form compatible with the CellML spec instead, i.e. component_name__variable_name, unless the component has its ignore_component_name property set, in which case just use variable_name. If debug is True, also give information about the variable object.
Definition at line 1684 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable.component, CellMLToNektar.pycml.mathml.component, and CellMLToNektar.pycml.cellml_component.name.
Referenced by CellMLToNektar.pycml.cellml_variable.__hash__(), CellMLToNektar.pycml.cellml_variable.__repr__(), CellMLToNektar.pycml.cellml_variable.__str__(), CellMLToNektar.pycml.cellml_variable._add_dependency(), CellMLToNektar.pycml.cellml_variable._add_ode_dependency(), CellMLToNektar.pycml.cellml_variable._decrement_usage_count(), CellMLToNektar.pycml.cellml_variable._get_binding_time(), CellMLToNektar.pycml.cellml_variable._set_source_variable(), CellMLToNektar.pycml.cellml_variable.add_rdf_annotation(), CellMLToNektar.pycml.cellml_variable.get_ode_dependency(), CellMLToNektar.pycml.cellml_variable.get_source_variable(), CellMLToNektar.pycml.cellml_variable.get_value(), and CellMLToNektar.pycml.cellml_variable.set_is_modifiable_parameter().
def CellMLToNektar.pycml.cellml_variable.get_all_expr_dependencies | ( | self | ) |
Return all expressions this variable depends on, either directly or as an ODE.
Definition at line 1845 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable._cml_depends_on, CellMLToNektar.pycml.mathml_apply._cml_depends_on, and CellMLToNektar.pycml.cellml_variable._cml_depends_on_ode.
def CellMLToNektar.pycml.cellml_variable.get_component | ( | self | ) |
def CellMLToNektar.pycml.cellml_variable.get_dependencies | ( | self | ) |
Return the list of things this variable depends on.
Definition at line 1790 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable._cml_depends_on, and CellMLToNektar.pycml.mathml_apply._cml_depends_on.
def CellMLToNektar.pycml.cellml_variable.get_ode_dependency | ( | self, | |
independent_var, | |||
context = None |
|||
) |
Return the expression defining the ODE giving the derivative of this variable w.r.t. independent_var. Triggers a validation error if the ODE has not been defined.
Definition at line 1827 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable._cml_depends_on_ode, CellMLToNektar.pycml.cellml_variable.fullname(), CellMLToNektar.pycml.cellml_variable.get_ode_dependency(), CellMLToNektar.pycml.cellml_variable.get_source_variable(), and CellMLToNektar.pycml.cellml_variable.get_type().
Referenced by CellMLToNektar.pycml.cellml_variable.get_ode_dependency().
def CellMLToNektar.pycml.cellml_variable.get_rdf_annotation | ( | self, | |
property | |||
) |
Get an RDF annotation about this variable. property must be a tuple (qname, namespace_uri). Will return the unique annotation found with source being this variable's id, and the given property. If no annotation is found (or if the variable does not have a cmeta:id), returns None. Throws an error if more than one annotation is found.
Definition at line 1988 of file pycml.py.
References CellMLToNektar.pycml.element_base.cmeta_id(), CellMLToNektar.processors.ModelModifier.model, CellMLToNektar.pycml.cellml_variable.model(), CellMLToNektar.pycml.mathml.model(), and CellMLToNektar.translators.CellMLTranslator.model.
Referenced by CellMLToNektar.pycml.cellml_variable._get_binding_time(), CellMLToNektar.pycml.cellml_variable.is_derived_quantity(), CellMLToNektar.pycml.cellml_variable.is_modifiable_parameter(), CellMLToNektar.pycml.cellml_variable.is_output_variable(), and CellMLToNektar.pycml.cellml_variable.pe_keep().
def CellMLToNektar.pycml.cellml_variable.get_rdf_annotations | ( | self, | |
property | |||
) |
Get all RDF annotations about this variable that use the given property. property must be a tuple (qname, namespace_uri). Will return all annotations found with source being this variable's id, and the given property. If no annotation is found (or if the variable does not have a cmeta:id), returns the empty list
Definition at line 2005 of file pycml.py.
References CellMLToNektar.pycml.element_base.cmeta_id(), CellMLToNektar.processors.ModelModifier.model, CellMLToNektar.pycml.cellml_variable.model(), CellMLToNektar.pycml.mathml.model(), and CellMLToNektar.translators.CellMLTranslator.model.
Referenced by CellMLToNektar.pycml.cellml_variable.oxmeta_name().
def CellMLToNektar.pycml.cellml_variable.get_source_variable | ( | self, | |
recurse = False |
|||
) |
Assuming this variable imports its value, return the variable from which we obtain our value. If our value is determined within this component, raise a TypeError. If recurse is set to True, recursively follow mappings until a non-mapped variable is found.
Definition at line 1870 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable._cml_source_var, and CellMLToNektar.pycml.cellml_variable.fullname().
Referenced by CellMLToNektar.pycml.cellml_variable._decrement_usage_count(), CellMLToNektar.pycml.cellml_variable._get_binding_time(), CellMLToNektar.pycml.cellml_variable._reduce(), CellMLToNektar.pycml.cellml_variable._set_type(), CellMLToNektar.pycml.cellml_variable._update_ode_dependency(), CellMLToNektar.pycml.cellml_variable._used(), CellMLToNektar.pycml.cellml_variable.get_ode_dependency(), CellMLToNektar.pycml.cellml_variable.get_type(), CellMLToNektar.pycml.cellml_variable.get_value(), CellMLToNektar.pycml.cellml_variable.is_statically_const(), CellMLToNektar.pycml.cellml_variable.set_value(), and CellMLToNektar.pycml.cellml_variable.unset_values().
def CellMLToNektar.pycml.cellml_variable.get_type | ( | self, | |
follow_maps = False |
|||
) |
Return the type of this variable. If follow_maps is True and the value of this variable is imported from another component, then return the type of the variable we get our value from instead.
Definition at line 1913 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable._cml_var_type, CellMLToNektar.pycml.cellml_variable.get_source_variable(), and CellMLToNektar.pycml.cellml_variable.get_type().
Referenced by CellMLToNektar.pycml.cellml_variable._get_binding_time(), CellMLToNektar.pycml.cellml_variable._update_ode_dependency(), CellMLToNektar.pycml.cellml_variable.get_ode_dependency(), CellMLToNektar.pycml.cellml_variable.get_type(), CellMLToNektar.pycml.cellml_variable.get_value(), CellMLToNektar.pycml.cellml_variable.is_modifiable_parameter(), CellMLToNektar.pycml.cellml_variable.is_statically_const(), CellMLToNektar.pycml.cellml_variable.set_is_modifiable_parameter(), CellMLToNektar.pycml.cellml_variable.set_value(), and CellMLToNektar.pycml.cellml_variable.unset_values().
def CellMLToNektar.pycml.cellml_variable.get_units | ( | self | ) |
Get the cellml_units object giving this variable's units.
Definition at line 1769 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable.component, CellMLToNektar.pycml.mathml.component, and CellMLToNektar.pycml.get_units_by_name().
Referenced by CellMLToNektar.pycml.mathml._ensure_units_exist(), CellMLToNektar.pycml.mathml_units_mixin_tokens._set_in_units(), and CellMLToNektar.pycml.mathml_apply._set_in_units().
def CellMLToNektar.pycml.cellml_variable.get_usage_count | ( | self | ) |
Return the number of times this variable is used in an expression.
Definition at line 1941 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable._cml_usage_count.
def CellMLToNektar.pycml.cellml_variable.get_value | ( | self, | |
ode = None |
|||
) |
Return the value of this variable. If a value has been set with set_value(), return that. Otherwise, the behaviour depends on the type of this variable. If it is Mapped, return the value of the source variable. If it is Constant or State, return its initial value. Otherwise, raise an EvaluationError. If ode is given, it should be an instance of cellml_variable. In this case, we're getting the value of d(self)/d(ode).
Definition at line 2171 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable._cml_depends_on, CellMLToNektar.pycml.mathml_apply._cml_depends_on, CellMLToNektar.pycml.cellml_variable._cml_value, CellMLToNektar.pycml.cellml_variable._get_binding_time(), CellMLToNektar.pycml.mathml_cn._get_binding_time(), CellMLToNektar.pycml.mathml_ci._get_binding_time(), CellMLToNektar.pycml.mathml_piecewise._get_binding_time(), CellMLToNektar.pycml.mathml_diff._get_binding_time(), CellMLToNektar.pycml.mathml_and._get_binding_time(), CellMLToNektar.pycml.mathml_or._get_binding_time(), CellMLToNektar.pycml.mathml_eq._get_binding_time(), CellMLToNektar.pycml.mathml_apply._get_binding_time(), CellMLToNektar.pycml.cellml_variable.fullname(), CellMLToNektar.pycml.cellml_variable.get_source_variable(), CellMLToNektar.pycml.cellml_variable.get_type(), CellMLToNektar.pycml.cellml_variable.get_value(), CellMLToNektar.pycml.cellml_variable.initial_value, and CellMLToNektar.pycml.cellml_variable.set_value().
Referenced by CellMLToNektar.pycml.cellml_variable.get_value().
|
static |
Return the variable object that has name varname. This method tries to handle various forms of fully qualified variable name, i.e. names which include the name of the component the variable occurs in, including those created by CellMLTranslator.code_name.
Definition at line 1730 of file pycml.py.
def CellMLToNektar.pycml.cellml_variable.is_derived_quantity | ( | self | ) |
Whether this variable should be included in reports of derived quantities.
Definition at line 2216 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable.get_rdf_annotation().
Referenced by CellMLToNektar.pycml.cellml_variable.pe_keep().
def CellMLToNektar.pycml.cellml_variable.is_modifiable_parameter | ( | self | ) |
Whether this variable is a parameter that should be modifiable at run-time.
Definition at line 2202 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable.get_rdf_annotation(), and CellMLToNektar.pycml.cellml_variable.get_type().
Referenced by CellMLToNektar.pycml.cellml_variable.pe_keep().
def CellMLToNektar.pycml.cellml_variable.is_output_variable | ( | self | ) |
Whether a protocol has requested this variable as a model output.
Definition at line 2227 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable.get_rdf_annotation().
Referenced by CellMLToNektar.pycml.cellml_variable.pe_keep().
def CellMLToNektar.pycml.cellml_variable.is_statically_const | ( | self, | |
ignore_annotations = False |
|||
) |
Determine loosely if this variable is considered constant. Checks if we're Constant, or Computed with a static binding time (or of unknown type). If ignore_annotations is True, will ignore cached binding time values and pe:keep annotations. It instead finds all variables we depend on, directly or indirectly, and gives a dynamic result iff any is a state or free variable.
Definition at line 2119 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable._get_binding_time(), CellMLToNektar.pycml.mathml_cn._get_binding_time(), CellMLToNektar.pycml.mathml_ci._get_binding_time(), CellMLToNektar.pycml.mathml_piecewise._get_binding_time(), CellMLToNektar.pycml.mathml_diff._get_binding_time(), CellMLToNektar.pycml.mathml_and._get_binding_time(), CellMLToNektar.pycml.mathml_or._get_binding_time(), CellMLToNektar.pycml.mathml_eq._get_binding_time(), CellMLToNektar.pycml.mathml_apply._get_binding_time(), CellMLToNektar.pycml.cellml_variable.get_source_variable(), CellMLToNektar.pycml.cellml_variable.get_type(), CellMLToNektar.pycml.cellml_variable.is_statically_const(), CellMLToNektar.processors.ModelModifier.model, CellMLToNektar.pycml.cellml_variable.model(), CellMLToNektar.pycml.mathml.model(), and CellMLToNektar.translators.CellMLTranslator.model.
Referenced by CellMLToNektar.pycml.cellml_variable.is_statically_const().
def CellMLToNektar.pycml.cellml_variable.model | ( | self | ) |
Definition at line 1766 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable.component, and CellMLToNektar.pycml.mathml.component.
Referenced by CellMLToNektar.processors.InterfaceGenerator._add_all_odes_to_interface(), CellMLToNektar.processors.ModelModifier._clear_model_caches(), CellMLToNektar.processors.ModelModifier._create_connection_element(), CellMLToNektar.processors.ModelModifier._find_connection_element(), CellMLToNektar.processors.ModelModifier._find_or_create_variable(), CellMLToNektar.processors.ModelModifier._process_operator(), CellMLToNektar.pycml.reduce_commutative_nary._reduce(), CellMLToNektar.pycml.mathml_power._reduce(), CellMLToNektar.pycml.mathml_piecewise._set_in_units(), CellMLToNektar.pycml.cellml_variable._set_source_variable(), CellMLToNektar.processors.InterfaceGenerator._split_ode(), CellMLToNektar.processors.InterfaceGenerator._transform_derivatives_on_rhs(), CellMLToNektar.processors.ModelModifier._update_connections(), CellMLToNektar.processors.UnitsConverter.add_all_conversions(), CellMLToNektar.processors.UnitsConverter.add_conversions_for_component(), CellMLToNektar.processors.ModelModifier.add_expr_to_comp(), CellMLToNektar.processors.InterfaceGenerator.add_output_function(), CellMLToNektar.pycml.cellml_variable.add_rdf_annotation(), CellMLToNektar.processors.ModelModifier.add_units(), CellMLToNektar.processors.ModelModifier.add_variable(), CellMLToNektar.translators.CellMLTranslator.calculate_extended_dependencies(), CellMLToNektar.pycml.mathml_apply.classify_variables(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.code_name(), CellMLToNektar.processors.ModelModifier.connect_variables(), CellMLToNektar.processors.UnitsConverter.convert_assignments(), CellMLToNektar.processors.UnitsConverter.convert_connections(), CellMLToNektar.processors.UnitsConverter.convert_constant(), CellMLToNektar.processors.UnitsConverter.convert_mapping(), CellMLToNektar.processors.ModelModifier.create_new_component(), CellMLToNektar.processors.ModelModifier.finalize(), CellMLToNektar.pycml.mathml.get_component(), CellMLToNektar.processors.InterfaceGenerator.get_interface_component(), CellMLToNektar.pycml.cellml_variable.get_rdf_annotation(), CellMLToNektar.pycml.cellml_variable.get_rdf_annotations(), CellMLToNektar.pycml.mathml_apply.get_units(), CellMLToNektar.pycml.mathml_piecewise.get_units(), CellMLToNektar.pycml.cellml_variable.is_statically_const(), CellMLToNektar.processors.InterfaceGenerator.make_var_computed_constant(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_backward_euler_mathematics(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_constructor(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_default_stimulus(), CellMLToNektar.translators.CellMLTranslator.output_equations(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_equations(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_get_i_ionic(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_includes(), CellMLToNektar.translators.CellMLTranslator.output_mathematics(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_model_attributes(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_top_boilerplate(), CellMLToNektar.translators.CellMLTranslator.output_top_boilerplate(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.output_verify_state_variables(), CellMLToNektar.processors.ModelModifier.remove_connections(), CellMLToNektar.pycml.cellml_variable.remove_rdf_annotations(), CellMLToNektar.translators.CellMLTranslator.var_display_name(), and CellMLToNektar.translators.CellMLTranslator.varobj().
def CellMLToNektar.pycml.cellml_variable.oxmeta_name | ( | self | ) |
The canonical name of this variable, as given by Oxford metadata. Returns the empty string if no annotation is given.
Definition at line 2252 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable.get_rdf_annotations().
def CellMLToNektar.pycml.cellml_variable.pe_keep | ( | self | ) |
Whether PE should retain this variable in the specialised model.
Definition at line 2238 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable.get_rdf_annotation(), CellMLToNektar.pycml.cellml_variable.is_derived_quantity(), CellMLToNektar.pycml.cellml_variable.is_modifiable_parameter(), and CellMLToNektar.pycml.cellml_variable.is_output_variable().
Referenced by CellMLToNektar.pycml.cellml_variable._get_binding_time(), and CellMLToNektar.pycml.cellml_variable._reduce().
def CellMLToNektar.pycml.cellml_variable.remove_rdf_annotations | ( | self, | |
property = None |
|||
) |
Remove all RDF annotations about this variable. If property is given, only remove annotations with the given property.
Definition at line 2021 of file pycml.py.
References CellMLToNektar.pycml.element_base.cmeta_id(), CellMLToNektar.utilities.DEBUG(), CellMLToNektar.processors.ModelModifier.model, CellMLToNektar.pycml.cellml_variable.model(), CellMLToNektar.pycml.mathml.model(), and CellMLToNektar.translators.CellMLTranslator.model.
Referenced by CellMLToNektar.pycml.cellml_variable._unset_binding_time().
def CellMLToNektar.pycml.cellml_variable.set_is_derived_quantity | ( | self, | |
is_dq | |||
) |
Set method for the is_derived_quantity property. We need a separate method for this to bypass Amara's property setting checks.
Definition at line 2219 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable.set_rdf_annotation_from_boolean().
def CellMLToNektar.pycml.cellml_variable.set_is_modifiable_parameter | ( | self, | |
is_param | |||
) |
Set method for the is_modifiable_parameter property. We need a separate method for this to bypass Amara's property setting checks.
Definition at line 2206 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable.fullname(), CellMLToNektar.pycml.cellml_variable.get_type(), and CellMLToNektar.pycml.cellml_variable.set_rdf_annotation_from_boolean().
def CellMLToNektar.pycml.cellml_variable.set_is_output_variable | ( | self, | |
is_ov | |||
) |
Set method for the is_output_variable property. We need a separate method for this to bypass Amara's property setting checks.
Definition at line 2230 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable.set_rdf_annotation_from_boolean().
def CellMLToNektar.pycml.cellml_variable.set_oxmeta_name | ( | self, | |
name | |||
) |
Set method for the oxmeta_name property. Sets a bqbiol:is RDF annotation with the name. We need a separate method for this to bypass Amara's property setting checks.
Definition at line 2263 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable.add_rdf_annotation().
def CellMLToNektar.pycml.cellml_variable.set_pe_keep | ( | self, | |
keep | |||
) |
Set method for the pe_keep property. We need a separate method for this to bypass Amara's property setting checks.
Definition at line 2244 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable.set_rdf_annotation_from_boolean().
def CellMLToNektar.pycml.cellml_variable.set_rdf_annotation_from_boolean | ( | self, | |
property, | |||
is_yes | |||
) |
Set an RDF annotation as 'yes' or 'no' depending on a boolean value.
Definition at line 2034 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable.add_rdf_annotation().
Referenced by CellMLToNektar.pycml.cellml_variable.set_is_derived_quantity(), CellMLToNektar.pycml.cellml_variable.set_is_modifiable_parameter(), CellMLToNektar.pycml.cellml_variable.set_is_output_variable(), and CellMLToNektar.pycml.cellml_variable.set_pe_keep().
def CellMLToNektar.pycml.cellml_variable.set_value | ( | self, | |
value, | |||
ode = None , |
|||
follow_maps = True |
|||
) |
Set the value of this variable. Expects a floating point or boolean value. If ode is given, it should be an instance of cellml_variable. In this case, we're setting the value of d(self)/d(ode). If this is a mapped variable, assign the value to its source variable instead, unless follow_maps is set to False
Definition at line 2147 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable._cml_value, CellMLToNektar.pycml.cellml_variable.get_source_variable(), CellMLToNektar.pycml.cellml_variable.get_type(), and CellMLToNektar.pycml.cellml_variable.set_value().
Referenced by CellMLToNektar.pycml.cellml_variable.get_value(), and CellMLToNektar.pycml.cellml_variable.set_value().
|
static |
Split a variable name as given by cellml_variable.fullname into constituent parts. Returns a tuple (component name, local variable name). If the component name cannot be identified, it will be returned as the empty string.
Definition at line 1714 of file pycml.py.
def CellMLToNektar.pycml.cellml_variable.unset_values | ( | self | ) |
Unset all values for this variable set with set_value.
Definition at line 2165 of file pycml.py.
References CellMLToNektar.pycml.cellml_variable._cml_value, CellMLToNektar.pycml.cellml_variable.get_source_variable(), CellMLToNektar.pycml.cellml_variable.get_type(), and CellMLToNektar.pycml.cellml_variable.unset_values().
Referenced by CellMLToNektar.pycml.cellml_variable.unset_values().
|
private |
|
private |
Move the definition to this component defn._unset_cached_links() defn.xml_parent.xml_remove_child(defn) self.component.math.xml_append(defn) Schedule the LHS of the defining expression for update.
Definition at line 1668 of file pycml.py.
Referenced by CellMLToNektar.pycml.cellml_variable._add_dependency(), CellMLToNektar.pycml.cellml_variable._get_binding_time(), CellMLToNektar.pycml.cellml_variable.get_all_expr_dependencies(), CellMLToNektar.pycml.cellml_variable.get_dependencies(), CellMLToNektar.pycml.mathml_apply.get_dependencies(), and CellMLToNektar.pycml.cellml_variable.get_value().
|
private |
Definition at line 1669 of file pycml.py.
Referenced by CellMLToNektar.pycml.cellml_variable._add_ode_dependency(), CellMLToNektar.pycml.cellml_variable._update_ode_dependency(), CellMLToNektar.pycml.cellml_variable.get_all_expr_dependencies(), and CellMLToNektar.pycml.cellml_variable.get_ode_dependency().
|
private |
Definition at line 2053 of file pycml.py.
Referenced by CellMLToNektar.pycml.cellml_variable._unset_binding_time().
|
private |
Definition at line 1664 of file pycml.py.
Referenced by CellMLToNektar.pycml.cellml_variable._set_source_variable(), and CellMLToNektar.pycml.cellml_variable.get_source_variable().
|
private |
Definition at line 1670 of file pycml.py.
Referenced by CellMLToNektar.pycml.cellml_variable._decrement_usage_count(), CellMLToNektar.pycml.cellml_variable._set_type(), CellMLToNektar.pycml.cellml_variable._used(), and CellMLToNektar.pycml.cellml_variable.get_usage_count().
|
private |
Definition at line 1665 of file pycml.py.
Referenced by CellMLToNektar.pycml.cellml_variable.get_value(), CellMLToNektar.pycml.cellml_variable.set_value(), and CellMLToNektar.pycml.cellml_variable.unset_values().
|
private |
Definition at line 1663 of file pycml.py.
Referenced by CellMLToNektar.pycml.cellml_variable._decrement_usage_count(), CellMLToNektar.pycml.cellml_variable._reduce(), CellMLToNektar.pycml.cellml_variable._set_type(), CellMLToNektar.pycml.cellml_variable._used(), and CellMLToNektar.pycml.cellml_variable.get_type().
CellMLToNektar.pycml.cellml_variable.initial_value |
Definition at line 2290 of file pycml.py.
Referenced by CellMLToNektar.pycml.cellml_variable.get_value().
|
static |
Definition at line 1763 of file pycml.py.
Referenced by CellMLToNektar.pycml.mathml_constructor._get_element_units(), CellMLToNektar.pycml.mathml_units_mixin._set_element_in_units(), CellMLToNektar.pycml.cellml_variable.fullname(), CellMLToNektar.pycml.cellml_variable.get_units(), CellMLToNektar.pycml.mathml_cn.get_units(), CellMLToNektar.pycml.mathml_ci.get_units(), CellMLToNektar.pycml.cellml_model.get_variable_by_name(), CellMLToNektar.pycml.cellml_variable.model(), and CellMLToNektar.pycml.mathml_ci.variable().