Example #1
0
    if CREATE_TOPOGRAPHY and d==DIM-1:
       fixed_v_mask+=whereZero(x[d])*unitVector(d,DIM)
    else:
       s=whereZero(x[d])+whereZero(x[d]-ll)
       faces+=s
       fixed_v_mask+=s*unitVector(d,DIM)
#
#   set up velovity problem
#
flow=IncompressibleIsotropicFlowCartesian(dom, stress=stress, v=v, p=p, t=t, numMaterials=2, verbose=VERBOSE)
flow.setDruckerPragerLaw(tau_Y=TAU_Y/P_REF+BETA*(1.-Function(dom).getX()[DIM-1]))

flow.setElasticShearModulus(MUE)
flow.setTolerance(FLOW_TOL)
flow.setEtaTolerance(FLOW_TOL)
flow.setExternals(fixed_v_mask=fixed_v_mask)
print("<%s> Flow solver has been set up."%time.asctime())
#
# topography set-up
#
boundary=FunctionOnBoundary(dom).getX()[DIM-1]
top_boundary_mask=whereZero(boundary-sup(boundary))
surface_area=integrate(top_boundary_mask)
if CREATE_TOPOGRAPHY:
    mts=Mountains(dom,eps=TOPO_SMOOTH)
    mts.setTopography(topography)
    print("<%s> topography has been set up."%time.asctime())
#
#  let the show begin:
#
t1 = time.time()
#   set up velovity problem
#
flow = IncompressibleIsotropicFlowCartesian(dom,
                                            stress=stress,
                                            v=v,
                                            p=p,
                                            t=t,
                                            numMaterials=2,
                                            verbose=VERBOSE)
flow.setDruckerPragerLaw(tau_Y=TAU_Y / P_REF + BETA *
                         (1. - Function(dom).getX()[DIM - 1]))

flow.setElasticShearModulus(MUE)
flow.setTolerance(FLOW_TOL)
flow.setEtaTolerance(FLOW_TOL)
flow.setExternals(fixed_v_mask=fixed_v_mask)
print("<%s> Flow solver has been set up." % time.asctime())
#
# topography set-up
#
boundary = FunctionOnBoundary(dom).getX()[DIM - 1]
top_boundary_mask = whereZero(boundary - sup(boundary))
surface_area = integrate(top_boundary_mask)
if CREATE_TOPOGRAPHY:
    mts = Mountains(dom, eps=TOPO_SMOOTH)
    mts.setTopography(topography)
    print("<%s> topography has been set up." % time.asctime())
#
#  let the show begin:
#
t1 = time.time()