Example #1
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)
Example #2
0
#  cube = lg.gridder(x,y,z)

#----
cube = lg.surface_box([0., 0., 0.], [1., 1., 1.],
                      name='cube',
                      ibtype='reflect')
"""
(3) Define interior interfaces
---------------------------------------------------
- Interfaces are defined with the surface command.
- In this case the boundary type is intrface
- divide the unit cube defined above in half vertically
"""

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')