Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite wrappers #204

Merged
merged 12 commits into from
Feb 20, 2020
Merged

Rewrite wrappers #204

merged 12 commits into from
Feb 20, 2020

Conversation

michalhabera
Copy link
Contributor

Clean-up in naming and wrappers generation.

In the old code, wrappers were a separate compiler step, which violated pipelined workflow - it generated code which wrongly

  1. didn't comply with templated codes codegeneration/***_template.py,
  2. generated code directly from analysis, bypassing IR.

After this rewrite

  1. every C generated code should come only from templates,
  2. helpers naming of create_*** is made more systematic,
  3. helper to create function space takes name of function as an argument, ufc_function_space* create_functionspace_form_poisson_L(const char* function_name). So for command-line workflow a C++ user is presented with e.g.
ufc_function_space* create_functionspace_form_poisson_L(const char* function_name)
{
  ufc_function_space* space = (ufc_function_space*) malloc(sizeof(*space));

if (strcmp(function_name, "v") == 0)
{
    space->create_element = create_element_cddd9e3e151003bf238a36139e064f7fe0542033;
    space->create_dofmap = create_dofmap_cddd9e3e151003bf238a36139e064f7fe0542033;
    space->create_coordinate_mapping = create_coordinate_mapping_a5704bef5087a0d4f18840cff811a6ff1e9b283c;
}
if (strcmp(function_name, "f") == 0)
{
    space->create_element = create_element_cddd9e3e151003bf238a36139e064f7fe0542033;
    space->create_dofmap = create_dofmap_cddd9e3e151003bf238a36139e064f7fe0542033;
    space->create_coordinate_mapping = create_coordinate_mapping_a5704bef5087a0d4f18840cff811a6ff1e9b283c;
}
if (strcmp(function_name, "g") == 0)
{
    space->create_element = create_element_cddd9e3e151003bf238a36139e064f7fe0542033;
    space->create_dofmap = create_dofmap_cddd9e3e151003bf238a36139e064f7fe0542033;
    space->create_coordinate_mapping = create_coordinate_mapping_a5704bef5087a0d4f18840cff811a6ff1e9b283c;
}
return space;

}

@coveralls
Copy link

coveralls commented Feb 18, 2020

Coverage Status

Coverage increased (+1.5%) to 78.693% when pulling ba6d15d on michal/rewrite-wrappers into 687cd93 on master.

@garth-wells garth-wells merged commit 96b867d into master Feb 20, 2020
@garth-wells garth-wells deleted the michal/rewrite-wrappers branch February 20, 2020 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants