Skip to content

Commit

Permalink
add a test for gen_cyl + extrude with multiple boundary conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumechauvat committed Dec 24, 2022
1 parent 6c339e0 commit 7d6a7a9
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,23 @@ def test_gen_circle(test_data_dir):
assert mesh.check_connectivity()
assert mesh.nel == 8100

def test_cylinder(test_data_dir):
import pymech.meshtools as mt
import numpy as np

# test making a cylinder using `gen_circle` and `extrude`
# with a temperature field
mesh = mt.gen_circle(1, 0.5, 9, 2, bc=["W", "I"])
assert mesh.nbc == 2
z = np.linspace(-1, 1, 5)
# with default (periodic) boundary conditions
mesh3D = mt.extrude(mesh, z)
assert mesh3D.nbc == 2
mesh3D.elem[0].bcs[1, 4][0] == "P"
# with custom boundary conditions
mesh3D = mt.extrude(mesh, z, bc1=["W", "t"], bc2=["W", "t"])
assert mesh3D.elem[0].bcs[1, 4][0] == "t"


# ------------------------------------------------------------------------------
# test simson scripts
Expand Down

0 comments on commit 7d6a7a9

Please sign in to comment.