Пример #1
0
def run_kv3d():
    O = ConstructorPlaceholder

    timestamp = get_timestamp()

    for chi in [None, 2]:
        for rec in [
                O("DepShape"),
                O(
                    "DepGrid",
                    O("FineCoreBrickGenerator", core_axis=2),
                    #el_tolerance=0.1,
                    submethod="simplex_reduce")
        ]:
            job = BatchJob(
                "kv3d-$DATE/%s-chi%s" % (cn(rec), chi),
                "-m pyrticle.driver",
                aux_files=["kv3d.cpy"],
                timestamp=timestamp,
            )
            job.write_setup([
                "execfile('kv3d.cpy')",
                "depositor = %s" % rec,
                "chi = %s" % chi,
            ])
            job.submit()
Пример #2
0
def study_blob_exponent():
    """Submit jobs to study the effect of the exponent in the shape blob."""

    O = ConstructorPlaceholder

    timestamp = get_timestamp()

    for exponent in [1, 2, 3, 4, 5, 6]:
        #for rec in [O("DepAdv"), O("DepNormShape"), O("DepNormShape")]:
        #for rec in [O("DepShape"), ]:
        for eorder in [2, 3, 4, 5]:
            for rec in [
                    O("DepShape"),
            ]:
                for push in [O("PushMonomial"), O("PushAverage")]:
                    job = BatchJob(
                        "expstudy-$DATE/exp%d-eo%d-%s-%s" %
                        (exponent, eorder, cn(rec), cn(push)),
                        "with-charge.py",
                        timestamp=timestamp,
                    )
                    job.write_setup([
                        "pusher = %s" % push,
                        "depositor = %s" % rec,
                        "shape_exponent = %s" % exponent,
                        "element_order = %s" % eorder,
                    ])
                    job.submit()
Пример #3
0
def study_blob_exponent():
    """Submit jobs to study the effect of the exponent in the shape blob."""

    O = ConstructorPlaceholder

    timestamp = get_timestamp()

    for exponent in [1,2,3,4,5,6]:
        #for rec in [O("DepAdv"), O("DepNormShape"), O("DepNormShape")]:
        #for rec in [O("DepShape"), ]:
        for eorder in [2,3,4,5]:
            for rec in [O("DepShape"), ]:
                for push in [O("PushMonomial"), O("PushAverage")]:
                    job = BatchJob(
                            "expstudy-$DATE/exp%d-eo%d-%s-%s" % (exponent, eorder, cn(rec), cn(push)),
                            "with-charge.py",
                            timestamp=timestamp,
                            )
                    job.write_setup([
                        "pusher = %s" % push,
                        "depositor = %s" % rec,
                        "shape_exponent = %s" % exponent,
                        "element_order = %s" % eorder,
                        ])
                    job.submit()
Пример #4
0
def study_advec_filter():
    """Submit jobs to see whether filtering really improves advection."""

    O = ConstructorPlaceholder

    def get_filter_orders(amp):
        if filter_amp is None:
            return [None]
        else:
            return [3, 6, 7, 9]

    timestamp = get_timestamp()

    for filter_amp in [None, 0.97, 0.93, 0.88, 0.8, 0.7, 0.5]:
        for filter_order in get_filter_orders(filter_amp):
            job = BatchJob(
                "filtstudy-$DATE/amp%s-ord%s" % (filter_amp, filter_order),
                "with-charge.py",
                timestamp=timestamp,
            )
            job.write_setup([
                "pusher = %s" % O("PushAverage"),
                "depositor = %s" %
                O("DepAdv", filter_order=filter_order, filter_amp=filter_amp),
            ])
            job.submit()
Пример #5
0
def compare_element_finders():
    """Submit jobs to compare element finders."""

    O = ConstructorPlaceholder

    timestamp = get_timestamp()

    depositor = O("DepShape")
    pusher = O("PushMonomial")
    for xpos in [0, 0.5, 1]:
        for finder in [O("FindFaceBased"), O("FindHeuristic")]:
            job = BatchJob(
                "compelfind-$DATE/%s-%s" % (xpos, cn(classname)),
                "rec-by-area.py",
                ["special_meshes.py"],
                timestamp=timestamp,
            )
            job.write_setup([
                "pusher = %s" % pusher,
                "depositor = %s" % depositor,
                "finder = %s" % finder,
                "mean_x = num.array([%g*tube_length,0])" % xpos,
                "nparticles = 1000",
                "mesh = 'glued'",
            ])
            job.submit()
Пример #6
0
def study_advec_filter():
    """Submit jobs to see whether filtering really improves advection."""

    O = ConstructorPlaceholder

    def get_filter_orders(amp):
        if filter_amp is None:
            return [None]
        else:
            return [3, 6, 7, 9]

    timestamp = get_timestamp()

    for filter_amp in [None, 0.97, 0.93, 0.88, 0.8, 0.7, 0.5]:
        for filter_order in get_filter_orders(filter_amp):
            job = BatchJob(
                    "filtstudy-$DATE/amp%s-ord%s" % (filter_amp, filter_order),
                    "with-charge.py",
                    timestamp=timestamp,
                    )
            job.write_setup([
                "pusher = %s" % O("PushAverage"),
                "depositor = %s" % O("DepAdv",
                    filter_order=filter_order,
                    filter_amp=filter_amp),
                ])
            job.submit()
Пример #7
0
def compare_element_finders():
    """Submit jobs to compare element finders."""

    O = ConstructorPlaceholder

    timestamp = get_timestamp()

    depositor = O("DepShape")
    pusher = O("PushMonomial")
    for xpos in [0, 0.5, 1]:
        for finder in [O("FindFaceBased"), O("FindHeuristic")]:
            job = BatchJob(
                    "compelfind-$DATE/%s-%s" % (xpos, cn(classname)),
                    "rec-by-area.py",
                    ["special_meshes.py"],
                    timestamp=timestamp,
                    )
            job.write_setup([
                "pusher = %s" % pusher,
                "depositor = %s" % depositor,
                "finder = %s" % finder,
                "mean_x = num.array([%g*tube_length,0])" % xpos,
                "nparticles = 1000",
                "mesh = 'glued'",
                ])
            job.submit()
Пример #8
0
def study_rec_grid(output_path=None):
    """Submit jobs to study the behavior of grid deposition."""

    O = ConstructorPlaceholder

    timestamp = get_timestamp()

    pusher = O("PushMonomial")
    eorder = 3

    nparticles = 30000

    for method in ["simplex_enlarge", "simplex_extra", "simplex_reduce"]:
        #for el_tolerance in [0, 0.1, 0.15, 0.2]:
        for el_tolerance in [0.1, 0.15]:
            #for enf_cont in [True, False]:
            for enf_cont in [False]:
                #for overres in [0.8, 1.0, 1.2, 1.3, 1.4, 1.6, 2]:
                for overres in [1.2, 1.4, 1.6, 2]:
                    for mesh_margin in [0]:
                        #for mesh_margin in [0, 0.05, 0.1, 0.2]:
                        job = BatchJob(
                            "recgrid-$DATE/%s-tol%g-cont%s-or%g-mm%g" %
                            (method, el_tolerance, enf_cont, overres,
                             mesh_margin),
                            "-m pyrticle.driver",
                            timestamp=timestamp,
                        )
                        brick_gen = O("SingleBrickGenerator",
                                      overresolve=overres,
                                      mesh_margin=mesh_margin)
                        rec = O("DepGrid",
                                brick_gen,
                                el_tolerance=el_tolerance,
                                enforce_continuity=enf_cont,
                                method=method)

                        setup = [
                            "pusher = %s" % pusher,
                            "depositor = %s" % rec,
                            "element_order = %d" % eorder,
                            "nparticles = %d" % nparticles,
                        ] + basic_2d_gauss_setup()

                        if output_path is not None:
                            import os
                            job_out_path = os.path.join(
                                output_path, job.subdir)
                            os.makedirs(job_out_path)

                            setup.append("vis_path = %s" %
                                         repr(job_out_path), )
                        job.write_setup(setup)
                        job.submit()
Пример #9
0
def study_rec_grid(output_path=None):
    """Submit jobs to study the behavior of grid deposition."""

    O = ConstructorPlaceholder

    timestamp = get_timestamp()

    pusher = O("PushMonomial")
    eorder = 3

    nparticles = 30000


    for method in ["simplex_enlarge", "simplex_extra", "simplex_reduce"]:
        #for el_tolerance in [0, 0.1, 0.15, 0.2]:
        for el_tolerance in [0.1, 0.15]:
            #for enf_cont in [True, False]:
            for enf_cont in [False]:
                #for overres in [0.8, 1.0, 1.2, 1.3, 1.4, 1.6, 2]:
                for overres in [1.2, 1.4, 1.6, 2]:
                    for mesh_margin in [0]:
                    #for mesh_margin in [0, 0.05, 0.1, 0.2]:
                        job = BatchJob(
                                "recgrid-$DATE/%s-tol%g-cont%s-or%g-mm%g" % (
                                    method, el_tolerance, enf_cont, overres, mesh_margin),
                                "-m pyrticle.driver",
                                timestamp=timestamp,
                                )
                        brick_gen = O("SingleBrickGenerator",
                                overresolve=overres,
                                mesh_margin=mesh_margin)
                        rec = O("DepGrid", brick_gen,
                                el_tolerance=el_tolerance,
                                enforce_continuity=enf_cont,
                                method=method)

                        setup = [
                            "pusher = %s" % pusher,
                            "depositor = %s" % rec,
                            "element_order = %d" % eorder,
                            "nparticles = %d" % nparticles,
                            ]+basic_2d_gauss_setup()

                        if output_path is not None:
                            import os
                            job_out_path = os.path.join(output_path, job.subdir)
                            os.makedirs(job_out_path)

                            setup.append(
                                    "vis_path = %s" % repr(job_out_path),
                                    )
                        job.write_setup(setup)
                        job.submit()
Пример #10
0
def compare_methods():
    """Submit jobs to compare deposition/pushing methods."""

    O = ConstructorPlaceholder

    timestamp = get_timestamp()

    for max_area in [0.04, 0.02, 0.01]:
        for chi in [None, 2]:
            for dep in [
                #O("DepGrid", jiggle_radius=0),
                O("DepGrid"),
                O("DepGrid", enforce_continuity=True),
                O("DepGridFind"),
                O("DepAdv"),
                O("DepNormShape"),
                O("DepShape"),
                ]:
                for eorder in [3, 4, 5]:
                    for sexp in [2]:
                        if "Grid" in dep.classname:
                            pushers = [O("PushMonomial")]
                        else:
                            pushers = [
                                    O("PushMonomial"),
                                    O("PushAverage")
                                    ]
                        for pusher in pushers:

                            job = BatchJob(
                                    "compmeth-$DATE/ma%f-eo%d-se%d-%s-%s-chi%s" % (
                                        max_area, eorder, sexp, cn_with_args(dep), cn(pusher),
                                        chi),
                                    "-m pyrticle.driver",
                                    timestamp=timestamp,
                                    )
                            job.write_setup([
                                "pusher = %s" % pusher,
                                "depositor = %s" % dep,
                                "element_order = %d" % eorder,
                                "shape_exponent = %d" % sexp,
                                "chi = %s" % chi,
                                "_max_area = %f" % max_area,
                                ]
                                +basic_2d_gauss_setup()
                                )

                            if "Adv" in dep.classname:
                                mem_megs = 3000
                            else:
                                mem_megs = 400

                            job.submit(memory_megs=mem_megs)
Пример #11
0
def run_apsgun():
    O = ConstructorPlaceholder

    timestamp = get_timestamp()

    job = BatchJob(
        "apsgun/$DATE",
        "-m pyrticle.driver",
        aux_files=["apsgun.cpy"],
        timestamp=timestamp,
    )
    job.write_setup(["execfile('apsgun.cpy')"])
    job.submit()
Пример #12
0
def run_apsgun():
    O = ConstructorPlaceholder

    timestamp = get_timestamp()

    job = BatchJob(
            "apsgun/$DATE",
            "-m pyrticle.driver",
            aux_files=["apsgun.cpy"],
            timestamp=timestamp,
            )
    job.write_setup([ "execfile('apsgun.cpy')" ])
    job.submit()
Пример #13
0
def study_cleaning():
    """Submit jobs to see the effect of hyperbolic cleaning."""

    O = ConstructorPlaceholder

    timestamp = get_timestamp()

    def filt_desc(f):
        if isinstance(f, tuple):
            return "-".join(str(i) for i in f)
        else:
            return str(f)

    for rec in [
            #O("DepAdv"),
            #O("DepNormShape"),
            O("DepShape"),
            O("DepGrid", jiggle_radius=0),
    ]:
        for chi in [None, 2]:
            if chi is None:
                filters = [None]
            else:
                filters = [
                    None,
                    #(0.6,6),
                    #(0.8,6),
                    #(0.95,6),
                    #(0.6,3),
                    #(0.8,3),
                    #(0.95,3),
                ]
            for filter in filters:
                for pusher in [O("PushMonomial")]:
                    job = BatchJob(
                        "cleanstudy-$DATE/%s-chi%s-filt%s" %
                        (cn(rec), chi, filt_desc(filter)),
                        "-m pyrticle.driver",
                        timestamp=timestamp,
                    )
                    job.write_setup([
                        "pusher = %s" % pusher,
                        "depositor = %s" % rec,
                        "chi = %s" % chi,
                        "phi_filter = %s" % str(filter),
                        "element_order = 4",
                    ] + basic_2d_gauss_setup())
                    job.submit()
Пример #14
0
def compare_methods():
    """Submit jobs to compare deposition/pushing methods."""

    O = ConstructorPlaceholder

    timestamp = get_timestamp()

    for max_area in [0.04, 0.02, 0.01]:
        for chi in [None, 2]:
            for dep in [
                    #O("DepGrid", jiggle_radius=0),
                    O("DepGrid"),
                    O("DepGrid", enforce_continuity=True),
                    O("DepGridFind"),
                    O("DepAdv"),
                    O("DepNormShape"),
                    O("DepShape"),
            ]:
                for eorder in [3, 4, 5]:
                    for sexp in [2]:
                        if "Grid" in dep.classname:
                            pushers = [O("PushMonomial")]
                        else:
                            pushers = [O("PushMonomial"), O("PushAverage")]
                        for pusher in pushers:

                            job = BatchJob(
                                "compmeth-$DATE/ma%f-eo%d-se%d-%s-%s-chi%s" %
                                (max_area, eorder, sexp, cn_with_args(dep),
                                 cn(pusher), chi),
                                "-m pyrticle.driver",
                                timestamp=timestamp,
                            )
                            job.write_setup([
                                "pusher = %s" % pusher,
                                "depositor = %s" % dep,
                                "element_order = %d" % eorder,
                                "shape_exponent = %d" % sexp,
                                "chi = %s" % chi,
                                "_max_area = %f" % max_area,
                            ] + basic_2d_gauss_setup())

                            if "Adv" in dep.classname:
                                mem_megs = 3000
                            else:
                                mem_megs = 400

                            job.submit(memory_megs=mem_megs)
Пример #15
0
def study_cleaning():
    """Submit jobs to see the effect of hyperbolic cleaning."""

    O = ConstructorPlaceholder

    timestamp = get_timestamp()

    def filt_desc(f):
        if isinstance(f, tuple):
            return "-".join(str(i) for i in f)
        else:
            return str(f)

    for rec in [
      #O("DepAdv"),
      #O("DepNormShape"),
      O("DepShape"),
      O("DepGrid", jiggle_radius=0),
      ]:
        for chi in [None, 2]:
            if chi is None:
                filters = [None]
            else:
                filters = [
                  None,
                  #(0.6,6),
                  #(0.8,6),
                  #(0.95,6),
                  #(0.6,3),
                  #(0.8,3),
                  #(0.95,3),
                  ]
            for filter in filters:
                for pusher in [O("PushMonomial")]:
                        job = BatchJob(
                                "cleanstudy-$DATE/%s-chi%s-filt%s" % (cn(rec), chi, filt_desc(filter)),
                                "-m pyrticle.driver",
                                timestamp=timestamp,
                                )
                        job.write_setup([
                            "pusher = %s" % pusher,
                            "depositor = %s" % rec,
                            "chi = %s" % chi,
                            "phi_filter = %s" % str(filter),
                            "element_order = 4",
                            ]+basic_2d_gauss_setup())
                        job.submit()
Пример #16
0
def run_kv3d():
    O = ConstructorPlaceholder

    timestamp = get_timestamp()

    for chi in [None, 2]:
        for rec in [
                O("DepShape"),
                O("DepGrid", O("FineCoreBrickGenerator", core_axis=2),
                    #el_tolerance=0.1,
                    submethod="simplex_reduce")
                ]:
            job = BatchJob(
                    "kv3d-$DATE/%s-chi%s" % (cn(rec), chi),
                    "-m pyrticle.driver",
                    aux_files=["kv3d.cpy"],
                    timestamp=timestamp,
                    )
            job.write_setup([
                "execfile('kv3d.cpy')",
                "depositor = %s" % rec,
                "chi = %s" % chi,
                ])
            job.submit()