adamantine-sim / adamantine

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

Zeros in the temperature introduced along MPI boundaries after adding material #212

Closed stvdwtt closed 1 year ago

stvdwtt commented 1 year ago

Every time that material is added in an MPI run, zeros are introduced along the MPI domain boundaries. At first I assumed this was a ghost cell issue, but adding a simple temperature.update_ghost_values() after the call to add_material doesn't do anything. I'm not sure when this started happening.

@Rombur, I can keep digging, but if it's obvious to you what's wrong, let me know.

stvdwtt commented 1 year ago

Inputs: mpi_zeros_inputs.zip

Temperature:

image

MPI domains:

image
Rombur commented 1 year ago

The problem is from https://github.com/adamantine-sim/adamantine/blob/a9c99e22cf1eaad22cd22c63119276f302607ec9/source/ThermalPhysics.templates.hh#L844 If rw_solution contains a zero it will override the value and you will see it.

Under the following code https://github.com/adamantine-sim/adamantine/blob/a9c99e22cf1eaad22cd22c63119276f302607ec9/source/ThermalPhysics.templates.hh#L783-L787

Can you set the value of the ghosted elements to std::numeric_limits<double>::infinity()

If that doesn't work can you try to replace import(min) with import(insert)