pulsed liqiud jet (pid & npe)

151 views
Skip to first unread message

nader nekoubin

unread,
Nov 27, 2018, 7:53:38 AM11/27/18
to basilisk-fr
hello all,

I am working with two-phase.h, and I am trying to understand the example about pulsed liquid jet. However, I cannot understand the following commands.

  scalar pid[];
  foreach()
    pid[] = fmod(pid()*(npe() + 37), npe());
  boundary ({pid}); // not used for the moment
  view (camera = "iso",
	fov = 14.5, tx = -0.418, ty = 0.288,
	width = 1600, height = 1200);
  clear();
  draw_vof ("f");
#endif // 3D
  save ("movie.mp4");
}


event snapshot (t = 0.1; t += 0.1; t <= 3.8) {
  char name[80];
  sprintf (name, "snapshot-%g", t);
  scalar pid[];
  foreach()
    pid[] = fmod(pid()*(npe() + 37), npe());
  boundary ({pid});
  dump (name);
}

What is the meaning of
pid and npe in the above commands? Also, what is the meaning of tx, ty and fov? How do they
arrange the camera in view?
Please guide me in this regard,

Best regards,
Nader

Wojciech Aniszewski

unread,
Nov 27, 2018, 8:11:35 AM11/27/18
to nader nekoubin, basilisk-fr
1. view.h, line 22:

* *tx*, *ty*: shifts the camera center point.

2. pid() - most likely the process id of current process (in context of MPI, of course).
3. npe() - most likely the total number of processes in a parallel run.

best
w


On Tue, Nov 27, 2018 at 04:53:38AM -0800, nader nekoubin wrote:
> hello all,
>
> I am working with two-phase.h, and I am trying to understand the example
> about pulsed liquid jet. However, I cannot understand the following
> commands.
>
> scalar pid[];
> foreach <http://basilisk.fr/Basilisk%20C#iterators>()
> pid[] = fmod(pid()*(npe() + 37), npe());
> boundary <http://basilisk.fr/Basilisk%20C#boundary-conditions> ({pid}); // not used for the moment
> view <http://basilisk.fr/src/draw.h#view> (camera = "iso",
> fov = 14.5, tx = -0.418, ty = 0.288,
> width = 1600, height <http://basilisk.fr/src/heights.h#height> = 1200);
> clear <http://basilisk.fr/src/draw.h#clear>();
> draw_vof <http://basilisk.fr/src/draw.h#draw_vof> ("f");#endif // 3D
> save <http://basilisk.fr/src/view.h#save> ("movie.mp4");
> }
>
>
> event <http://basilisk.fr/Basilisk%20C#events> snapshot (t = 0.1; t += 0.1; t <= 3.8) {
> char name[80];
> sprintf <http://man7.org/linux/man-pages/man3/sprintf.3.html> (name, "snapshot-%g", t);
> scalar pid[];
> foreach <http://basilisk.fr/Basilisk%20C#iterators>()
> pid[] = fmod(pid()*(npe() + 37), npe());
> boundary <http://basilisk.fr/Basilisk%20C#boundary-conditions> ({pid});
> dump <http://basilisk.fr/src/output.h#dump> (name);
> }
>
> What is the meaning of pid and npe in the above commands? Also, what is the meaning of tx, ty and fov? How do they
> arrange the camera in view?
> Please guide me in this regard,
>
> Best regards,
> Nader
>
> --
> You received this message because you are subscribed to the Google Groups "basilisk-fr" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to basilisk-fr...@googlegroups.com.
> To post to this group, send email to basil...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/basilisk-fr/4e1e0ae4-b79b-4ed5-a5a1-031eb44dacc2%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


--
/^..^\ Wojciech (Wojtek) ANISZEWSKI ► Post-doctoral Researcher
( (••) ) [Fr: vôitek anichévsky] ► Sorbonne University
(|)_._(|)~ [Eng: voyteck aanishevsky] ► Institut ∂'Alembert
GPG key ► Web [English] https://tinyurl.com/y73t4xsg [old! 2015]
ID:AC66485E ► [Polish ] https://tinyurl.com/yckark7n [old! 2014]
signature.asc

Antoon van Hooft

unread,
Nov 27, 2018, 8:18:03 AM11/27/18
to basilisk-fr
Hallo nader,

Here as similar question is raised with regards to the meaing "pid[ ]" field:
pid() and npe() are macros defined in src/common.h and depend on how you compile/run the code.

As for the arguments to the "view" function. On the Basilisk website functions are often clickable as links that take you to their description/implementation. Please follow this link and report if it remains unclear.

Antoon
Message has been deleted

nader nekoubin

unread,
Nov 27, 2018, 12:42:24 PM11/27/18
to basilisk-fr
Dear Antoon,

I read your description about this issue and it helps me to understand the meaning of pid and npe. I really appreciate your help and guidance.
Unfortunately, the pid and npe are not clickable in the code I investigate. I also saw the view.h code, however I could not find the related links.

Best regards,
Nader

nader nekoubin

unread,
Nov 27, 2018, 1:04:10 PM11/27/18
to basilisk-fr
Hello Antoon,

Could you please explain about the meaning of pid and npe when employing snapshot?
for example:

event snapshot (t = 0.1; t += 0.1; t <= 3.8) {
  char name[80];
  sprintf (name, "snapshot-%g", t);
  scalar pid[];
  foreach()
    pid[] = fmod(pid()*(npe() + 37), npe());
  boundary ({pid});
  dump (name);
}

Best regards,
Nader

On Tuesday, 27 November 2018 16:48:03 UTC+3:30, Antoon van Hooft wrote:
Reply all
Reply to author
Forward
0 new messages