Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
teqp_fork_old
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Sven Michael Pohl
teqp_fork_old
Commits
0ee8ea7f
Commit
0ee8ea7f
authored
3 years ago
by
Ian Bell
Browse files
Options
Downloads
Patches
Plain Diff
Some docs for the mutant wrapping
parent
4951e95a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
interface/multifluid_mutant.cpp
+19
-11
19 additions, 11 deletions
interface/multifluid_mutant.cpp
with
19 additions
and
11 deletions
interface/multifluid_mutant.cpp
+
19
−
11
View file @
0ee8ea7f
...
@@ -5,16 +5,24 @@
...
@@ -5,16 +5,24 @@
void
add_multifluid_mutant
(
py
::
module
&
m
)
{
void
add_multifluid_mutant
(
py
::
module
&
m
)
{
// A typedef for the base model
using
MultiFluid
=
decltype
(
build_multifluid_model
(
std
::
vector
<
std
::
string
>
{
""
,
""
},
""
,
""
));
using
MultiFluid
=
decltype
(
build_multifluid_model
(
std
::
vector
<
std
::
string
>
{
""
,
""
},
""
,
""
));
{
m
.
def
(
"build_multifluid_mutant"
,
&
build_multifluid_mutant
<
MultiFluid
>
);
// Wrap the function for generating a multifluid mutant
using
RedType
=
std
::
decay_t
<
decltype
(
MultiFluid
::
redfunc
)
>
;
m
.
def
(
"build_multifluid_mutant"
,
&
build_multifluid_mutant
<
MultiFluid
>
);
using
DepType
=
std
::
decay_t
<
decltype
(
MultiFluid
::
dep
)
>
;
using
BIPmod
=
std
::
decay_t
<
MultiFluidAdapter
<
RedType
,
DepType
,
MultiFluid
>>
;
// The reducing function type and the departure function types are the same
auto
wMFBIP
=
py
::
class_
<
BIPmod
>
(
m
,
"MultiFluidMutant"
)
// as the base model
.
def
(
"set_meta"
,
[](
BIPmod
&
c
,
const
std
::
string
&
s
)
{
return
c
.
set_meta
(
s
);
})
using
RedType
=
std
::
decay_t
<
decltype
(
MultiFluid
::
redfunc
)
>
;
.
def
(
"get_meta"
,
[](
const
BIPmod
&
c
)
{
return
c
.
get_meta
();
})
using
DepType
=
std
::
decay_t
<
decltype
(
MultiFluid
::
dep
)
>
;
;
add_derivatives
<
BIPmod
>
(
m
,
wMFBIP
);
// Typedef for modified mutant type
}
using
BIPmod
=
std
::
decay_t
<
MultiFluidAdapter
<
RedType
,
DepType
,
MultiFluid
>>
;
// Define python wrapper of the mutant class
auto
wMFBIP
=
py
::
class_
<
BIPmod
>
(
m
,
"MultiFluidMutant"
)
.
def
(
"set_meta"
,
[](
BIPmod
&
c
,
const
std
::
string
&
s
)
{
return
c
.
set_meta
(
s
);
})
.
def
(
"get_meta"
,
[](
const
BIPmod
&
c
)
{
return
c
.
get_meta
();
})
;
add_derivatives
<
BIPmod
>
(
m
,
wMFBIP
);
}
}
\ No newline at end of file
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