Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matlab update #169

Merged
merged 25 commits into from
Oct 27, 2023
Merged

Matlab update #169

merged 25 commits into from
Oct 27, 2023

Conversation

abaillod
Copy link
Collaborator

I updated the matlab tools with my own subroutines. I did some cleanup, and added the routine "SPEC_Namelist" which allows you to read, edit, and write SPEC input files, as well as plot the initial guess.

I think it is safe to merge, since I didn't touch SPEC source, only the matlab tools. Let me know if you find a bug or if a feature is missing!

@abaillod abaillod requested review from zhisong and jloizu May 10, 2022 09:42
@jloizu
Copy link
Collaborator

jloizu commented May 16, 2022

I started testing these updated tools.

  • I think there is a bug in get_spec_jacobian.m, line 26, what is "<<<<<<< HEAD"? This gives errors.
  • Could you explain how to use the SPEC_Namelist? why is it in some other directory (and inside that, there are also other directories with other routines...a bit confusing to me, sorry!)

@abaillod
Copy link
Collaborator Author

Thanks for testing!

I don't see the problematic line you are talking about in get_spec_jacobian.m. In the latest version of the matlab_update branch, line 26 is

% Check input
Istellsym = data.input.physics.Istellsym;
if Istellsym==0
error('Non stellarator symmetric not implemented')
end
Rarr = get_spec_R_derivatives(data, lvol, sarr, tarr, zarr, 'R');

Regarding the SPEC_Namelist; you can just do

nm = SPEC_Namelist('input.sp')

Then you can do nm. and double tabs to see all methods associated to SPEC_Namelist. Use the help to print some information about each element of the class:

>> nm = SPEC_Namelist('final.sp');
>> nm.
change_boundary_representation  lists                           plot_initial_guess              truncate_fourier_series         
diagnosticslist                 locallist                       plot_plasma_boundary            write_input_file                
get_fourier_harmonics           numericlist                     read_initial_guess              
globallist                      physicslist                     screenlist                      
initial_guess                   plot_computational_boundary     set_fourier_harmonics           
>> help nm.truncate_fourier_series
--- help for SPEC_Namelist/truncate_fourier_series ---

 
  TRUNCATE_FOURIER_SERIES( MPOL, NTOR )
  =====================================
 
  Truncates all spectral quantities to the requested poloidal
  and toroidal resolution
 
  INPUTS
  ------
    -Mpol: Poloidal resolution
    -Ntor: Toroidal resolution
 
  OUTPUT
  ------
    -OBJ: Truncated instance of SPEC_Namelist

I should probably write a tutorial for this class; I will write one down this week.

@jloizu
Copy link
Collaborator

jloizu commented May 16, 2022

OK the problem with the jacobian was related to internal file conflicts I had not resolved myself.

One small issue: the routine plot_spec_poincare.m is not consistent between arguments and help – please explain in the help what is varargin.

@jloizu
Copy link
Collaborator

jloizu commented May 16, 2022

Another issue: when running plot_spec_modB_boundary.m, I get an error message "Error using get_spec_R_derivatives, Too many output arguments".

@abaillod
Copy link
Collaborator Author

I pushed a new commit.

  • I cleaned up the SPEC_Namelist directory, there is now only the matlab class and the read / write routine for FORTRAN namelists.
  • I fixed a typo with get_spec_regularisation_factor
  • I extended the description of plot_spec_poincare to explain what varargin is.

Regarding your error in plot_spec_modB_boundary, I don't have it. Is it possible that you have another internal file conflict?

@jloizu
Copy link
Collaborator

jloizu commented May 18, 2022

OK so my internal conflicts were finally solved (thanks!).

I found some bugs in a number of routines, and fixed them, and pushed changes – please check.

Doxygen automatic testing seems to fail  – please have a look.

After that, we'll be almost ready to merge!

@jonathanschilling
Copy link
Collaborator

@jloizu
I fixed the doxygen version in the master branch, but currently it fails due to some "$" in the comments which confuse LaTeX when generating the PDF version of the documentation.

@abaillod
Copy link
Collaborator Author

Sorry this thing completely got out of my mind.

I tested most of the plotting routines and everything seems to be fine on my side. I vote for a merge!

@zhisong
Copy link
Collaborator

zhisong commented Nov 25, 2022

Does anyone know what happens to the cmake tests? They seem to fail since 4 months ago.

@jonathanschilling
Copy link
Collaborator

Does anyone know what happens to the cmake tests? They seem to fail since 4 months ago.

Seems due to pip being to old on the provided docker image (see https://stackoverflow.com/a/63457606). Fixed now.

@jonathanschilling
Copy link
Collaborator

I vote for a merge!

Me too :-)

@smiet
Copy link
Collaborator

smiet commented Oct 16, 2023

There seemed widespread agreement on merging this with master, but this was never completed.
I am re-triggering the checks and waiting for 24 hours, if nobody objects, I will merge this into master.

@smiet smiet merged commit a41e487 into master Oct 27, 2023
10 checks passed
@smiet smiet deleted the matlab_update branch March 6, 2024 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants