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.02k stars 244 forks source link

ShapeOptimizationApplication: Reset dof results at the beginning of each optimization iteration #1309

Closed armingeiser closed 6 years ago

armingeiser commented 6 years ago

In shape optimization, we calculate the primal solution several times, between the solution steps, we are modifying the shape of the structure. The problem is, that the solution from the previous solution step remains stored in the variables, and if the element calculates a nonlinear stiffness matrix (like I assume it is the case for the e.g. ShellThinElement3D3N) in a linear static analysis only a delta u is calculated, which is wrong in this case.

We need to reset the dof results in order to solve the linear system correctly.

I suggest a function at the modelpart, that is able to do so, without affecting e.g. non zero dirichlet conditions.

loumalouomega commented 6 years ago

Can the problem be solved if you move the mesh?

armingeiser commented 6 years ago

At the moment we solve it by looping the nodes and set the DISPLACEMENT and ROTATION to 0.0 at the beginning of each iteration step, in our main optimization script. But I think we need to find a more robust way to deal with this in the optimization application.

Mesh motion will not affect this problem , i think. The point is that we are cloning the time step in order to "simulate" the optimization iteration, and this is why the structural mechanics application thinks it should use the solution from the previous step, whereas it should do a completely new solution.

loumalouomega commented 6 years ago

Huuuum, any suggestion @RiccardoRossi ?

RiccardoRossi commented 6 years ago

Hi @armingeiser, as @djvicente suggested, you do need to also reset the Coordinates to the InitialCoordinates.

If you were to use the processes, the clean solution would be to have a process "assign_initial_conditions", to be called every time you restart your calculations. that would give a rather clean solution.

would that do?

If your problem is to restart your ProcessInfo and modelpart to zero we can speak about how to do that

loumalouomega commented 6 years ago

@RiccardoRossi I am @loumalouomega not @djvicente

RiccardoRossi commented 6 years ago

apologies @loumalouomega @djvicente i confused myself

djvicente commented 6 years ago

Do not worry at all @RiccardoRossi. I have just joined the Kratos comunity this week, so this mistake has allowed me to know how do you work here ;)

RiccardoRossi commented 6 years ago

closing as inactive for a while