repo
stringlengths
2
99
file
stringlengths
13
225
code
stringlengths
0
18.3M
file_length
int64
0
18.3M
avg_line_length
float64
0
1.36M
max_line_length
int64
0
4.26M
extension_type
stringclasses
1 value
pySDC
pySDC-master/pySDC/tests/test_projects/test_soft_failure/test_generate_statistics.py
import pytest @pytest.mark.base def test_generate_statistics(): from pySDC.projects.soft_failure.generate_statistics import main main()
147
15.444444
68
py
pySDC
pySDC-master/pySDC/tests/test_projects/test_AC/test_temp_forcing.py
import pytest @pytest.mark.mpi4py def test_main_serial(): from pySDC.projects.AllenCahn_Bayreuth.run_temp_forcing_verification import main main(cwd='pySDC/projects/AllenCahn_Bayreuth/')
197
21
84
py
pySDC
pySDC-master/pySDC/tests/test_projects/test_AC/__init__.py
0
0
0
py
pySDC
pySDC-master/pySDC/tests/test_projects/test_AC/test_simple_forcing.py
import pytest import subprocess import os import warnings @pytest.mark.mpi4py def test_main_serial(): from pySDC.projects.AllenCahn_Bayreuth.run_simple_forcing_verification import main, visualize_radii main() visualize_radii() @pytest.mark.slow @pytest.mark.mpi4py def test_main_parallel(): # try to...
1,526
30.8125
183
py
pySDC
pySDC-master/pySDC/tests/test_projects/test_compression/test_proof_of_concept.py
import pytest @pytest.mark.libpressio @pytest.mark.parametrize("thresh", [1e-6, 1e-8]) @pytest.mark.parametrize("useMPI", [True, False]) @pytest.mark.parametrize("num_procs", [1, 4]) def test_compression_proof_of_concept(thresh, useMPI, num_procs): if useMPI: import subprocess import os #...
2,085
31.59375
116
py
pySDC
pySDC-master/pySDC/tests/test_projects/test_compression/__init__.py
0
0
0
py
pySDC
pySDC-master/pySDC/tests/test_projects/test_SDC_showdown/__init__.py
0
0
0
py
pySDC
pySDC-master/pySDC/tests/test_projects/test_SDC_showdown/test_fisher.py
import pytest @pytest.mark.petsc def test_fisher(): from pySDC.projects.SDC_showdown.SDC_timing_Fisher import main main()
133
13.888889
66
py
pySDC
pySDC-master/pySDC/tests/test_projects/test_SDC_showdown/test_grayscott.py
import pytest @pytest.mark.petsc def test_grayscott(): from pySDC.projects.SDC_showdown.SDC_timing_GrayScott import main main(cwd='pySDC/projects/SDC_showdown/')
173
18.333333
69
py
pySDC
pySDC-master/pySDC/tests/test_projects/test_fwsw/test_boussinesq.py
import os import pytest @pytest.mark.base def test_plot(): from pySDC.projects.FastWaveSlowWave.plotgmrescounter_boussinesq import plot_buoyancy assert os.path.isfile('pySDC/projects/FastWaveSlowWave/data/xaxis.npy'), 'ERROR: xaxis.npy does not exist' assert os.path.isfile('pySDC/projects/FastWaveSlowWav...
964
55.764706
112
py
pySDC
pySDC-master/pySDC/tests/test_projects/test_fwsw/test_acoustic.py
import os import pytest @pytest.mark.base def test_plot_convergence(): from pySDC.projects.FastWaveSlowWave.runconvergence_acoustic import plot_convergence assert os.path.isfile('pySDC/projects/FastWaveSlowWave/data/conv-data.txt'), 'ERROR: conv-data.txt does not exist' plot_convergence(cwd='pySDC/projec...
1,016
35.321429
118
py
pySDC
pySDC-master/pySDC/tests/test_projects/test_fwsw/__init__.py
0
0
0
py
pySDC
pySDC-master/pySDC/tests/test_projects/test_fwsw/test_fwsw.py
import os import pytest import numpy as np @pytest.mark.base def test_stifflimit_specrad(): from pySDC.projects.FastWaveSlowWave.plot_stifflimit_specrad import compute_specrad, plot_specrad nodes_v, lambda_f, specrad, norm = compute_specrad() assert np.amax(specrad) < 0.9715, 'Spectral radius is too high...
2,454
41.327586
104
py
pySDC
pySDC-master/pySDC/tests/test_projects/test_pintsime/test_piline_model.py
import pytest @pytest.mark.base def test_main(): from pySDC.projects.PinTSimE.piline_model import main main()
121
12.555556
57
py
pySDC
pySDC-master/pySDC/tests/test_projects/test_pintsime/test_estimation_check.py
import pytest @pytest.mark.base def test_main(): from pySDC.projects.PinTSimE.estimation_check import run run()
123
12.777778
60
py
pySDC
pySDC-master/pySDC/tests/test_projects/test_pintsime/test_battery_model.py
import pytest @pytest.mark.base def test_main(): from pySDC.projects.PinTSimE.battery_model import run run()
120
12.444444
57
py
pySDC
pySDC-master/pySDC/tests/test_projects/test_pintsime/test_buck_model.py
import pytest @pytest.mark.base def test_main(): from pySDC.projects.PinTSimE.buck_model import main main()
119
12.333333
55
py
pySDC
pySDC-master/pySDC/tests/test_projects/test_pintsime/test_battery_2capacitors_model.py
import pytest @pytest.mark.base def test_main(): from pySDC.projects.PinTSimE.battery_2capacitors_model import run run()
132
13.777778
69
py
pySDC
pySDC-master/pySDC/tests/test_projects/test_pintsime/test_estimation_check_2capacitors.py
import pytest @pytest.mark.base def test_main(): from pySDC.projects.PinTSimE.estimation_check_2capacitors import run run()
135
14.111111
72
py
pySDC
pySDC-master/pySDC/tests/test_projects/test_parallelSDC/test_preconditioner_MPI.py
import os import subprocess import pytest @pytest.mark.slow @pytest.mark.mpi4py def test_preconditioner_playground_MPI_5(): # Set python path once my_env = os.environ.copy() my_env['PYTHONPATH'] = '../../..:.' my_env['COVERAGE_PROCESS_START'] = 'pyproject.toml' cwd = '.' num_procs = 5 cmd ...
1,504
31.717391
119
py
pySDC
pySDC-master/pySDC/tests/test_projects/test_parallelSDC/__init__.py
0
0
0
py
pySDC
pySDC-master/pySDC/tests/test_projects/test_parallelSDC/test_preconditioner.py
import pytest @pytest.mark.base def test_main(): from pySDC.projects.parallelSDC.preconditioner_playground import main, plot_iterations main() plot_iterations()
176
16.7
90
py
pySDC
pySDC-master/pySDC/tests/test_projects/test_parallelSDC/test_AllenCahn_parallel.py
import pytest @pytest.mark.mpi4py def test_main(): from pySDC.projects.parallelSDC.AllenCahn_parallel import main # try to import MPI here, will fail if things go wrong (and not in the subprocess part) try: import mpi4py del mpi4py except ImportError: raise ImportError('petsc...
353
19.823529
91
py
pySDC
pySDC-master/pySDC/tests/test_projects/test_parallelSDC/test_fisher.py
import pytest @pytest.mark.base def test_main(): from pySDC.projects.parallelSDC.nonlinear_playground import main, plot_graphs main() plot_graphs() @pytest.mark.base def test_newton_vs_sdc(): from pySDC.projects.parallelSDC.newton_vs_sdc import main as main_newton_vs_sdc from pySDC.projects.par...
449
22.684211
97
py
pySDC
pySDC-master/pySDC/playgrounds/__init__.py
0
0
0
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/playground_dtype.py
import numpy as np import time from mpi4py import MPI from mpi4py_fft import PFFT from pySDC.implementations.datatype_classes.mesh import mesh from pySDC.implementations.datatype_classes.mesh import mesh class mytype(np.ndarray): def __new__(cls, init, val=0.0): if isinstance(init, mytype): ob...
2,153
20.979592
82
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/datatype_test.py
import time import numpy as np from dedalus import public as de from pySDC.implementations.datatype_classes.mesh import mesh from pySDC.implementations.datatype_classes.mesh import mesh from pySDC.playgrounds.Dedalus.dedalus_field import dedalus_field from pySDC.playgrounds.Dedalus.dedalus_field_fast import dedalus_fi...
3,344
24.730769
75
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/__init__.py
0
0
0
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/acoustic_1d_imex/plotenergy.py
from subprocess import call import numpy as np from matplotlib import pyplot as plt from matplotlib.ticker import ScalarFormatter from pylab import rcParams fs = 8 params = np.array([[3, 3], [3, 4], [3, 5]]) file = open('energy-exact.txt') energy_exact = float(file.readline().strip()) Tend = float(file.readline().str...
2,591
30.609756
119
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/acoustic_1d_imex/runconvergence_rk.py
import numpy as np import pySDC.core.deprecated.PFASST_stepwise as mp from ProblemClass_conv import acoustic_1d_imex from pySDC.projects.FastWaveSlowWave.HookClass import plot_solution from standard_integrators import rk_imex from pySDC.core import CollocationClasses as collclass from pySDC.core import Log from pySDC....
3,763
32.309735
102
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/acoustic_1d_imex/ploterrorconstants.py
from subprocess import call import numpy as np from matplotlib import pyplot as plt from matplotlib.ticker import ScalarFormatter from pylab import rcParams fs = 8 order = np.array([]) nsteps = np.array([]) error = np.array([]) # load SDC data file = open('conv-data.txt', 'r') while True: line = file.readline() ...
3,561
31.981481
103
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/acoustic_1d_imex/ProblemClass.py
r""" One-dimensional IMEX acoustic-advection ========================= Integrate the linear 1D acoustic-advection problem: .. math:: u_t + U u_x + c p_x & = 0 \\ p_t + U p_x + c u_x & = 0. """ import numpy as np import scipy.sparse.linalg as LA from buildWave1DMatrix import getWave1DMatrix, getWav...
4,882
27.063218
130
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/acoustic_1d_imex/ProblemClass_multiscale.py
r""" One-dimensional IMEX acoustic-advection ========================= Integrate the linear 1D acoustic-advection problem: .. math:: u_t + U u_x + c p_x & = 0 \\ p_t + U p_x + c u_x & = 0. """ import numpy as np import scipy.sparse.linalg as LA from buildWave1DMatrix import getWave1DMatrix, getWav...
4,640
26.3
112
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/acoustic_1d_imex/__init__.py
0
0
0
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/acoustic_1d_imex/dirk.py
import math import numpy as np import scipy.sparse as sp import scipy.sparse.linalg as LA class dirk: def __init__(self, M, order): assert np.shape(M)[0] == np.shape(M)[1], "Matrix M must be quadratic" self.Ndof = np.shape(M)[0] self.M = M self.order = order assert self....
3,105
27.236364
77
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/acoustic_1d_imex/runenergy.py
from subprocess import call import numpy as np import pySDC.core.deprecated.PFASST_stepwise as mp from ProblemClass_conv import acoustic_1d_imex from pySDC.projects.FastWaveSlowWave.HookClass import plot_solution from standard_integrators import dirk, rk_imex from pySDC.core import CollocationClasses as collclass fro...
4,192
34.533898
107
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/acoustic_1d_imex/playground.py
import numpy as np import pySDC.core.deprecated.PFASST_stepwise as mp from ProblemClass import acoustic_1d_imex from matplotlib import pyplot as plt from pySDC.projects.FastWaveSlowWave.HookClass import plot_solution from pySDC.core import CollocationClasses as collclass from pySDC.core import Log from pySDC.implement...
3,044
31.741935
115
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/fwsw/run_convergence.py
from __future__ import print_function import matplotlib.pyplot as plt import numpy as np import pySDC.core.deprecated.PFASST_stepwise as mp from pySDC.implementations.problem_classes.FastWaveSlowWave_Scalar import swfw_scalar from pySDC.implementations.sweeper_classes.imex_1st_order import imex_1st_order from pySDC.c...
2,185
30.681159
96
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/fwsw/plot_stab_vs_m.py
import matplotlib.pyplot as plt import numpy as np from matplotlib.ticker import ScalarFormatter from pySDC.implementations.problem_classes.FastWaveSlowWave_Scalar import swfw_scalar from pylab import rcParams from pySDC.core import CollocationClasses as collclass from pySDC.core import Hooks as hookclass from pySDC.c...
3,801
39.021053
119
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/fwsw/__init__.py
__author__ = 'robert'
22
10.5
21
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/fwsw/playground.py
from __future__ import print_function import matplotlib.pyplot as plt import numpy as np import pySDC.core.deprecated.PFASST_stepwise as mp from pySDC.implementations.problem_classes.FastWaveSlowWave_Scalar import swfw_scalar from pySDC.implementations.sweeper_classes.imex_1st_order import imex_1st_order from pySDC.c...
2,696
30.360465
125
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/Dedalus/playground_datatypes.py
from dedalus import public as de from dedalus import core import numpy as np import matplotlib.pyplot as plt import time from pySDC.playgrounds.Dedalus.dedalus_field import dedalus_field class wrapper(core.field.Field): def __abs__(self): abs = super(wrapper, self).__abs__() while hasattr(abs, ...
2,333
20.027027
65
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/Dedalus/Dynamo_2D_Dedalus_NEW.py
import numpy as np from dedalus import public as de from pySDC.core.Problem import ptype from pySDC.core.Errors import ParameterError from pySDC.implementations.datatype_classes.mesh import mesh, imex_mesh class dynamo_2d_dedalus(ptype): """ """ def __init__(self, problem_params, dtype_u=mesh, dtype_f=ime...
6,341
34.038674
115
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/Dedalus/DynamoGP_2D_Dedalus.py
import numpy as np from dedalus import public as de from pySDC.core.Problem import ptype from pySDC.core.Errors import ParameterError from pySDC.playgrounds.Dedalus.dedalus_field import dedalus_field, rhs_imex_dedalus_field class dynamogp_2d_dedalus(ptype): """ """ def __init__(self, problem_params, dtype...
6,289
34.337079
113
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/Dedalus/periodic_playground_parallel.py
import numpy as np import matplotlib.pyplot as plt from mpi4py import MPI from pySDC.helpers.stats_helper import get_sorted from pySDC.implementations.controller_classes.controller_MPI import controller_MPI from pySDC.implementations.sweeper_classes.imex_1st_order import imex_1st_order from pySDC.playgrounds.Dedalus...
4,047
35.142857
118
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/Dedalus/TransferDedalusFields.py
import numpy as np from pySDC.core.Errors import TransferError from pySDC.core.SpaceTransfer import space_transfer from pySDC.implementations.datatype_classes.mesh import mesh, imex_mesh class dedalus_field_transfer(space_transfer): """ Custon base_transfer class, implements Transfer.py This implementa...
3,367
35.608696
104
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/Dedalus/RayleighBenard_monitor.py
import numpy as np import matplotlib.pyplot as plt from pySDC.core.Hooks import hooks class monitor(hooks): def __init__(self): super(monitor, self).__init__() self.imshow = None def pre_run(self, step, level_number): """ Overwrite standard post step hook Args: ...
1,266
23.365385
58
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/Dedalus/AllenCahn_2D_Dedalus_new.py
import numpy as np from dedalus import public as de from pySDC.core.Problem import ptype from pySDC.core.Errors import ParameterError from pySDC.playgrounds.Dedalus.dedalus_field_new import dedalus_field, rhs_imex_dedalus_field class allencahn2d_dedalus(ptype): """ Example implementing the 2D Allen-Cahn eq...
5,075
35.517986
119
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/Dedalus/DynamoGP_2D_Dedalus_NEW.py
import numpy as np from dedalus import public as de from pySDC.core.Problem import ptype from pySDC.core.Errors import ParameterError from pySDC.implementations.datatype_classes.mesh import mesh, imex_mesh class dynamogp_2d_dedalus(ptype): """ """ def __init__(self, problem_params, dtype_u=mesh, dtype_f=i...
6,194
32.306452
104
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/Dedalus/HeatEquation_1D_Dedalus_forced.py
import numpy as np from dedalus import public as de from pySDC.core.Problem import ptype from pySDC.core.Errors import ParameterError, ProblemError from pySDC.playgrounds.Dedalus.dedalus_field import dedalus_field, rhs_imex_dedalus_field class heat1d_dedalus_forced(ptype): """ Example implementing the forc...
4,418
35.221311
115
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/Dedalus/playground_parallel.py
from mpi4py import MPI import matplotlib matplotlib.use("TkAgg") from dedalus import public as de import numpy as np import matplotlib.pyplot as plt comm = MPI.COMM_WORLD world_rank = comm.Get_rank() world_size = comm.Get_size() # split world communicator to create space-communicators color = int(world_rank / worl...
3,250
23.628788
121
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/Dedalus/Dynamo_monitor.py
import numpy as np from pySDC.core.Hooks import hooks class monitor(hooks): def pre_run(self, step, level_number): """ Overwrite standard post step hook Args: step (pySDC.Step.step): the current step level_number (int): the current level number """ ...
1,481
24.551724
58
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/Dedalus/HeatEquation_2D_Dedalus_forced.py
import numpy as np from dedalus import public as de from pySDC.core.Problem import ptype from pySDC.core.Errors import ParameterError, ProblemError from pySDC.playgrounds.Dedalus.dedalus_field import dedalus_field, rhs_imex_dedalus_field class heat2d_dedalus_forced(ptype): """ Example implementing the forc...
4,280
33.804878
115
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/Dedalus/AllenCahn_2D_Dedalus.py
import numpy as np from dedalus import public as de from pySDC.core.Problem import ptype from pySDC.core.Errors import ParameterError from pySDC.playgrounds.Dedalus.dedalus_field import dedalus_field, rhs_imex_dedalus_field class allencahn2d_dedalus(ptype): """ Example implementing the 2D Allen-Cahn equati...
5,071
35.489209
119
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/Dedalus/rayleighbenard_playground.py
import numpy as np import sys import matplotlib.pyplot as plt from mpi4py import MPI from pySDC.helpers.stats_helper import get_sorted from pySDC.implementations.controller_classes.controller_MPI import controller_MPI from pySDC.implementations.sweeper_classes.imex_1st_order import imex_1st_order from pySDC.playgro...
4,363
34.193548
110
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/Dedalus/Dynamo_2D_Dedalus.py
import numpy as np from dedalus import public as de from pySDC.core.Problem import ptype from pySDC.core.Errors import ParameterError from pySDC.playgrounds.Dedalus.dedalus_field import dedalus_field, rhs_imex_dedalus_field class dynamo_2d_dedalus(ptype): """ """ def __init__(self, problem_params, dtype_u...
6,674
36.290503
115
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/Dedalus/dynamo_playground.py
import numpy as np import sys import matplotlib.pyplot as plt from mpi4py import MPI from pySDC.helpers.stats_helper import get_sorted from pySDC.implementations.controller_classes.controller_MPI import controller_MPI from pySDC.implementations.sweeper_classes.imex_1st_order import imex_1st_order from pySDC.playgrou...
4,463
34.149606
110
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/Dedalus/periodic_playground.py
import numpy as np import matplotlib.pyplot as plt from pySDC.helpers.stats_helper import get_sorted from pySDC.implementations.controller_classes.controller_nonMPI import controller_nonMPI from pySDC.implementations.sweeper_classes.imex_1st_order import imex_1st_order from pySDC.playgrounds.Dedalus.TransferDedalusF...
3,690
35.544554
118
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/Dedalus/periodic_playground_2D.py
import numpy as np import matplotlib.pyplot as plt from pySDC.helpers.stats_helper import get_sorted from pySDC.implementations.controller_classes.controller_nonMPI import controller_nonMPI from pySDC.implementations.sweeper_classes.imex_1st_order import imex_1st_order from pySDC.playgrounds.Dedalus.TransferDedalusF...
3,582
34.83
118
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/Dedalus/AllenCahn_monitor.py
import numpy as np from pySDC.core.Hooks import hooks class monitor(hooks): def __init__(self): """ Initialization of Allen-Cahn monitoring """ super(monitor, self).__init__() self.init_radius = None def pre_run(self, step, level_number): """ Overwrit...
3,812
30.512397
110
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/Dedalus/__init__.py
0
0
0
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/Dedalus/periodic_playground_2D_parallel.py
import sys import numpy as np import matplotlib.pyplot as plt from mpi4py import MPI from pySDC.helpers.stats_helper import get_sorted from pySDC.implementations.controller_classes.controller_MPI import controller_MPI from pySDC.implementations.sweeper_classes.imex_1st_order import imex_1st_order from pySDC.playgro...
4,915
33.377622
120
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/Dedalus/AllenCahn_2D_Dedalus_multiple.py
import numpy as np from dedalus import public as de from pySDC.core.Problem import ptype from pySDC.core.Errors import ParameterError from pySDC.playgrounds.Dedalus.dedalus_field import dedalus_field, rhs_imex_dedalus_field class allencahn2d_dedalus(ptype): """ Example implementing the 2D Allen-Cahn equati...
5,071
35.489209
119
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/Dedalus/dedalus_field.py
import numpy as np from mpi4py import MPI from dedalus import public as de from pySDC.core.Errors import DataError class dedalus_field(object): """ Dedalus data type This data type can be used whenever structured data with a single unknown per point in space is required Attributes: values:...
11,938
32.256267
112
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/Dedalus/AC_playground_2D_parallel.py
import sys import numpy as np import matplotlib.pyplot as plt from mpi4py import MPI from pySDC.helpers.stats_helper import get_sorted from pySDC.implementations.controller_classes.controller_MPI import controller_MPI from pySDC.implementations.sweeper_classes.imex_1st_order import imex_1st_order from pySDC.playgro...
4,345
32.689922
110
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/Dedalus/playground.py
from dedalus import public as de from dedalus import core import numpy as np import matplotlib.pyplot as plt from pySDC.playgrounds.Dedalus.dedalus_field import dedalus_field # class wrapper(core.field.Field): # # # def __init__(self, domain): # # super(wrapper, self).__init__(domain) # # def __add__(...
4,014
21.683616
99
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/Dedalus/RayleighBenard_2D_Dedalus.py
import numpy as np from dedalus import public as de from pySDC.core.Problem import ptype from pySDC.core.Errors import ParameterError from pySDC.playgrounds.Dedalus.dedalus_field import dedalus_field, rhs_imex_dedalus_field class rayleighbenard_2d_dedalus(ptype): """ """ def __init__(self, problem_params,...
7,344
35.725
113
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/Dedalus/dynamogp_playground.py
import numpy as np import sys import matplotlib.pyplot as plt from mpi4py import MPI from pySDC.helpers.stats_helper import get_sorted from pySDC.implementations.controller_classes.controller_MPI import controller_MPI from pySDC.implementations.sweeper_classes.imex_1st_order import imex_1st_order from pySDC.playgrou...
4,474
34.23622
110
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/acoustic_2d_imex/buildFDMatrix.py
import numpy as np import scipy.linalg as la import scipy.sparse as sp # Only for periodic BC because we have advection only in x direction def getUpwindMatrix(N, dx): # stencil = [-1.0, 1.0] # zero_pos = 2 # coeff = 1.0 # stencil = [1.0, -4.0, 3.0] # coeff = 1.0/2.0 # zero_p...
3,057
25.136752
105
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/acoustic_2d_imex/buildWave2DMatrix.py
import numpy as np import scipy.sparse as sp from build2DFDMatrix import get2DMatrix, getBCHorizontal, get2DUpwindMatrix def getWave2DUpwindMatrix(N, dx): Dx = get2DUpwindMatrix(N, dx) Zero = np.zeros((N[0] * N[1], N[0] * N[1])) M1 = sp.hstack((Dx, Zero, Zero), format="csr") M2 = sp.hstack((Zero, Dx...
1,516
29.34
75
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/acoustic_2d_imex/ProblemClass.py
import numpy as np import scipy.sparse.linalg as LA from build2DFDMatrix import get2DMesh from buildWave2DMatrix import getWave2DMatrix, getWave2DUpwindMatrix from unflatten import unflatten from pySDC.core.Problem import ptype from pySDC.implementations.datatype_classes import mesh, rhs_imex_mesh class acoustic_2d_...
4,902
30.229299
165
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/acoustic_2d_imex/HookClass.py
from matplotlib import cm from matplotlib import pyplot as plt from pySDC.core.Hooks import hooks class plot_solution(hooks): def __init__(self): """ Initialization of output """ super(plot_solution, self).__init__() # add figure object for further use # se...
1,663
29.254545
110
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/acoustic_2d_imex/build2DFDMatrix.py
import sys sys.path.append('../') import numpy as np import scipy.sparse as sp from buildFDMatrix import getMatrix, getUpwindMatrix, getBCLeft, getBCRight def get2DUpwindMatrix(N, dx): Dx = getUpwindMatrix(N[0], dx) return sp.kron(Dx, sp.eye(N[1]), format="csr") def get2DMesh(N, x_b, z_b, bc_hor, bc_ver):...
3,520
32.216981
111
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/acoustic_2d_imex/__init__.py
1
0
0
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/acoustic_2d_imex/unflatten.py
import numpy as np def unflatten(uin, dim, Nx, Nz): temp = np.zeros((dim, Nx * Nz)) temp = np.asarray(np.split(uin, dim)) uout = np.zeros((dim, Nx, Nz)) for i in range(0, dim): uout[i, :, :] = np.split(temp[i, :], Nx) return uout
260
22.727273
48
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/acoustic_2d_imex/playground.py
import numpy as np import pySDC.core.deprecated.PFASST_stepwise as mp from ProblemClass import acoustic_2d_imex from matplotlib import pyplot as plt from pySDC.core import CollocationClasses as collclass from pySDC.core import Log from pySDC.implementations.datatype_classes import mesh, rhs_imex_mesh from pySDC.implem...
2,633
29.988235
98
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/advection_2d_explicit/ProblemClass.py
import numpy as np from clawpack import pyclaw from clawpack import riemann from unflatten import unflatten from pySDC.core.Problem import ptype from pySDC.implementations.datatype_classes import mesh, rhs_imex_mesh class advection_2d_explicit(ptype): """ Example implementing the forced 1D heat equation with...
4,971
28.595238
96
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/advection_2d_explicit/HookClass.py
from matplotlib import cm from matplotlib import pyplot as plt from pySDC.core.Hooks import hooks class plot_solution(hooks): def __init__(self): """ Initialization of output """ super(plot_solution, self).__init__() # add figure object for further use # se...
1,713
28.551724
110
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/advection_2d_explicit/__init__.py
1
0
0
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/advection_2d_explicit/unflatten.py
import numpy as np def unflatten(uin, dim, Nx, Nz): temp = np.zeros((dim, Nx * Nz)) temp = np.asarray(np.split(uin, dim)) uout = np.zeros((dim, Nx, Nz)) for i in range(0, dim): uout[i, :, :] = np.split(temp[i, :], Nx) return uout
260
22.727273
48
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/advection_2d_explicit/playground.py
import pySDC.core.Methods as mp from ProblemClass import advection_2d_explicit from matplotlib import pyplot as plt from pySDC.core import CollocationClasses as collclass from pySDC.core import Log from pySDC.implementations.datatype_classes import mesh, rhs_imex_mesh from pySDC.implementations.sweeper_classes.imex_1s...
2,457
30.922078
103
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/pmesh/playground_pmesh_comm.py
from mpi4py import MPI import matplotlib matplotlib.use("TkAgg") import numpy as np import pfft import time import matplotlib.pyplot as plt from numpy.fft import rfft2, irfft2 from pmesh.pm import ParticleMesh, RealField, ComplexField def doublesine(i, v): r = [ii * (Li / ni) for ii, ni, Li in zip(i, v.Nmesh, ...
1,911
24.837838
105
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/pmesh/AllenCahn_monitor_and_dump_NEW.py
import numpy as np import json from mpi4py import MPI from pySDC.core.Hooks import hooks class monitor_and_dump(hooks): def __init__(self): """ Initialization of Allen-Cahn monitoring """ super(monitor_and_dump, self).__init__() self.init_radius = None self.ndim = ...
7,672
33.254464
101
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/pmesh/AC_Temperatur_benchmark.py
import sys import numpy as np from mpi4py import MPI from pySDC.helpers.stats_helper import get_sorted from pySDC.implementations.controller_classes.controller_MPI import controller_MPI from pySDC.implementations.sweeper_classes.imex_1st_order import imex_1st_order from pySDC.playgrounds.pmesh.AllenCahn_Temperature_...
5,148
34.756944
116
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/pmesh/AllenCahn_PMESH_NEW.py
import numpy as np from mpi4py import MPI from pmesh.pm import ParticleMesh from pySDC.core.Errors import ParameterError, ProblemError from pySDC.core.Problem import ptype from pySDC.playgrounds.pmesh.PMESH_datatype_NEW import pmesh_datatype, rhs_imex_pmesh class allencahn_imex(ptype): """ Example implementi...
10,466
34.969072
120
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/pmesh/TransferMesh_PMESH.py
from pySDC.core.Errors import TransferError from pySDC.core.SpaceTransfer import space_transfer from pySDC.playgrounds.pmesh.PMESH_datatype import pmesh_datatype, rhs_imex_pmesh import time class pmesh_to_pmesh(space_transfer): """ Custon base_transfer class, implements Transfer.py This implementation ca...
4,370
39.850467
112
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/pmesh/AllenCahn_monitor_and_dump.py
import numpy as np import json from mpi4py import MPI from pySDC.core.Hooks import hooks class monitor_and_dump(hooks): def __init__(self): """ Initialization of Allen-Cahn monitoring """ super(monitor_and_dump, self).__init__() self.init_radius = None self.ndim = ...
7,516
33.640553
101
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/pmesh/AllenCahn_dump.py
import numpy as np import json from mpi4py import MPI from pySDC.core.Hooks import hooks class dump(hooks): def __init__(self): """ Initialization of Allen-Cahn monitoring """ super(dump, self).__init__() self.init_radius = None self.ndim = None self.comm ...
3,866
31.495798
86
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/pmesh/PMESH_datatype.py
from mpi4py import MPI import numpy as np from pySDC.core.Errors import DataError class pmesh_datatype(object): """ Mesh data type with arbitrary dimensions, will contain PMESH values and communicator Attributes: values (np.ndarray): contains the ndarray of the values comm: MPI communica...
8,399
29.882353
104
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/pmesh/AllenCahn_PMESH.py
import numpy as np from mpi4py import MPI from pmesh.pm import ParticleMesh from pySDC.core.Errors import ParameterError, ProblemError from pySDC.core.Problem import ptype from pySDC.playgrounds.pmesh.PMESH_datatype import pmesh_datatype, rhs_imex_pmesh class allencahn_imex(ptype): """ Example implementing A...
10,337
35.146853
120
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/pmesh/TransferMesh_PMESH_NEW.py
from pySDC.core.Errors import TransferError from pySDC.core.SpaceTransfer import space_transfer from pySDC.playgrounds.pmesh.PMESH_datatype_NEW import pmesh_datatype, rhs_imex_pmesh import time class pmesh_to_pmesh(space_transfer): """ Custon base_transfer class, implements Transfer.py This implementatio...
4,929
41.136752
112
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/pmesh/AC_2D_application.py
import sys import numpy as np from mpi4py import MPI from pySDC.helpers.stats_helper import get_sorted from pySDC.implementations.controller_classes.controller_MPI import controller_MPI from pySDC.implementations.sweeper_classes.imex_1st_order import imex_1st_order from pySDC.playgrounds.pmesh.AllenCahn_PMESH import...
4,568
34.146154
110
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/pmesh/AC_benchmark.py
import sys import numpy as np from mpi4py import MPI from pySDC.helpers.stats_helper import get_sorted from pySDC.implementations.controller_classes.controller_MPI import controller_MPI from pySDC.implementations.sweeper_classes.imex_1st_order import imex_1st_order from pySDC.playgrounds.pmesh.AllenCahn_PMESH import...
5,136
34.923077
116
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/pmesh/PMESH_datatype_NEW.py
from mpi4py import MPI import numpy as np from pySDC.core.Errors import DataError class pmesh_datatype(object): """ Mesh data type with arbitrary dimensions, will contain PMESH values and communicator Attributes: values (np.ndarray): contains the ndarray of the values comm: MPI communica...
8,401
30.00369
104
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/pmesh/AC_2D_application_NEW.py
import sys import numpy as np from mpi4py import MPI from pySDC.helpers.stats_helper import get_sorted from pySDC.implementations.controller_classes.controller_MPI import controller_MPI from pySDC.implementations.sweeper_classes.imex_1st_order import imex_1st_order from pySDC.playgrounds.pmesh.AllenCahn_PMESH_NEW im...
4,578
34.223077
110
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/pmesh/visualize_Temperature.py
import json import glob import numpy as np import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt import imageio def plot_data(name=''): """ Visualization using numpy arrays (written via MPI I/O) and json description Produces one png file per time-step, combine as movie via e.g. ...
3,225
27.052174
82
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/pmesh/__init__.py
0
0
0
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/pmesh/shift_test.py
import numpy as np from scipy.signal import resample ratio = 2 nvars = 2048 cnvars = int(nvars / ratio) xvalues = np.array([i * 1 / nvars - 0.5 for i in range(nvars)]) uexf = 0.5 * (1 + np.tanh((0.25 - abs(xvalues)) / (np.sqrt(2) * 0.04))) xvalues = np.array([i * 1 / cnvars - 0.5 for i in range(cnvars)]) uexc = 0.5 *...
702
26.038462
71
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/pmesh/AllenCahn_Temperatur_monitor_and_dump.py
import numpy as np import json from mpi4py import MPI from pySDC.core.Hooks import hooks class monitor_and_dump(hooks): def __init__(self): """ Initialization of Allen-Cahn monitoring """ super(monitor_and_dump, self).__init__() self.init_radius = None self.ndim = ...
7,536
33.732719
101
py
pySDC
pySDC-master/pySDC/playgrounds/deprecated/pmesh/AllenCahn_dump_NEW.py
import numpy as np import json from mpi4py import MPI from pySDC.core.Hooks import hooks class dump(hooks): def __init__(self): """ Initialization of Allen-Cahn monitoring """ super(dump, self).__init__() self.init_radius = None self.ndim = None self.comm ...
4,104
31.322835
86
py