KratosMultiphysics / Kratos

Kratos Multiphysics (A.K.A Kratos) is a framework for building parallel multi-disciplinary simulation software. Modularity, extensibility and HPC are the main objectives. Kratos has BSD license and is written in C++ with extensive Python interface.
https://kratosmultiphysics.github.io/Kratos/
Other
1.05k stars 246 forks source link

[SMApp] Adding 2D truss elements 2N and 3N #12837

Closed AlejandroCornejo closed 1 week ago

AlejandroCornejo commented 2 weeks ago

📝 Description Adding 2 and 3 noded plane truss elements. Classic implementation of linear and quadratic FE with numerical integration. I am reusing the truss constitutive law already existing in the app (with a minor modification). Test added for each truss element. They are able to print axial forces and strains.

Template implementation for efficiency.

@RiccardoRossi @WPK4FEM

loumalouomega commented 2 weeks ago

CI fails

AlejandroCornejo commented 2 weeks ago

Anyone knows how to sort this CI error out? @roigcarlo

Kratos::KratosStructuralMechanicsApplication::mLinearTrussElement2D3N' will be initialized after [-Werror=reorder]
  285 |     const LinearTrussElement2D<3> mLinearTrussElement2D3N;

I cannot reproduce it in my pc, either with WIN and WSL linux...

roigcarlo commented 2 weeks ago

This is a warning that appears as an error because of the CI.

Its telling you that in the class creator you have a member initializer list which has a different order than the member declaration. In spanish:

class foo {
    //     This one is an error. Should be mArg2(), mArg3()
    //                  |
    // -----------------V    
    foo(): mArg1(), mArg3(), mArg2() { ... }

    int mArg1;
    int mArg2;
    int mArg3;
}

Just change the order of the affected variable in the initialization list and should be fixed.

Edit: Fun fact, the warning has little to do with the construction order, its better to do it this way because the destructor uses the reverse order when destroying the class and can only obtain such order from the declaration, and not the initialization, and this one can indeed lead to problems.

AlejandroCornejo commented 1 week ago

@loumalouomega now it passes!

loumalouomega commented 1 week ago

@loumalouomega now it passes!

Huuuum, how do I know that it actually passes and it is not the evil genius changing my perception of it?, I compile therefore I exist?