-
Notifications
You must be signed in to change notification settings - Fork 161
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
creating DG0 feilds computationally without floating point error. #4022
Comments
Can you not get what you want with conditional? There's nothing wrong with adding floor and ceil to UFL other than it'll cause you a lot of legwork (the differentiation rules, for example). If you can get away with conditional then your life will be easier. |
Is there a way to use something like this:
but correctly ? This obviously does not work for DG0 |
Could please you send an example where the round-off error is noticeable?
|
Here's how you
We should probably make this more user-friendly. |
@ksagiyam could we allow |
dtype = int does not work with VTKFile But the solution is very good. I like it. |
def assign_subdomain(f, vals, subdomains):
is this ok for multiple valsues and subdomains ? |
@pbrubeck I think the potential problem is that, if we assign to a CG function with some cell subdomain IDs, what should happen at the subdomain interface is not clear. It is clear for DG functions. |
Wouldn't the obvious operation assign dofs on the closure of each cell in the subdomain? |
I think |
this is Ok for DG functions right ? |
Yes, for DG there's no confusion |
@ksagiyam I think for CG we can agree on a well defined operation, by considering the subspace of basis functions supported on the closure of cells in the subdomain.
|
when we want to create a DG0 field like:
assemble(sum(Constant(v)/CellVolume(mesh)*dx(i+1) for i, v in enumerate(val)))
the floating point error sometimes creates large distortion.
as per recommandation from Colin Cotter:
"This could be fixed by adding floor/ceil to UFL (and then handling in the form compiler).
6:03
If you raise this as an issue in Firedrake then someone can give you advise on how to do it."
How to do this ?
thanks.
The text was updated successfully, but these errors were encountered: