From dc639c08edbb52599be8b947b44b2a14b7664948 Mon Sep 17 00:00:00 2001 From: Thibaut Lunet Date: Thu, 19 Jan 2023 13:24:46 +0100 Subject: [PATCH 1/2] TL: minor doc correction --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e7fa2ef81f..59b2fd6a97 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ environment. For this, `pySDC` ships with environment files which can be found in the folder `etc/`. Use these as e.g. ``` bash -conda env create --yes -f etc/environment-base.yml +conda env create -f etc/environment-base.yml ``` To check your installation, run From 4b3f45236fd814795057e14166f06d8d5fce3404 Mon Sep 17 00:00:00 2001 From: Thibaut Lunet Date: Fri, 20 Jan 2023 15:53:28 +0100 Subject: [PATCH 2/2] TL: added numQuad tests for lagrange core module --- pySDC/tests/test_lagrange.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 pySDC/tests/test_lagrange.py diff --git a/pySDC/tests/test_lagrange.py b/pySDC/tests/test_lagrange.py new file mode 100644 index 0000000000..58833a2135 --- /dev/null +++ b/pySDC/tests/test_lagrange.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +Created on Fri Jan 20 14:52:18 2023 + +@author: telu +""" +import pytest +import numpy as np + +from pySDC.core.Lagrange import LagrangeApproximation + +# Pre-compute reference integration matrix +nNodes = 5 +approx = LagrangeApproximation(np.linspace(0, 1, nNodes)) +nIntegPoints = 13 +tEndVals = np.linspace(0, 1, nIntegPoints) +integMatRef = approx.getIntegrationMatrix([(0, t) for t in tEndVals]) + + +@pytest.mark.base +@pytest.mark.parametrize("numQuad", ["LEGENDRE_NUMPY", "LEGENDRE_SCIPY"]) +def test_numericalQuadrature(numQuad): + integMat = approx.getIntegrationMatrix([(0, t) for t in tEndVals], numQuad=numQuad) + assert np.allclose(integMat, integMatRef)