test_heat_convergence module

Module to gather tests for convergence of decoupled stress system.

This file is executed by pytest to have good CI.

class test_heat_convergence.TestHeatConvergence[source]

Bases: object

Class to bundle all stress convergence tests.

All tests are compared against reference errors.

working_dir = 'tests/2d_heat'
solver_path = 'fenicsR13'
run_solver(inputfile)[source]

Run the solver as subprocess with the given input file.

Test fails if subprocess return Exception or error.

compare_errors(errorsfile, ref_errorsfile)[source]

Check against reference errors. Compares absolute differences.

Absolute Error allowed: 1E-10 Return exception if diff returns with !=0 A comparison for complete equalness can be obtained with:

subprocess.check_call([
    "diff", "-u", "--strip-trailing-cr", errorsfile, ref_errorsfile
], cwd=self.working_dir)
create_meshes()[source]

Create the test meshes. Executed before any test of the class.

Often not needed if meshes are in Git through LFS for reproducability.

test_heat_01_coeffs_p1p1_gls()[source]

Execute decoupled heat system test and check with reference errors.

Parameter

Value

\(Kn\)

\(0.1\)

Elements

\(P_1P_1\)

Stabilization

GLS

test_heat_01_coeffs_p1p1_stab()[source]

Execute decoupled heat system test and check with reference errors.

Parameter

Value

\(Kn\)

\(0.1\)

Elements

\(P_1P_1\)

Stabilization

CIP, \(\delta_\theta=1\)

test_heat_10_coeffs_p2p2_stab()[source]

Execute decoupled heat system test and check with reference errors.

Parameter

Value

\(Kn\)

\(10.0\)

Elements

\(P_2P_2\)

Stabilization

CIP, \(\delta_\theta=1\)

test_heat_01_coeffs_p2p2_stab()[source]

Execute decoupled heat system test and check with reference errors.

Parameter

Value

\(Kn\)

\(0.1\)

Elements

\(P_2P_2\)

Stabilization

CIP, \(\delta_\theta=1\)

test_heat_01_coeffs_p1p2_nostab()[source]

Execute decoupled heat system test and check with reference errors.

Parameter

Value

\(Kn\)

\(0.1\)

Elements

\(P_2P_1\)

Stabilization

CIP, \(\delta_\theta=1\)