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
Jonas Plewinski
pystencils
Commits
eb52e10d
Commit
eb52e10d
authored
Apr 10, 2018
by
Martin Bauer
Browse files
Tests for derivative & Chapman Enskog
parent
4a7299f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
derivative.py
View file @
eb52e10d
...
...
@@ -195,10 +195,10 @@ def collect_derivatives(expr):
return
expr
.
collect
(
derivative_terms
(
expr
))
def
create_nested_diff
(
*
arg
s
,
arg
=
None
):
def
create_nested_diff
(
arg
,
*
arg
s
):
"""Shortcut to create nested derivatives"""
assert
arg
is
not
None
args
=
sorted
(
args
,
reverse
=
True
)
args
=
sorted
(
args
,
reverse
=
True
,
key
=
lambda
e
:
e
.
name
if
isinstance
(
e
,
sp
.
Symbol
)
else
e
)
res
=
arg
for
i
in
args
:
res
=
Diff
(
res
,
i
)
...
...
@@ -455,7 +455,7 @@ def functional_derivative(functional, v):
\frac{\delta F}{\delta v} =
\frac{\partial F}{\partial v} - \nabla \cdot \frac{\partial F}{\partial \nabla v}
- assumes that gradients are represented by Diff() node
(from Chapman Enskog module)
- assumes that gradients are represented by Diff() node
- Diff(Diff(r)) represents the divergence of r
- the constants parameter is a list with symbols not affected by the derivative. This is used for simplification
of the derivative terms.
...
...
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