Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-fufem
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
agnumpde
dune-fufem
Commits
6a8c869d
There was a problem fetching the pipeline summary.
Commit
6a8c869d
authored
Jan 9, 2018
by
Daniel Kienle
Committed by
Carsten Gräser
Apr 16, 2018
Browse files
Options
Downloads
Patches
Plain Diff
add test case for python fix
parent
2e102b60
Branches
Branches containing commit
No related tags found
1 merge request
!26
Feature/fix nonsequence python conversion
Pipeline
#
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/fufem/test/dunepythontest.cc
+29
-0
29 additions, 0 deletions
dune/fufem/test/dunepythontest.cc
with
29 additions
and
0 deletions
dune/fufem/test/dunepythontest.cc
+
29
−
0
View file @
6a8c869d
...
@@ -800,6 +800,35 @@ int main(int argc, char** argv)
...
@@ -800,6 +800,35 @@ int main(int argc, char** argv)
}
}
#endif
#endif
std
::
cout
<<
std
::
endl
;
std
::
cout
<<
"Example 18: calling functions with Fieldvector multiple times ******************"
<<
std
::
endl
;
{
using
Vec3D
=
Dune
::
FieldVector
<
double
,
3
>
;
using
Vec2D
=
Dune
::
FieldVector
<
double
,
2
>
;
using
Vec1D
=
Dune
::
FieldVector
<
double
,
1
>
;
Vec3D
a
{
0.5
,
0.5
,
0.5
};
Vec2D
b
{
0.5
,
0.5
};
Vec1D
c
{
0.5
};
auto
test3d
=
Python
::
make_function
<
Vec3D
>
(
Python
::
evaluate
(
"lambda x: (0.0, 0.0, 0.0)"
));
auto
test2d
=
Python
::
make_function
<
Vec2D
>
(
Python
::
evaluate
(
"lambda x: (0.0, 0.0)"
));
auto
test1d
=
Python
::
make_function
<
Vec1D
>
(
Python
::
evaluate
(
"lambda x: (0.0)"
));
int
nloop
=
2
;
std
::
cout
<<
"multiple calls with 3d Fieldvector... "
<<
std
::
endl
;
for
(
int
i
=
0
;
i
<
nloop
;
++
i
)
std
::
cout
<<
i
<<
". call "
<<
test3d
(
a
)
<<
" should be (0,0,0)"
<<
std
::
endl
;
std
::
cout
<<
"multiple calls with 2d Fieldvector... "
<<
std
::
endl
;
for
(
int
i
=
0
;
i
<
nloop
;
++
i
)
std
::
cout
<<
i
<<
". call "
<<
test2d
(
b
)
<<
" should be (0,0)"
<<
std
::
endl
;
std
::
cout
<<
"multiple calls with 1d Fieldvector... "
<<
std
::
endl
;
for
(
int
i
=
0
;
i
<
nloop
;
++
i
)
std
::
cout
<<
i
<<
". call "
<<
test1d
(
c
)
<<
" should be (0)"
<<
std
::
endl
;
}
// Before exiting you should stop the python interpreter.
// Before exiting you should stop the python interpreter.
Python
::
stop
();
Python
::
stop
();
...
...
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