Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TurTLE
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
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
TurTLE
TurTLE
Commits
bfa2e9e6
There was a problem fetching the pipeline summary.
Commit
bfa2e9e6
authored
7 years ago
by
Cristian Lalescu
Browse files
Options
Downloads
Patches
Plain Diff
add alternate random field generator
parent
10486066
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!23
WIP: Feature/use cmake
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bfps/tools.py
+13
-0
13 additions, 0 deletions
bfps/tools.py
with
13 additions
and
0 deletions
bfps/tools.py
+
13
−
0
View file @
bfa2e9e6
...
@@ -143,6 +143,19 @@ def generate_data_3D(
...
@@ -143,6 +143,19 @@ def generate_data_3D(
a
[
ii
]
=
0
a
[
ii
]
=
0
return
a
return
a
def
generate_random_discontinuous_data_3D
(
n0
,
n1
,
n2
,
dtype
=
np
.
complex128
,
p
=
1.5
,
amplitude
=
0.5
):
"""
returns the Fourier representation of a random field.
"""
assert
(
n0
%
2
==
0
and
n1
%
2
==
0
and
n2
%
2
==
0
)
a
=
np
.
random
.
randn
(
n1
,
n0
,
n2
)
b
=
np
.
fft
.
rfftn
(
a
).
astype
(
dtype
)
return
b
def
randomize_phases
(
v
):
def
randomize_phases
(
v
):
"""
randomize the phases of an FFTW complex field.
"""
randomize the phases of an FFTW complex field.
...
...
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