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
d8a7e663
Commit
d8a7e663
authored
3 years ago
by
Kilian Weishaupt
Committed by
Timo Koch
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[python][gridGeometry] use def_property_readonly
parent
da78fc52
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2681
Feature/python main file
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dumux/python/discretization/gridgeometry.hh
+23
-22
23 additions, 22 deletions
dumux/python/discretization/gridgeometry.hh
with
23 additions
and
22 deletions
dumux/python/discretization/gridgeometry.hh
+
23
−
22
View file @
d8a7e663
...
...
@@ -48,12 +48,12 @@ void registerSubControlVolume(pybind11::handle scope)
{
using
pybind11
::
operator
""
_a
;
cls
.
def
(
"center"
,
&
SCV
::
center
);
cls
.
def
(
"volume"
,
&
SCV
::
volume
);
cls
.
def
(
"dofIndex"
,
&
SCV
::
dofIndex
);
cls
.
def
(
"localDofIndex"
,
&
SCV
::
localDofIndex
);
cls
.
def
(
"dofPosition"
,
&
SCV
::
dofPosition
);
cls
.
def
(
"elementIndex"
,
&
SCV
::
elementIndex
);
cls
.
def
_property_readonly
(
"center"
,
&
SCV
::
center
);
cls
.
def
_property_readonly
(
"volume"
,
&
SCV
::
volume
);
cls
.
def
_property_readonly
(
"dofIndex"
,
&
SCV
::
dofIndex
);
cls
.
def
_property_readonly
(
"localDofIndex"
,
&
SCV
::
localDofIndex
);
cls
.
def
_property_readonly
(
"dofPosition"
,
&
SCV
::
dofPosition
);
cls
.
def
_property_readonly
(
"elementIndex"
,
&
SCV
::
elementIndex
);
}
}
...
...
@@ -73,14 +73,14 @@ void registerSubControlVolumeFace(pybind11::handle scope)
{
using
pybind11
::
operator
""
_a
;
cls
.
def
(
"center"
,
&
SCVF
::
center
);
cls
.
def
(
"area"
,
&
SCVF
::
area
);
cls
.
def
(
"ipGlobal"
,
&
SCVF
::
ipGlobal
);
cls
.
def
(
"boundary"
,
&
SCVF
::
boundary
);
cls
.
def
(
"unitOuterNormal"
,
&
SCVF
::
unitOuterNormal
);
cls
.
def
(
"insideScvIdx"
,
&
SCVF
::
insideScvIdx
);
cls
.
def
(
"outsideScvIdx"
,
[](
SCVF
&
self
){
return
self
.
outsideScvIdx
();
});
cls
.
def
(
"index"
,
&
SCVF
::
index
);
cls
.
def
_property_readonly
(
"center"
,
&
SCVF
::
center
);
cls
.
def
_property_readonly
(
"area"
,
&
SCVF
::
area
);
cls
.
def
_property_readonly
(
"ipGlobal"
,
&
SCVF
::
ipGlobal
);
cls
.
def
_property_readonly
(
"boundary"
,
&
SCVF
::
boundary
);
cls
.
def
_property_readonly
(
"unitOuterNormal"
,
&
SCVF
::
unitOuterNormal
);
cls
.
def
_property_readonly
(
"insideScvIdx"
,
&
SCVF
::
insideScvIdx
);
cls
.
def
_property_readonly
(
"outsideScvIdx"
,
[](
SCVF
&
self
){
return
self
.
outsideScvIdx
();
});
cls
.
def
_property_readonly
(
"index"
,
&
SCVF
::
index
);
}
}
...
...
@@ -99,10 +99,10 @@ void registerFVElementGeometry(pybind11::handle scope)
{
using
pybind11
::
operator
""
_a
;
cls
.
def
(
"numScvf"
,
&
FVEG
::
numScv
);
cls
.
def
(
"numScv"
,
&
FVEG
::
numScv
);
cls
.
def_property_readonly
(
"numScvf"
,
&
FVEG
::
numScv
);
cls
.
def_property_readonly
(
"numScv"
,
&
FVEG
::
numScv
);
cls
.
def_property_readonly
(
"hasBoundaryScvf"
,
&
FVEG
::
hasBoundaryScvf
);
cls
.
def
(
"bind"
,
&
FVEG
::
bind
,
"element"
_a
);
cls
.
def
(
"hasBoundaryScvf"
,
&
FVEG
::
hasBoundaryScvf
);
cls
.
def
(
"scvs"
,
[](
FVEG
&
self
){
const
auto
range
=
scvs
(
self
);
return
pybind11
::
make_iterator
(
range
.
begin
(),
range
.
end
());
...
...
@@ -129,11 +129,12 @@ void registerGridGeometry(pybind11::handle scope, pybind11::class_<GG, Options..
}),
"gridView"
_a
);
cls
.
def
(
"update"
,
&
GG
::
update
);
cls
.
def
(
"numDofs"
,
&
GG
::
numDofs
);
cls
.
def
(
"numScv"
,
&
GG
::
numScv
);
cls
.
def
(
"numScvf"
,
&
GG
::
numScvf
);
cls
.
def
(
"bBoxMax"
,
&
GG
::
bBoxMax
);
cls
.
def
(
"bBoxMin"
,
&
GG
::
bBoxMin
);
cls
.
def_property_readonly
(
"numDofs"
,
&
GG
::
numDofs
);
cls
.
def_property_readonly
(
"numScv"
,
&
GG
::
numScv
);
cls
.
def_property_readonly
(
"numScvf"
,
&
GG
::
numScvf
);
cls
.
def_property_readonly
(
"bBoxMax"
,
&
GG
::
bBoxMax
);
cls
.
def_property_readonly
(
"bBoxMin"
,
&
GG
::
bBoxMin
);
cls
.
def_property_readonly
(
"gridView"
,
&
GG
::
gridView
);
cls
.
def_property_readonly_static
(
"discMethod"
,
[](
const
pybind11
::
object
&
){
return
toString
(
GG
::
discMethod
);
...
...
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