-
Notifications
You must be signed in to change notification settings - Fork 192
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
Functions in ApparentHorizons/Tags.cpp are now free functions. #3799
Functions in ApparentHorizons/Tags.cpp are now free functions. #3799
Conversation
|
||
/// @{ | ||
/*! | ||
* `r_hat(i)` is \f$\hat{r}^i = x_i/\sqrt{x^2+y^2+z^2}\f$ on the |
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.
Is there a reason why you have chosen upper / lower indices for theta_phi
, rhat
, etc? It probably doesn't matter much, unless you want to use them with tensor expressions at some point. If there's a design decision behind this though, then please add some documentation, e.g. to a namespace or to these function dox.
/*! | ||
* \f$(\theta,\phi)\f$ on the Strahlkorper surface. | ||
* Doesn't depend on the shape of the surface. | ||
*/ |
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.
no need to repeat the dox, that's what /// @{
is for. Applies to all functions in this namespace.
* | ||
* `radius` is the radius as a function of angle, as returned by | ||
* `StrahlkorperFunctions::radius`, and `r_hat` is the Euclidean | ||
* radial unit vector as returned by `StrahlkorperFunctions::rhat`. |
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.
(optional) I suggest to structure these docs with Doxygen commands:
* \param radius The radius as a function of angle, as returned by ...
* \param r_hat The Euclidean radial unit vector ...
This would apply to all functions in this namespace, if you choose to do it.
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.
👍 squash
@markscheel Doxygen wants you to document all params now, which I think is a good idea :) |
d2ff941
to
30ede84
Compare
30ede84
to
5b5e5df
Compare
It appears that Doxygen does not like the combination of
If the documentation contains So which do you prefer?
|
@markscheel I believe you can do this (see Doxygen member groups): /*!
* \name Jacobian
* Description, math and stuff.
*/
///@{
/*!
* Optional details for first overload
*
* \param theta_phi Parameter description
*/
void jacobian(...);
/*!
* Optional details for second overload
*
* \param theta_phi Parameter description
* \param other_param Other parameter description
*/
void jacobian(...);
/// @} What do you think? |
Previously ApparentHorizons/Tags.cpp defined many functions inside of ComputeItems. These should have been free functions instead of ComputeItems. These functions have been moved from Tags.cpp to StrahlkorperFunctions.hpp where they are now free functions. The ComputeTags in ApparentHorizons/Tags.hpp now point to those free functions. For the most part, code has simply been moved from Tags.cpp to StrahlkorperFunction.cpp, but there were a few other changes: * Some of the new free functions use fewer memory allocations than the corresponding ComputeItems did. This is accomplished by storing temporaries in components of the final result, and computing everything in a carefully chosen order so that memory is re-used. * The free functions all have versions that return a value and versions that take and fill a not_null pointer. * The functions that take derivatives of the radius have been renamed and generalized to take derivatives of an arbitrary scalar on the Strahlkorper. * LaplacianRadius now returns a Scalar<DataVector> instead of a DataVector. * Some of the documentation has been clarified. * Tests have been added for the free functions. * There is still a single ComputeItem remaining in Tags.cpp, for a function that doesn't need to be a free function (because it's just a member function of Strahlkorper).
e56f7ea
to
3351b06
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.
LGTM, docs render fine 👍
Proposed changes
This is some code cleanup that I wanted to finish before doing #3561
Previously ApparentHorizons/Tags.cpp defined many functions inside of
ComputeItems. These should have been free functions instead of
ComputeItems.
These functions have now been moved from Tags.cpp to
StrahlkorperFunctions.hpp where they are now free functions.
The ComputeTags in ApparentHorizons/Tags.hpp now point to those
free functions.
For the most part, code has simply been moved from Tags.cpp to
StrahlkorperFunctions.cpp, but there were a few other changes:
than the corresponding ComputeItems did. This is accomplished
by storing temporaries in components of the final result, and
computing everything in a carefully chosen order so that memory
is re-used.
versions that take and fill a not_null pointer.
renamed and generalized to take derivatives of an arbitrary scalar
on the Strahlkorper.
DataVector.
a function that doesn't need to be a free function
(because it's just a member function of Strahlkorper).
Upgrade instructions
The only interface difference (other than the existence of new functions) is that
ah::Tags::LaplacianRadius
is now aScalar<DataVector>
instead of aDataVector
.Code review checklist
make doc
to generate the documentation locally intoBUILD_DIR/docs/html
.Then open
index.html
.code review guide.
bugfix
ornew feature
if appropriate.Further comments