Nektar++
|
Public Member Functions | |
def | __init__ (self) |
def | __repr__ (self) |
def | __deepcopy__ (self, memo) |
def | clone_self (self, register=False) |
def | get_original_of_clone (self) |
def | get_component (self) |
def | model (self) |
def | eval (self, elt) |
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 | clone (expr) |
Properties | |
component = property(get_component) | |
Private Member Functions | |
def | _unset_cached_links (self, elt=None) |
def | _ensure_units_exist (self, units=None, no_act=False) |
Private Attributes | |
_cml_component | |
_cml_model | |
_cml_source_expr_for_clone | |
Additional Inherited Members | |
Public Attributes inherited from CellMLToNektar.pycml.element_base | |
xml_attributes | |
def CellMLToNektar.pycml.mathml.__init__ | ( | self | ) |
Reimplemented from CellMLToNektar.pycml.element_base.
Reimplemented in CellMLToNektar.pycml.mathml_math, CellMLToNektar.pycml.mathml_constructor, CellMLToNektar.pycml.mathml_cn, CellMLToNektar.pycml.mathml_ci, CellMLToNektar.pycml.mathml_apply, CellMLToNektar.pycml.mathml_piecewise, and CellMLToNektar.pycml.mathml_plus.
Definition at line 3684 of file pycml.py.
References CellMLToNektar.pycml.mathml.__init__().
Referenced by CellMLToNektar.pycml.mathml.__init__().
def CellMLToNektar.pycml.mathml.__deepcopy__ | ( | self, | |
memo | |||
) |
Customise copying of MathML expressions. When copying an expression tree, we only want to deepcopy the XML, not the additional info that we have attached to it - these should be copied as references to the originals.
Definition at line 3694 of file pycml.py.
def CellMLToNektar.pycml.mathml.__repr__ | ( | self | ) |
|
private |
Ensure that there is an element in the XML tree giving this expression's units. Add a new <units> element if this expression has generated units. If units is not None, use the given units rather than those of this expression. Return an attribute dictionary with the appropriate units attribute.
Definition at line 3807 of file pycml.py.
References CellMLToNektar.pycml.extract(), CellMLToNektar.pycml.cellml_variable.get_units(), CellMLToNektar.pycml.mathml_apply.get_units(), CellMLToNektar.pycml.mathml_piecewise.get_units(), CellMLToNektar.pycml.mathml_cn.get_units(), and CellMLToNektar.pycml.mathml_ci.get_units().
Referenced by CellMLToNektar.pycml.mathml_constructor._eval_self().
|
private |
Forget cached component and variable references in this MathML tree. Used by partial evaluator when moving maths to a new component, and by simulation protocols.
Reimplemented in CellMLToNektar.pycml.mathml_ci.
Definition at line 3767 of file pycml.py.
References CellMLToNektar.pycml.mathml._unset_cached_links(), and CellMLToNektar.pycml.mathml_ci._unset_cached_links().
Referenced by CellMLToNektar.pycml.mathml._unset_cached_links().
|
static |
Properly clone a MathML sub-expression. Makes sure siblings and parent don't get copied too.
Definition at line 3716 of file pycml.py.
References CellMLToNektar.utilities.prid().
def CellMLToNektar.pycml.mathml.clone_self | ( | self, | |
register = False |
|||
) |
Properly clone this expression. If register is True, then keep a link to this expression in the clone.
Definition at line 3730 of file pycml.py.
def CellMLToNektar.pycml.mathml.eval | ( | self, | |
elt | |||
) |
Evaluate the given element. Tries to evaluate the given element, and raises an EvaluationError if this is not possible.
Definition at line 3791 of file pycml.py.
Referenced by CellMLToNektar.pycml.mathml_piecewise._get_binding_time(), CellMLToNektar.pycml.mathml_and._get_binding_time(), CellMLToNektar.pycml.mathml_or._get_binding_time(), CellMLToNektar.pycml.mathml_power._reduce(), CellMLToNektar.pycml.mathml_piecewise._reduce(), CellMLToNektar.pycml.mathml_piecewise.evaluate(), CellMLToNektar.pycml.mathml_plus.evaluate(), CellMLToNektar.pycml.mathml_minus.evaluate(), CellMLToNektar.pycml.mathml_times.evaluate(), CellMLToNektar.pycml.mathml_divide.evaluate(), CellMLToNektar.pycml.mathml_exp.evaluate(), CellMLToNektar.pycml.mathml_ln.evaluate(), CellMLToNektar.pycml.mathml_log.evaluate(), CellMLToNektar.pycml.mathml_abs.evaluate(), CellMLToNektar.pycml.mathml_power.evaluate(), CellMLToNektar.pycml.mathml_root.evaluate(), CellMLToNektar.pycml.mathml_and.evaluate(), CellMLToNektar.pycml.mathml_or.evaluate(), CellMLToNektar.pycml.mathml_leq.evaluate(), CellMLToNektar.pycml.mathml_lt.evaluate(), CellMLToNektar.pycml.mathml_geq.evaluate(), CellMLToNektar.pycml.mathml_gt.evaluate(), CellMLToNektar.pycml.mathml_neq.evaluate(), CellMLToNektar.pycml.mathml_eq.evaluate(), CellMLToNektar.pycml.mathml_rem.evaluate(), CellMLToNektar.pycml.mathml_logbase.evaluate(), CellMLToNektar.pycml.mathml_degree.evaluate(), CellMLToNektar.pycml.mathml_sin.evaluate(), CellMLToNektar.pycml.mathml_cos.evaluate(), CellMLToNektar.pycml.mathml_tan.evaluate(), CellMLToNektar.pycml.mathml_arcsin.evaluate(), CellMLToNektar.pycml.mathml_arccos.evaluate(), CellMLToNektar.pycml.mathml_arctan.evaluate(), and CellMLToNektar.pycml.mathml_apply.get_units().
def CellMLToNektar.pycml.mathml.get_component | ( | self | ) |
Definition at line 3747 of file pycml.py.
References CellMLToNektar.pycml.mathml._cml_component, CellMLToNektar.processors.ModelModifier.model, CellMLToNektar.pycml.cellml_variable.model(), CellMLToNektar.pycml.mathml.model(), and CellMLToNektar.translators.CellMLTranslator.model.
def CellMLToNektar.pycml.mathml.get_original_of_clone | ( | self | ) |
If this is a clone with a registered original expression, return it. Otherwise returns None.
Definition at line 3740 of file pycml.py.
References CellMLToNektar.pycml.mathml._cml_source_expr_for_clone.
def CellMLToNektar.pycml.mathml.model | ( | self | ) |
Cache & return the enclosing model element.
Definition at line 3785 of file pycml.py.
References CellMLToNektar.pycml.mathml._cml_model, and CellMLToNektar.pycml.element_base.rootNode().
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().
|
private |
Definition at line 3686 of file pycml.py.
Referenced by CellMLToNektar.pycml.mathml.get_component().
|
private |
Definition at line 3687 of file pycml.py.
Referenced by CellMLToNektar.pycml.mathml.model().
|
private |
Definition at line 3688 of file pycml.py.
Referenced by CellMLToNektar.pycml.mathml.get_original_of_clone().
|
static |
Definition at line 3765 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().