-
Notifications
You must be signed in to change notification settings - Fork 47
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
Refactor petsc examples to reduce redundant code #726
Conversation
There is a small bug with BP3-6 in this that I need to track down |
80bc9f7
to
bcd4424
Compare
Now there is just a bug with OCCA/OMP for bpssphere |
That example runs fine in valgrind with the memcheck backends, so I suspect that we somehow have found another OCCA backend bug. I'll dig more tomorrow. |
bcd4424
to
4cf204d
Compare
Nope, I was wrong. A missed 'takearray' in the original bpssphere |
4cf204d
to
63fbd5a
Compare
And we trimmed 781 lines of redundant code. We really should get around to doing this to the fluids miniapp one of these days. I'll use this as the base to build the new BDDC example. |
Mildly related - do we want to finally kill that meshes directory in this PR? |
@LeilaGhaffari, just making sure you see this. I think we should do this with the fluids example too. I won't have time to get to it this month, but if you get a chance and/or are interested and hit any snags, let me know and I'll help. |
@valeriabarra, I'll start the style guide PR after this PR is approved. |
Yes, I am following this PR. I have used |
I went ahead and tried the new style in this PR so we could see if we like it. |
be4996e
to
60b583d
Compare
examples/petsc/area.c
Outdated
ceed_resource[PETSC_MAX_PATH_LEN] = "/cpu/self"; | ||
PetscInt l_size, g_size, xl_size, | ||
q_extra = 1, // default number of extra quadrature points | ||
ncomp_x = 3, // number of components of 3D physical coordinates |
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.
How about n_comp_x
?
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.
I'd be fine using num_comp_x
(I think that's how we have it in Rust), but I'd prefer to avoid n_comp_x
. The later feels harder to read to me.
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.
I see your point. Yes, I like num_comp_x
.
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 for asking - I went ahead and made some changes in that vein
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.
Thank you for taking care of that. I will make the same changes in the fluids example.
I plan on squashing this to 3 commits before merging
|
@@ -78,7 +78,7 @@ struct RunParams_ { | |||
MPI_Comm comm; | |||
PetscBool test_mode, read_mesh, user_l_nodes, write_solution; | |||
char *filename, *hostname; | |||
PetscInt local_nodes, degree, q_extra, dim, num_comp_u, *m_elem; | |||
PetscInt local_nodes, degree, q_extra, dim, num_comp_u, *mesh_elem; |
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.
Part of my philosophy with these name changes is that the PETSc (and solid mechanics) examples seem to be the entry point for people looking to understand and use libCEED (especially for new grad students), so I'm ok with slightly more verbose names that help ease that learning curve.
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.
Very good point. This verbosity could have saved me a lot of time when I first started reading the fluids example.
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.
Some of the pain with the fluids example comes from the fact I was the one who started it and it was my first attempt at making an mini-app :) hopefully this wave of style + modularity refactors will make things easier for everyone down the road
f3a8de5
to
a3c37f2
Compare
a3c37f2
to
a3c062d
Compare
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.
Tests are passing and changes look reasonable at a glance, so I'm happy to merge.
No description provided.