Skip to content
Snippets Groups Projects
Unverified Commit 433f0263 authored by Thomas Baumann's avatar Thomas Baumann Committed by GitHub
Browse files

Added warnings when trying to compute local error with analytic exact (#339)


solution

Co-authored-by: default avatarThomas Baumann <t.baumann@fz-juelich.de>
parent 3ffc810c
No related branches found
No related tags found
No related merge requests found
......@@ -97,6 +97,11 @@ class advectionNd(GenericNDimFinDiff):
sol : dtype_u
The exact solution.
"""
if 'u_init' in kwargs.keys() or 't_init' in kwargs.keys():
self.logger.warn(
f'{type(self).__name__} uses an analytic exact solution from t=0. If you try to compute the local error, you will get the global error instead!'
)
# Initialize pointers and variables
ndim, freq, c, sigma, sol = self.ndim, self.freq, self.c, self.sigma, self.u_init
......
......@@ -38,6 +38,11 @@ class heatNd_unforced(GenericNDimFinDiff):
sol : dtype_u
The exact solution.
"""
if 'u_init' in kwargs.keys() or 't_init' in kwargs.keys():
self.logger.warn(
f'{type(self).__name__} uses an analytic exact solution from t=0. If you try to compute the local error, you will get the global error instead!'
)
ndim, freq, nu, sigma, dx, sol = self.ndim, self.freq, self.nu, self.sigma, self.dx, self.u_init
if ndim == 1:
......
......@@ -161,6 +161,10 @@ class nonlinearschroedinger_imex(ptype):
u : dtype_u
The exact solution.
"""
if 'u_init' in kwargs.keys() or 't_init' in kwargs.keys():
self.logger.warn(
f'{type(self).__name__} uses an analytic exact solution from t=0. If you try to compute the local error, you will get the global error instead!'
)
def nls_exact_1D(t, x, c):
ae = 1.0 / np.sqrt(2.0) * np.exp(1j * t)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment