Skip to content
Snippets Groups Projects
Commit 87fed348 authored by Kilian Weishaupt's avatar Kilian Weishaupt Committed by Timo Koch
Browse files

[python][component] Add Constant component

parent 9a4600c7
No related branches found
No related tags found
1 merge request!2973Improve python component
Pipeline #11881 waiting for manual action
......@@ -11,6 +11,7 @@ _components = {
"SimpleH2O": "dumux/material/components/simpleh2o.hh",
"N2": "dumux/material/components/n2.hh",
"Calcite": "dumux/material/components/calcite.hh",
"Constant": "dumux/material/components/constant.hh",
}
......@@ -21,10 +22,12 @@ def listComponents():
@cppWrapperCreator
def _createComponent(name, *, scalar="double"):
def _createComponent(name, *, scalar="double", componentId=0):
"""Create a new component of the given name"""
typeName = f"Dumux::Components::{name} <{scalar}>"
if name == "Constant":
typeName = f"Dumux::Components::{name} <{componentId}, {scalar}>"
else:
typeName = f"Dumux::Components::{name} <{scalar}>"
moduleName = f"{name.lower()}_{hashIt(typeName)}"
includes = ["dumux/python/material/components/component.hh"]
includes += [_components[name]]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment