ForestClaw / forestclaw

Quadtree/octree adaptive PDE solver based based on p4est.
http://www.forestclaw.org
BSD 2-Clause "Simplified" License
57 stars 21 forks source link

Remove use of deprecated package container #262

Closed scottaiton closed 1 year ago

scottaiton commented 1 year ago

Remove the use of deprecated package container and add fclaw2d_global_options_store and fclaw2d_global_get_options to fclaw2d_global. These functions simplifies the the storing of options so the options getter and setters go from looking like this:

void fclaw2d_options_store (fclaw2d_global_t *glob, fclaw_options_t* gparms)
{
    FCLAW_ASSERT(fclaw_pointer_map_get(glob->options,"fclaw2d") == NULL);
    fclaw_pointer_map_insert(glob->options, "fclaw2d", gparms, NULL);
}

fclaw_options_t* fclaw2d_get_options(fclaw2d_global_t* glob)
{
    fclaw_options_t* gparms = (fclaw_options_t*) 
                                 fclaw_pointer_map_get(glob->options, "fclaw2d");
    FCLAW_ASSERT(gparms != NULL);
    return gparms;
}

to this

void fclaw2d_options_store (fclaw2d_global_t *glob, fclaw_options_t* gparms)
{
    fclaw2d_global_options_store(glob, "fclaw2d", gparms);
}

fclaw_options_t* fclaw2d_get_options(fclaw2d_global_t* glob)
{
    return (fclaw_options_t*) fclaw2d_global_get_options(glob, "fclaw2d");
}