Basilisk CFD
Adaptive Cartesian mesh PDE framework
Loading...
Searching...
No Matches
bview.c
Go to the documentation of this file.
1/** @file bview.c
2 */
3/**
4# Basilisk View "dump files" server
5
6This can be used to interactively display [dump files](output.h#dump)
7using the [javascript interface](jview/README).
8
9Typical usage is:
10
11~~~bash
12bview3D /path/to/file/dump
13~~~
14
15(note that the appropriate 2D/3D version must be chosen). The
16connection URL for the client will then be displayed.
17
18The `-d` or `-debug` option can be used to follow the server
19activity. */
20
21#define DISPLAY 0
22#define DISPLAY_NO_CONTROLS
23#include "display.h"
24
25int main (int argc, char * argv[])
26{
27 char * file = "dump"; argc--; argv++;
28 for (char * arg = *argv; argc; argc--, arg = *++argv) {
29 if (!strcmp (arg, "-debug") || !strcmp (arg, "-d"))
30 Display.debug = true;
31 else
32 file = arg;
33 }
34
35 if (!restore (file = file, list = all)) {
36 fprintf (stderr, "%s: could not restore from '%s'\n", argv[0], file);
37 exit (1);
38 }
41
42 fputc ('\n', stderr);
43 display_url (stderr);
44 fputc ('\n', stderr);
45
46 display ("box();");
47 while (1) {
48 if (display_poll (-1))
49 display_update (INT_MAX);
50 }
52}
int main(int argc, char *argv[])
Definition bview.c:25
define VT _attribute[s.i] v y scalar * list
Definition cartesian.h:276
scalar * all
Definition common.h:342
void display(const char *commands, bool overwrite=false)
Definition common.h:527
define sysmalloc malloc define syscalloc calloc define sysrealloc realloc define sysfree free define systrdup strdup define file
Definition config.h:120
void display_url(FILE *fp)
Definition display.h:697
static struct @3 Display
static void display_destroy()
Definition display.h:720
int display_poll(int timeout)
Definition display.h:645
static void display_update(int i)
Definition display.h:569
void(* restriction)(Point, scalar)
void fields_stats(scalar *list=all)
This function returns a summary of the currently-defined fields.
Definition utils.h:382