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

RuntimeError while evaluating integration on mesh #135

Open
gthyagi opened this issue Nov 18, 2023 · 2 comments
Open

RuntimeError while evaluating integration on mesh #135

gthyagi opened this issue Nov 18, 2023 · 2 comments

Comments

@gthyagi
Copy link
Contributor

gthyagi commented Nov 18, 2023

The mesh requires at least a single variable for integration to function correctly. This is a PETSc limitation.

Here is the code to reproduce the error.

import underworld3 as uw
mesh = uw.meshing.UnstructuredSimplexBox(minCoords=(0.0, 0.0), 
                                         maxCoords=(1.0, 1.0), 
                                         cellSize=1.0 / 32.0, 
                                         regular=True)
# # add this line to avoid petsc error
# s_soln = uw.discretisation.MeshVariable("T", mesh, 1, degree=2) 

x = mesh.N.x
y = mesh.N.y
z = mesh.N.z

I = uw.maths.Integral(mesh, x * y)
print(I.evaluate())  # 0.25
@lmoresi
Copy link
Member

lmoresi commented Nov 19, 2023 via email

@knepley
Copy link
Collaborator

knepley commented Nov 19, 2023

This can be fixed. I just did not contemplate integrating a pure function. We would need to get the quadrature rule from somewhere (right now it comes from the PetscFE)

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

No branches or pull requests

3 participants