示例#1
0
# Define enclosing volume
box = lg.surface_box([-10., -10., -100.], [10., 10., 0.],
                     name='fullbox',
                     ibtype='reflect')

# NOT SURE IF NEED TO DEFINE INTERIOR INTERFACE(S)
#--- interfaces cannot be coincident w/ reflective boundaries
fractureplane = lg.surface_box([-0.5, -10.1, -100.1], [0.5, 10.1, 0.1],
                               name='fractureplane',
                               ibtype='intrface')

# Divide enclosing volume into regions
#-- Matrix region (surrounding fracture)
m_boolstr = 'le fullbox and gt fractureplane'
m_region = lg.region_bool(m_boolstr, name='matrix')
#-- Fracture region
f_boolstr = 'le fullbox and le fractureplane'
f_region = lg.region_bool(f_boolstr, name='fracture')

# Assign material types to the regions
#--- similar to regions command, but interface should be assigned to a material region
mmat_boolstr = 'le fullbox and gt fractureplane'
fmat_boolstr = 'le fullbox and lt fractureplane'
mmat = lg.region_bool(mmat_boolstr, name='matrixmat')
fmat = lg.region_bool(fmat_boolstr, name='fracmat')

#
#  """
#  Define grid dimensions/discretization
#  """
示例#2
0
# (assumes pylagritc is being used)
#--THIS NEEDS TO BE HERE     (otherwise mo1.inp file doesn't get created)
m.paraview(filename='fracture_region.inp')

# fault coordinates
cs = [[-0.0005, -10., 0.], [-0.0005, 10., 0.], [0.0005, 10., 0.],
      [0.0005, 10., -100.], [0.0005, -10., -100.], [-0.0005, 10., -100.],
      [-0.0005, -10., -100.], [-0.0005, -10., -100.]]
cs = np.array(cs)
# create surfaces of fault
ss = []
zipped = zip(cs[:-1], cs[1:])
for p1, p2 in zipped:
    #  p3 = p1.copy() #doesn't work for non-dictionaries (?)
    p3 = list(p1)
    p3[2] = -100.  #????
    ss.append(lg.surface_plane(p1, p2, p3))

# create region by boolean operations of fault surfaces
boolstr = ''
for i, s in enumerate(ss):
    if not i == 0: boolstr += ' and '
    boolstr += 'le ' + s.name
r = lg.region_bool(boolstr)
# create pset from region
#  p = motet.pset_region(r)
p = m.pset_region(r)
# Change imt value for pset
p.setatt('imt', 21)  #makes this zone 21
m.dump_zone_imt('tet_nefault', 21)
示例#3
0
cutplane = lg.surface_plane([0., 0., 0.5], [1., 0., 0.5], [1., 1., 0.5],
                            name='cutplane',
                            ibtype='intrface')
"""
(4) Divide the enclosing volume into regions
---------------------------------------------------
-  define the two regions created by the plane bisecting the unit cube
- The region command is used to divide the enclosing volume into regions.
- The directional operators lt, le, gt, ** ** and ge are applied to previously defined surfaces according to the rules.
"""

# 'top' region: includes top half of cube and non of the interface (cutplane)
#--- LaGriT command: 'region/top le cube and gt cutplane'
# PyLaGriT: create region by boolean operations
top_boolstr = 'le cube and gt cutplane'
top = lg.region_bool(top_boolstr, name='top')
#  top = m.region_bool(top_boolstr, name='top')

# 'bottom' region: includes bottom half of cube and cutplane
#--- LaGriT command: 'region/bottom le cube and lt cutplane'
# PyLaGriT: create region by boolean operations
bot_boolstr = 'le cube and le cutplane'
bot = lg.region_bool(bot_boolstr, name='bottom')
#  bot = m.region_bool(bot_boolstr, name='bottom')
"""
(5) Assign material types to the regions
---------------------------------------------------
- Assign materials to regions using the mregion command
- Assign two materials, mattop and matbot, to the regions top and bottom
"""
#--- LaGriT commands: