Skip to content

Commit

Permalink
avoid error in meem file generation if in wrong folder
Browse files Browse the repository at this point in the history
  • Loading branch information
rebeccamccabe committed Oct 28, 2024
1 parent e8989d7 commit 28606b1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mdocean/simulation/modules/MEEM/run_MEEM.m
Original file line number Diff line number Diff line change
Expand Up @@ -439,11 +439,16 @@ syms C_1n_1(n) C_1m_2(m) C_2n_1(n) C_2m_2(m) B_k(k) % unknown coefficients
% plot(full_line, bars(2)*[1,1], 'k') % second horizontal
% plot(full_line, bars(3)*[1,1], 'k') % third horizontal

matlabFunction(A,b,c,c_0,'File',['simulation/modules/MEEM/generated/A_b_c_matrix_' fname], 'Vars',[a1,a2,d1,d2,h,m0,m_k_const]);
folder = 'simulation/modules/MEEM/generated/';
if ~isfolder(folder)
folder = '';
warning("Can't find folder for MEEM generated functions. Generating in current directory instead.")
end
matlabFunction(A,b,c,c_0,'File',[folder 'A_b_c_matrix_' fname], 'Vars',[a1,a2,d1,d2,h,m0,m_k_const]);

matlabFunction(hydro_nondim_NMK,phi_i1_NMK,phi_i2_NMK,phi_e_NMK,phi_p_i1_NMK,phi_p_i2_NMK,...
phi_h_i1_NMK,phi_h_i2_NMK,v_1_r_NMK,v_1_z_NMK,v_2_r_NMK,v_2_z_NMK,v_e_r_NMK,v_e_z_NMK,...
'File',['simulation/modules/MEEM/generated/hydro_potential_velocity_fields_' fname],...
'File',[folder 'hydro_potential_velocity_fields_' fname],...
'Vars',[a1,a2,d1,d2,h,m0,m_k_const,unknowns_const,r,z]);

end
Expand Down

0 comments on commit 28606b1

Please sign in to comment.