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

[Structural] Implementing quadratic elements #12855

Closed takeshimg92 closed 6 days ago

takeshimg92 commented 6 days ago

Description Sorry for the noobie question. I am investigating using higher-order elements -- in StructuralMechanics, specifically, expanding the current SmallDisplacement elements -- but I guess the question is more general. Assuming, say, quadratic elements for solids don't exist, how can I go about developing them?

In most FEM libraries, I would have access to the FE space and could choose by basis functions (e.g. Lagrange order 3). Since Kratos does things a bit differently, I am having a bit of difficulty finding out the "roadmap" to doing this. I guess I would have to create custom Elements, custom associated Conditions for the boundaries, but not sure what else.

Scope StructuralMechanics, but it applies in general.

rubenzorrilla commented 6 days ago

I think that these are already avaiblable, at least for the SmallDisplacement ones, which are implemented to leverage the Kratos geometries meaning that the element is somehow agnostic to the discretization under the hood.

loumalouomega commented 6 days ago

We have quadratic elements. The base solid elements are defined in function of it geometry, so despite not being templated the class, if the element is registered with the proper geometry will use a quadratic geometry. For example the small displacement element for quadratic tetrahedra iss SmallDisplacementElement3D10N, look at the names in the application file:

https://github.com/KratosMultiphysics/Kratos/blob/b29eccbacd1b6f8abd602a03dc24879c926e6244/applications/StructuralMechanicsApplication/structural_mechanics_application.cpp#L113

Yes, we are not working as FeniCS, so if you want something more advanced you may need to do a in pourpose development. For example if you want a cubic tetrahedra you will need to develop the corresponding geometry and then register the element (ass shown in my link) with the corresponding geometry.

loumalouomega commented 6 days ago

I think that these are already avaiblable, at least for the SmallDisplacement ones, which are implemented to leverage the Kratos geometries meaning that the element is somehow agnostic to the discretization under the hood.

More details in my answer.

takeshimg92 commented 6 days ago

Thank you both for the quick responses. So, currently there is a 1-1 relation between the geometry and the shape functions, and any other choice of basis that works with the same amount of nodes would have to be specified as a different element?

If I were to do that, what would be, grosso modo, the key steps?

loumalouomega commented 6 days ago

Thank you both for the quick responses. So, currently there is a 1-1 relation between the geometry and the shape functions, and any other choice of basis that works with the same amount of nodes would have to be specified as a different element?

If I were to do that, what would be, grosso modo, the key steps?

If you want to add new elements first add the corressponding geometry, and if the current element implementation doesn't fit your needs (because it assumes as you say a relationship 1-1) you can write a new one following a similar structure as the current one. Also you can suggest a modification fo the current one in order to be more generic if that doesn't add overhead. In any case first step would be to implement the geometry.

takeshimg92 commented 6 days ago

Understood. Thank you very much!