We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Reported at:
Run following test on a one triangle mesh
from mpi4py import MPI import numpy as np import basix.ufl import ufl import dolfinx as dfx degree = 2 vertices = np.array( [(0.0, 0.0, 1.0), (1.0, 1.0, 1.0), (1.0, 0.0, 0.0)], dtype=dfx.default_real_type, ) cells = [(0, 1, 2)] domain = ufl.Mesh(basix.ufl.element("Lagrange", "triangle", 1, shape=(3,), dtype=dfx.default_real_type)) msh = dfx.mesh.create_mesh(MPI.COMM_WORLD, cells, vertices, domain) N1E = basix.ufl.element(basix.ElementFamily.N1E,basix.CellType.triangle,degree = degree) BDM = basix.ufl.element(basix.ElementFamily.BDM,basix.CellType.triangle, degree = degree) P = basix.ufl.element(basix.ElementFamily.P,basix.CellType.triangle, shape = (3,), degree = degree, discontinuous=True) N1E = dfx.fem.functionspace(msh, N1E) BDM = dfx.fem.functionspace(msh, BDM) P = dfx.fem.functionspace(msh, P) n1e = dfx.fem.Function(N1E) bdm = dfx.fem.Function(BDM) p = dfx.fem.Function(P) def f(x): return 0*x[0], 0*x[1], 1*x[2] n1e.interpolate(f) bdm.interpolate(f) p.interpolate(f) def error(ph): x_ = ufl.SpatialCoordinate(msh) f_ex = ufl.as_vector(f(x_)) diff = ufl.inner(ph - f_ex, ph-f_ex) * ufl.dx compiled = dfx.fem.form(diff) local_err = dfx.fem.assemble_scalar(compiled) return np.sqrt(MPI.COMM_WORLD.allreduce(local_err, op=MPI.SUM)) print(f"{error(p)=}, {error(bdm)=}, {error(n1e)=}") p_n1e = dfx.fem.Function(P) p_n1e.interpolate(n1e) p_bdm = dfx.fem.Function(P) p_bdm.interpolate(bdm) print(f"{error(p_n1e)=}, {error(p_bdm)=}")
error(p)=9.124861240584765e-17, error(bdm)=0.7891307953048737, error(n1e)=0.5645633547617197 error(p_n1e)=0.5645633547617197, error(p_bdm)=0.7891307953048737
main branch
e64178c
Docker, ghcr.io/fenics/dolfinx/lab:nightly
No response
The text was updated successfully, but these errors were encountered:
Works on cartesian-aligned manifold:
vertices = np.array( [(1.0, 0.0, 0.0), (1.0, 1.0, 0.0), (0.0, 0.0, 0.0)], dtype=dfx.default_real_type, )
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Summarize the issue
Reported at:
How to reproduce the bug
Run following test on a one triangle mesh
Minimal Example (Python)
Output (Python)
Version
main branch
DOLFINx git commit
e64178c
Installation
Docker, ghcr.io/fenics/dolfinx/lab:nightly
Additional information
No response
The text was updated successfully, but these errors were encountered: