[CIG-SEISMO] bug in geocubitlib?

Junwei Huang jwhuang1982 at gmail.com
Fri Mar 25 09:29:57 PDT 2016


Hello,
Not sure if this is a bug, but a scenario not well handled by
boundary_definition.define_bc. I will be very grateful if anyone can help.
I run the following script:
=======================
#!/usr/bin/env python
import cubit
from geocubitlib import boundary_definition as boundary_definition

cubit.cmd('reset')
cubit.cmd('brick x 10 ')
cubit.cmd('brick x 3 y 3 z 10')
cubit.cmd('webcut Body 1 tool Body 2 ')
cubit.cmd('delete Volume 3')
cubit.cmd('merge all')
cubit.cmd('imprint all')
cubit.cmd('volume all size 1')
cubit.cmd('mesh volume all')
boundary_definition.entities=['face']
boundary_definition.define_bc(boundary_definition.entities,parallel=True)
=====================
and noticed that blocks like "face_abs_xmin" will include the internal
surfaces in the absorbing boundary. It could be that functions like
define_4side_lateral_surfaces() doesn't consider the presence of vertical
internal surfaces. Any suggestions of dealing with this? Thank you.

def define_4side_lateral_surfaces():
    list_vol=cubit.parse_cubit_list("volume","all")
    surf_xmin=[]
    surf_ymin=[]
    surf_xmax=[]
    surf_ymax=[]
    for id_vol in list_vol:
        surf_vertical=[]
        xsurf=[]
        ysurf=[]
        tres=0.3
        lsurf=cubit.get_relatives("volume",id_vol,"surface")
        for k in lsurf:
            normal=cubit.get_surface_normal(k)
            center_point = cubit.get_center_point("surface", k)
            if normal[2] >= -1*tres and normal[2] <= tres:
                surf_vertical.append(k)
                xsurf.append(center_point[0])
                ysurf.append(center_point[1])
        surf_xmin.append(surf_vertical[xsurf.index(min(xsurf))])
        surf_ymin.append(surf_vertical[ysurf.index(min(ysurf))])
        surf_xmax.append(surf_vertical[xsurf.index(max(xsurf))])
        surf_ymax.append(surf_vertical[ysurf.index(max(ysurf))])
    return surf_xmin,surf_ymin,surf_xmax,surf_ymax

Best regards,
Junwei
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geodynamics.org/pipermail/cig-seismo/attachments/20160325/02985735/attachment.html>


More information about the CIG-SEISMO mailing list