-
Notifications
You must be signed in to change notification settings - Fork 238
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
Feature fix quality metrics #101
Conversation
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 there are some compatibility issues for windows to be checked
kratos/testing/tester.cpp
Outdated
@@ -228,8 +228,7 @@ namespace Kratos | |||
{ | |||
// creating the regex pattern replacing * with ".*" | |||
|
|||
#if defined(__GNUC__) &&( __GNUC__ < 4 || \ | |||
(__GNUC__ == 4 && (__GNUC_MINOR__ < 9))) | |||
#if __cplusplus <= 199711L |
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 this also visual studio compatible?
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.
There was a problem in VS 2012 with this but since we already use 2015 it should be fine. I will test it again to be sure.
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 like they still define this as 199711L.
The question is, since we now have C+11 as a requisite can't we just compile the regex code as is?
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 that this particular feature (regex) was still broken on relatively recent gccs, anyway Pooyan will remember more about this
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.
Exactly as @RiccardoRossi saying, gcc 4.8 which is one of the popular old one does not support it and for me this function wasn't enough for drop it
@@ -28,14 +28,15 @@ | |||
namespace Kratos { | |||
namespace Testing { | |||
|
|||
static std::ofstream out("/dev/null"); |
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 this windows compatible?
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.
Probably not.
As we spoke, maybe I should just remove that ?
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.
At the end it was working because std::cout.rdbuf(out.rdbuf());
was evaluated as NULL
, which is an accepted buffer which has the same effect as /dev/null
in linux. As it happens to be what we want im just making std::cout.rdbuf(nullptr);
According to this it also sets the std::ios::badbit
which should prevent conversions in the output in case we eventually have any.
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.
Seems ok, but in long term I would like to know why the same mechanism is not working in the tester
…osMultiphysics/Kratos into feature-fix-quality-metrics
@pooyan-dadvand I've made some changes since the last time:
However, none of the quality functions were using 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.
I would not let change the Volume method unless you have a very strong reason because it will break a lot of code.
double detJMX = s10 * y20 * z30 + y10 * z20 * s30 + z10 * s20 * y30 - s30 * y20 * z30 - y30 * z20 * s10 - z30 * s20 * y10; | ||
double detJMY = s10 * x20 * z30 + x10 * z20 * s30 + z10 * s20 * x30 - s30 * x20 * z30 - x30 * z20 * s10 - z30 * s20 * x10; | ||
double detJMZ = s10 * x20 * y30 + x10 * y20 * s30 + y10 * s20 * x30 - s30 * x20 * y30 - x30 * y20 * s10 - y30 * s20 * x10; | ||
double detJMX = s10 * y20 * z30 + y10 * z20 * s30 + z10 * s20 * y30 - s30 * y20 * z10 - y30 * z20 * s10 - z30 * s20 * y10; |
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 should not change this! The volume results to be correct after my issue. Why you want to change 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.
This is not the volume function. This calculates the circumradius of the tetrahedron for the quality function that need them. It had an error in one of the components of a diagonal that calculates another determinant. See ac707a5.
But I can rewrite the whole matrix so it looks like the volume if you want.
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.
Now I see. So I aree with changes.
Can we merge? |
This should fix #94 and fix #85.
As a resume this PR:
VolumeToAverageEdgeLength
quality function for tetrahedras