-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbasic.py
35 lines (32 loc) · 881 Bytes
/
basic.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
""" Basic example file for advcubit
"""
# import the package
import advcubit
# initialize advcubit
advcubit.init()
# start cubit
advcubit.startCubit()
# create a simple brick
brick = advcubit.brick(1, 1, 1)
# find top surface
topSurface = advcubit.findSurfaceWithNormal(brick.surfaces(), (0, 0, 1), 0)[0]
# apply scheme
advcubit.setMeshScheme(topSurface, advcubit.SurfaceMeshSchemes.tri)
# mesh surface
advcubit.mesh(topSurface)
# set volume mesh scheme
advcubit.setMeshScheme(brick, advcubit.VolumeMeshSchemes.sweep)
# mesh volume
advcubit.mesh(brick)
# create block
advcubit.createBlock(brick, 1)
# name block
advcubit.nameBlock(1, 'mein_block')
# set second order mesh
advcubit.setElementType(1, advcubit.VolumeElementTypes.WEDGE15)
# export to exodus
advcubit.export('basic.e', True)
# close cubit
advcubit.closeCubit()
# clean up cubit's mess
advcubit.deleteJournalFiles()