Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
irp
Fresnel
Commits
a114998c
Commit
a114998c
authored
May 11, 2021
by
Leon Merten Lohse
Browse files
formatting
parent
0925342a
Pipeline
#195163
passed with stages
in 2 minutes and 39 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
fresnel/misc.py
View file @
a114998c
...
...
@@ -28,7 +28,7 @@ def fftfreqn(n, dx=1):
xi
=
[
fftfreq
(
n_i
,
dx_i
)
for
n_i
,
dx_i
in
zip
(
n
,
dx
)]
return
np
.
meshgrid
(
*
xi
,
sparse
=
True
,
indexing
=
'
ij
'
)
return
np
.
meshgrid
(
*
xi
,
sparse
=
True
,
indexing
=
"
ij
"
)
def
gridn
(
n
):
...
...
@@ -37,7 +37,7 @@ def gridn(n):
x
=
[
np
.
arange
(
-
n
[
dim
]
+
1
,
n
[
dim
])
for
dim
in
range
(
ndim
)]
return
np
.
meshgrid
(
*
x
,
sparse
=
True
,
indexing
=
'
ij
'
)
return
np
.
meshgrid
(
*
x
,
sparse
=
True
,
indexing
=
"
ij
"
)
def
crop
(
a
,
crop_width
):
...
...
source/finite_difference.h
View file @
a114998c
...
...
@@ -96,7 +96,7 @@ namespace finite_differences {
m
(
1
,
i
-
1
)
=
rz
+
2.0
*
rxx
-
f
(
i
);
// diagonal
m
(
2
,
i
-
1
)
=
-
rxx
;
// upper;
r
(
i
-
1
)
=
(
rz
+
fp
(
i
))
*
up
(
i
)
+
rxx
*
(
up
(
i
-
1
)
-
2.0
*
up
(
i
)
+
up
(
i
+
1
));
+
rxx
*
(
up
(
i
-
1
)
-
2.0
*
up
(
i
)
+
up
(
i
+
1
));
}
// boundary
...
...
@@ -200,7 +200,7 @@ namespace finite_differences {
m
(
2
,
ix
-
1
)
=
-
rxx
;
r
(
ix
-
1
)
=
(
rz
+
fp
(
ix
,
iy
))
*
up
(
ix
,
iy
)
+
ryy
*
(
up
(
ix
,
iy
-
1
)
-
2.0
*
up
(
ix
,
iy
)
+
up
(
ix
,
iy
+
1
));
+
ryy
*
(
up
(
ix
,
iy
-
1
)
-
2.0
*
up
(
ix
,
iy
)
+
up
(
ix
,
iy
+
1
));
}
// boundary conditions
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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