113 while ((
c + 1)->expr)
118 (
c + 1)->expr =
NULL;
181 p->sx =
p->sy =
p->sz = 1.;
182 p->quat[0] =
p->quat[1] =
p->quat[2] = 0;
p->quat[3] = 1;
187 p->bg[0] = 1;
p->bg[1] = 1;
p->bg[2] = 1;
189 p->bg[0] = 0.3;
p->bg[1] = 0.4;
p->bg[2] = 0.6;
195 p->width = 600*
p->samples,
p->height = 600*
p->samples;
280 m[0][0] = 0.,
m[0][1] = 0.,
m[0][2] = -1.;
281 m[1][0] = 0.,
m[1][1] = -1.,
m[1][2] = 0.;
282 m[2][0] = 1.,
m[2][1] = 0.,
m[2][2] = 0.;
338 for (
int i = 0;
i < *len;
i++,
rin++,
out++)
374 for (
int i = 0;
i < *len;
i++,
rin++,
out++)
375 if (
out->depth >
rin->depth)
397 unsigned char * ptr =
image;
399 for (
int i = 0;
i <
size;
i++) {
400 for (
int j = 0;
j < 4;
j++)
406 unsigned char * ptr =
image;
408 for (
int j = 0;
j < 4;
j++)
451 view->active =
false;
573 fprintf (
ferr,
"save(): error: the '%s' format is no longer supported\n",
578 "view (fov = %g, quat = {%g,%g,%g,%g}, "
581 "width = %d, height = %d, samples = %d"
602 fprintf (
ferr,
"save(): error: the '%s' format is no longer supported\n",
632 while (*
s !=
'\0' && *
s !=
'#') {
672 else if (!
strcmp (
s,
"dump")) {
678 else if (!
strcmp (
s,
"input_gfs")) {
689 else if (!
strcmp (
s,
"save")) {
696 else if (!
strcmp (
s,
"load")) {
713 else if (
s[0] !=
'\n' &&
s[0] !=
'\0')
735 char *
s = (
char *)
buf->p;
740 if (*
s ==
'\n' && ++
s > start) {
741 char line[
s - start + 1];
743 line[
s - start] =
'\0';
vector g[]
We store the combined pressure gradient and acceleration field in g*.
define m((k)==0 &&(l)==0 &&(m)==0) macro2 foreach_point(double _x=0.
define VT _attribute[s.i] v y scalar * list
void free_solver_func_add(free_solver_func func)
static uint32_t a32_hash(const Adler32Hash *hash)
static void a32_hash_add(Adler32Hash *hash, const void *data, size_t size)
static void a32_hash_init(Adler32Hash *hash)
if __APPLE__ include< stdint.h > include fp_osx h endif if _GPU define enable_fpe(flags) @else @ define enable_fpe(flags) feenableexcept(flags) @endif @ define disable_fpe(flags) fedisableexcept(flags) static void set_fpe(void)
#define qcalloc(size, type)
define sysmalloc malloc define syscalloc calloc define sysrealloc realloc define sysfree free define systrdup strdup define line calloc(n, s) @ define prealloc(p
define sysmalloc malloc define syscalloc calloc define sysrealloc realloc define sysfree free define systrdup strdup define line line line line op define op
define sysmalloc malloc define syscalloc calloc define sysrealloc realloc define sysfree free define systrdup strdup define file
define sysmalloc malloc define syscalloc calloc define sysrealloc realloc define sysfree free define systrdup strdup define line line realloc(p, s) @ define pfree(p
define sysmalloc malloc define syscalloc calloc define sysrealloc realloc define sysfree free define systrdup strdup define line line line line strdup(s) @ define tracing(...) @ define end_tracing(...) @define tid() 0 @define pid() 0 @define npe() 1 @define mpi_all_reduce(v
void view(float tx=0., float ty=0., float fov=0., float quat[4]={0}, float sx=1., float sy=1., float sz=1., unsigned width=800, unsigned height=800, unsigned samples=4, float bg[3]={0}, float theta=0., float phi=0., float psi=0., bool relative=false, float tz=0., float near=0., float far=0., float res=0., char *camera=NULL, MapFunc map=NULL, int cache=0, float p1x=0., float p1y=0., float p2x=0., float p2y=0., bview *view1=NULL)
trace bool draw_vof(char *c, char *s=NULL, bool edges=false, double larger=0., int filled=0, char *color=NULL, double min=0, double max=0, double spread=0, bool linear=false, Colormap map=jet, float fc[3]={0}, float lc[3]={0}, float lw=1., bool expr=false, bool cbar=false, float size=15, float pos[2]={-.95, -.95}, char *label="", double lscale=1, bool horizontal=false, bool border=false, bool mid=false, float fsize=50, char *format="%g", int levels=50)
trace bool box(bool notics=false, float lc[3]={0}, float lw=1.)
*cs[i, 0, 0] a *[i -1, 0, 0] j
#define GL_COLOR_BUFFER_BIT
#define GL_DEPTH_BUFFER_BIT
static int include(char *file, FILE *fin, FILE *fout)
void(* restriction)(Point, scalar)
FILE * open_image(const char *file, const char *options)
static bool which(const char *command)
static const char * is_animation(const char *file)
void close_image(const char *file, FILE *fp)
static char * mystrtok(char *str, const char *delim)
int parse_params(Params *params)
define n sizeof(Cell))) @define fine(a
void fields_stats(scalar *list=all)
This function returns a summary of the currently-defined fields.
static void bview_draw(bview *view)
trace bool save(char *file=NULL, char *format="ppm", char *opt=NULL, FILE *fp=NULL, float lw=0, int sort=0, int options=0, FILE *checksum=NULL, bview *view=NULL)
static bview * _view
For the moment there is a single (static) current view.
bview * draw()
This is called by graphics primitives before drawing.
static void destroy_view()
The current view needs to be destroyed when we exit Basilisk.
static void redraw(bool clear=true)
The main drawing function.
static cexpr * add_cexpr(cexpr *cache, int maxlen, const char *expr, scalar s)
static char * remove_blanks(char *line)
static scalar get_cexpr(cexpr *cache, const char *expr)
void bview_destroy(bview *p)
The destructor method.
static trace pointer compose_image(bview *view)
static void free_cexpr(cexpr *cache)
bool load(FILE *fp=NULL, char *file=NULL, Array *buf=NULL)
bool process_line(char *line)
bview * bview_new()
The allocator method.