-
Notifications
You must be signed in to change notification settings - Fork 32
Added functionality to specify degree element order #997
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
Conversation
Modified settings.py and hydrogen_transport_problem.py to add optional degree order for finite element - defaults to 1
|
Solves #991 |
RemDelaporteMathurin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ck768 for this first contribution!
Could you also propagate this change to HydrogenTransportProblemDiscontinuous which is the multi-material version of the hydrogen problem class?
FESTIM/src/festim/hydrogen_transport_problem.py
Lines 1170 to 1176 in d308842
| degree = 1 | |
| element_CG = basix.ufl.element( | |
| basix.ElementFamily.P, | |
| subdomain.submesh.basix_cell(), | |
| degree, | |
| basix.LagrangeVariant.equispaced, | |
| ) |
|
Also, it seems like the CI is failing, are the tests passing locally? |
|
@ck768 I see why some tests are failing. Now whenever we call Now the straightforward way of fixing that is to add a Otherwise, it may be better to instead have def define_function_space(self, element_degree=1):
...Then inside def initialise(self):
...
self.define_function_space(element_degree=self.settings.element_degree)That way you don't have to modify all the tests and it's a better design altogether |
|
Yeah seems the CI is failing because in many tests, settings aren't given to the problem object. Just wondering if this argument should live in settings, maybe within Mesh class instead? Even though they are different, they're more closely related than this an settings, which is more for solver and transient parameters. And, in building the function spaces it already gets the What do you think @RemDelaporteMathurin ? |
|
I would keep it in the settings instead of mesh and keep the mesh object for anything geometry related |
|
Hmm, that's interesting. I ran the tests locally and I had initial errors that I needed to install some Python modules, but after I installed them, it said the tests were successful. I've been running the line |
|
This is how you run tests locally. The tests should fail (see explanation above). Are you sure you are running pytest on |
Inputs the degree in define_function_spaces rather than only settings
|
Figured out where the problem was while running local tests (thanks @jhdark )! I changed |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## fenicsx #997 +/- ##
========================================
Coverage 95.39% 95.40%
========================================
Files 46 46
Lines 2847 2851 +4
========================================
+ Hits 2716 2720 +4
Misses 131 131 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
RemDelaporteMathurin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proposed changes
Users can specify the degree order when setting up a FESTIM model. This argument is optional, default is set to 1.
Types of changes
Checklist
Example usage:
my_model.settings = F.Settings(
atol=1e10,
rtol=1e-10,
max_iterations=30,
final_time=50,
element_degree=2
)