-
-
Notifications
You must be signed in to change notification settings - Fork 219
Replace IntegralType
enum with something that is more expressive
#3919
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
base: main
Are you sure you want to change the base?
Conversation
@garth-wells CI (via Spack, experimental) is blocking here. |
IntegralType
enum with something that is more expressive
@garth-wells I've now replaced the |
…domain is strange is not consistent with ds or dS (it is the sum of both).
Thinking even more about this, I think the integral type should also contain a currently these two measure would give different behavior for the two measures, which is unintuitive, at least to me. This would affect thinking even more about it, ds,dP and dr (facet, vertex, ridge) integrals should only take entities on the exterior boundary as default. Anything else will lead to non-deterministic results when having discontinuous data in such cells, and calling dP or dr, as the first connected cell is not the same when executed with a different number of processes. if a user wants to integrate over all vertices, they should compute the integration data themselves to ensure correctness, and attach it as subdomain data. |
@michalhabera @schnellerhase
I think |
I agree these are a lot of special cases, but they are not combinable at the moment. Consider a branching mesh (truss layout), here
Integration of discontinuous data should not be performed with these integral types. An attempt of facilitating this is to be found at https://github.com/FEniCS/ffcx/blob/main/ffcx/analysis.py#L205-L209 for |
I don't think |
Agree - just need the dimension and special case handling for interior facets for now. |
Using num_cells or a Boolean flag doesn’t change the implementation much. This depends on how you want to generate your kernels (in the future). If you think along the lines of how we do interior facet, the kernel needs to know how many cells (for packing coordinate data, coefficients etc) it is taking in. For instance, if I could specify restriction (0,1,2,….,N) in UFL, rather than +,-, this is the information that would be required. One of my key points is that dP (vertex) does all the same assumptions as my ridge implementation (things should be one sided), which is the same when manually packing |
Replaces
dolfinx::fem::IntegralType
-enum with a more expressive integral type.The only thing IntegralType requires to know of the DOLFINx side is:
Default behavior is
num_cells=1
. Thus:fem::IntegralType::cell
->fem::IntegralType(0)
fem::IntegralType::exterior_facet
->fem::IntegralType(1)
fem::IntegralType::interior_facet
->fem::IntegralType(1, 2)
fem::IntegralType::ridge
->fem::IntegralType(2)
fem::IntegralType::vertex
->fem::IntegralType(-1)
Future integral type that should replace vertex is
peak
, and it should befem::IntegralType(3)
.Depends on FEniCS/ffcx#787 (due to renaming of
exterior_facet
tofacet
to be consistent withvertex
andridge
.As I have kept
IntegralType
as input to all existing functions, they only user-facing API change is intializing the IntegralType.Also fixes assigning environment variables through config file on windows CI.
This idea will also extend to Integrals where one have more than one or two cells that should be packed for a kernel.