Example #1
0
        'chi': chi,
        'D': D
    }
}
media = [['HM', L]]  # i.e. homogeneously filled

# set b.c.
LBC, RBC = 0, 0

# Initiate inpur data object
Homog2GSlab_data = input_data(xs_media, media, xi, geometry_type, LBC, RBC)
# Initiate solver options object
slvr_opts = solver_options()

# Initiate quadratures object
N = 16
qdata = quad_data(N, L=0)

if __name__ == "__main__":

    import logging as lg
    lg.info("*** Solve the MC 2011 problem ***")
    from snmg1dslab import solve_sn

    flxm, k = solve_sn(Homog2GSlab_data, slvr_opts, qdata)
    basefilen = "../output/kflx_MC2011_LBC%dRBC%d_I%d_L%d_N%d" % (
        Homog2GSlab_data.LBC, Homog2GSlab_data.RBC, Homog2GSlab_data.I,
        Homog2GSlab_data.xi[-1], qdata.N)
    np.save(basefilen + ".npy", np.array([k, flxm]), allow_pickle=True)
    #np.savez(basefilen + ".npz", k=k, flxm=flxm)
sys.path.append('..')  # do not use this at the beginning!
from snmg1dslab import input_data, solver_options, quad_data
import numpy as np

# set b.c.
# LBC, RBC = 0, 0

# or initiate input data object here...
# Heter2GSlab_data = input_data(xs_media, media, xi, geometry_type, LBC, RBC)

# Initiate solver options object
slvr_opts = solver_options()

# Initiate quadratures object
N, L = 16, 0
qdata = quad_data(N, L)

if __name__ == "__main__":

    import logging as lg
    lg.info("*** Solve Sood 2003 problem 30 ***")
    from snmg1dslab import solve_sn

    flxm, k = solve_sn(Heter1GSlab_data, slvr_opts, qdata)

    basefilen = "../output/Sood2003_kflx_SN_LBC%dRBC%d_I%d_N%d_P30" % (
        Heter1GSlab_data.LBC, Heter1GSlab_data.RBC, Heter1GSlab_data.I,
        qdata.N)
    np.save(basefilen + ".npy", np.array([k, flxm]), allow_pickle=True)
    #np.savez(basefilen + ".npz", k=k, flxm=flxm)