-
Notifications
You must be signed in to change notification settings - Fork 18
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
488 refactor energy #506
488 refactor energy #506
Conversation
…lkit into 488-refactor-energy
…eFunction, DIfferentiableFunction to have arguments of Simplex type instead of Tuple type
…ion to use domain simplex instead of tuple
…n. get_grad, get_hessian takes domain_simplex and variable_simplex as arguments instead of tuples
…ray of DScalar type vectors
…ain to obtain 3 vertices or edges for Autodiff vector
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #506 +/- ##
==========================================
+ Coverage 83.35% 85.27% +1.92%
==========================================
Files 215 207 -8
Lines 5954 6032 +78
==========================================
+ Hits 4963 5144 +181
+ Misses 991 888 -103
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
fix the simplex stuff and try to add some more unit tests, but other than that looks good. i'l'l leave this at approve, but please try to improve the code coverage.
Undo last changes to the simplex folder. This undoes an internal API practice |
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.
Main concerns: documentation and coverage. The code itself looks good to me but especially with the simplex stuff, we should really make sure that it is 100% covered because everyone is going to use that.
throw std::runtime_error("AMIPS only supports 2D and 3D meshes"); | ||
} | ||
if (embedded_dimension() == 2) { | ||
DSVec2 coordinate0_2d = coordinate0; |
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 that conversion safe? It seems to me like something that at least throws a warning and should be guarded properly by asserts). Actually, it might be the best if all the coordinates use a templated type.
~AMIPS(); | ||
|
||
protected: | ||
DScalar eval(DSVec& coordinate0, DSVec& coordinate1, DSVec& coordinate2) const override; |
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 think all the parameters should be const
.
And where are DSVec
and DScalar
defined? I couldn't find it in autodiff.h.
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.
DSVec and DScalar are defined in my AutodiffFunction.
src/wmtk/operations/tri_mesh/internal/VertexSmoothGradientDescent.cpp
Outdated
Show resolved
Hide resolved
|
||
std::vector<Tuple> cofaces_single_dimension_tuples( | ||
SimplexCollection cofaces_single_dimension( |
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 one definitely needs documentation.
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'm going to leave everything that's related to cofaces_single_dimension unchanged for now, since Michael is going to possibly rewrite a lot about this function in #514
@@ -17,4 +18,10 @@ std::vector<Tuple> cofaces_single_dimension_tuples( | |||
const Mesh& mesh, | |||
const Simplex& my_simplex, | |||
PrimitiveType cofaces_type); | |||
|
|||
std::vector<Simplex> cofaces_single_dimension_simplices( |
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.
Getting the vector of simplices from the simplex collection is very simple. I don't think this needs its own function.
std::vector<Tuple> cofaces_single_dimension_tuples( | ||
const TriMesh& mesh, | ||
const Simplex& my_simplex, | ||
std::vector<Simplex> cofaces_single_dimension_simplices( |
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 a function that is going to be used by everyone. It should have 100% coverage.
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
issue 488 refactor energy