adamantine-sim / adamantine

Software to simulate heat transfer for additive manufacturing
https://adamantine-sim.github.io/adamantine/
Other
32 stars 9 forks source link

Fix issue when adding material for thermo-mechanical simulation #218

Closed Rombur closed 1 year ago

Rombur commented 1 year ago

Fix #187

Rombur commented 1 year ago

There is a bug here https://github.com/adamantine-sim/adamantine/blob/1f3dbfe963d0a2913354c35bedcac9b0205b6c79/source/ThermalPhysics.templates.hh#L594

Using at crashes the code. I don't think this is related to this PR

Rombur commented 1 year ago

The code above is wrong. It won't work with MPI because cell->active_cell_index() takes into account ghost and artificial cells.

Rombur commented 1 year ago

It's also wrong with FE_Nothing because _has_melted has the size of the number of active cells which have fe index = 0 which is less than the number of cells when there is FE_Nothing.

Rombur commented 1 year ago

The tests are now passing CI

I also have a clean results using ctest -T memcheck which uses valgrind and it looks clean (only leaks from MPI)

Rombur commented 1 year ago

There is a bug here

https://github.com/adamantine-sim/adamantine/blob/1f3dbfe963d0a2913354c35bedcac9b0205b6c79/source/ThermalPhysics.templates.hh#L594

Using at crashes the code. I don't think this is related to this PR

Actually we have the same bug here: https://github.com/adamantine-sim/adamantine/blob/cb20d62c8c37a47d920bc5f34f668e7878ac59aa/source/MechanicalOperator.cc#L200

This is going to be harder to fix because we don't know in which order the cells are visited