project-asgard / DG-SparseGrid

Matlab implementation of ASGarD
1 stars 2 forks source link

Output snapshot matrix of data with appended time slices #37

Open sbdepascuale opened 4 years ago

sbdepascuale commented 4 years ago

Is your feature request related to a problem? Please describe. Ln 400 of asgard.m at "saveOutput." When marked true code hits variable unknown error for "deg, LevX, and LevV" using the call to "project_diff1" in PDES/ folder. For example,

[f_err,f_wav,f_real,coord] = asgard(projecti_diff1,'lev',7,'deg',3,'timestep_method','BE', 'dt',dt,'num_steps',it,'quiet',true); Describe the solution you'd like It would be nice to have an option for asgard.m to output an indexed matrix of values including intermediate steps in the integration over the time loop defined in Ln 68 for variable "L." For example,

for L = 1:num_steps ... fval_real_accumulate(:,L) = fval_realspace; ... end save(fName,'fval_real_accumulate','coord','num_steps','dt'); end

Describe alternatives you've considered I modified the identified hardcoded conditional statement at Ln 400 as shown above, but it would be better to wrap the capability in a keyword argument to pass into the function similar to the plotting call.

Additional context The requirement for saving or creating a "snapshot matrix" is for integration with a DMD procedure that uses data arranged in "dimensions vs time" as "rows vs columns."

dlg0 commented 4 years ago

@sbdepascuale @lwonnell

Guys, I have added the following options to the reference branch ...

'save_output',true,'output_filename_id','some_string'

which will save the output that you both should be able to use for your work, and for @lwonnell specifically, the 'output_filename_id' option will allow you to append some string to the output file. Note that the pde, opts, dt etc variables are in the output file (stored as output/asgard-out.mat) so you don't need to explicitly put dt in the filename id.

lwonnell commented 4 years ago

When I run on fusiont5, I get the following error

Error in asgard (line 408) Undefined function 'append' for input arguments of type 'char'.