xref: /libCEED/examples/python/ex_test.py (revision 7b3ff0698626cc2e5ce463afc10290072fd55c90)
1*7b3ff069SJeremy L Thompson#!/usr/bin/env python3
2*7b3ff069SJeremy L Thompson# Copyright (c) 2017-2025, Lawrence Livermore National Security, LLC and other CEED contributors
3*7b3ff069SJeremy L Thompson# All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
4*7b3ff069SJeremy L Thompson#
5*7b3ff069SJeremy L Thompson# SPDX-License-Identifier: BSD-2-Clause
6*7b3ff069SJeremy L Thompson#
7*7b3ff069SJeremy L Thompson# This file is part of CEED:  http://github.com/ceed
8*7b3ff069SJeremy L Thompson
9*7b3ff069SJeremy L Thompsonimport pytest
10*7b3ff069SJeremy L Thompsonfrom argparse import Namespace
11*7b3ff069SJeremy L Thompsonimport ex1_volume
12*7b3ff069SJeremy L Thompsonimport ex2_surface
13*7b3ff069SJeremy L Thompsonimport ex3_volume
14*7b3ff069SJeremy L Thompson
15*7b3ff069SJeremy L Thompson# -------------------------------------------------------------------------------
16*7b3ff069SJeremy L Thompson
17*7b3ff069SJeremy L Thompson
18*7b3ff069SJeremy L Thompsondef test_101(ceed_resource):
19*7b3ff069SJeremy L Thompson    args = Namespace(
20*7b3ff069SJeremy L Thompson        ceed=ceed_resource,
21*7b3ff069SJeremy L Thompson        dim=1,
22*7b3ff069SJeremy L Thompson        mesh_degree=4,
23*7b3ff069SJeremy L Thompson        solution_degree=4,
24*7b3ff069SJeremy L Thompson        quadrature_points=6,
25*7b3ff069SJeremy L Thompson        problem_size=-1,
26*7b3ff069SJeremy L Thompson        test=True,
27*7b3ff069SJeremy L Thompson        quiet=True,
28*7b3ff069SJeremy L Thompson        gallery=False,
29*7b3ff069SJeremy L Thompson    )
30*7b3ff069SJeremy L Thompson    ex1_volume.example_1(args)
31*7b3ff069SJeremy L Thompson
32*7b3ff069SJeremy L Thompson# -------------------------------------------------------------------------------
33*7b3ff069SJeremy L Thompson
34*7b3ff069SJeremy L Thompson
35*7b3ff069SJeremy L Thompsondef test_101g(ceed_resource):
36*7b3ff069SJeremy L Thompson    args = Namespace(
37*7b3ff069SJeremy L Thompson        ceed=ceed_resource,
38*7b3ff069SJeremy L Thompson        dim=1,
39*7b3ff069SJeremy L Thompson        mesh_degree=4,
40*7b3ff069SJeremy L Thompson        solution_degree=4,
41*7b3ff069SJeremy L Thompson        quadrature_points=6,
42*7b3ff069SJeremy L Thompson        problem_size=-1,
43*7b3ff069SJeremy L Thompson        test=True,
44*7b3ff069SJeremy L Thompson        quiet=True,
45*7b3ff069SJeremy L Thompson        gallery=True,
46*7b3ff069SJeremy L Thompson    )
47*7b3ff069SJeremy L Thompson    ex1_volume.example_1(args)
48*7b3ff069SJeremy L Thompson
49*7b3ff069SJeremy L Thompson# -------------------------------------------------------------------------------
50*7b3ff069SJeremy L Thompson
51*7b3ff069SJeremy L Thompson
52*7b3ff069SJeremy L Thompsondef test_102(ceed_resource):
53*7b3ff069SJeremy L Thompson    args = Namespace(
54*7b3ff069SJeremy L Thompson        ceed=ceed_resource,
55*7b3ff069SJeremy L Thompson        dim=2,
56*7b3ff069SJeremy L Thompson        mesh_degree=4,
57*7b3ff069SJeremy L Thompson        solution_degree=4,
58*7b3ff069SJeremy L Thompson        quadrature_points=6,
59*7b3ff069SJeremy L Thompson        problem_size=-1,
60*7b3ff069SJeremy L Thompson        test=True,
61*7b3ff069SJeremy L Thompson        quiet=True,
62*7b3ff069SJeremy L Thompson        gallery=False,
63*7b3ff069SJeremy L Thompson    )
64*7b3ff069SJeremy L Thompson    ex1_volume.example_1(args)
65*7b3ff069SJeremy L Thompson
66*7b3ff069SJeremy L Thompson# -------------------------------------------------------------------------------
67*7b3ff069SJeremy L Thompson
68*7b3ff069SJeremy L Thompson
69*7b3ff069SJeremy L Thompsondef test_102g(ceed_resource):
70*7b3ff069SJeremy L Thompson    args = Namespace(
71*7b3ff069SJeremy L Thompson        ceed=ceed_resource,
72*7b3ff069SJeremy L Thompson        dim=2,
73*7b3ff069SJeremy L Thompson        mesh_degree=4,
74*7b3ff069SJeremy L Thompson        solution_degree=4,
75*7b3ff069SJeremy L Thompson        quadrature_points=6,
76*7b3ff069SJeremy L Thompson        problem_size=-1,
77*7b3ff069SJeremy L Thompson        test=True,
78*7b3ff069SJeremy L Thompson        quiet=True,
79*7b3ff069SJeremy L Thompson        gallery=True,
80*7b3ff069SJeremy L Thompson    )
81*7b3ff069SJeremy L Thompson    ex1_volume.example_1(args)
82*7b3ff069SJeremy L Thompson
83*7b3ff069SJeremy L Thompson# -------------------------------------------------------------------------------
84*7b3ff069SJeremy L Thompson
85*7b3ff069SJeremy L Thompson
86*7b3ff069SJeremy L Thompsondef test_103(ceed_resource):
87*7b3ff069SJeremy L Thompson    args = Namespace(
88*7b3ff069SJeremy L Thompson        ceed=ceed_resource,
89*7b3ff069SJeremy L Thompson        dim=3,
90*7b3ff069SJeremy L Thompson        mesh_degree=4,
91*7b3ff069SJeremy L Thompson        solution_degree=4,
92*7b3ff069SJeremy L Thompson        quadrature_points=6,
93*7b3ff069SJeremy L Thompson        problem_size=-1,
94*7b3ff069SJeremy L Thompson        test=True,
95*7b3ff069SJeremy L Thompson        quiet=True,
96*7b3ff069SJeremy L Thompson        gallery=False,
97*7b3ff069SJeremy L Thompson    )
98*7b3ff069SJeremy L Thompson    ex1_volume.example_1(args)
99*7b3ff069SJeremy L Thompson
100*7b3ff069SJeremy L Thompson# -------------------------------------------------------------------------------
101*7b3ff069SJeremy L Thompson
102*7b3ff069SJeremy L Thompson
103*7b3ff069SJeremy L Thompsondef test_103g(ceed_resource):
104*7b3ff069SJeremy L Thompson    args = Namespace(
105*7b3ff069SJeremy L Thompson        ceed=ceed_resource,
106*7b3ff069SJeremy L Thompson        dim=3,
107*7b3ff069SJeremy L Thompson        mesh_degree=4,
108*7b3ff069SJeremy L Thompson        solution_degree=4,
109*7b3ff069SJeremy L Thompson        quadrature_points=6,
110*7b3ff069SJeremy L Thompson        problem_size=-1,
111*7b3ff069SJeremy L Thompson        test=True,
112*7b3ff069SJeremy L Thompson        quiet=True,
113*7b3ff069SJeremy L Thompson        gallery=True,
114*7b3ff069SJeremy L Thompson    )
115*7b3ff069SJeremy L Thompson    ex1_volume.example_1(args)
116*7b3ff069SJeremy L Thompson
117*7b3ff069SJeremy L Thompson
118*7b3ff069SJeremy L Thompson# -------------------------------------------------------------------------------
119*7b3ff069SJeremy L Thompsondef test_201(ceed_resource):
120*7b3ff069SJeremy L Thompson    args = Namespace(
121*7b3ff069SJeremy L Thompson        ceed=ceed_resource,
122*7b3ff069SJeremy L Thompson        dim=1,
123*7b3ff069SJeremy L Thompson        mesh_degree=4,
124*7b3ff069SJeremy L Thompson        solution_degree=4,
125*7b3ff069SJeremy L Thompson        quadrature_points=6,
126*7b3ff069SJeremy L Thompson        problem_size=-1,
127*7b3ff069SJeremy L Thompson        test=True,
128*7b3ff069SJeremy L Thompson        quiet=True,
129*7b3ff069SJeremy L Thompson        gallery=False,
130*7b3ff069SJeremy L Thompson    )
131*7b3ff069SJeremy L Thompson    ex2_surface.example_2(args)
132*7b3ff069SJeremy L Thompson
133*7b3ff069SJeremy L Thompson# -------------------------------------------------------------------------------
134*7b3ff069SJeremy L Thompson
135*7b3ff069SJeremy L Thompson
136*7b3ff069SJeremy L Thompsondef test_201g(ceed_resource):
137*7b3ff069SJeremy L Thompson    args = Namespace(
138*7b3ff069SJeremy L Thompson        ceed=ceed_resource,
139*7b3ff069SJeremy L Thompson        dim=1,
140*7b3ff069SJeremy L Thompson        mesh_degree=4,
141*7b3ff069SJeremy L Thompson        solution_degree=4,
142*7b3ff069SJeremy L Thompson        quadrature_points=6,
143*7b3ff069SJeremy L Thompson        problem_size=-1,
144*7b3ff069SJeremy L Thompson        test=True,
145*7b3ff069SJeremy L Thompson        quiet=True,
146*7b3ff069SJeremy L Thompson        gallery=True,
147*7b3ff069SJeremy L Thompson    )
148*7b3ff069SJeremy L Thompson    ex2_surface.example_2(args)
149*7b3ff069SJeremy L Thompson
150*7b3ff069SJeremy L Thompson# -------------------------------------------------------------------------------
151*7b3ff069SJeremy L Thompson
152*7b3ff069SJeremy L Thompson
153*7b3ff069SJeremy L Thompsondef test_202(ceed_resource):
154*7b3ff069SJeremy L Thompson    args = Namespace(
155*7b3ff069SJeremy L Thompson        ceed=ceed_resource,
156*7b3ff069SJeremy L Thompson        dim=2,
157*7b3ff069SJeremy L Thompson        mesh_degree=4,
158*7b3ff069SJeremy L Thompson        solution_degree=4,
159*7b3ff069SJeremy L Thompson        quadrature_points=6,
160*7b3ff069SJeremy L Thompson        problem_size=-1,
161*7b3ff069SJeremy L Thompson        test=True,
162*7b3ff069SJeremy L Thompson        quiet=True,
163*7b3ff069SJeremy L Thompson        gallery=False,
164*7b3ff069SJeremy L Thompson    )
165*7b3ff069SJeremy L Thompson    ex2_surface.example_2(args)
166*7b3ff069SJeremy L Thompson
167*7b3ff069SJeremy L Thompson# -------------------------------------------------------------------------------
168*7b3ff069SJeremy L Thompson
169*7b3ff069SJeremy L Thompson
170*7b3ff069SJeremy L Thompsondef test_202g(ceed_resource):
171*7b3ff069SJeremy L Thompson    args = Namespace(
172*7b3ff069SJeremy L Thompson        ceed=ceed_resource,
173*7b3ff069SJeremy L Thompson        dim=2,
174*7b3ff069SJeremy L Thompson        mesh_degree=4,
175*7b3ff069SJeremy L Thompson        solution_degree=4,
176*7b3ff069SJeremy L Thompson        quadrature_points=6,
177*7b3ff069SJeremy L Thompson        problem_size=-1,
178*7b3ff069SJeremy L Thompson        test=True,
179*7b3ff069SJeremy L Thompson        quiet=True,
180*7b3ff069SJeremy L Thompson        gallery=True,
181*7b3ff069SJeremy L Thompson    )
182*7b3ff069SJeremy L Thompson    ex2_surface.example_2(args)
183*7b3ff069SJeremy L Thompson
184*7b3ff069SJeremy L Thompson# -------------------------------------------------------------------------------
185*7b3ff069SJeremy L Thompson
186*7b3ff069SJeremy L Thompson
187*7b3ff069SJeremy L Thompsondef test_203(ceed_resource):
188*7b3ff069SJeremy L Thompson    args = Namespace(
189*7b3ff069SJeremy L Thompson        ceed=ceed_resource,
190*7b3ff069SJeremy L Thompson        dim=3,
191*7b3ff069SJeremy L Thompson        mesh_degree=4,
192*7b3ff069SJeremy L Thompson        solution_degree=4,
193*7b3ff069SJeremy L Thompson        quadrature_points=6,
194*7b3ff069SJeremy L Thompson        problem_size=-1,
195*7b3ff069SJeremy L Thompson        test=True,
196*7b3ff069SJeremy L Thompson        quiet=True,
197*7b3ff069SJeremy L Thompson        gallery=False,
198*7b3ff069SJeremy L Thompson    )
199*7b3ff069SJeremy L Thompson    ex2_surface.example_2(args)
200*7b3ff069SJeremy L Thompson
201*7b3ff069SJeremy L Thompson# -------------------------------------------------------------------------------
202*7b3ff069SJeremy L Thompson
203*7b3ff069SJeremy L Thompson
204*7b3ff069SJeremy L Thompsondef test_203g(ceed_resource):
205*7b3ff069SJeremy L Thompson    args = Namespace(
206*7b3ff069SJeremy L Thompson        ceed=ceed_resource,
207*7b3ff069SJeremy L Thompson        dim=3,
208*7b3ff069SJeremy L Thompson        mesh_degree=4,
209*7b3ff069SJeremy L Thompson        solution_degree=4,
210*7b3ff069SJeremy L Thompson        quadrature_points=6,
211*7b3ff069SJeremy L Thompson        problem_size=-1,
212*7b3ff069SJeremy L Thompson        test=True,
213*7b3ff069SJeremy L Thompson        quiet=True,
214*7b3ff069SJeremy L Thompson        gallery=True,
215*7b3ff069SJeremy L Thompson    )
216*7b3ff069SJeremy L Thompson    ex2_surface.example_2(args)
217*7b3ff069SJeremy L Thompson
218*7b3ff069SJeremy L Thompson# -------------------------------------------------------------------------------
219*7b3ff069SJeremy L Thompson
220*7b3ff069SJeremy L Thompson
221*7b3ff069SJeremy L Thompsondef test_301(ceed_resource):
222*7b3ff069SJeremy L Thompson    args = Namespace(
223*7b3ff069SJeremy L Thompson        ceed=ceed_resource,
224*7b3ff069SJeremy L Thompson        dim=1,
225*7b3ff069SJeremy L Thompson        mesh_degree=4,
226*7b3ff069SJeremy L Thompson        solution_degree=4,
227*7b3ff069SJeremy L Thompson        quadrature_points=6,
228*7b3ff069SJeremy L Thompson        problem_size=-1,
229*7b3ff069SJeremy L Thompson        test=True,
230*7b3ff069SJeremy L Thompson        quiet=True,
231*7b3ff069SJeremy L Thompson        gallery=False,
232*7b3ff069SJeremy L Thompson    )
233*7b3ff069SJeremy L Thompson    ex3_volume.example_3(args)
234*7b3ff069SJeremy L Thompson
235*7b3ff069SJeremy L Thompson# -------------------------------------------------------------------------------
236*7b3ff069SJeremy L Thompson
237*7b3ff069SJeremy L Thompson
238*7b3ff069SJeremy L Thompsondef test_302(ceed_resource):
239*7b3ff069SJeremy L Thompson    args = Namespace(
240*7b3ff069SJeremy L Thompson        ceed=ceed_resource,
241*7b3ff069SJeremy L Thompson        dim=2,
242*7b3ff069SJeremy L Thompson        mesh_degree=4,
243*7b3ff069SJeremy L Thompson        solution_degree=4,
244*7b3ff069SJeremy L Thompson        quadrature_points=6,
245*7b3ff069SJeremy L Thompson        problem_size=-1,
246*7b3ff069SJeremy L Thompson        test=True,
247*7b3ff069SJeremy L Thompson        quiet=True,
248*7b3ff069SJeremy L Thompson        gallery=False,
249*7b3ff069SJeremy L Thompson    )
250*7b3ff069SJeremy L Thompson    ex3_volume.example_3(args)
251*7b3ff069SJeremy L Thompson
252*7b3ff069SJeremy L Thompson# -------------------------------------------------------------------------------
253*7b3ff069SJeremy L Thompson
254*7b3ff069SJeremy L Thompson
255*7b3ff069SJeremy L Thompsondef test_303(ceed_resource):
256*7b3ff069SJeremy L Thompson    args = Namespace(
257*7b3ff069SJeremy L Thompson        ceed=ceed_resource,
258*7b3ff069SJeremy L Thompson        dim=3,
259*7b3ff069SJeremy L Thompson        mesh_degree=4,
260*7b3ff069SJeremy L Thompson        solution_degree=4,
261*7b3ff069SJeremy L Thompson        quadrature_points=6,
262*7b3ff069SJeremy L Thompson        problem_size=-1,
263*7b3ff069SJeremy L Thompson        test=True,
264*7b3ff069SJeremy L Thompson        quiet=True,
265*7b3ff069SJeremy L Thompson        gallery=False,
266*7b3ff069SJeremy L Thompson    )
267*7b3ff069SJeremy L Thompson    ex3_volume.example_3(args)
268*7b3ff069SJeremy L Thompson
269*7b3ff069SJeremy L Thompson# -------------------------------------------------------------------------------
270