Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dumux-repositories
dumux
Commits
87fed348
Commit
87fed348
authored
3 years ago
by
Kilian Weishaupt
Committed by
Timo Koch
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[python][component] Add Constant component
parent
9a4600c7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2973
Improve python component
Pipeline
#11881
waiting for manual action
Stage: trigger
Stage: downstream modules
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/dumux/material/components/__init__.py
+6
-3
6 additions, 3 deletions
python/dumux/material/components/__init__.py
with
6 additions
and
3 deletions
python/dumux/material/components/__init__.py
+
6
−
3
View file @
87fed348
...
...
@@ -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
]]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment