|
| 1 | +#!/usr/bin/env python3 |
| 2 | +# Copyright (c) 2017-2026, Lawrence Livermore National Security, LLC and other CEED contributors |
| 3 | +# All Rights Reserved. See the top-level LICENSE and NOTICE files for details. |
| 4 | +# |
| 5 | +# SPDX-License-Identifier: BSD-2-Clause |
| 6 | +# |
| 7 | +# This file is part of CEED: http://github.com/ceed |
| 8 | + |
| 9 | +import pytest |
| 10 | +from argparse import Namespace |
| 11 | + |
| 12 | +# The BP examples use PETSc, unlike ex1-ex3, so skip them where it is unavailable |
| 13 | +pytest.importorskip("petsc4py") |
| 14 | +import bpsraw # noqa: E402 |
| 15 | + |
| 16 | +# ------------------------------------------------------------------------------- |
| 17 | + |
| 18 | + |
| 19 | +def test_bp1_degree_1(ceed_resource): |
| 20 | + args = Namespace( |
| 21 | + ceed=ceed_resource, |
| 22 | + problem='bp1', |
| 23 | + degree=1, |
| 24 | + q_extra=None, |
| 25 | + local=1000, |
| 26 | + test=True, |
| 27 | + benchmark=False, |
| 28 | + write_solution=False, |
| 29 | + ksp_max_it_clip=[15, 15], |
| 30 | + ) |
| 31 | + bpsraw.example_bps(args) |
| 32 | + |
| 33 | +# ------------------------------------------------------------------------------- |
| 34 | + |
| 35 | + |
| 36 | +def test_bp1_degree_2(ceed_resource): |
| 37 | + args = Namespace( |
| 38 | + ceed=ceed_resource, |
| 39 | + problem='bp1', |
| 40 | + degree=2, |
| 41 | + q_extra=None, |
| 42 | + local=1000, |
| 43 | + test=True, |
| 44 | + benchmark=False, |
| 45 | + write_solution=False, |
| 46 | + ksp_max_it_clip=[15, 15], |
| 47 | + ) |
| 48 | + bpsraw.example_bps(args) |
| 49 | + |
| 50 | +# ------------------------------------------------------------------------------- |
| 51 | + |
| 52 | + |
| 53 | +def test_bp1_degree_3(ceed_resource): |
| 54 | + args = Namespace( |
| 55 | + ceed=ceed_resource, |
| 56 | + problem='bp1', |
| 57 | + degree=3, |
| 58 | + q_extra=None, |
| 59 | + local=1000, |
| 60 | + test=True, |
| 61 | + benchmark=False, |
| 62 | + write_solution=False, |
| 63 | + ksp_max_it_clip=[15, 15], |
| 64 | + ) |
| 65 | + bpsraw.example_bps(args) |
| 66 | + |
| 67 | +# ------------------------------------------------------------------------------- |
0 commit comments