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

Cleaning the dirty fix in adapter_core.py #17

Open
PhilipHildebrand opened this issue Dec 15, 2022 · 1 comment
Open

Cleaning the dirty fix in adapter_core.py #17

PhilipHildebrand opened this issue Dec 15, 2022 · 1 comment
Assignees

Comments

@PhilipHildebrand
Copy link
Contributor

PhilipHildebrand commented Dec 15, 2022

Right now, there is a dirty fix implemented for collecting the sampled data. Is there a particular reason for this?

edit by @BenjaminRodenberg

# TODO begin dirty fix
x_mesh = fenicsx_function.function_space.mesh.geometry.x
x_dofs = fenicsx_function.function_space.tabulate_dof_coordinates()
mask = [] # where dof coordinate == mesh coordinate
for i in range(x_dofs.shape[0]):
for j in range(x_mesh.shape[0]):
if np.allclose(x_dofs[i, :], x_mesh[j, :], 1e-15):
mask.append(i)
break
sampled_data = fenicsx_function.x.array[mask]
# end dirty fix

@arvedes
Copy link
Contributor

arvedes commented Dec 16, 2022

I implemented it when updating to v0.4, because the property fenicsx_function.x.array we used before was removed. See also:
#1 (comment)
5af2065

@BenjaminRodenberg BenjaminRodenberg changed the title Cleaning the dirty fix in adapter_core.py Cleaning the dirty fix in adapter_core.py Dec 16, 2022
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

2 participants