Conversation
| * @param rCurrentProcessInfo Current ProcessInfo values (input) | ||
| */ | ||
| void CalculateLocalVelocityContribution( | ||
| virtual void CalculateLocalVelocityContribution( |
There was a problem hiding this comment.
Why is this required to be virtual?
There was a problem hiding this comment.
This function is derived in the elements I have renovated. I need to initialize the second derivatives of the shape functions.
There was a problem hiding this comment.
The point is that by doing so you're introducing the vtable overhead. Considering that you know at compile time which elements are high order as we've a dimension and number of nodes template argument, I think we can achieve this in a more generic and efficient way by using an if constexpr together with an overload of the method that calculates the kinematics. Note that this approach would make possible to keep a unique implementation for all the elements deriving from the FluidElement.
There was a problem hiding this comment.
Ok, but we shall consider to implement GetShapeSecondDerivatives in FluidElement and modify 'CalculateLocalVelocityContribution' using an if constexpr.
There was a problem hiding this comment.
@rubenzorrilla, I am still confused. If I remove GetShapeSecondDerivatives, where do I implement the transform of the second shape derivatives?
There was a problem hiding this comment.
In a new overload of the CalculateGeometryData.
There was a problem hiding this comment.
@rubenzorrilla, this means that we must implement GetShapeSecondDerivatives in the fluid_element and overload the UpdateIntegrationPointData to call the second derivatives from data.
There was a problem hiding this comment.
No, you do another version of the CalculateGeometryData (method overload) that does what we're currently doing plus the second derivatives.
There was a problem hiding this comment.
It seems that this is not solved yet.
| * @param b Newton-Raphson right hand side (unused) | ||
| */ | ||
| void Update( | ||
| virtual void Update( |
There was a problem hiding this comment.
Why is the virtual required?
There was a problem hiding this comment.
Because this function is derived in bdf2_turbulent_schemeDEMCoupled.h, which will be merge to master after this PR.
There was a problem hiding this comment.
But this is already virtual in the base class... I mean, it makes no sense to add it also here.
| void InitializeNonLinIteration( | ||
| ModelPart &rModelPart, | ||
| TSystemMatrixType &A, | ||
| TSystemVectorType &Dx, | ||
| TSystemVectorType &b) override | ||
| { | ||
|
|
||
| BaseType::InitializeNonLinIteration(rModelPart, A, Dx, b); | ||
|
|
||
| } | ||
|
|
There was a problem hiding this comment.
This is doing nothing. Please remove it and leave current base class implementation.
There was a problem hiding this comment.
Yes, it was for a testing implementation, I forgot to remove it.
| @@ -0,0 +1,113 @@ | |||
| // | / | | |||
There was a problem hiding this comment.
I'd add this test to current test_alternative_qs_vms_dem_coupled_element.cpp. Note that you're testing the very same implementation but with different template instantiation.
| @@ -0,0 +1,138 @@ | |||
| // | / | | |||
There was a problem hiding this comment.
I'd add this test to current test_alternative_qs_vms_dem_coupled_element.cpp under the very same reasoning I posted above.
There was a problem hiding this comment.
I thought that it would be better to split these tests in three in order to ease the detection of errors. However, I can add them in only one.
There was a problem hiding this comment.
The tests are already split by the macro.
There was a problem hiding this comment.
Ok, so you mean to write them in the same .cpp file. I thought you meant to join them in only one test. To me it is ok
|
is this done? |
@RiccardoRossi, in theory it is done, but we have decided to move the second derivatives transform to KratosCore. We are waiting for the approval of #11253. |
|
It is very strange since in my local machine all tests run OK. But in github, the results in fluid cpp tests are different... How is it possible? |
It could be a memory error. Are you running the tests in FullDebug? |
Yes, I am running in FullDebug. That's why is so strange. |
|
Now, tests should work. I have checked the tests with |
|
@rubenzorrilla tests are runnning. We are ready to merge. |
rubenzorrilla
left a comment
There was a problem hiding this comment.
The issue with the virtual seems to be still pending. Aside of this everything looks good to me.
|
@rubenzorrilla, I have removed the |
| if(Dim == 2){ | ||
| if (NumNodes == 9 || NumNodes == 6 || NumNodes == 4) | ||
| mInterpolationOrder = 2; | ||
| } | ||
| else if(Dim == 3){ | ||
| if (NumNodes == 10 || NumNodes == 27) | ||
| mInterpolationOrder = 2; | ||
| } |
There was a problem hiding this comment.
As these are template parameters, in this case you can use if constexpr so you evaluate the if at compile time.
(I'd do this in a future PR considering that this is already taking a while...)
There was a problem hiding this comment.
Yeah, you are right
rubenzorrilla
left a comment
There was a problem hiding this comment.
No more changes in base elements. Thanks.
📝 Description
This PR is aimed to include the porous version of Navier-Stokes via VMS for both projections, ASGS and OSS.
Please mark the PR with appropriate tags:
🆕 Changelog
alternative_qs_vms_dem_coupled.cpp,alternative_d_vms_dem_coupled.cpp,qs_vms_dem_coupled.cppandd_vms_dem_coupled.cppalternative_qs_vms_dem_coupled.cpp,alternative_d_vms_dem_coupled.cpp,qs_vms_dem_coupled.cppandd_vms_dem_coupled.cppelements.