Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Daniel Boeckenhoff
tfields
Commits
08625a6e
Commit
08625a6e
authored
May 11, 2020
by
dboe
Browse files
manicure
parent
400a1023
Changes
1
Hide whitespace changes
Inline
Side-by-side
tfields/mesh3D.py
View file @
08625a6e
...
...
@@ -1128,12 +1128,15 @@ class Mesh3D(tfields.TensorMaps):
>>> m_altered_fields = m.copy()
>>> m_altered_fields[0] += 42
>>> assert not m_split.equal(m_altered_fields.cut(template))
>>> assert tfields.Tensors(m_split).equal(m_altered_fields.cut(template))
>>> assert tfields.Tensors(m_split.maps[3]).equal(m_altered_fields.cut(template).maps[3])
>>> assert tfields.Tensors(m_split).equal(
... m_altered_fields.cut(template))
>>> assert tfields.Tensors(m_split.maps[3]).equal(
... m_altered_fields.cut(template).maps[3])
The cut expression may be a sympy.BooleanFunction:
>>> cut_expr_bool_fun = (x > 1.5) & (y < 1.5) & (y >0.2) & (z > -0.5)
>>> m_split_bool = m.cut(cut_expr_bool_fun, at_intersection='split')
>>> m_split_bool = m.cut(cut_expr_bool_fun,
... at_intersection='split')
Returns:
copy of cut mesh
...
...
@@ -1166,7 +1169,8 @@ class Mesh3D(tfields.TensorMaps):
Forwarding to plotTools.plot_mesh
"""
scalars_demanded
=
any
([
v
in
kwargs
for
v
in
[
'vmin'
,
'vmax'
,
'cmap'
]])
map_index
=
kwargs
.
pop
(
'map_index'
,
None
if
not
scalars_demanded
else
0
)
map_index
=
kwargs
.
pop
(
'map_index'
,
None
if
not
scalars_demanded
else
0
)
if
map_index
is
not
None
:
if
not
len
(
self
.
maps
[
3
])
==
0
:
kwargs
[
'color'
]
=
self
.
maps
[
3
].
fields
[
map_index
]
...
...
@@ -1175,6 +1179,4 @@ class Mesh3D(tfields.TensorMaps):
if
__name__
==
'__main__'
:
# pragma: no cover
import
doctest
# doctest.run_docstring_examples(Mesh3D.project, globals())
# doctest.run_docstring_examples(Mesh3D.tree, globals())
doctest
.
testmod
()
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment