amrex icon indicating copy to clipboard operation
amrex copied to clipboard

About input parameters documentation

Open pedro-ricardo opened this issue 4 years ago • 4 comments

It seems that the documentation about Run-time Inputs does not contain all parameters that can be set for AMReX. Is this documented somewhere? Like a list with the parameters and what they are for.

For example regrid_on_restart is a parameter from amr group that isn't on that documentation I linked.

Also, is there and example of how to use the initial_grid_file parameter? I imagine that this one will help me control the initial mesh topology.

pedro-ricardo avatar Nov 08 '20 04:11 pedro-ricardo

Could you submit a PR to add that? And any others you’ve noticed as well?

Sent from my iPhone

On Nov 7, 2020, at 8:05 PM, Pedro Ricardo C Souza [email protected] wrote:



It seems that the documentation about Run-time Inputs https://amrex-codes.github.io/amrex/docs_html/Inputs_Chapter.html does not contain all parameters that can be set for AMReX. Is this documented somewhere? Like a list with the parameters and what they are for.

For example regrid_on_restart is a parameter from amr group that isn't on that documentation I linked.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/AMReX-Codes/amrex/issues/1526, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACRE6YXJVOAIGN7IWWQ3UGTSOYKJRANCNFSM4TOB7FTA .

asalmgren avatar Nov 08 '20 04:11 asalmgren

I was thinking about this when I recently added an option without documenting it. We could, if we wanted, take this as an opportunity to implement the runtime inputs system that AMReX-Astro uses (see https://github.com/AMReX-Astro/Castro/blob/main/Source/driver/parse_castro_params.py and https://github.com/AMReX-Astro/Castro/blob/main/Source/driver/_cpp_parameters for an example). This is not a substitute for prose that describes the meaning of the various options, but at the very least it makes all of the runtime options discoverable in the same place.

maxpkatz avatar Nov 08 '20 07:11 maxpkatz

@asalmgren Unfortunately I don't know what parameters are missing from the documentation, so i don't have anything to add as a Pull Request.

I would liked to have a list of all parameters that can be set ... and a brief description on them.

But for now, if anyone can give me the format for the file set in parameter initial_grid_file, It's good enough ... I can't seem to find this in the examples.

pedro-ricardo avatar Nov 08 '20 19:11 pedro-ricardo

The code that reads it is in Src/Amr/AMReX_Amr.cpp:

   is >> in_finest;
    STRIP;
    initial_ba.resize(in_finest);

    use_fixed_upto_level = in_finest;
    if (in_finest > max_level)
       amrex::Error("You have fewer levels in your inputs file then in

your grids file!");

    for (int lev = 1; lev <= in_finest; lev++)
    {
        BoxList bl;
        is >> ngrid;
        STRIP;
        for (int i = 0; i < ngrid; i++)
        {
            Box bx;
            is >> bx;
            STRIP;
            bx.refine(ref_ratio[lev-1]);
            bl.push_back(bx);
        }
        initial_ba[lev-1].define(bl);
    }
    is.close();
    if (verbose > 0) {
        amrex::Print() << "Read initial_ba. Size is " <<

initial_ba.size() << "\n"; }

so the first line is total number of levels > 0 (finest_level), then for each level you first put the number of grids/boxes at that level, then you write each box.

So for example, a level 0-1-2 calculation (max_level = 2) with 2 grids at level 1 and 1 grid at level 2 might look like (in 2D):

2 2 ((0,0) (15,15)(0,0)) ((16,16) (15,23)(0,0)) 1 ((8,8) (15,15)(0,0))

On Sun, Nov 8, 2020 at 11:29 AM Pedro Ricardo C Souza < [email protected]> wrote:

@asalmgren https://github.com/asalmgren Unfortunately I don't know what parameters are missing from the documentation, so i don't have anything to add as a Pull Request.

I would liked to have a list of all parameters that can be set ... and a brief description on them.

But for now, if anyone can give me the format for the file set in parameter initial_grid_file, It's good enough ... I can't seem to find this in the examples.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/AMReX-Codes/amrex/issues/1526#issuecomment-723654520, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACRE6YTC5CDMPA3X6Y3XZE3SO3WQPANCNFSM4TOB7FTA .

-- Ann Almgren Senior Scientist; CCSE Group Lead

asalmgren avatar Nov 08 '20 19:11 asalmgren