setup_sphere Function

public function setup_sphere() result(array)

setup the sphere test case from tran and jacques paper.

Arguments

None

Return Value type(sdf), allocatable, (:)


Source Code

    function setup_sphere() result(array)
    !! setup the sphere test case from tran and jacques paper.

        use mat_class,         only : invert
        use opticalProperties, only : mono, opticalProp_t
        use sdfs,              only : sdf, box, sphere
        use sdfHelpers,        only : translate
        use vector_class,      only : vector
        
        type(sdf), allocatable :: array(:)
        type(opticalProp_t) :: opt(3)

        real(kind=wp) :: mus, mua, n, hgg, t(4, 4)
        type(vector)  :: a
        
        allocate(array(3))
        mus = 0._wp; mua = 1.e-17_wp; hgg = 0._wp; n = 1._wp;
        opt(1) = mono(mus, mua, hgg, n)
        array(2) = box(vector(2._wp, 2._wp, 2._wp), opt(1), 2)
        opt(2) = mono(mus, 10000000._wp, hgg, n)
        array(3) = box(vector(2.01_wp, 2.01_wp, 2.01_wp), opt(2), 3)

        mus = 0._wp; mua = 1.e-17_wp; hgg = 0._wp; n = 1.33_wp;
        opt(3) = mono(mus, mua, hgg, n)
        a = vector(.0_wp, 0._wp, 0._wp)
        t = invert(translate(a))
        array(1) = sphere(0.5_wp, opt(3), 1, transform=t)

    end function setup_sphere