PageRenderTime 26ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/sctransp_1.m

http://edufem.googlecode.com/
MATLAB | 836 lines | 403 code | 147 blank | 286 comment | 46 complexity | 757a4798ca4f9f20905e8c6d29d0ed22 MD5 | raw file
  1. function varargout = sctransp_1(varargin)
  2. % SCTRANSP_1 M-file for sctransp_1.fig
  3. % SCTRANSP_1, by itself, creates a new SCTRANSP_1 or raises the existing
  4. % singleton*.
  5. %
  6. % H = SCTRANSP_1 returns the handle to a new SCTRANSP_1 or the handle to
  7. % the existing singleton*.
  8. %
  9. % SCTRANSP_1('CALLBACK',hObject,eventData,handles,...) calls the local
  10. % function named CALLBACK in SCTRANSP_1.M with the given input arguments.
  11. %
  12. % SCTRANSP_1('Property','Value',...) creates a new SCTRANSP_1 or raises the
  13. % existing singleton*. Starting from the left, property value pairs are
  14. % applied to the GUI before sctransp_1_OpeningFcn gets called. An
  15. % unrecognized property name or invalid value makes property application
  16. % stop. All inputs are passed to sctransp_1_OpeningFcn via varargin.
  17. %
  18. % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
  19. % instance to run (singleton)".
  20. %
  21. % See also: GUIDE, GUIDATA, GUIHANDLES
  22. % Edit the above text to modify the response to help sctransp_1
  23. % Last Modified by GUIDE v2.5 16-Apr-2012 12:29:21
  24. % Begin initialization code - DO NOT EDIT
  25. gui_Singleton = 1;
  26. gui_State = struct('gui_Name', mfilename, ...
  27. 'gui_Singleton', gui_Singleton, ...
  28. 'gui_OpeningFcn', @sctransp_1_OpeningFcn, ...
  29. 'gui_OutputFcn', @sctransp_1_OutputFcn, ...
  30. 'gui_LayoutFcn', [] , ...
  31. 'gui_Callback', []);
  32. if nargin && ischar(varargin{1})
  33. gui_State.gui_Callback = str2func(varargin{1});
  34. end
  35. if nargout
  36. [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
  37. else
  38. gui_mainfcn(gui_State, varargin{:});
  39. end
  40. % End initialization code - DO NOT EDIT
  41. % --- Executes just before sctransp_1 is made visible.
  42. function sctransp_1_OpeningFcn(hObject, eventdata, handles, varargin)
  43. % This function has no output args, see OutputFcn.
  44. % hObject handle to figure
  45. % eventdata reserved - to be defined in a future version of MATLAB
  46. % handles structure with handles and user data (see GUIDATA)
  47. % varargin command line arguments to sctransp_1 (see VARARGIN)
  48. % Choose default command line output for sctransp_1
  49. handles.output = hObject;
  50. % Update handles structure
  51. guidata(hObject, handles);
  52. % UIWAIT makes sctransp_1 wait for user response (see UIRESUME)
  53. % uiwait(handles.figure1);
  54. %if exist(strcat(data.param.direc,'/data.mat')) == 2
  55. % load (strcat(data.param.direc,'/data.mat'),'data');
  56. %end
  57. global data;
  58. data.param.Gcierre = true;
  59. if (data.param.cust_diff)
  60. set(handles.cb_diffusion,'Value',1.0);
  61. set(handles.rb_diffusion_2,'Value',1.0);
  62. set(handles.rb_diffusion_1,'Enable','On');
  63. set(handles.rb_diffusion_2,'Enable','On');
  64. elseif (data.param.diffusion~=0)
  65. set(handles.cb_diffusion,'Value',1.0);
  66. set(handles.rb_diffusion_1,'Value',1.0);
  67. set(handles.edit_diffusion,'String',num2str(data.param.diffusion));
  68. set(handles.edit_diffusion,'Enable','On');
  69. set(handles.rb_diffusion_1,'Enable','On');
  70. set(handles.rb_diffusion_2,'Enable','On');
  71. else
  72. set(handles.cb_diffusion,'Value',0.0);
  73. end
  74. if (data.param.cust_conv)
  75. set(handles.cb_convection,'Value',1.0);
  76. set(handles.rb_convection_2,'Value',1.0);
  77. set(handles.rb_convection_1,'Enable','On');
  78. set(handles.rb_convection_2,'Enable','On');
  79. elseif (data.param.convection_x~=0)
  80. set(handles.cb_convection,'Value',1.0);
  81. set(handles.rb_convection_1,'Value',1.0);
  82. set(handles.edit_convection_x,'String',num2str(data.param.convection_x));
  83. set(handles.edit_convection_x,'Enable','On');
  84. set(handles.rb_convection_1,'Enable','On');
  85. set(handles.rb_convection_2,'Enable','On');
  86. if (data.param.type_geo~=1)
  87. set(handles.edit_convection_y,'String',num2str(data.param.convection_y));
  88. set(handles.edit_convection_y,'Enable','On');
  89. end
  90. else
  91. set(handles.cb_convection,'Value',0.0);
  92. end
  93. if (data.param.cust_sour)
  94. set(handles.cb_source,'Value',1.0);
  95. set(handles.rb_source_2,'Value',1.0);
  96. set(handles.rb_source_1,'Enable','On');
  97. set(handles.rb_source_2,'Enable','On');
  98. elseif (data.param.source~=0)
  99. set(handles.cb_source,'Value',1.0);
  100. set(handles.rb_source_1,'Value',1.0);
  101. set(handles.edit_source,'String',num2str(data.param.source));
  102. set(handles.edit_source,'Enable','On');
  103. set(handles.rb_source_1,'Enable','On');
  104. set(handles.rb_source_2,'Enable','On');
  105. else
  106. set(handles.cb_source,'Value',0.0);
  107. end
  108. if (data.param.cust_reac)
  109. set(handles.cb_reaction,'Value',1.0);
  110. set(handles.rb_reaction_2,'Value',1.0);
  111. set(handles.rb_reaction_1,'Enable','On');
  112. set(handles.rb_reaction_2,'Enable','On');
  113. elseif (data.param.reaction~=0)
  114. set(handles.cb_reaction,'Value',1.0);
  115. set(handles.rb_reaction_1,'Value',1.0);
  116. set(handles.edit_reaction,'String',num2str(data.param.reaction));
  117. set(handles.edit_reaction,'Enable','On');
  118. set(handles.rb_reaction_1,'Enable','On');
  119. set(handles.rb_reaction_2,'Enable','On');
  120. else
  121. set(handles.cb_reaction,'Value',0.0);
  122. end
  123. if (data.param.cust_temp)
  124. set(handles.cb_temporal,'Value',1.0);
  125. set(handles.rb_temporal_2,'Value',1.0);
  126. set(handles.rb_temporal_1,'Enable','On');
  127. set(handles.rb_temporal_2,'Enable','On');
  128. elseif (data.param.temporal~=0)
  129. set(handles.cb_temporal,'Value',1.0);
  130. set(handles.rb_temporal_1,'Value',1.0);
  131. set(handles.edit_temporal,'String',num2str(data.param.temporal));
  132. set(handles.edit_temporal,'Enable','On');
  133. set(handles.rb_temporal_1,'Enable','On');
  134. set(handles.rb_temporal_2,'Enable','On');
  135. else
  136. set(handles.cb_temporal,'Value',0.0);
  137. end
  138. % --- Outputs from this function are returned to the command line.
  139. function varargout = sctransp_1_OutputFcn(hObject, eventdata, handles)
  140. % varargout cell array for returning output args (see VARARGOUT);
  141. % hObject handle to figure
  142. % eventdata reserved - to be defined in a future version of MATLAB
  143. % handles structure with handles and user data (see GUIDATA)
  144. % Get default command line output from handles structure
  145. varargout{1} = handles.output;
  146. % --- Executes during object creation, after setting all properties.
  147. function axes1_CreateFcn(hObject, eventdata, handles)
  148. % hObject handle to axes1 (see GCBO)
  149. % eventdata reserved - to be defined in a future version of MATLAB
  150. % handles empty - handles not created until after all CreateFcns called
  151. I = imread('images/eq_sctransp.jpg');
  152. imshow(I)
  153. % Hint: place code in OpeningFcn to populate axes1
  154. % --- Executes on button press in cb_diffusion.
  155. function cb_diffusion_Callback(hObject, eventdata, handles)
  156. % hObject handle to cb_diffusion (see GCBO)
  157. % eventdata reserved - to be defined in a future version of MATLAB
  158. % handles structure with handles and user data (see GUIDATA)
  159. % Hint: get(hObject,'Value') returns toggle state of cb_diffusion
  160. if(get(hObject,'Value'))
  161. set(handles.rb_diffusion_1,'Enable','On');
  162. set(handles.rb_diffusion_2,'Enable','On');
  163. set(handles.rb_diffusion_1,'Value',1.0);
  164. set(handles.edit_diffusion,'Enable','On');
  165. else
  166. set(handles.rb_diffusion_1,'Enable','Off');
  167. set(handles.rb_diffusion_2,'Enable','Off');
  168. set(handles.rb_diffusion_1,'Value',0.0);
  169. set(handles.rb_diffusion_2,'Value',0.0);
  170. set(handles.edit_diffusion,'Enable','Off');
  171. end
  172. % --- Executes on button press in cb_convection.
  173. function cb_convection_Callback(hObject, eventdata, handles)
  174. % hObject handle to cb_convection (see GCBO)
  175. % eventdata reserved - to be defined in a future version of MATLAB
  176. % handles structure with handles and user data (see GUIDATA)
  177. % Hint: get(hObject,'Value') returns toggle state of cb_convection
  178. global data;
  179. if(get(hObject,'Value'))
  180. set(handles.rb_convection_1,'Enable','On');
  181. set(handles.rb_convection_2,'Enable','On');
  182. set(handles.rb_convection_1,'Value',1.0);
  183. set(handles.edit_convection_x,'Enable','On');
  184. set(handles.label_Ux,'Enable','On');
  185. if data.mesh.ndm==2
  186. set(handles.edit_convection_y,'Enable','On');
  187. set(handles.label_Uy,'Enable','On');
  188. end
  189. else
  190. set(handles.rb_convection_1,'Enable','Off');
  191. set(handles.rb_convection_2,'Enable','Off');
  192. set(handles.rb_convection_1,'Value',0.0);
  193. set(handles.rb_convection_2,'Value',0.0);
  194. set(handles.edit_convection_x,'Enable','Off');
  195. set(handles.label_Ux,'Enable','Off');
  196. if data.mesh.ndm==2
  197. set(handles.label_Uy,'Enable','Off');
  198. set(handles.edit_convection_y,'Enable','Off');
  199. end
  200. end
  201. % --- Executes on button press in cb_source.
  202. function cb_source_Callback(hObject, eventdata, handles)
  203. % hObject handle to cb_source (see GCBO)
  204. % eventdata reserved - to be defined in a future version of MATLAB
  205. % handles structure with handles and user data (see GUIDATA)
  206. % Hint: get(hObject,'Value') returns toggle state of cb_source
  207. if(get(hObject,'Value'))
  208. set(handles.rb_source_1,'Enable','On');
  209. set(handles.rb_source_2,'Enable','On');
  210. set(handles.rb_source_1,'Value',1.0);
  211. set(handles.edit_source,'Enable','On');
  212. else
  213. set(handles.rb_source_1,'Enable','Off');
  214. set(handles.rb_source_2,'Enable','Off');
  215. set(handles.rb_source_1,'Value',0.0);
  216. set(handles.rb_source_2,'Value',0.0);
  217. set(handles.edit_source,'Enable','Off');
  218. end
  219. % --- Executes on button press in cb_reaction.
  220. function cb_reaction_Callback(hObject, eventdata, handles)
  221. % hObject handle to cb_reaction (see GCBO)
  222. % eventdata reserved - to be defined in a future version of MATLAB
  223. % handles structure with handles and user data (see GUIDATA)
  224. % Hint: get(hObject,'Value') returns toggle state of cb_reaction
  225. if(get(hObject,'Value'))
  226. set(handles.rb_reaction_1,'Enable','On');
  227. set(handles.rb_reaction_2,'Enable','On');
  228. set(handles.rb_reaction_1,'Value',1.0);
  229. set(handles.edit_reaction,'Enable','On');
  230. else
  231. set(handles.rb_reaction_1,'Enable','Off');
  232. set(handles.rb_reaction_2,'Enable','Off');
  233. set(handles.rb_reaction_1,'Value',0.0);
  234. set(handles.rb_reaction_2,'Value',0.0);
  235. set(handles.edit_reaction,'Enable','Off');
  236. end
  237. % --- Executes on button press in cb_temporal.
  238. function cb_temporal_Callback(hObject, eventdata, handles)
  239. % hObject handle to cb_temporal (see GCBO)
  240. % eventdata reserved - to be defined in a future version of MATLAB
  241. % handles structure with handles and user data (see GUIDATA)
  242. % Hint: get(hObject,'Value') returns toggle state of cb_temporal
  243. if(get(hObject,'Value'))
  244. set(handles.rb_temporal_1,'Enable','On');
  245. set(handles.rb_temporal_2,'Enable','On');
  246. set(handles.rb_temporal_1,'Value',1.0);
  247. set(handles.edit_temporal,'Enable','On');
  248. else
  249. set(handles.rb_temporal_1,'Enable','Off');
  250. set(handles.rb_temporal_2,'Enable','Off');
  251. set(handles.rb_temporal_1,'Value',0.0);
  252. set(handles.rb_temporal_2,'Value',0.0);
  253. set(handles.edit_temporal,'Enable','Off');
  254. end
  255. function edit_K_Callback(hObject, eventdata, handles)
  256. % hObject handle to edit_K (see GCBO)
  257. % eventdata reserved - to be defined in a future version of MATLAB
  258. % handles structure with handles and user data (see GUIDATA)
  259. % Hints: get(hObject,'String') returns contents of edit_K as text
  260. % str2double(get(hObject,'String')) returns contents of edit_K as a double
  261. % --- Executes during object creation, after setting all properties.
  262. function edit_K_CreateFcn(hObject, eventdata, handles)
  263. % hObject handle to edit_K (see GCBO)
  264. % eventdata reserved - to be defined in a future version of MATLAB
  265. % handles empty - handles not created until after all CreateFcns called
  266. % Hint: edit controls usually have a white background on Windows.
  267. % See ISPC and COMPUTER.
  268. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  269. set(hObject,'BackgroundColor','white');
  270. end
  271. function edit2_Callback(hObject, eventdata, handles)
  272. % hObject handle to edit2 (see GCBO)
  273. % eventdata reserved - to be defined in a future version of MATLAB
  274. % handles structure with handles and user data (see GUIDATA)
  275. % Hints: get(hObject,'String') returns contents of edit2 as text
  276. % str2double(get(hObject,'String')) returns contents of edit2 as a double
  277. % --- Executes during object creation, after setting all properties.
  278. function edit2_CreateFcn(hObject, eventdata, handles)
  279. % hObject handle to edit2 (see GCBO)
  280. % eventdata reserved - to be defined in a future version of MATLAB
  281. % handles empty - handles not created until after all CreateFcns called
  282. % Hint: edit controls usually have a white background on Windows.
  283. % See ISPC and COMPUTER.
  284. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  285. set(hObject,'BackgroundColor','white');
  286. end
  287. function edit3_Callback(hObject, eventdata, handles)
  288. % hObject handle to edit3 (see GCBO)
  289. % eventdata reserved - to be defined in a future version of MATLAB
  290. % handles structure with handles and user data (see GUIDATA)
  291. % Hints: get(hObject,'String') returns contents of edit3 as text
  292. % str2double(get(hObject,'String')) returns contents of edit3 as a double
  293. % --- Executes during object creation, after setting all properties.
  294. function edit3_CreateFcn(hObject, eventdata, handles)
  295. % hObject handle to edit3 (see GCBO)
  296. % eventdata reserved - to be defined in a future version of MATLAB
  297. % handles empty - handles not created until after all CreateFcns called
  298. % Hint: edit controls usually have a white background on Windows.
  299. % See ISPC and COMPUTER.
  300. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  301. set(hObject,'BackgroundColor','white');
  302. end
  303. function edit4_Callback(hObject, eventdata, handles)
  304. % hObject handle to edit4 (see GCBO)
  305. % eventdata reserved - to be defined in a future version of MATLAB
  306. % handles structure with handles and user data (see GUIDATA)
  307. % Hints: get(hObject,'String') returns contents of edit4 as text
  308. % str2double(get(hObject,'String')) returns contents of edit4 as a double
  309. % --- Executes during object creation, after setting all properties.
  310. function edit4_CreateFcn(hObject, eventdata, handles)
  311. % hObject handle to edit4 (see GCBO)
  312. % eventdata reserved - to be defined in a future version of MATLAB
  313. % handles empty - handles not created until after all CreateFcns called
  314. % Hint: edit controls usually have a white background on Windows.
  315. % See ISPC and COMPUTER.
  316. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  317. set(hObject,'BackgroundColor','white');
  318. end
  319. % --- Executes on button press in pushbutton1.
  320. function pushbutton1_Callback(hObject, eventdata, handles)
  321. % hObject handle to pushbutton1 (see GCBO)
  322. % eventdata reserved - to be defined in a future version of MATLAB
  323. % handles structure with handles and user data (see GUIDATA)
  324. %global data;
  325. %save(strcat(data.param.direc,'/data'), 'data');
  326. global data;
  327. data.param.Gcierre = false;
  328. close sctransp_1
  329. %set(main,'Visible','on')
  330. geo_1
  331. % --- Executes on button press in pushbutton2.
  332. function pushbutton2_Callback(hObject, eventdata, handles)
  333. % hObject handle to pushbutton2 (see GCBO)
  334. % eventdata reserved - to be defined in a future version of MATLAB
  335. % handles structure with handles and user data (see GUIDATA)
  336. % set(sctransp_1,'Visible','off')
  337. % set(geo_3,'Visible','on')
  338. global data;
  339. data.param.Gcierre = false;
  340. correct=1;
  341. tot_ter=0;
  342. diff=0; conv_x=0; conv_y=0;
  343. reac=0; sour=0; temp=0;
  344. c_diff=false; c_conv=false; c_reac=false;
  345. c_sour=false; c_temp=false;
  346. if get(handles.cb_diffusion,'Value')
  347. tot_ter=tot_ter+1;
  348. if get(handles.rb_diffusion_1,'Value')
  349. diff=str2num(get(handles.edit_diffusion,'String'));
  350. if isempty(diff)
  351. correct=0;
  352. end
  353. else
  354. c_diff=true;
  355. filename = strcat([data.param.Gdirec,'/custom_diffusion.m']);
  356. s = ['edit ' filename];
  357. eval(s)
  358. %s = strcat(['gedit ', filename]);
  359. %system(s);
  360. end
  361. end
  362. if get(handles.cb_convection,'Value')
  363. tot_ter=tot_ter+1;
  364. if get(handles.rb_convection_1,'Value')
  365. conv_x=str2num(get(handles.edit_convection_x,'String'));
  366. if(data.mesh.ndm==2)
  367. conv_y=str2num(get(handles.edit_convection_y,'String'));
  368. else
  369. conv_y=0;
  370. end
  371. if isempty(conv_x) || isempty(conv_y)
  372. correct=0;
  373. end
  374. else
  375. c_conv=true;
  376. filename = strcat([data.param.Gdirec,'/custom_convection.m']);
  377. s = ['edit ' filename];
  378. eval(s)
  379. %s = strcat(['gedit ', filename]);
  380. %system(s);
  381. end
  382. end
  383. if get(handles.cb_reaction,'Value')
  384. tot_ter=tot_ter+1;
  385. if get(handles.rb_reaction_1,'Value')
  386. reac=str2num(get(handles.edit_reaction,'String'));
  387. if isempty(reac)
  388. correct=0;
  389. end
  390. else
  391. c_reac=true;
  392. filename = strcat([data.param.Gdirec,'/custom_reaction.m']);
  393. s = ['edit ' filename];
  394. eval(s)
  395. %s = strcat(['gedit ', filename]);
  396. %system(s);
  397. end
  398. end
  399. if get(handles.cb_source,'Value')
  400. tot_ter=tot_ter+1;
  401. if get(handles.rb_source_1,'Value')
  402. sour=str2num(get(handles.edit_source,'String'));
  403. if isempty(sour)
  404. correct=0;
  405. end
  406. else
  407. c_sour=true;
  408. filename = strcat([data.param.Gdirec,'/custom_source.m']);
  409. s = ['edit ' filename];
  410. eval(s)
  411. %s = strcat(['gedit ', filename]);
  412. %system(s);
  413. end
  414. end
  415. if get(handles.cb_temporal,'Value')
  416. tot_ter=tot_ter+10;
  417. if get(handles.rb_temporal_1,'Value')
  418. temp=str2num(get(handles.edit_temporal,'String'));
  419. if isempty(temp)
  420. correct=0;
  421. end
  422. else
  423. c_temp=true;
  424. filename = strcat([data.param.Gdirec,'/custom_temporal.m']);
  425. s = ['edit ' filename];
  426. eval(s)
  427. %s = strcat(['gedit ', filename]);
  428. %system(s);
  429. end
  430. end
  431. if (tot_ter==0)
  432. warndlg('At least one term must be selected in the model');
  433. elseif (tot_ter==10)
  434. warndlg('Another term in addition to the temporal term should be selected');
  435. else
  436. if correct
  437. %set(obj.param,{'diff','conv_x','conv_y','reac','sour','temp'}, num2cell([diff,conv_x,conv_y,reac,sour,temp]) );
  438. data.param.b_set(diff,conv_x,conv_y,reac,sour,temp);
  439. data.param.c_set(c_diff,c_conv,c_reac,c_sour,c_temp);
  440. if c_diff || c_conv || c_reac || c_sour || c_temp
  441. hh = warndlg('Custom parameters must be programmed before run the problem. Matlab editor, with these files, has been opened.','caution','modal');
  442. uiwait(hh);
  443. end
  444. %save(strcat(data.param.Gdirec,'/data'), 'data');
  445. close sctransp_1;
  446. geo_3;
  447. else
  448. warndlg('Input must be numerical');
  449. end
  450. end
  451. % --- Executes during object creation, after setting all properties.
  452. function uipanel2_CreateFcn(hObject, eventdata, handles)
  453. % hObject handle to uipanel2 (see GCBO)
  454. % eventdata reserved - to be defined in a future version of MATLAB
  455. % handles empty - handles not created until after all CreateFcns called
  456. function edit_diffusion_Callback(hObject, eventdata, handles)
  457. % hObject handle to edit_diffusion (see GCBO)
  458. % eventdata reserved - to be defined in a future version of MATLAB
  459. % handles structure with handles and user data (see GUIDATA)
  460. % Hints: get(hObject,'String') returns contents of edit_diffusion as text
  461. % str2double(get(hObject,'String')) returns contents of edit_diffusion as a double
  462. % --- Executes during object creation, after setting all properties.
  463. function edit_diffusion_CreateFcn(hObject, eventdata, handles)
  464. % hObject handle to edit_diffusion (see GCBO)
  465. % eventdata reserved - to be defined in a future version of MATLAB
  466. % handles empty - handles not created until after all CreateFcns called
  467. % Hint: edit controls usually have a white background on Windows.
  468. % See ISPC and COMPUTER.
  469. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  470. set(hObject,'BackgroundColor','white');
  471. end
  472. % --- Executes on button press in rb_diffusion_1.
  473. function rb_diffusion_1_Callback(hObject, eventdata, handles)
  474. % hObject handle to rb_diffusion_1 (see GCBO)
  475. % eventdata reserved - to be defined in a future version of MATLAB
  476. % handles structure with handles and user data (see GUIDATA)
  477. % Hint: get(hObject,'Value') returns toggle state of rb_diffusion_1
  478. if(get(hObject,'Value'))
  479. set(handles.edit_diffusion,'Enable','On');
  480. else
  481. set(handles.edit_diffusion,'Enable','Off');
  482. end
  483. % --- Executes on button press in rb_diffusion_2.
  484. function rb_diffusion_2_Callback(hObject, eventdata, handles)
  485. % hObject handle to rb_diffusion_2 (see GCBO)
  486. % eventdata reserved - to be defined in a future version of MATLAB
  487. % handles structure with handles and user data (see GUIDATA)
  488. % Hint: get(hObject,'Value') returns toggle state of rb_diffusion_2
  489. if(get(hObject,'Value'))
  490. set(handles.edit_diffusion,'Enable','Off');
  491. end
  492. % --- Executes on button press in rb_convection_1.
  493. function rb_convection_1_Callback(hObject, eventdata, handles)
  494. % hObject handle to rb_convection_1 (see GCBO)
  495. % eventdata reserved - to be defined in a future version of MATLAB
  496. % handles structure with handles and user data (see GUIDATA)
  497. % Hint: get(hObject,'Value') returns toggle state of rb_convection_1
  498. if(get(hObject,'Value'))
  499. set(handles.edit_convection_x,'Enable','On');
  500. else
  501. set(handles.edit_convection_x,'Enable','Off');
  502. end
  503. % --- Executes on button press in rb_convection_2.
  504. function rb_convection_2_Callback(hObject, eventdata, handles)
  505. % hObject handle to rb_convection_2 (see GCBO)
  506. % eventdata reserved - to be defined in a future version of MATLAB
  507. % handles structure with handles and user data (see GUIDATA)
  508. % Hint: get(hObject,'Value') returns toggle state of rb_convection_2
  509. if(get(hObject,'Value'))
  510. set(handles.edit_convection_x,'Enable','Off');
  511. end
  512. % --- Executes on button press in rb_source_1.
  513. function rb_source_1_Callback(hObject, eventdata, handles)
  514. % hObject handle to rb_source_1 (see GCBO)
  515. % eventdata reserved - to be defined in a future version of MATLAB
  516. % handles structure with handles and user data (see GUIDATA)
  517. % Hint: get(hObject,'Value') returns toggle state of rb_source_1
  518. if(get(hObject,'Value'))
  519. set(handles.edit_source,'Enable','On');
  520. else
  521. set(handles.edit_source,'Enable','Off');
  522. end
  523. % --- Executes on button press in rb_source_2.
  524. function rb_source_2_Callback(hObject, eventdata, handles)
  525. % hObject handle to rb_source_2 (see GCBO)
  526. % eventdata reserved - to be defined in a future version of MATLAB
  527. % handles structure with handles and user data (see GUIDATA)
  528. % Hint: get(hObject,'Value') returns toggle state of rb_source_2
  529. if(get(hObject,'Value'))
  530. set(handles.edit_source,'Enable','Off');
  531. end
  532. % --- Executes on button press in rb_reaction_1.
  533. function rb_reaction_1_Callback(hObject, eventdata, handles)
  534. % hObject handle to rb_reaction_1 (see GCBO)
  535. % eventdata reserved - to be defined in a future version of MATLAB
  536. % handles structure with handles and user data (see GUIDATA)
  537. % Hint: get(hObject,'Value') returns toggle state of rb_reaction_1
  538. if(get(hObject,'Value'))
  539. set(handles.edit_reaction,'Enable','On');
  540. else
  541. set(handles.edit_reaction,'Enable','Off');
  542. end
  543. % --- Executes on button press in rb_reaction_2.
  544. function rb_reaction_2_Callback(hObject, eventdata, handles)
  545. % hObject handle to rb_reaction_2 (see GCBO)
  546. % eventdata reserved - to be defined in a future version of MATLAB
  547. % handles structure with handles and user data (see GUIDATA)
  548. % Hint: get(hObject,'Value') returns toggle state of rb_reaction_2
  549. if(get(hObject,'Value'))
  550. set(handles.edit_reaction,'Enable','Off');
  551. end
  552. % --- Executes on button press in rb_temporal_1.
  553. function rb_temporal_1_Callback(hObject, eventdata, handles)
  554. % hObject handle to rb_temporal_1 (see GCBO)
  555. % eventdata reserved - to be defined in a future version of MATLAB
  556. % handles structure with handles and user data (see GUIDATA)
  557. % Hint: get(hObject,'Value') returns toggle state of rb_temporal_1
  558. if(get(hObject,'Value'))
  559. set(handles.edit_temporal,'Enable','On');
  560. else
  561. set(handles.edit_temporal,'Enable','Off');
  562. end
  563. % --- Executes on button press in rb_temporal_2.
  564. function rb_temporal_2_Callback(hObject, eventdata, handles)
  565. % hObject handle to rb_temporal_2 (see GCBO)
  566. % eventdata reserved - to be defined in a future version of MATLAB
  567. % handles structure with handles and user data (see GUIDATA)
  568. % Hint: get(hObject,'Value') returns toggle state of rb_temporal_2
  569. if(get(hObject,'Value'))
  570. set(handles.edit_temporal,'Enable','Off');
  571. end
  572. function edit_temporal_Callback(hObject, eventdata, handles)
  573. % hObject handle to edit_temporal (see GCBO)
  574. % eventdata reserved - to be defined in a future version of MATLAB
  575. % handles structure with handles and user data (see GUIDATA)
  576. % Hints: get(hObject,'String') returns contents of edit_temporal as text
  577. % str2double(get(hObject,'String')) returns contents of edit_temporal as a double
  578. % --- Executes during object creation, after setting all properties.
  579. function edit_temporal_CreateFcn(hObject, eventdata, handles)
  580. % hObject handle to edit_temporal (see GCBO)
  581. % eventdata reserved - to be defined in a future version of MATLAB
  582. % handles empty - handles not created until after all CreateFcns called
  583. % Hint: edit controls usually have a white background on Windows.
  584. % See ISPC and COMPUTER.
  585. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  586. set(hObject,'BackgroundColor','white');
  587. end
  588. function edit_reaction_Callback(hObject, eventdata, handles)
  589. % hObject handle to edit_reaction (see GCBO)
  590. % eventdata reserved - to be defined in a future version of MATLAB
  591. % handles structure with handles and user data (see GUIDATA)
  592. % Hints: get(hObject,'String') returns contents of edit_reaction as text
  593. % str2double(get(hObject,'String')) returns contents of edit_reaction as a double
  594. % --- Executes during object creation, after setting all properties.
  595. function edit_reaction_CreateFcn(hObject, eventdata, handles)
  596. % hObject handle to edit_reaction (see GCBO)
  597. % eventdata reserved - to be defined in a future version of MATLAB
  598. % handles empty - handles not created until after all CreateFcns called
  599. % Hint: edit controls usually have a white background on Windows.
  600. % See ISPC and COMPUTER.
  601. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  602. set(hObject,'BackgroundColor','white');
  603. end
  604. function edit_source_Callback(hObject, eventdata, handles)
  605. % hObject handle to edit_source (see GCBO)
  606. % eventdata reserved - to be defined in a future version of MATLAB
  607. % handles structure with handles and user data (see GUIDATA)
  608. % Hints: get(hObject,'String') returns contents of edit_source as text
  609. % str2double(get(hObject,'String')) returns contents of edit_source as a double
  610. % --- Executes during object creation, after setting all properties.
  611. function edit_source_CreateFcn(hObject, eventdata, handles)
  612. % hObject handle to edit_source (see GCBO)
  613. % eventdata reserved - to be defined in a future version of MATLAB
  614. % handles empty - handles not created until after all CreateFcns called
  615. % Hint: edit controls usually have a white background on Windows.
  616. % See ISPC and COMPUTER.
  617. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  618. set(hObject,'BackgroundColor','white');
  619. end
  620. function edit_convection_x_Callback(hObject, eventdata, handles)
  621. % hObject handle to edit_convection_x (see GCBO)
  622. % eventdata reserved - to be defined in a future version of MATLAB
  623. % handles structure with handles and user data (see GUIDATA)
  624. % Hints: get(hObject,'String') returns contents of edit_convection_x as text
  625. % str2double(get(hObject,'String')) returns contents of edit_convection_x as a double
  626. % --- Executes during object creation, after setting all properties.
  627. function edit_convection_x_CreateFcn(hObject, eventdata, handles)
  628. % hObject handle to edit_convection_x (see GCBO)
  629. % eventdata reserved - to be defined in a future version of MATLAB
  630. % handles empty - handles not created until after all CreateFcns called
  631. % Hint: edit controls usually have a white background on Windows.
  632. % See ISPC and COMPUTER.
  633. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  634. set(hObject,'BackgroundColor','white');
  635. end
  636. % --- Executes during object creation, after setting all properties.
  637. function next_CreateFcn(hObject, eventdata, handles)
  638. % hObject handle to next (see GCBO)
  639. % eventdata reserved - to be defined in a future version of MATLAB
  640. % handles empty - handles not created until after all CreateFcns called
  641. % Hint: place code in OpeningFcn to populate next
  642. function edit_convection_y_Callback(hObject, eventdata, handles)
  643. % hObject handle to edit_convection_y (see GCBO)
  644. % eventdata reserved - to be defined in a future version of MATLAB
  645. % handles structure with handles and user data (see GUIDATA)
  646. % Hints: get(hObject,'String') returns contents of edit_convection_y as text
  647. % str2double(get(hObject,'String')) returns contents of edit_convection_y as a double
  648. % --- Executes during object creation, after setting all properties.
  649. function edit_convection_y_CreateFcn(hObject, eventdata, handles)
  650. % hObject handle to edit_convection_y (see GCBO)
  651. % eventdata reserved - to be defined in a future version of MATLAB
  652. % handles empty - handles not created until after all CreateFcns called
  653. % Hint: edit controls usually have a white background on Windows.
  654. % See ISPC and COMPUTER.
  655. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  656. set(hObject,'BackgroundColor','white');
  657. end
  658. % --- Executes during object creation, after setting all properties.
  659. function eqn_CreateFcn(hObject, eventdata, handles)
  660. % hObject handle to eqn (see GCBO)
  661. % eventdata reserved - to be defined in a future version of MATLAB
  662. % handles empty - handles not created until after all CreateFcns called
  663. % Hint: place code in OpeningFcn to populate eqn
  664. %imshow('images/eq_sctransp.png')
  665. %imshow('images/eq_sctransp.png');
  666. % text('Interpreter','latex');
  667. % %text(0,0,'\rho c_p \frac{\partial \phi}{\partial t} + \nabla \cdot
  668. % (\mathbf{u} \phi) = \nabla \cdot (k\nabla \phi) + R\phi + G_\phi')
  669. % --- Executes when user attempts to close figure1.
  670. function figure1_CloseRequestFcn(hObject, eventdata, handles)
  671. % hObject handle to figure1 (see GCBO)
  672. % eventdata reserved - to be defined in a future version of MATLAB
  673. % handles structure with handles and user data (see GUIDATA)
  674. % Hint: delete(hObject) closes the figure
  675. global data;
  676. if (data.param.Gcierre)
  677. resp=questdlg('Est?? seguro que desea salir?','EduFEM');
  678. if strcmp(resp,'Yes')
  679. save(strcat(data.param.Gdirec,'/data'), 'data');
  680. delete(hObject);
  681. end
  682. else
  683. delete(hObject);
  684. end
  685. % --- Executes during object deletion, before destroying properties.
  686. function figure1_DeleteFcn(hObject, eventdata, handles)
  687. % hObject handle to figure1 (see GCBO)
  688. % eventdata reserved - to be defined in a future version of MATLAB
  689. % handles structure with handles and user data (see GUIDATA)