# Question about adding wave gages

**URL:** <https://gpusph.discourse.group/t/question-about-adding-wave-gages/137>\
**Category:** Issues\
**Created:** [February 25, 2021, 3:32am UTC](https://gpusph.discourse.group/t/question-about-adding-wave-gages/137 "2021-02-25T03:32:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![brittlyd](https://yyz2.discourse-cdn.com/free1/user_avatar/gpusph.discourse.group/brittlyd/32/25_2.png) [@brittlyd](https://gpusph.discourse.group/u/brittlyd)\
**Post date:** [February 25, 2021, 3:32am UTC](https://gpusph.discourse.group/t/question-about-adding-wave-gages/137/1 "2021-02-25T03:32:20Z")

</div>

Hi!

I would like to start adding wave gages to my wave tank simulation, but I noticed that adding wave gages changes the amount of fluid particles at each time step. The way I am currently post-processing my code, I usually count on the number of fluid, fixed, floating, and moving particles being constant (as I feel like they usually should be for a simulation that is behaving has it should). Is the number of fluid particles supposed to change when I add a wave gage? And if so, why does it do that and can I adjust my code so that I can have a constant number of fluid particles? Or am I doing something wrong in general?

Thank you!

---

<div class="post-metadata">

**Author:** ![giuseppe.bilotta](https://yyz2.discourse-cdn.com/free1/user_avatar/gpusph.discourse.group/giuseppe.bilotta/32/72_2.png) [@giuseppe.bilotta](https://gpusph.discourse.group/u/giuseppe.bilotta)\
**Post date:** [March 3, 2021, 11:29am UTC](https://gpusph.discourse.group/t/question-about-adding-wave-gages/137/2 "2021-03-03T11:29:29Z")

</div>

Hello @brittlyd,

wave gages are part of the post-processing and adding them (with `add_gage`) should not have any impact on the number of fluid particles. I’ve just done a quick check by adding a gage to the `DamBreak3D` test case, and the number of particles does not change for me, so if this is indeed the case in your test cases there’s definitely something wrong. How are you adding the gages?

---

<div class="post-metadata">

**Author:** ![brittlyd](https://yyz2.discourse-cdn.com/free1/user_avatar/gpusph.discourse.group/brittlyd/32/25_2.png) [@brittlyd](https://gpusph.discourse.group/u/brittlyd)\
**Post date:** [April 7, 2021, 7:25pm UTC](https://gpusph.discourse.group/t/question-about-adding-wave-gages/137/3 "2021-04-07T19:25:14Z")

</div>

Sorry for the long response, I realized that the fluid particle type can be either 0, or 512 for fluid particles. When I figured that out, everything works. Thanks!

---

<div class="post-metadata">

**Author:** ![giuseppe.bilotta](https://yyz2.discourse-cdn.com/free1/user_avatar/gpusph.discourse.group/giuseppe.bilotta/32/72_2.png) [@giuseppe.bilotta](https://gpusph.discourse.group/u/giuseppe.bilotta)\
**Post date:** [April 8, 2021, 5:57am UTC](https://gpusph.discourse.group/t/question-about-adding-wave-gages/137/4 "2021-04-08T05:57:45Z")

</div>

Hello @brittlyd,

ah, I see. Within the code, the `info` field encodes information not only about the particle type, but also a number of flags. You can check the source file `src/particleinfo.h` for more information both about the flags and the macros and functions available to extract the relevant information, in particular `PART_TYPE` will extract only the type (`PT_FLUID` vs `PT_BOUNDARY`).

The reason why with wave gages some fluid particles have 512 encoded in the `.x` field is that wave gages automatically enable free surface detection (which is needed for them to work), and the particles on the surfaces have the `FG_SURFACE` flag encoded in their `.x` field.
