-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add a vector_calculus class #120
Conversation
!! derivatives are decided at runtime. Backend implementations | ||
!! are responsible from directing calls to transeq_ders into | ||
!! the correct algorithm. | ||
subroutine tds_solve(self, du, u, tdsops) |
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.
Removed dirps argument here, it had become redundant when we introduced mesh class a while ago.
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.
looks good to me, I just think it would be good to properly define what is expected from the input variables in terms of direction and dataloc.
Thanks! Changed the namings from velocity/pressure grid to data_loc based VERT/CELL. Also added a bit more explanation in subroutine headers to explain expected |
|
||
type :: vector_calculus_t | ||
!! Defines vector calculus operators | ||
class(base_backend_t), pointer :: backend |
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.
This is the kind of circular pointer that I think we should try and avoid (i.e. a pointer to the backend
object in the parent class of vector_calculus
). Could we pass backend
as an argument to vector_calculus
methods? e.g.
call vector_calculus%curl(..., backend)
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.
We don't really have a circular pointer or dependency here. backend
, solver
and vector_calculus
are all independent classes and there is no inheritance relationship among them. There are other classes too that use backend
, like time_integrator
and new wind turbine stuff. In a class diagram backend
would be under all of them so I don't see a problem having a pointer to backend
in these classes. Why do you think we should avoid?
I think it might be worth checking the conditions at the start of the curl/div/grad/xxx subroutines. A "invalid field locations passed to curl" will be easier to debug than "invalid fields in tdsops" (which you then need to figure out where it came from). Having the tdsops perform this last level check is good to ensure we catch everything, but a higher-level check might ultimately be beneficial in my opinion. |
This PR moves the vector calculus operations currently implemented inside solver class out to a dedicated new class. This new structure should allow accessing vector calculus operations outside the solver class. Examples include the laplacian operation iterative Poisson solver needs and curl/divergence for postprocessing/monitoring.