Particle-advection error occurs only in debug mode but not in release mode

Hi all,

I’m encountering an issue when running ASPECT in debug mode that does not appear in release mode.

In debug mode, the model crashes with the following error:

An error occurred in line <337> of file /simulator/initial_conditions.cc  
The violated condition was:  
  advection_field_has_been_found[advection_field] == true  

Additional information:  
  The field composition 0 (mantle) is marked as advected by particles,  
  but no particle property exists that is mapped to this field.  
  Make sure that the particle property exists and is mapped to the correct field in the parameter file.

However, when I run the exact same model using the release version of ASPECT, the simulation proceeds without any problem, and I get reasonable results.

Here are some additional details:

  • ASPECT version: 3.0

  • Dimension: 3D

  • The compositional field “mantle” is set to be advected by particles

  • I have enabled Particle properties = compositional field and attempted to map it accordingly

  • The behavior seems inconsistent between debug and release builds

My question is:

  • Why does this assertion fail only in debug mode?

  • Could this be caused by an uninitialized or incorrectly mapped particle property that the release version simply skips over?

  • What can I do to ensure consistency and avoid this issue?

Any insight or suggestions would be greatly appreciated!

Thanks in advance,

Jane

Hi Jane,

Can you post your PRM file or at minimum the subsection Compositional fields and subsection Particles portions of the PRM file?

Cheers,

John

@lij24 Regarding the question of why this only fails in debug mode: Because assertions are only checked in debug mode. In release mode, we simply don’t check, which then oftentimes means that results are nonsensical – the fact that they sometimes look “reasonable” notwithstanding.

In your case, the error message is actually quite detailed. Do you have a particle property called mantle?

Best

W.