diff --git a/interp/tools.py b/interp/tools.py index 44cd32a..45dd032 100644 --- a/interp/tools.py +++ b/interp/tools.py @@ -18,10 +18,19 @@ def rms(errors): def exact_func(X): """ - the exact function used from baker's article (for testing) + the exact function (2D) used from baker's article (for testing) """ x ,y = X - answer = 1.0 + x*x + y*y # np.power((np.sin(x * np.pi) * np.cos(y * np.pi)), 2) + answer = np.power((np.sin(x * np.pi) * np.cos(y * np.pi)), 2) + log.debug(answer) + return answer + +def exact2D(X): + """ + A friendlier 2D func + """ + x ,y = X + answer = 1.0 + x*x + y*y log.debug(answer) return answer @@ -43,6 +52,7 @@ def exact(X): def improved_answer(answer, exact, verbose=False): if not answer['error']: return True + log.debug('qlin: %s' % answer['qlin']) log.debug('error: %s' % answer['error']) log.debug('final: %s' % answer['final'])