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

Transition to basix library for finite element definitions #296

Merged
merged 144 commits into from
Jan 19, 2021

Conversation

mscroggs
Copy link
Member

@mscroggs mscroggs commented Jan 15, 2021

Refactor everything to use Basix in the place of FIAT. This PR is twinned with FEniCS/dolfinx#1324.

Close #277. Close #175. Close #176. Close #33.

@garth-wells garth-wells changed the title Basix Transition to basix library for finite element definitions Jan 15, 2021
return [L.Comment(msg), L.Return(-1)]

return generate_evaluate_reference_basis(L, data, parameters)
def apply_dof_transformation(L, ir, parameters, reverse=False):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly does this do? Is it only about permutations?

/// @param[in] cell_permutation An integer encoding the orientation of the
/// cell's entities
/// @param[in] dim The number of data items for each DOD
int (*apply_dof_transformation)(double* data, uint32_t cell_permutation,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to my previous comment. If this is ever only about permutation, then why name suggest something more general?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For more complicated situations such as face tangents, the DOF transformation is not a permutation, as it combines multiple DOFs to get the new DOF. It's probably more sensible though to call the functions permutations everywhere though to avoid confusion, so I'll rename stuff

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, just noticed that there's apply_dof_transformation and get_dof_permutation and I guess it's useful to have different names to distinguish these

@@ -7,13 +7,15 @@
import numpy as np
import pytest

import ffcx
import ffcx.codegeneration.jit
# import ffcx
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the point of this file now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. I've removed it

return (points, weights)
return (None, None)

logging.exception(f"Unknown integral type: {integral_type}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this ever hit?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no. I've changed it to a RuntimeError as in the function below to give a stronger warning that something is wrong if this is hit

{{
{evaluate_reference_basis_derivatives}
}}

int transform_reference_basis_derivatives_{factory_name}(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this method still in ufc?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's still used in dolfinx, but could possibly be more neatly replaced by implementing Piola mapping functionality in Basix

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made an issue: #299

@mscroggs mscroggs merged commit 3f686be into master Jan 19, 2021
@mscroggs mscroggs deleted the mscroggs/basix branch January 19, 2021 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants