Exemple #1
0
import advcubit

advcubit.init('/Applications/Cubit-15.1/Cubit.app/Contents/MacOS', False)
import cubit

# start cubit
advcubit.startCubit()

# create a circle
circle = advcubit.createCircle(1)
# create a surface from circle
surface = cubit.create_surface([circle]).surfaces()[0]

# set meshing scheme, use the additional parameters for advanced control
advcubit.setMeshScheme(surface,
                       advcubit.SurfaceMeshSchemes.circle,
                       fraction=0.5,
                       interval=3)
# mesh surface
surface.mesh()
# sweep the surface, include the mesh using a parameter
body = advcubit.sweepVector(circle, (0, 0, -1), 'include_mesh')

# create block and export
advcubit.createBlock(body, 1)
advcubit.export('param.e')

# close cubit and clean
advcubit.closeCubit()
advcubit.deleteJournalFiles()
Exemple #2
0
"""

# import and init advcubit
import advcubit

advcubit.init('/Applications/Cubit-15.1/Cubit.app/Contents/MacOS', False)
import cubit

# start cubit
advcubit.startCubit()

# create a circle
circle = advcubit.createCircle(1)
# create a surface from circle
surface = cubit.create_surface([circle]).surfaces()[0]

# set meshing scheme, use the additional parameters for advanced control
advcubit.setMeshScheme(surface, advcubit.SurfaceMeshSchemes.circle, fraction=0.5, interval=3)
# mesh surface
surface.mesh()
# sweep the surface, include the mesh using a parameter
body = advcubit.sweepVector(circle, (0, 0, -1), 'include_mesh')

# create block and export
advcubit.createBlock(body, 1)
advcubit.export('param.e')

# close cubit and clean
advcubit.closeCubit()
advcubit.deleteJournalFiles()
Exemple #3
0
# 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()
Exemple #4
0
import cubit


# start cubit
advcubit.startCubit()
# create a simple brick
brick = cubit.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()