quadgrid 0.1
simple cartesian quad grid with particles for c++/octave
make_input_json.m File Reference

Functions

 fwrite (fid, str, 'char')
 
 fclose (fid)
 

Variables

in grid_properties = struct ('hx', .1, 'hy', .1, 'nx', 100, 'ny', 100)
 
 num_global_nodes = (in.grid_properties.nx+1)*(in.grid_properties.ny+1)
 
 Z = zeros (num_global_nodes, 1)
 
 x = linspace (0, in.grid_properties.hx*in.grid_properties.nx, 100)
 
 y = linspace (0, in.grid_properties.hy*in.grid_properties.ny, 100)
 
in num_particles = numel (in.x)
 
in iprops label = [0:numel(in.x)](:)
 
in dprops
 
in grid_vars
 
 str = jsonencode (in)
 
 fid = fopen ('input.json', 'w')
 

Function Documentation

◆ fclose()

fclose ( fid  )

◆ fwrite()

fwrite ( fid  ,
str  ,
'char'   
)

Variable Documentation

◆ dprops

in dprops
Initial value:
= struct ('M', ones(in.num_particles, 1), ...
'Vx', ones(in.num_particles, 1), ...
'Vy', zeros(in.num_particles, 1), ...
'RHO', zeros(in.num_particles, 1), ...
'DivV', zeros(in.num_particles, 1), ...
'P', zeros(in.num_particles, 1), ...
'IE', zeros(in.num_particles, 1), ...
'Area', zeros(in.num_particles, 1), ...
'MVx', ones(in.num_particles, 1), ...
'MVy', ones(in.num_particles, 1), ...
'Zeros', zeros(in.num_particles, 1), ...
'Ax', zeros(in.num_particles, 1), ...
'Ay', zeros(in.num_particles, 1), ...
'Vbarx', zeros(in.num_particles, 1), ...
'Vbary', zeros(in.num_particles, 1), ...
'printVx', zeros(in.num_particles, 1), ...
'printVy', zeros(in.num_particles, 1))

◆ fid

fid = fopen ('input.json', 'w')

◆ grid_properties

in grid_properties = struct ('hx', .1, 'hy', .1, 'nx', 100, 'ny', 100)

◆ grid_vars

in grid_vars
Initial value:
= struct ('m', Z, 'fx', Z, 'fy', Z, ...
'mvx', Z, 'mvy', Z, 'vx', Z, ...
'vy', Z, 'ax', Z, 'ay', Z)
Z
Definition: make_input_json.m:4

◆ label

in iprops label = [0:numel(in.x)](:)

◆ num_global_nodes

num_global_nodes = (in.grid_properties.nx+1)*(in.grid_properties.ny+1)

◆ num_particles

in num_particles = numel (in.x)

◆ str

str = jsonencode (in)

◆ x

in x = linspace (0, in.grid_properties.hx*in.grid_properties.nx, 100)

◆ y

in y = linspace (0, in.grid_properties.hy*in.grid_properties.ny, 100)

◆ Z

Z = zeros (num_global_nodes, 1)