-
Notifications
You must be signed in to change notification settings - Fork 248
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
[SMApp] Adding 2D truss elements 2N and 3N #12837
[SMApp] Adding 2D truss elements 2N and 3N #12837
Conversation
CI fails |
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.
Once CI passes Okay
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.
minor comments 👍
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.
2 things:
- can you please add cpp test for those fcts
- are they really truss specific or do they require certain dofs?
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.
The additions to this file are basic rotation of displacement DoFs, just lke in beams but eliminating the rotation DoF. If they are tested in the general python test is it necessary to add a cpp?
* @author Alejandro Cornejo | ||
*/ | ||
template <SizeType TNNodes> | ||
class KRATOS_API(STRUCTURAL_MECHANICS_APPLICATION) LinearTrussElement2D |
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.
whats the difference to the existing truss elements?
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.
These are 2D elements (thecurrent ones are just 3D). Besides, we use numerical integration so it is general in case a custom constitutive law is used.
if constexpr (NNodes == 2) { | ||
mThisIntegrationMethod = GeometryData::IntegrationMethod::GI_GAUSS_1; | ||
} else { | ||
mThisIntegrationMethod = GeometryData::IntegrationMethod::GI_GAUSS_2; |
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 duplicated several times, can you please refactor to a function?
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.
done
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... |
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. |
@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? |
📝 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