Skip to content

Commit d826086

Browse files
committed
Added plot
1 parent 28d6715 commit d826086

File tree

2 files changed

+32
-7
lines changed

2 files changed

+32
-7
lines changed

pySDC/implementations/convergence_controller_classes/step_size_limiter.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,7 @@ def _round_step_size(dt, fac, digits):
192192

193193
def get_new_step_size(self, controller, S, **kwargs):
194194
"""
195-
Enforce an upper and lower limit to the step size here.
196-
Be aware that this is only tested when a new step size has been determined. That means if you set an initial
197-
value for the step size outside of the limits, and you don't do any further step size control, that value will
198-
go through.
199-
Also, the final step is adjusted such that we reach Tend as best as possible, which might give step sizes below
200-
the lower limit set here.
195+
Round step size here
201196
202197
Args:
203198
controller (pySDC.Controller): The controller

pySDC/projects/GPU/analysis_scripts/plot_RBC_matrix.py

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,36 @@ def plot_ultraspherical():
6161
plt.show()
6262

6363

64+
def plot_DCT():
65+
fig, axs = plt.subplots(1, 3, figsize=figsize_by_journal('TUHH_thesis', 1, 0.28), sharey=True)
66+
67+
N = 8
68+
color = 'black'
69+
70+
x = np.linspace(0, 3, N)
71+
y = x**3 - 4 * x**2
72+
axs[0].plot(y, marker='o', color=color)
73+
74+
y_m = np.append(y, y[::-1])
75+
axs[1].scatter(np.arange(2 * N)[::2], y_m[::2], marker='<', color=color)
76+
axs[1].scatter(np.arange(2 * N)[1::2], y_m[1::2], marker='>', color=color)
77+
axs[1].plot(np.arange(2 * N), y_m, color=color)
78+
79+
v = y_m[::2]
80+
axs[2].plot(np.arange(N), v, color=color, marker='x')
81+
82+
axs[0].set_title('original')
83+
axs[1].set_title('mirrored')
84+
axs[2].set_title('periodically reordered')
85+
86+
for ax in axs:
87+
# ax.set_xlabel(r'$n$')
88+
ax.set_yticks([])
89+
fig.savefig('plots/DCT_via_FFT.pdf', bbox_inches='tight', dpi=300)
90+
91+
6492
if __name__ == '__main__':
6593
setup_mpl()
66-
plot_ultraspherical()
94+
plot_DCT()
95+
# plot_ultraspherical()
96+
plt.show()

0 commit comments

Comments
 (0)