Xiangyu-Hu / SPHinXsys

SPHinXsys provides C++ APIs for engineering simulation and optimization. It aims at complex systems driven by fluid, structure, multi-body dynamics and beyond. The multi-physics library is based on a unique and unified computational framework by which strong coupling has been achieved for all involved physics.
https://www.sphinxsys.org/
Apache License 2.0
259 stars 197 forks source link

Re-organize the code structure of continuum dynamics by using ComplexInteraction #516

Closed Shuaihao-Zhang closed 2 months ago

Shuaihao-Zhang commented 2 months ago

There are two main changes in this PR.

(1) Refer to the current fluid_integration, I re-organized the code structure of continuum_dynamics by using ComplexInteraction.

(2) I slightly modified the constraint_dynamics. Specifically, I made the data type (such as SolidDataSimple) as a template. Then I can use the algorithms of constraint_dynamics under the namespace solid_dynamics directly in the continuum_dynamics. And the codes for continuum_dynamics are largely simplified. For example. previously, I need to re-write the algorithms of constraint_dynamics in the continuum_dynamics: https://github.com/Xiangyu-Hu/SPHinXsys/blob/dedd19eef73dbbb287f714a27c56605a450a5dd8/tests/user_examples/extra_src/shared/general_continuum/continuum_dynamics/continuum_dynamics_inner.h#L98-L167 Now, with the PR, we just need three lines of code: https://github.com/Shuaihao-Zhang/SPHinXsys/blob/0dbd8f57341be04655bda104e661305d72bc8e07/tests/user_examples/extra_src/shared/general_continuum/continuum_dynamics/continuum_integration.h#L72-L74 image

DrChiZhang commented 2 months ago

In the continuum dynamics, change "relaxation" to "integration" seems not a good consistency with the previous naming pattern.

Shuaihao-Zhang commented 2 months ago

In the continuum dynamics, change "relaxation" to "integration" seems not a good consistency with the previous naming pattern.

Yes. I combined the continuum_dynamics_inner and continuum_dynamics_complex into one file continuum_integration. This is because, for plastic dynamics, I integrated the PlasticRelaxationInner and PlasticRelaxationComplex and replaced them with PlasticIntegration, just like what we did for fluid_dynamics. I am not sure if this is good. I need to discuss with Prof. Hu @Xiangyu-Hu .

Xiangyu-Hu commented 2 months ago

In the continuum dynamics, change "relaxation" to "integration" seems not a good consistency with the previous naming pattern.

Yes. I combined the continuum_dynamics_inner and continuum_dynamics_complex into one file continuum_integration. This is because, for plastic dynamics, I integrated the PlasticRelaxationInner and PlasticRelaxationComplex and replaced them with PlasticIntegration, just like what we did for fluid_dynamics. I am not sure if this is good. I need to discuss with Prof. Hu @Xiangyu-Hu .

Yes. We are migrating to use "integration" to naming these classes. Actually, in order to avoid possible miss-understanding for new contributors, will also need to renaming these corresponding objects in the test classes. Also I am planning to identify the difference methods with and without time integration.

Xiangyu-Hu commented 2 months ago

@Shuaihao-Zhang I think that your contribution on continuum mechanics is for general purposes and should be put into the main library and tests other than in user examples. Could you move them and then we can merge the branch?

Shuaihao-Zhang commented 2 months ago

@Shuaihao-Zhang I think that your contribution on continuum mechanics is for general purposes and should be put into the main library and tests other than in user examples. Could you move them and then we can merge the branch?

@Xiangyu-Hu No problem. I will do this.