Compare commits

...
8 Commits
Author SHA1 Message Date
kk b66db49cff bugfix for guide 2026-04-28 22:00:30 +08:00
kk14222andGitHub fb54f4512b Merge pull request #1 from kk14222/copilot/convert-app-designer-to-guide
Add MATLAB R2022a GUIDE-compatible EDFM simulator UI
2026-04-28 18:57:28 +08:00
fefb0a5506 Refine GUIDE adapter review feedback
Agent-Logs-Url: https://github.com/kk14222/3D_EDFM_SIM-X/sessions/a128ab7f-6b94-4048-a847-f2dc37bbe0ab

Co-authored-by: kk14222 <217880052+kk14222@users.noreply.github.com>
2026-04-28 03:37:41 +00:00
0018b44cea Clarify GUIDE helper names
Agent-Logs-Url: https://github.com/kk14222/3D_EDFM_SIM-X/sessions/a128ab7f-6b94-4048-a847-f2dc37bbe0ab

Co-authored-by: kk14222 <217880052+kk14222@users.noreply.github.com>
2026-04-28 03:36:55 +00:00
421696c5e0 Clean up GUIDE compatibility review comments
Agent-Logs-Url: https://github.com/kk14222/3D_EDFM_SIM-X/sessions/a128ab7f-6b94-4048-a847-f2dc37bbe0ab

Co-authored-by: kk14222 <217880052+kk14222@users.noreply.github.com>
2026-04-28 03:36:09 +00:00
2447ff62f6 Address GUIDE layout review feedback
Agent-Logs-Url: https://github.com/kk14222/3D_EDFM_SIM-X/sessions/a128ab7f-6b94-4048-a847-f2dc37bbe0ab

Co-authored-by: kk14222 <217880052+kk14222@users.noreply.github.com>
2026-04-28 03:35:16 +00:00
f10831f06b Support editable GUIDE fig layout
Agent-Logs-Url: https://github.com/kk14222/3D_EDFM_SIM-X/sessions/a128ab7f-6b94-4048-a847-f2dc37bbe0ab

Co-authored-by: kk14222 <217880052+kk14222@users.noreply.github.com>
2026-04-28 03:34:20 +00:00
dd42a8f138 Add GUIDE-compatible simulator shell
Agent-Logs-Url: https://github.com/kk14222/3D_EDFM_SIM-X/sessions/a128ab7f-6b94-4048-a847-f2dc37bbe0ab

Co-authored-by: kk14222 <217880052+kk14222@users.noreply.github.com>
2026-04-28 03:33:45 +00:00
12 changed files with 1662 additions and 45 deletions
+76
View File
@@ -0,0 +1,76 @@
# GUIDE Version Run Notes
The MATLAB R2022a entry point now launches the GUIDE-compatible UI. GUIDE does not support `uitabgroup` or `uitab`, so this UI uses GUIDE-supported `uipanel` containers plus `popupmenu` selectors to simulate pages.
Main files:
- `gui_support/app/EDFMSimulatorGuide.fig`
- `gui_support/app/EDFMSimulatorGuide.m`
## Run
In MATLAB R2022a:
```matlab
cd('C:\Users\15715\Documents\3D_EDFM_SIM-X')
startup
app = launch_edfm_simulator_guide;
```
The generic launcher also starts the GUIDE version:
```matlab
cd('C:\Users\15715\Documents\3D_EDFM_SIM-X')
startup
app = launch_edfm_simulator_app;
```
## Edit With GUIDE
Open the FIG in GUIDE:
```matlab
guide('C:\Users\15715\Documents\3D_EDFM_SIM-X\gui_support\app\EDFMSimulatorGuide.fig')
```
The top-level page selector is `PageDropDown`. Each page is a stacked `uipanel`, such as `ModelTab`, `GridTab`, `FlowTab`, and `ResultsTab`.
Because the page panels overlap, simply setting one panel to `Visible=on` may still leave another visible panel covering it. The most reliable editing workflow is to open GUIDE through the page helper:
```matlab
edit_edfm_guide_page('Model')
edit_edfm_guide_page('Flow')
edit_edfm_guide_page('Results')
```
For inner pages:
```matlab
edit_edfm_guide_page('SP')
edit_edfm_guide_page('DP')
edit_edfm_guide_page('GasWater')
edit_edfm_guide_page('OilWater')
edit_edfm_guide_page('MultiComponent')
```
This helper updates the same `EDFMSimulatorGuide.fig` file before opening GUIDE: it turns the other panels in the same group off, brings the selected panel to the top, saves the FIG, and then opens GUIDE. Save and close an already-open GUIDE editor before switching pages with this command, otherwise GUIDE may keep an older in-memory copy.
`show_edfm_guide_page` is lower-level and only works on a normal open figure handle. GUIDE's design window is not always exposed as a normal MATLAB figure, so prefer `edit_edfm_guide_page` for day-to-day editing.
The Property Inspector title may show `matlab.ui.container.Panel`. That is the object class, not the page name. Check the `Tag` property to confirm whether the selected panel is `ResultsTab`, `FlowTab`, or another page.
Do not freely rename control `Tag` values. `EDFMSimulatorGuide.m` and `EDFMAppController.m` use these tags to find controls and bind callbacks.
## Regenerate FIG
If the FIG is lost or damaged, regenerate it from the layout script:
```matlab
cd('C:\Users\15715\Documents\3D_EDFM_SIM-X')
startup
build_edfm_guide_fig
```
This is only a recovery path. Day-to-day UI maintenance should edit `EDFMSimulatorGuide.fig` in GUIDE.
Do not change the page containers back to `uitabgroup`. MATLAB can display `uitabgroup` at runtime, but GUIDE deletes it when opening the FIG.
+88 -43
View File
@@ -115,7 +115,7 @@ classdef EDFMAppController < handle
obj.appendLog(errorReport); obj.appendLog(errorReport);
obj.setRunProgress('Failed'); obj.setRunProgress('Failed');
obj.setStatus('Run failed'); obj.setStatus('Run failed');
uialert(obj.App.UIFigure, errorSummary, 'Run Failed', 'Interpreter', 'none'); obj.showAlert(errorSummary, 'Run Failed', 'Interpreter', 'none');
end end
end end
@@ -135,7 +135,7 @@ classdef EDFMAppController < handle
function exportResults(obj) function exportResults(obj)
if isempty(fieldnames(obj.Results)) if isempty(fieldnames(obj.Results))
uialert(obj.App.UIFigure, 'No results available to export.', 'Export Results'); obj.showAlert('No results available to export.', 'Export Results');
return; return;
end end
[fileName, folder] = uiputfile('*.mat', 'Export Results', 'results.mat'); [fileName, folder] = uiputfile('*.mat', 'Export Results', 'results.mat');
@@ -218,7 +218,7 @@ classdef EDFMAppController < handle
return; return;
case 'FractureWellLocationTable' case 'FractureWellLocationTable'
if obj.getFractureWellCount() == 0 if obj.getFractureWellCount() == 0
uialert(obj.App.UIFigure, ... obj.showAlert(...
'Please add a fracture well before editing perforation coordinates.', ... 'Please add a fracture well before editing perforation coordinates.', ...
'No Fracture Well'); 'No Fracture Well');
return; return;
@@ -254,7 +254,7 @@ classdef EDFMAppController < handle
selectedRow = obj.App.(tableName).UserData; selectedRow = obj.App.(tableName).UserData;
end end
if isempty(selectedRow) || ~isscalar(selectedRow) || selectedRow < 1 if isempty(selectedRow) || ~isscalar(selectedRow) || selectedRow < 1
uialert(obj.App.UIFigure, ... obj.showAlert(...
sprintf('Please select a row in %s first.', tableName), ... sprintf('Please select a row in %s first.', tableName), ...
'Delete Row'); 'Delete Row');
return; return;
@@ -288,7 +288,7 @@ classdef EDFMAppController < handle
selectedRow = obj.App.(tableName).UserData; selectedRow = obj.App.(tableName).UserData;
end end
if isempty(selectedRow) || ~isscalar(selectedRow) || selectedRow < 1 if isempty(selectedRow) || ~isscalar(selectedRow) || selectedRow < 1
uialert(obj.App.UIFigure, ... obj.showAlert(...
sprintf('Please select a row in %s first.', tableName), ... sprintf('Please select a row in %s first.', tableName), ...
'Delete Row'); 'Delete Row');
return; return;
@@ -304,7 +304,7 @@ classdef EDFMAppController < handle
function runCasePlot(obj, actionId) function runCasePlot(obj, actionId)
if isempty(fieldnames(obj.Results)) if isempty(fieldnames(obj.Results))
uialert(obj.App.UIFigure, 'Run or import results before plotting.', 'Plot'); obj.showAlert('Run or import results before plotting.', 'Plot');
return; return;
end end
@@ -327,7 +327,7 @@ classdef EDFMAppController < handle
fprintf(2, '\n[EDFM GUI Plot Error]\n%s\n', errorReport); fprintf(2, '\n[EDFM GUI Plot Error]\n%s\n', errorReport);
obj.appendLog(errorSummary); obj.appendLog(errorSummary);
obj.appendLog(errorReport); obj.appendLog(errorReport);
uialert(obj.App.UIFigure, errorSummary, 'Plot Failed', 'Interpreter', 'none'); obj.showAlert(errorSummary, 'Plot Failed', 'Interpreter', 'none');
end end
end end
@@ -368,29 +368,24 @@ classdef EDFMAppController < handle
gridModel = obj.getNumericDropDownValue('ModelGridModelDropDown', 1); gridModel = obj.getNumericDropDownValue('ModelGridModelDropDown', 1);
flowModel = obj.getNumericDropDownValue('ModelFlowModelDropDown', 1); flowModel = obj.getNumericDropDownValue('ModelFlowModelDropDown', 1);
if isprop(obj.App, 'TabGroup3') if gridModel == 2
if gridModel == 2 && isprop(obj.App, 'DPTab') obj.setPanelSelectorValue('DiscretizationPageDropDown', 'DP');
obj.App.TabGroup3.SelectedTab = obj.App.DPTab; obj.showOnlyPanels({'SPTab', 'DPTab'}, 'DPTab');
elseif isprop(obj.App, 'SPTab') else
obj.App.TabGroup3.SelectedTab = obj.App.SPTab; obj.setPanelSelectorValue('DiscretizationPageDropDown', 'SP');
end obj.showOnlyPanels({'SPTab', 'DPTab'}, 'SPTab');
end end
if isprop(obj.App, 'TabGroup2') switch flowModel
switch flowModel case 1
case 1 obj.setPanelSelectorValue('FlowPageDropDown', 'GasWater');
if isprop(obj.App, 'GasWaterTab') obj.showOnlyPanels({'GasWaterTab', 'OilWaterTab', 'MultiComponentTab'}, 'GasWaterTab');
obj.App.TabGroup2.SelectedTab = obj.App.GasWaterTab; case 2
end obj.setPanelSelectorValue('FlowPageDropDown', 'OilWater');
case 2 obj.showOnlyPanels({'GasWaterTab', 'OilWaterTab', 'MultiComponentTab'}, 'OilWaterTab');
if isprop(obj.App, 'OilWaterTab') otherwise
obj.App.TabGroup2.SelectedTab = obj.App.OilWaterTab; obj.setPanelSelectorValue('FlowPageDropDown', 'MultiComponent');
end obj.showOnlyPanels({'GasWaterTab', 'OilWaterTab', 'MultiComponentTab'}, 'MultiComponentTab');
otherwise
if isprop(obj.App, 'MultiComponentTab')
obj.App.TabGroup2.SelectedTab = obj.App.MultiComponentTab;
end
end
end end
obj.setEditableState('InitialCsEditField', flowModel == 3); obj.setEditableState('InitialCsEditField', flowModel == 3);
@@ -839,24 +834,37 @@ classdef EDFMAppController < handle
obj.setFlowTabControlsVisible('OilWater', showOilWaterTab); obj.setFlowTabControlsVisible('OilWater', showOilWaterTab);
obj.setFlowTabControlsVisible('MultiComponent', showMultiComponentTab); obj.setFlowTabControlsVisible('MultiComponent', showMultiComponentTab);
if isprop(obj.App, 'TabGroup2') switch flowModel
switch flowModel case 1
case 1 obj.setPanelSelectorValue('FlowPageDropDown', 'GasWater');
if isprop(obj.App, 'GasWaterTab') obj.showOnlyPanels({'GasWaterTab', 'OilWaterTab', 'MultiComponentTab'}, 'GasWaterTab');
obj.App.TabGroup2.SelectedTab = obj.App.GasWaterTab; case 2
end obj.setPanelSelectorValue('FlowPageDropDown', 'OilWater');
case 2 obj.showOnlyPanels({'GasWaterTab', 'OilWaterTab', 'MultiComponentTab'}, 'OilWaterTab');
if isprop(obj.App, 'OilWaterTab') otherwise
obj.App.TabGroup2.SelectedTab = obj.App.OilWaterTab; obj.setPanelSelectorValue('FlowPageDropDown', 'MultiComponent');
end obj.showOnlyPanels({'GasWaterTab', 'OilWaterTab', 'MultiComponentTab'}, 'MultiComponentTab');
otherwise
if isprop(obj.App, 'MultiComponentTab')
obj.App.TabGroup2.SelectedTab = obj.App.MultiComponentTab;
end
end
end end
end end
function showOnlyPanels(obj, panelNames, visiblePanelName)
for i = 1:numel(panelNames)
isVisible = strcmp(panelNames{i}, visiblePanelName);
obj.setControlVisible(panelNames{i}, isVisible);
end
end
function setPanelSelectorValue(obj, selectorName, selectedItem)
if ~isprop(obj.App, selectorName)
return;
end
component = obj.App.(selectorName);
if ~any(strcmp(component.Items, selectedItem))
return;
end
component.Value = selectedItem;
end
function setFlowTabControlsVisible(obj, flowTabName, isVisible) function setFlowTabControlsVisible(obj, flowTabName, isVisible)
switch flowTabName switch flowTabName
case 'GasWater' case 'GasWater'
@@ -1520,6 +1528,27 @@ classdef EDFMAppController < handle
end end
end end
function showAlert(obj, message, titleText, varargin)
if nargin < 3 || strlength(string(titleText)) == 0
titleText = 'EDFM Simulator';
end
try
uialert(obj.App.UIFigure, message, titleText, varargin{:});
catch
dialogTitle = obj.formatDialogMessage(titleText);
errordlg(obj.formatDialogMessage(message), dialogTitle, 'modal');
end
end
function textValue = formatDialogMessage(~, value)
if iscell(value)
textValue = strjoin(string(value), newline);
else
textValue = string(value);
end
textValue = char(textValue);
end
function textValue = formatExceptionSummary(~, ME) function textValue = formatExceptionSummary(~, ME)
lines = { lines = {
sprintf('Error: %s', ME.message) sprintf('Error: %s', ME.message)
@@ -1706,6 +1735,7 @@ classdef EDFMAppController < handle
tableHandle = obj.App.(tableName); tableHandle = obj.App.(tableName);
tableHandle.ColumnName = columnNames; tableHandle.ColumnName = columnNames;
tableHandle.ColumnWidth = obj.getColumnWidthsForTable(tableName);
tableHandle.RowName = {}; tableHandle.RowName = {};
switch tableName switch tableName
case 'Well2Table' case 'Well2Table'
@@ -1715,6 +1745,21 @@ classdef EDFMAppController < handle
end end
end end
function columnWidths = getColumnWidthsForTable(~, tableName)
switch tableName
case 'Well1Table'
columnWidths = {90, 55, 95, 55, 55, 90};
case 'FractureWellLocationTable'
columnWidths = {140, 140, 140};
case 'Well2Table'
columnWidths = {100, 70, 120, 70, 70, 130};
case 'ScheduleTable'
columnWidths = {100, 120, 100, 150, 80, 80, 80, 80, 80, 100};
otherwise
columnWidths = 'auto';
end
end
function columnNames = getColumnNamesForTable(~, tableName) function columnNames = getColumnNamesForTable(~, tableName)
switch tableName switch tableName
case 'Well1Table' case 'Well1Table'
+33
View File
@@ -0,0 +1,33 @@
classdef EDFMGuideApp < dynamicprops
%EDFMGUIDEAPP App-like container used by the GUIDE implementation.
properties
Controller EDFMAppController
end
methods
function obj = EDFMGuideApp(handles)
names = fieldnames(handles);
for i = 1:numel(names)
name = names{i};
if isprop(obj, name)
obj.(name) = obj.wrapHandle(name, handles.(name));
else
addprop(obj, name);
obj.(name) = obj.wrapHandle(name, handles.(name));
end
end
end
end
methods (Access = private)
function value = wrapHandle(~, name, handleObj)
if strcmp(name, 'UIFigure') || isa(handleObj, 'matlab.ui.container.TabGroup') || ...
isa(handleObj, 'matlab.ui.container.Tab') || isa(handleObj, 'matlab.graphics.axis.Axes')
value = handleObj;
else
value = EDFMGuideComponent(handleObj);
end
end
end
end
+321
View File
@@ -0,0 +1,321 @@
classdef EDFMGuideComponent < handle
%EDFMGUIDECOMPONENT Compatibility adapter from GUIDE/uicontrol to App Designer-style properties.
properties (Constant, Access = private)
NumericFieldType = 'numeric'
end
properties (SetAccess = private)
Handle
end
properties (Dependent)
Value
Items
Text
Position
Visible
Enable
Editable
Data
ColumnName
ColumnWidth
RowName
ColumnEditable
ValueChangedFcn
ButtonPushedFcn
CellSelectionCallback
Limits
MajorTicks
MinorTicks
UserData
end
properties (Access = private)
StoredMajorTicks = []
StoredMinorTicks = []
IsNumericEditField logical = false
end
methods
function obj = EDFMGuideComponent(handleObj)
obj.Handle = handleObj;
obj.IsNumericEditField = obj.detectNumericEditField();
end
function value = get.Value(obj)
if isa(obj.Handle, 'matlab.ui.control.Table')
value = get(obj.Handle, 'Data');
return;
end
style = obj.getStyle();
switch style
case 'popupmenu'
items = obj.Items;
idx = get(obj.Handle, 'Value');
if isempty(items)
value = '';
else
idx = min(max(1, idx), numel(items));
value = items{idx};
end
case 'slider'
value = get(obj.Handle, 'Value');
case 'edit'
if obj.isNumericEditField()
value = str2double(string(get(obj.Handle, 'String')));
if isnan(value)
value = NaN;
end
else
raw = get(obj.Handle, 'String');
if ischar(raw)
value = cellstr(raw);
else
value = raw;
end
end
otherwise
value = get(obj.Handle, 'Value');
end
end
function set.Value(obj, value)
if isa(obj.Handle, 'matlab.ui.control.Table')
set(obj.Handle, 'Data', value);
return;
end
style = obj.getStyle();
switch style
case 'popupmenu'
items = obj.Items;
textValue = char(string(value));
idx = find(strcmp(items, textValue), 1);
if isempty(idx)
items{end + 1} = textValue;
obj.Items = items;
idx = numel(items);
end
set(obj.Handle, 'Value', idx);
case 'slider'
set(obj.Handle, 'Value', double(value));
case 'edit'
if obj.isNumericEditField()
if isempty(value)
set(obj.Handle, 'String', '');
else
set(obj.Handle, 'String', num2str(double(value)));
end
else
if isstring(value)
value = cellstr(value);
end
set(obj.Handle, 'String', value);
end
otherwise
set(obj.Handle, 'Value', value);
end
end
function value = get.Items(obj)
raw = get(obj.Handle, 'String');
if ischar(raw)
value = cellstr(raw);
else
value = raw;
end
end
function set.Items(obj, value)
if isstring(value)
value = cellstr(value);
end
if isempty(value)
value = {''};
end
set(obj.Handle, 'String', value, 'Value', min(get(obj.Handle, 'Value'), numel(value)));
end
function value = get.Text(obj)
value = get(obj.Handle, 'String');
end
function set.Text(obj, value)
set(obj.Handle, 'String', char(string(value)));
end
function value = get.Position(obj)
value = get(obj.Handle, 'Position');
end
function set.Position(obj, value)
set(obj.Handle, 'Position', value);
end
function value = get.Visible(obj)
value = get(obj.Handle, 'Visible');
end
function set.Visible(obj, value)
set(obj.Handle, 'Visible', obj.onOff(value));
end
function value = get.Enable(obj)
value = get(obj.Handle, 'Enable');
end
function set.Enable(obj, value)
set(obj.Handle, 'Enable', obj.onOff(value));
end
function value = get.Editable(obj)
if isprop(obj.Handle, 'Editable')
value = get(obj.Handle, 'Editable');
else
value = strcmp(get(obj.Handle, 'Enable'), 'on');
end
end
function set.Editable(obj, value)
if isprop(obj.Handle, 'Editable')
set(obj.Handle, 'Editable', obj.onOff(value));
else
set(obj.Handle, 'Enable', obj.onOff(value));
end
end
function value = get.Data(obj)
value = get(obj.Handle, 'Data');
end
function set.Data(obj, value)
set(obj.Handle, 'Data', value);
end
function value = get.ColumnName(obj)
value = get(obj.Handle, 'ColumnName');
end
function set.ColumnName(obj, value)
set(obj.Handle, 'ColumnName', value);
end
function value = get.ColumnWidth(obj)
value = get(obj.Handle, 'ColumnWidth');
end
function set.ColumnWidth(obj, value)
set(obj.Handle, 'ColumnWidth', value);
end
function value = get.RowName(obj)
value = get(obj.Handle, 'RowName');
end
function set.RowName(obj, value)
set(obj.Handle, 'RowName', value);
end
function value = get.ColumnEditable(obj)
value = get(obj.Handle, 'ColumnEditable');
end
function set.ColumnEditable(obj, value)
set(obj.Handle, 'ColumnEditable', value);
end
function value = get.ValueChangedFcn(obj)
value = get(obj.Handle, 'Callback');
end
function set.ValueChangedFcn(obj, value)
set(obj.Handle, 'Callback', value);
end
function value = get.ButtonPushedFcn(obj)
value = get(obj.Handle, 'Callback');
end
function set.ButtonPushedFcn(obj, value)
set(obj.Handle, 'Callback', value);
end
function value = get.CellSelectionCallback(obj)
value = get(obj.Handle, 'CellSelectionCallback');
end
function set.CellSelectionCallback(obj, value)
set(obj.Handle, 'CellSelectionCallback', value);
end
function value = get.Limits(obj)
value = [get(obj.Handle, 'Min'), get(obj.Handle, 'Max')];
end
function set.Limits(obj, value)
set(obj.Handle, 'Min', value(1), 'Max', value(2));
end
function value = get.UserData(obj)
value = get(obj.Handle, 'UserData');
end
function set.UserData(obj, value)
set(obj.Handle, 'UserData', value);
end
function value = get.MajorTicks(obj)
value = obj.StoredMajorTicks;
end
function set.MajorTicks(obj, value)
obj.StoredMajorTicks = value;
end
function value = get.MinorTicks(obj)
value = obj.StoredMinorTicks;
end
function set.MinorTicks(obj, value)
obj.StoredMinorTicks = value;
end
end
methods (Access = private)
function style = getStyle(obj)
if isprop(obj.Handle, 'Style')
style = get(obj.Handle, 'Style');
else
style = '';
end
end
function tf = isNumericEditField(obj)
tf = obj.IsNumericEditField;
end
function tf = detectNumericEditField(obj)
userData = get(obj.Handle, 'UserData');
tf = isstruct(userData) && isfield(userData, 'Type') && strcmp(userData.Type, obj.NumericFieldType);
end
end
methods (Static, Access = private)
function value = onOff(input)
if islogical(input)
if input
value = 'on';
else
value = 'off';
end
else
value = char(string(input));
if strcmpi(value, 'true')
value = 'on';
elseif strcmpi(value, 'false')
value = 'off';
end
end
end
end
end
Binary file not shown.
+186
View File
@@ -0,0 +1,186 @@
function varargout = EDFMSimulatorGuide(varargin)
%EDFMSIMULATORGUIDE GUIDE-compatible EDFM simulator GUI for MATLAB R2022a.
% APP = EDFMSIMULATORGUIDE launches the converted GUIDE/uicontrol version
% of the App Designer interface. The UI is built from standard figure,
% uipanel, uicontrol, uitable and axes objects so it can be inspected and
% adjusted with GUIDE-era tools in MATLAB R2022a. GUIDE does not support
% uitabgroup, so pages are implemented as switchable uipanel containers.
if nargin > 0 && ischar(varargin{1})
feval(varargin{:});
return;
end
startup;
handles = initializeGuideLayout();
fig = handles.UIFigure;
app = EDFMGuideApp(handles);
app.Controller = EDFMAppController(app);
handles.App = app;
guidata(fig, handles);
configureGuideCallbacks(app, fig);
app.Controller.startup();
set(fig, 'Visible', 'on');
if nargout > 0
varargout{1} = app;
end
end
function handles = initializeGuideLayout()
figFile = fullfile(fileparts(mfilename('fullpath')), 'EDFMSimulatorGuide.fig');
if exist(figFile, 'file') == 2
fig = openfig(figFile, 'reuse', 'invisible');
handles = guihandles(fig);
handles.UIFigure = fig;
else
handles = createEDFMSimulatorGuideLayout();
end
end
function configureGuideCallbacks(app, fig)
if isprop(app, 'PageDropDown')
app.PageDropDown.ValueChangedFcn = @(src, event) onMainPageChanged(fig);
end
if isprop(app, 'DiscretizationPageDropDown')
app.DiscretizationPageDropDown.ValueChangedFcn = @(src, event) onDiscretizationPageChanged(fig);
end
if isprop(app, 'FlowPageDropDown')
app.FlowPageDropDown.ValueChangedFcn = @(src, event) onFlowPageChanged(fig);
end
app.NewConfigButton.ButtonPushedFcn = @(src, event) onNewConfig(fig);
app.LoadTemplateButton.ButtonPushedFcn = @(src, event) onLoadTemplate(fig);
app.ImportConfigButton.ButtonPushedFcn = @(src, event) onImportConfig(fig);
app.ExportConfigButton.ButtonPushedFcn = @(src, event) onExportConfig(fig);
app.RunButton.ButtonPushedFcn = @(src, event) onRun(fig);
app.ImportResultButton.ButtonPushedFcn = @(src, event) onImportResult(fig);
app.ExportResultButton.ButtonPushedFcn = @(src, event) onExportResult(fig);
app.PlotWellResponseButton.ButtonPushedFcn = @(src, event) onActivateCasePlot(fig, 'plot_well_response');
app.Plot2DLayerButton.ButtonPushedFcn = @(src, event) onActivateCasePlot(fig, 'plot_2d_layer');
app.Plot3DDistributionButton.ButtonPushedFcn = @(src, event) onRunCasePlot(fig, 'plot_3d_distribution');
app.PlotPermButton.ButtonPushedFcn = @(src, event) onRunCasePlot(fig, 'plot_perm');
app.PlotSPDPButton.ButtonPushedFcn = @(src, event) onRunCasePlot(fig, 'plot_sp_dp');
app.PlotLayerDropDown.ValueChangedFcn = @(src, event) onPlotOptionChanged(fig);
app.PlotPropertyDropDown.ValueChangedFcn = @(src, event) onPlotOptionChanged(fig);
app.PlotWellDropDown.ValueChangedFcn = @(src, event) onPlotOptionChanged(fig);
app.PlotMetricDropDown.ValueChangedFcn = @(src, event) onPlotOptionChanged(fig);
app.PlotTimeStepSlider.ValueChangedFcn = @(src, event) onPlotOptionChanged(fig);
app.AddWell1RowButton.ButtonPushedFcn = @(src, event) onAddTableRow(fig, 'Well1Table');
app.DeleteWell1RowButton.ButtonPushedFcn = @(src, event) onDeleteTableRow(fig, 'Well1Table');
app.AddWell2RowButton.ButtonPushedFcn = @(src, event) onAddTableRow(fig, 'Well2Table');
app.DeleteWell2RowButton.ButtonPushedFcn = @(src, event) onDeleteTableRow(fig, 'Well2Table');
app.AddFracLocRowButton.ButtonPushedFcn = @(src, event) onAddTableRow(fig, 'FractureWellLocationTable');
app.DeleteFracLocRowButton.ButtonPushedFcn = @(src, event) onDeleteTableRow(fig, 'FractureWellLocationTable');
app.AddScheduleRowButton.ButtonPushedFcn = @(src, event) onAddTableRow(fig, 'ScheduleTable');
app.DeleteScheduleRowButton.ButtonPushedFcn = @(src, event) onDeleteTableRow(fig, 'ScheduleTable');
app.Well1Table.CellSelectionCallback = @(src, event) onTableSelection(fig, 'Well1Table', event);
app.Well2Table.CellSelectionCallback = @(src, event) onTableSelection(fig, 'Well2Table', event);
app.FractureWellLocationTable.CellSelectionCallback = @(src, event) onTableSelection(fig, 'FractureWellLocationTable', event);
app.ScheduleTable.CellSelectionCallback = @(src, event) onTableSelection(fig, 'ScheduleTable', event);
end
function onMainPageChanged(fig)
handles = guidata(fig);
pageTags = {'ModelTab', 'GridTab', 'FractureTab', 'DiscretizationTab', ...
'FlowTab', 'WellsTab', 'SolverRunTab', 'ResultsTab'};
showSelectedPanel(handles, 'PageDropDown', pageTags);
guidata(fig, handles);
end
function onDiscretizationPageChanged(fig)
handles = guidata(fig);
showSelectedPanel(handles, 'DiscretizationPageDropDown', {'SPTab', 'DPTab'});
guidata(fig, handles);
end
function onFlowPageChanged(fig)
handles = guidata(fig);
showSelectedPanel(handles, 'FlowPageDropDown', {'GasWaterTab', 'OilWaterTab', 'MultiComponentTab'});
guidata(fig, handles);
end
function showSelectedPanel(handles, selectorName, panelTags)
if ~isfield(handles, selectorName)
return;
end
selectedIndex = get(handles.(selectorName), 'Value');
selectedIndex = min(max(1, selectedIndex), numel(panelTags));
for i = 1:numel(panelTags)
if isfield(handles, panelTags{i}) && isgraphics(handles.(panelTags{i}))
if i == selectedIndex
set(handles.(panelTags{i}), 'Visible', 'on');
else
set(handles.(panelTags{i}), 'Visible', 'off');
end
end
end
end
function app = getGuideApp(fig)
handles = guidata(fig);
app = handles.App;
end
function onNewConfig(fig)
getGuideApp(fig).Controller.newConfig();
end
function onLoadTemplate(fig)
app = getGuideApp(fig);
app.Controller.loadTemplate(app.TemplateDropDown.Value);
end
function onImportConfig(fig)
getGuideApp(fig).Controller.importConfig();
end
function onExportConfig(fig)
getGuideApp(fig).Controller.exportConfig();
end
function onRun(fig)
getGuideApp(fig).Controller.runCurrentConfig();
end
function onImportResult(fig)
getGuideApp(fig).Controller.importResults();
end
function onExportResult(fig)
getGuideApp(fig).Controller.exportResults();
end
function onActivateCasePlot(fig, actionId)
getGuideApp(fig).Controller.activateCasePlot(actionId);
end
function onRunCasePlot(fig, actionId)
getGuideApp(fig).Controller.runCasePlot(actionId);
end
function onPlotOptionChanged(fig)
getGuideApp(fig).Controller.onPlotOptionChanged();
end
function onAddTableRow(fig, tableName)
getGuideApp(fig).Controller.addTableRow(tableName);
end
function onDeleteTableRow(fig, tableName)
getGuideApp(fig).Controller.deleteSelectedTableRow(tableName);
end
function onTableSelection(fig, tableName, event)
indices = [];
if nargin >= 3 && isstruct(event) && isfield(event, 'Indices')
indices = event.Indices;
elseif nargin >= 3
try
if isprop(event, 'Indices')
indices = event.Indices;
end
catch
end
end
getGuideApp(fig).Controller.onTableSelectionChanged(tableName, indices);
end
+17
View File
@@ -0,0 +1,17 @@
function figPath = build_edfm_guide_fig(figPath)
%BUILD_EDFM_GUIDE_FIG Generate an editable GUIDE FIG file for MATLAB R2022a.
% FIGPATH = BUILD_EDFM_GUIDE_FIG() creates EDFMSimulatorGuide.fig next to
% EDFMSimulatorGuide.m. Open the generated FIG with GUIDE to inspect or
% adjust the converted drag-and-drop style layout.
if nargin < 1 || strlength(string(figPath)) == 0
figPath = fullfile(fileparts(mfilename('fullpath')), 'EDFMSimulatorGuide.fig');
end
startup;
handles = createEDFMSimulatorGuideLayout();
fig = handles.UIFigure;
set(fig, 'Visible', 'off');
savefig(fig, figPath);
close(fig);
end
@@ -0,0 +1,785 @@
function handles = createEDFMSimulatorGuideLayout()
%CREATEEDFMSIMULATORGUIDELAYOUT Build the GUIDE-compatible EDFM GUI layout.
% This layout mirrors the exported App Designer source in context.txt when available.
fig = figure('Visible', 'off', 'Name', 'EDFM Simulator', 'NumberTitle', 'off', ...
'MenuBar', 'none', 'ToolBar', 'none', 'Resize', 'on', 'Units', 'pixels', ...
'Position', [100 100 1275 807], 'Tag', 'UIFigure');
handles = struct();
handles.UIFigure = fig;
handles.TemplateDropDown = uicontrol('Parent', fig, 'Style', 'popupmenu', 'Units', 'pixels', 'Position', [18 774 120 22], ...
'String', {'', ''}, 'Value', 1, 'Tag', 'TemplateDropDown');
setPopupDefaultValue(handles.TemplateDropDown, '');
handles.LoadTemplateButton = uicontrol('Parent', fig, 'Style', 'pushbutton', 'Units', 'pixels', 'Position', [177 774 94 23], ...
'String', 'Load Template', 'Tag', 'LoadTemplateButton');
handles.ImportConfigButton = uicontrol('Parent', fig, 'Style', 'pushbutton', 'Units', 'pixels', 'Position', [405 774 87 23], ...
'String', 'Import Config', 'Tag', 'ImportConfigButton');
handles.ExportConfigButton = uicontrol('Parent', fig, 'Style', 'pushbutton', 'Units', 'pixels', 'Position', [524 774 88 23], ...
'String', 'Export Config', 'Tag', 'ExportConfigButton');
handles.RunButton = uicontrol('Parent', fig, 'Style', 'pushbutton', 'Units', 'pixels', 'Position', [642 774 70 23], ...
'String', 'Run', 'Tag', 'RunButton');
handles.ImportResultButton = uicontrol('Parent', fig, 'Style', 'pushbutton', 'Units', 'pixels', 'Position', [754 774 86 23], ...
'String', 'Import Result', 'Tag', 'ImportResultButton');
handles.ExportResultButton = uicontrol('Parent', fig, 'Style', 'pushbutton', 'Units', 'pixels', 'Position', [875 774 87 23], ...
'String', 'Export Result', 'Tag', 'ExportResultButton');
handles.StatusLabel = uicontrol('Parent', fig, 'Style', 'text', 'Units', 'pixels', 'Position', [984 774 251 22], ...
'String', 'Status', 'HorizontalAlignment', 'left', 'Tag', 'StatusLabel');
handles.PageDropDown = uicontrol('Parent', fig, 'Style', 'popupmenu', 'Units', 'pixels', 'Position', [8 748 170 22], ...
'String', {'Model', 'Grid', 'Fracture', 'Discretization', 'Flow', 'Wells', 'Solver&Run', 'Results'}, 'Value', 1, 'Tag', 'PageDropDown');
handles.TabGroup = uipanel('Parent', fig, 'Units', 'pixels', 'Position', [8 46 1247 698], ...
'BorderType', 'none', 'Tag', 'TabGroup');
handles.ModelTab = uipanel('Parent', handles.TabGroup, 'Title', 'Model', 'Units', 'pixels', ...
'Position', [0 0 1247 698], 'Tag', 'ModelTab', 'Visible', 'on');
handles.GridModelDropDownLabel = uicontrol('Parent', handles.ModelTab, 'Style', 'text', 'Units', 'pixels', 'Position', [62 630 60 22], ...
'String', 'GridModel', 'HorizontalAlignment', 'right', 'Tag', 'GridModelDropDownLabel');
handles.ModelGridModelDropDown = uicontrol('Parent', handles.ModelTab, 'Style', 'popupmenu', 'Units', 'pixels', 'Position', [137 630 100 22], ...
'String', {'1', '2', '', ''}, 'Value', 1, 'Tag', 'ModelGridModelDropDown');
setPopupDefaultValue(handles.ModelGridModelDropDown, '');
handles.FlowModelDropDownLabel = uicontrol('Parent', handles.ModelTab, 'Style', 'text', 'Units', 'pixels', 'Position', [67 566 63 22], ...
'String', 'FlowModel', 'HorizontalAlignment', 'right', 'Tag', 'FlowModelDropDownLabel');
handles.ModelFlowModelDropDown = uicontrol('Parent', handles.ModelTab, 'Style', 'popupmenu', 'Units', 'pixels', 'Position', [145 566 100 22], ...
'String', {'1', '2', '3'}, 'Value', 1, 'Tag', 'ModelFlowModelDropDown');
setPopupDefaultValue(handles.ModelFlowModelDropDown, '1');
handles.GridTab = uipanel('Parent', handles.TabGroup, 'Title', 'Grid', 'Units', 'pixels', ...
'Position', [0 0 1247 698], 'Tag', 'GridTab', 'Visible', 'off');
handles.DxTextAreaLabel = uicontrol('Parent', handles.GridTab, 'Style', 'text', 'Units', 'pixels', 'Position', [49 643 25 22], ...
'String', 'Dx', 'HorizontalAlignment', 'right', 'Tag', 'DxTextAreaLabel');
handles.GridDxTextArea = uicontrol('Parent', handles.GridTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [89 566 263 101], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'GridDxTextArea');
handles.DyTextAreaLabel = uicontrol('Parent', handles.GridTab, 'Style', 'text', 'Units', 'pixels', 'Position', [49 529 25 22], ...
'String', 'Dy', 'HorizontalAlignment', 'right', 'Tag', 'DyTextAreaLabel');
handles.GridDyTextArea = uicontrol('Parent', handles.GridTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [89 455 263 98], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'GridDyTextArea');
handles.DzTextAreaLabel = uicontrol('Parent', handles.GridTab, 'Style', 'text', 'Units', 'pixels', 'Position', [52 400 25 22], ...
'String', 'Dz', 'HorizontalAlignment', 'right', 'Tag', 'DzTextAreaLabel');
handles.GridDzTextArea = uicontrol('Parent', handles.GridTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [92 300 263 124], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'GridDzTextArea');
handles.NTGTextAreaLabel = uicontrol('Parent', handles.GridTab, 'Style', 'text', 'Units', 'pixels', 'Position', [48 231 30 22], ...
'String', 'NTG', 'HorizontalAlignment', 'right', 'Tag', 'NTGTextAreaLabel');
handles.GridNTGTextArea = uicontrol('Parent', handles.GridTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [93 147 267 108], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'GridNTGTextArea');
handles.FractureTab = uipanel('Parent', handles.TabGroup, 'Title', 'Fracture', 'Units', 'pixels', ...
'Position', [0 0 1247 698], 'Tag', 'FractureTab', 'Visible', 'off');
handles.FractureInputTextAreaLabel = uicontrol('Parent', handles.FractureTab, 'Style', 'text', 'Units', 'pixels', 'Position', [59 571 76 22], ...
'String', 'FractureInput', 'HorizontalAlignment', 'right', 'Tag', 'FractureInputTextAreaLabel');
handles.FractureInputTextArea = uicontrol('Parent', handles.FractureTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [150 497 241 98], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'FractureInputTextArea');
handles.DiscretizationTab = uipanel('Parent', handles.TabGroup, 'Title', 'Discretization', 'Units', 'pixels', ...
'Position', [0 0 1247 698], 'Tag', 'DiscretizationTab', 'Visible', 'off');
handles.DiscretizationPageDropDown = uicontrol('Parent', handles.DiscretizationTab, 'Style', 'popupmenu', 'Units', 'pixels', ...
'Position', [48 480 120 22], 'String', {'SP', 'DP'}, 'Value', 1, 'Tag', 'DiscretizationPageDropDown');
handles.TabGroup3 = uipanel('Parent', handles.DiscretizationTab, 'Units', 'pixels', 'Position', [48 37 1156 430], ...
'BorderType', 'none', 'Tag', 'TabGroup3');
handles.SPTab = uipanel('Parent', handles.TabGroup3, 'Title', 'SP', 'Units', 'pixels', ...
'Position', [0 0 1156 430], 'Tag', 'SPTab', 'Visible', 'on');
handles.BoundaryTextAreaLabel = uicontrol('Parent', handles.SPTab, 'Style', 'text', 'Units', 'pixels', 'Position', [30 360 56 22], ...
'String', 'Boundary', 'HorizontalAlignment', 'right', 'Tag', 'BoundaryTextAreaLabel');
handles.SPBoundaryTextArea = uicontrol('Parent', handles.SPTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [101 307 150 77], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'SPBoundaryTextArea');
handles.InvalidLayerTextAreaLabel = uicontrol('Parent', handles.SPTab, 'Style', 'text', 'Units', 'pixels', 'Position', [19 265 70 22], ...
'String', 'InvalidLayer', 'HorizontalAlignment', 'right', 'Tag', 'InvalidLayerTextAreaLabel');
handles.SPInvalidLayerTextArea = uicontrol('Parent', handles.SPTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [104 211 150 78], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'SPInvalidLayerTextArea');
handles.MatrixKxTextAreaLabel = uicontrol('Parent', handles.SPTab, 'Style', 'text', 'Units', 'pixels', 'Position', [301 355 52 22], ...
'String', 'MatrixKx', 'HorizontalAlignment', 'right', 'Tag', 'MatrixKxTextAreaLabel');
handles.SPMatrixKxTextArea = uicontrol('Parent', handles.SPTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [368 319 150 60], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'SPMatrixKxTextArea');
handles.MatrixKyTextAreaLabel = uicontrol('Parent', handles.SPTab, 'Style', 'text', 'Units', 'pixels', 'Position', [302 259 52 22], ...
'String', 'MatrixKy', 'HorizontalAlignment', 'right', 'Tag', 'MatrixKyTextAreaLabel');
handles.SPMatrixKyTextArea = uicontrol('Parent', handles.SPTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [369 223 150 60], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'SPMatrixKyTextArea');
handles.MatrixKzTextAreaLabel = uicontrol('Parent', handles.SPTab, 'Style', 'text', 'Units', 'pixels', 'Position', [301 157 52 22], ...
'String', 'MatrixKz', 'HorizontalAlignment', 'right', 'Tag', 'MatrixKzTextAreaLabel');
handles.SPMatrixKzTextArea = uicontrol('Parent', handles.SPTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [368 121 150 60], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'SPMatrixKzTextArea');
handles.MatrixPoriTextAreaLabel = uicontrol('Parent', handles.SPTab, 'Style', 'text', 'Units', 'pixels', 'Position', [294 51 59 22], ...
'String', 'MatrixPori', 'HorizontalAlignment', 'right', 'Tag', 'MatrixPoriTextAreaLabel');
handles.SPMatrixPoriTextArea = uicontrol('Parent', handles.SPTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [368 15 150 60], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'SPMatrixPoriTextArea');
handles.RockDensityEditFieldLabel = uicontrol('Parent', handles.SPTab, 'Style', 'text', 'Units', 'pixels', 'Position', [16 165 72 22], ...
'String', 'RockDensity', 'HorizontalAlignment', 'right', 'Tag', 'RockDensityEditFieldLabel');
handles.SPRockDensityEditField = uicontrol('Parent', handles.SPTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [103 165 144 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'SPRockDensityEditField');
handles.DPTab = uipanel('Parent', handles.TabGroup3, 'Title', 'DP', 'Units', 'pixels', ...
'Position', [0 0 1156 430], 'Tag', 'DPTab', 'Visible', 'off');
handles.kxTextAreaLabel = uicontrol('Parent', handles.DPTab, 'Style', 'text', 'Units', 'pixels', 'Position', [66 365 25 22], ...
'String', 'kx', 'HorizontalAlignment', 'right', 'Tag', 'kxTextAreaLabel');
handles.DPFractureLayerKxTextArea = uicontrol('Parent', handles.DPTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [106 329 150 60], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'DPFractureLayerKxTextArea');
handles.kyTextAreaLabel = uicontrol('Parent', handles.DPTab, 'Style', 'text', 'Units', 'pixels', 'Position', [68 289 25 22], ...
'String', 'ky', 'HorizontalAlignment', 'right', 'Tag', 'kyTextAreaLabel');
handles.DPFractureLayerKyTextArea = uicontrol('Parent', handles.DPTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [108 253 150 60], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'DPFractureLayerKyTextArea');
handles.kzTextAreaLabel = uicontrol('Parent', handles.DPTab, 'Style', 'text', 'Units', 'pixels', 'Position', [76 207 25 22], ...
'String', 'kz', 'HorizontalAlignment', 'right', 'Tag', 'kzTextAreaLabel');
handles.DPFractureLayerKzTextArea = uicontrol('Parent', handles.DPTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [116 171 150 60], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'DPFractureLayerKzTextArea');
handles.kx_matrixLayerTextAreaLabel = uicontrol('Parent', handles.DPTab, 'Style', 'text', 'Units', 'pixels', 'Position', [701 190 86 22], ...
'String', 'kx_matrixLayer', 'HorizontalAlignment', 'right', 'Tag', 'kx_matrixLayerTextAreaLabel');
handles.DPMatrixLayerKxTextArea = uicontrol('Parent', handles.DPTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [802 154 150 60], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'DPMatrixLayerKxTextArea');
handles.ky_matrixLayerTextAreaLabel = uicontrol('Parent', handles.DPTab, 'Style', 'text', 'Units', 'pixels', 'Position', [341 173 86 22], ...
'String', 'ky_matrixLayer', 'HorizontalAlignment', 'right', 'Tag', 'ky_matrixLayerTextAreaLabel');
handles.DPMatrixLayerKyTextArea = uicontrol('Parent', handles.DPTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [442 137 150 60], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'DPMatrixLayerKyTextArea');
handles.kz_matrixLayerTextAreaLabel = uicontrol('Parent', handles.DPTab, 'Style', 'text', 'Units', 'pixels', 'Position', [349 260 86 22], ...
'String', 'kz_matrixLayer', 'HorizontalAlignment', 'right', 'Tag', 'kz_matrixLayerTextAreaLabel');
handles.DPMatrixLayerKzTextArea = uicontrol('Parent', handles.DPTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [450 224 150 60], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'DPMatrixLayerKzTextArea');
handles.pori_matrixLayerTextAreaLabel = uicontrol('Parent', handles.DPTab, 'Style', 'text', 'Units', 'pixels', 'Position', [618 283 94 22], ...
'String', 'pori_matrixLayer', 'HorizontalAlignment', 'right', 'Tag', 'pori_matrixLayerTextAreaLabel');
handles.DPMatrixLayerPoriTextArea = uicontrol('Parent', handles.DPTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [727 247 150 60], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'DPMatrixLayerPoriTextArea');
handles.sigmaTextAreaLabel = uicontrol('Parent', handles.DPTab, 'Style', 'text', 'Units', 'pixels', 'Position', [373 366 37 22], ...
'String', 'sigma', 'HorizontalAlignment', 'right', 'Tag', 'sigmaTextAreaLabel');
handles.DPShapeFactorTextArea = uicontrol('Parent', handles.DPTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [425 330 150 60], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'DPShapeFactorTextArea');
handles.CommonKfLabel = uicontrol('Parent', handles.DiscretizationTab, 'Style', 'text', 'Units', 'pixels', 'Position', [83 655 65 22], ...
'String', 'CommonKf', 'HorizontalAlignment', 'right', 'Tag', 'CommonKfLabel');
handles.CommonKfTextArea = uicontrol('Parent', handles.DiscretizationTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [163 619 150 60], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'CommonKfTextArea');
handles.CommonWfLabel = uicontrol('Parent', handles.DiscretizationTab, 'Style', 'text', 'Units', 'pixels', 'Position', [333 653 68 22], ...
'String', 'CommonWf', 'HorizontalAlignment', 'right', 'Tag', 'CommonWfLabel');
handles.CommonWfTextArea = uicontrol('Parent', handles.DiscretizationTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [416 617 150 60], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'CommonWfTextArea');
handles.CommonPorfLabel = uicontrol('Parent', handles.DiscretizationTab, 'Style', 'text', 'Units', 'pixels', 'Position', [594 655 76 22], ...
'String', 'CommonPorf', 'HorizontalAlignment', 'right', 'Tag', 'CommonPorfLabel');
handles.CommonPorfTextArea = uicontrol('Parent', handles.DiscretizationTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [685 619 150 60], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'CommonPorfTextArea');
handles.CommonCporfLabel = uicontrol('Parent', handles.DiscretizationTab, 'Style', 'text', 'Units', 'pixels', 'Position', [844 651 83 22], ...
'String', 'CommonCporf', 'HorizontalAlignment', 'right', 'Tag', 'CommonCporfLabel');
handles.CommonCporfEditField = uicontrol('Parent', handles.DiscretizationTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [942 651 142 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'CommonCporfEditField');
handles.CommonPrporfLabel = uicontrol('Parent', handles.DiscretizationTab, 'Style', 'text', 'Units', 'pixels', 'Position', [843 622 86 22], ...
'String', 'CommonPrporf', 'HorizontalAlignment', 'right', 'Tag', 'CommonPrporfLabel');
handles.CommonPrporfEditField = uicontrol('Parent', handles.DiscretizationTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [944 622 140 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'CommonPrporfEditField');
handles.CommonStressFractureLabel = uicontrol('Parent', handles.DiscretizationTab, 'Style', 'text', 'Units', 'pixels', 'Position', [19 588 132 22], ...
'String', 'CommonStressFracture', 'HorizontalAlignment', 'right', 'Tag', 'CommonStressFractureLabel');
handles.CommonStressFractureEditField = uicontrol('Parent', handles.DiscretizationTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [166 588 138 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'CommonStressFractureEditField');
handles.CommonStressMatrixLabel = uicontrol('Parent', handles.DiscretizationTab, 'Style', 'text', 'Units', 'pixels', 'Position', [326 580 120 22], ...
'String', 'CommonStressMatrix', 'HorizontalAlignment', 'right', 'Tag', 'CommonStressMatrixLabel');
handles.CommonStressMatrixEditField = uicontrol('Parent', handles.DiscretizationTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [461 580 142 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'CommonStressMatrixEditField');
handles.CommonStressRefPressureLabel = uicontrol('Parent', handles.DiscretizationTab, 'Style', 'text', 'Units', 'pixels', 'Position', [666 580 154 22], ...
'String', 'CommonStressRefPressure', 'HorizontalAlignment', 'right', 'Tag', 'CommonStressRefPressureLabel');
handles.CommonStressRefPressureEditField = uicontrol('Parent', handles.DiscretizationTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [835 580 129 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'CommonStressRefPressureEditField');
handles.CommonRptLabel = uicontrol('Parent', handles.DiscretizationTab, 'Style', 'text', 'Units', 'pixels', 'Position', [53 542 72 22], ...
'String', 'CommonRpt', 'HorizontalAlignment', 'right', 'Tag', 'CommonRptLabel');
handles.CommonRptEditField = uicontrol('Parent', handles.DiscretizationTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [140 542 170 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'CommonRptEditField');
handles.CommonCfLabel = uicontrol('Parent', handles.DiscretizationTab, 'Style', 'text', 'Units', 'pixels', 'Position', [317 545 66 22], ...
'String', 'CommonCf', 'HorizontalAlignment', 'right', 'Tag', 'CommonCfLabel');
handles.CommonCfEditField = uicontrol('Parent', handles.DiscretizationTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [398 545 172 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'CommonCfEditField');
handles.CommonCaLabel = uicontrol('Parent', handles.DiscretizationTab, 'Style', 'text', 'Units', 'pixels', 'Position', [691 542 69 22], ...
'String', 'CommonCa', 'HorizontalAlignment', 'right', 'Tag', 'CommonCaLabel');
handles.CommonCaEditField = uicontrol('Parent', handles.DiscretizationTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [775 542 165 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'CommonCaEditField');
handles.CommonPrporLabel = uicontrol('Parent', handles.DiscretizationTab, 'Style', 'text', 'Units', 'pixels', 'Position', [58 503 83 22], ...
'String', 'CommonPrpor', 'HorizontalAlignment', 'right', 'Tag', 'CommonPrporLabel');
handles.CommonPrporEditField = uicontrol('Parent', handles.DiscretizationTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [156 503 148 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'CommonPrporEditField');
handles.CommonCporLabel = uicontrol('Parent', handles.DiscretizationTab, 'Style', 'text', 'Units', 'pixels', 'Position', [325 502 80 22], ...
'String', 'CommonCpor', 'HorizontalAlignment', 'right', 'Tag', 'CommonCporLabel');
handles.CommonCporEditField = uicontrol('Parent', handles.DiscretizationTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [420 502 150 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'CommonCporEditField');
handles.FlowTab = uipanel('Parent', handles.TabGroup, 'Title', 'Flow', 'Units', 'pixels', ...
'Position', [0 0 1247 698], 'Tag', 'FlowTab', 'Visible', 'off');
handles.FlowPageDropDown = uicontrol('Parent', handles.FlowTab, 'Style', 'popupmenu', 'Units', 'pixels', ...
'Position', [54 286 160 22], 'String', {'GasWater', 'OilWater', 'MultiComponent'}, 'Value', 1, 'Tag', 'FlowPageDropDown');
handles.TabGroup2 = uipanel('Parent', handles.FlowTab, 'Units', 'pixels', 'Position', [54 12 1120 267], ...
'BorderType', 'none', 'Tag', 'TabGroup2');
handles.GasWaterTab = uipanel('Parent', handles.TabGroup2, 'Title', 'GasWater', 'Units', 'pixels', ...
'Position', [0 0 1120 267], 'Tag', 'GasWaterTab', 'Visible', 'on');
handles.ifpcglEditFieldLabel = uicontrol('Parent', handles.GasWaterTab, 'Style', 'text', 'Units', 'pixels', 'Position', [37 197 33 22], ...
'String', 'ifpcgl', 'HorizontalAlignment', 'right', 'Tag', 'ifpcglEditFieldLabel');
handles.GWifpcglEditField = uicontrol('Parent', handles.GasWaterTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [85 197 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'GWifpcglEditField');
handles.RPGWTextAreaLabel = uicontrol('Parent', handles.GasWaterTab, 'Style', 'text', 'Units', 'pixels', 'Position', [21 148 42 22], ...
'String', 'RPGW', 'HorizontalAlignment', 'right', 'Tag', 'RPGWTextAreaLabel');
handles.GWRPGWTextArea = uicontrol('Parent', handles.GasWaterTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [78 112 150 60], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'GWRPGWTextArea');
handles.PRFTextAreaLabel = uicontrol('Parent', handles.GasWaterTab, 'Style', 'text', 'Units', 'pixels', 'Position', [43 71 29 22], ...
'String', 'PRF', 'HorizontalAlignment', 'right', 'Tag', 'PRFTextAreaLabel');
handles.GWPRFTextArea = uicontrol('Parent', handles.GasWaterTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [87 35 150 60], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'GWPRFTextArea');
handles.OilWaterTab = uipanel('Parent', handles.TabGroup2, 'Title', 'OilWater', 'Units', 'pixels', ...
'Position', [0 0 1120 267], 'Tag', 'OilWaterTab', 'Visible', 'off');
handles.density_o_scEditFieldLabel = uicontrol('Parent', handles.OilWaterTab, 'Style', 'text', 'Units', 'pixels', 'Position', [242 199 75 22], ...
'String', 'density_o_sc', 'HorizontalAlignment', 'right', 'Tag', 'density_o_scEditFieldLabel');
handles.OWdensity_o_scEditField = uicontrol('Parent', handles.OilWaterTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [332 199 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'OWdensity_o_scEditField');
handles.proEditFieldLabel = uicontrol('Parent', handles.OilWaterTab, 'Style', 'text', 'Units', 'pixels', 'Position', [255 168 25 22], ...
'String', 'pro', 'HorizontalAlignment', 'right', 'Tag', 'proEditFieldLabel');
handles.OWproEditField = uicontrol('Parent', handles.OilWaterTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [295 168 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'OWproEditField');
handles.BoiEditFieldLabel = uicontrol('Parent', handles.OilWaterTab, 'Style', 'text', 'Units', 'pixels', 'Position', [254 132 25 22], ...
'String', 'Boi', 'HorizontalAlignment', 'right', 'Tag', 'BoiEditFieldLabel');
handles.OWBoiEditField = uicontrol('Parent', handles.OilWaterTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [294 132 112 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'OWBoiEditField');
handles.coEditFieldLabel = uicontrol('Parent', handles.OilWaterTab, 'Style', 'text', 'Units', 'pixels', 'Position', [248 94 25 22], ...
'String', 'co', 'HorizontalAlignment', 'right', 'Tag', 'coEditFieldLabel');
handles.OWcoEditField = uicontrol('Parent', handles.OilWaterTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [288 94 111 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'OWcoEditField');
handles.voiEditFieldLabel = uicontrol('Parent', handles.OilWaterTab, 'Style', 'text', 'Units', 'pixels', 'Position', [266 60 25 22], ...
'String', 'voi', 'HorizontalAlignment', 'right', 'Tag', 'voiEditFieldLabel');
handles.OWvoiEditField = uicontrol('Parent', handles.OilWaterTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [306 60 110 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'OWvoiEditField');
handles.cvoEditFieldLabel = uicontrol('Parent', handles.OilWaterTab, 'Style', 'text', 'Units', 'pixels', 'Position', [462 194 25 22], ...
'String', 'cvo', 'HorizontalAlignment', 'right', 'Tag', 'cvoEditFieldLabel');
handles.OWcvoEditField = uicontrol('Parent', handles.OilWaterTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [502 194 112 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'OWcvoEditField');
handles.ifpcowEditFieldLabel = uicontrol('Parent', handles.OilWaterTab, 'Style', 'text', 'Units', 'pixels', 'Position', [27 123 39 22], ...
'String', 'ifpcow', 'HorizontalAlignment', 'right', 'Tag', 'ifpcowEditFieldLabel');
handles.OWifpcowEditField = uicontrol('Parent', handles.OilWaterTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [81 123 120 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'OWifpcowEditField');
handles.PRMTextAreaLabel = uicontrol('Parent', handles.OilWaterTab, 'Style', 'text', 'Units', 'pixels', 'Position', [470 148 32 22], ...
'String', 'PRM', 'HorizontalAlignment', 'right', 'Tag', 'PRMTextAreaLabel');
handles.OWPRMTextArea = uicontrol('Parent', handles.OilWaterTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [508 112 150 60], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'OWPRMTextArea');
handles.PRFTextAreaLabel_2 = uicontrol('Parent', handles.OilWaterTab, 'Style', 'text', 'Units', 'pixels', 'Position', [18 82 29 22], ...
'String', 'PRF', 'HorizontalAlignment', 'right', 'Tag', 'PRFTextAreaLabel_2');
handles.OWPRFTextArea = uicontrol('Parent', handles.OilWaterTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [62 46 150 60], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'OWPRFTextArea');
handles.oil_modelLabel = uicontrol('Parent', handles.OilWaterTab, 'Style', 'text', 'Units', 'pixels', 'Position', [50 205 56 22], ...
'String', 'oil_model', 'HorizontalAlignment', 'right', 'Tag', 'oil_modelLabel');
handles.OWoil_modelDropDown = uicontrol('Parent', handles.OilWaterTab, 'Style', 'popupmenu', 'Units', 'pixels', 'Position', [121 205 100 22], ...
'String', {''}, 'Value', 1, 'Tag', 'OWoil_modelDropDown');
setPopupDefaultValue(handles.OWoil_modelDropDown, '');
handles.MultiComponentTab = uipanel('Parent', handles.TabGroup2, 'Title', 'MultiComponent', 'Units', 'pixels', ...
'Position', [0 0 1120 267], 'Tag', 'MultiComponentTab', 'Visible', 'off');
handles.cs_NcTextAreaLabel = uicontrol('Parent', handles.MultiComponentTab, 'Style', 'text', 'Units', 'pixels', 'Position', [16 191 38 22], ...
'String', 'cs_Nc', 'HorizontalAlignment', 'right', 'Tag', 'cs_NcTextAreaLabel');
handles.MCcs_NcTextArea = uicontrol('Parent', handles.MultiComponentTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [68 156 150 60], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'MCcs_NcTextArea');
handles.kr_nosurfTextAreaLabel = uicontrol('Parent', handles.MultiComponentTab, 'Style', 'text', 'Units', 'pixels', 'Position', [17 121 55 22], ...
'String', 'kr_nosurf', 'HorizontalAlignment', 'right', 'Tag', 'kr_nosurfTextAreaLabel');
handles.MCkr_nosurfTextArea = uicontrol('Parent', handles.MultiComponentTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [86 86 150 60], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'MCkr_nosurfTextArea');
handles.kr_surfTextAreaLabel = uicontrol('Parent', handles.MultiComponentTab, 'Style', 'text', 'Units', 'pixels', 'Position', [11 44 42 22], ...
'String', 'kr_surf', 'HorizontalAlignment', 'right', 'Tag', 'kr_surfTextAreaLabel');
handles.MCkr_surfTextArea = uicontrol('Parent', handles.MultiComponentTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [67 9 150 60], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'MCkr_surfTextArea');
handles.PCTextAreaLabel = uicontrol('Parent', handles.MultiComponentTab, 'Style', 'text', 'Units', 'pixels', 'Position', [863 189 25 22], ...
'String', 'PC', 'HorizontalAlignment', 'right', 'Tag', 'PCTextAreaLabel');
handles.MCPCTextArea = uicontrol('Parent', handles.MultiComponentTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [903 153 150 60], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'MCPCTextArea');
handles.cs_Nc_fractureTextAreaLabel = uicontrol('Parent', handles.MultiComponentTab, 'Style', 'text', 'Units', 'pixels', 'Position', [258 213 86 22], ...
'String', 'cs_Nc_fracture', 'HorizontalAlignment', 'right', 'Tag', 'cs_Nc_fractureTextAreaLabel');
handles.MCcs_Nc_fractureTextArea = uicontrol('Parent', handles.MultiComponentTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [359 183 150 54], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'MCcs_Nc_fractureTextArea');
handles.kr_nosurf_fractureTextAreaLabel = uicontrol('Parent', handles.MultiComponentTab, 'Style', 'text', 'Units', 'pixels', 'Position', [244 157 102 22], ...
'String', 'kr_nosurf_fracture', 'HorizontalAlignment', 'right', 'Tag', 'kr_nosurf_fractureTextAreaLabel');
handles.MCkr_nosurf_fractureTextArea = uicontrol('Parent', handles.MultiComponentTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [361 126 150 55], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'MCkr_nosurf_fractureTextArea');
handles.kr_surf_fractureTextAreaLabel = uicontrol('Parent', handles.MultiComponentTab, 'Style', 'text', 'Units', 'pixels', 'Position', [254 94 89 22], ...
'String', 'kr_surf_fracture', 'HorizontalAlignment', 'right', 'Tag', 'kr_surf_fractureTextAreaLabel');
handles.MCkr_surf_fractureTextArea = uicontrol('Parent', handles.MultiComponentTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [358 66 150 52], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'MCkr_surf_fractureTextArea');
handles.PC_fractureTextAreaLabel = uicontrol('Parent', handles.MultiComponentTab, 'Style', 'text', 'Units', 'pixels', 'Position', [271 33 69 22], ...
'String', 'PC_fracture', 'HorizontalAlignment', 'right', 'Tag', 'PC_fractureTextAreaLabel');
handles.MCPC_fractureTextArea = uicontrol('Parent', handles.MultiComponentTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [355 5 150 52], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'MCPC_fractureTextArea');
handles.ifpcglEditFieldLabel_2 = uicontrol('Parent', handles.MultiComponentTab, 'Style', 'text', 'Units', 'pixels', 'Position', [545 112 33 22], ...
'String', 'ifpcgl', 'HorizontalAlignment', 'right', 'Tag', 'ifpcglEditFieldLabel_2');
handles.MCifpcglEditField = uicontrol('Parent', handles.MultiComponentTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [593 112 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'MCifpcglEditField');
handles.stress_factor_fractureEditFieldLabel_2 = uicontrol('Parent', handles.MultiComponentTab, 'Style', 'text', 'Units', 'pixels', 'Position', [541 197 121 22], ...
'String', 'stress_factor_fracture', 'HorizontalAlignment', 'right', 'Tag', 'stress_factor_fractureEditFieldLabel_2');
handles.MCstress_factor_fractureEditField = uicontrol('Parent', handles.MultiComponentTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [677 197 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'MCstress_factor_fractureEditField');
handles.stress_factor_matrixEditFieldLabel_2 = uicontrol('Parent', handles.MultiComponentTab, 'Style', 'text', 'Units', 'pixels', 'Position', [554 168 113 22], ...
'String', 'stress_factor_matrix', 'HorizontalAlignment', 'right', 'Tag', 'stress_factor_matrixEditFieldLabel_2');
handles.MCstress_factor_matrixEditField = uicontrol('Parent', handles.MultiComponentTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [682 168 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'MCstress_factor_matrixEditField');
handles.stress_factor_ref_pressureEditFieldLabel_2 = uicontrol('Parent', handles.MultiComponentTab, 'Style', 'text', 'Units', 'pixels', 'Position', [514 142 148 22], ...
'String', 'stress_factor_ref_pressure', 'HorizontalAlignment', 'right', 'Tag', 'stress_factor_ref_pressureEditFieldLabel_2');
handles.MCstress_factor_ref_pressureEditField = uicontrol('Parent', handles.MultiComponentTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [677 142 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'MCstress_factor_ref_pressureEditField');
handles.InitStatusLabel = uicontrol('Parent', handles.FlowTab, 'Style', 'text', 'Units', 'pixels', 'Position', [87 645 167 22], ...
'String', 'InitStatus', 'HorizontalAlignment', 'left', 'Tag', 'InitStatusLabel');
handles.InitialPressureEditFieldLabel = uicontrol('Parent', handles.FlowTab, 'Style', 'text', 'Units', 'pixels', 'Position', [58 607 81 22], ...
'String', 'InitialPressure', 'HorizontalAlignment', 'right', 'Tag', 'InitialPressureEditFieldLabel');
handles.InitialPressureEditField = uicontrol('Parent', handles.FlowTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [154 607 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'InitialPressureEditField');
handles.InitialSwEditFieldLabel = uicontrol('Parent', handles.FlowTab, 'Style', 'text', 'Units', 'pixels', 'Position', [334 609 50 22], ...
'String', 'InitialSw', 'HorizontalAlignment', 'right', 'Tag', 'InitialSwEditFieldLabel');
handles.InitialSwEditField = uicontrol('Parent', handles.FlowTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [399 609 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'InitialSwEditField');
handles.InitialCsEditFieldLabel = uicontrol('Parent', handles.FlowTab, 'Style', 'text', 'Units', 'pixels', 'Position', [567 609 48 22], ...
'String', 'InitialCs', 'HorizontalAlignment', 'right', 'Tag', 'InitialCsEditFieldLabel');
handles.InitialCsEditField = uicontrol('Parent', handles.FlowTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [630 609 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'InitialCsEditField');
handles.InitialCbEditFieldLabel = uicontrol('Parent', handles.FlowTab, 'Style', 'text', 'Units', 'pixels', 'Position', [806 609 48 22], ...
'String', 'InitialCb', 'HorizontalAlignment', 'right', 'Tag', 'InitialCbEditFieldLabel');
handles.InitialCbEditField = uicontrol('Parent', handles.FlowTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [869 609 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'InitialCbEditField');
handles.DensityWScLabel = uicontrol('Parent', handles.FlowTab, 'Style', 'text', 'Units', 'pixels', 'Position', [40 529 70 22], ...
'String', 'DensityWSc', 'HorizontalAlignment', 'right', 'Tag', 'DensityWScLabel');
handles.FlowCommonDensityWScEditField = uicontrol('Parent', handles.FlowTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [125 529 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'FlowCommonDensityWScEditField');
handles.GasLabel = uicontrol('Parent', handles.FlowTab, 'Style', 'text', 'Units', 'pixels', 'Position', [84 503 27 22], ...
'String', 'Gas', 'HorizontalAlignment', 'left', 'Tag', 'GasLabel');
handles.PrwLabel = uicontrol('Parent', handles.FlowTab, 'Style', 'text', 'Units', 'pixels', 'Position', [247 531 26 22], ...
'String', 'Prw', 'HorizontalAlignment', 'right', 'Tag', 'PrwLabel');
handles.FlowCommonPrwEditField = uicontrol('Parent', handles.FlowTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [288 531 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'FlowCommonPrwEditField');
handles.BwiLabel = uicontrol('Parent', handles.FlowTab, 'Style', 'text', 'Units', 'pixels', 'Position', [423 529 25 22], ...
'String', 'Bwi', 'HorizontalAlignment', 'right', 'Tag', 'BwiLabel');
handles.FlowCommonBwiEditField = uicontrol('Parent', handles.FlowTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [463 529 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'FlowCommonBwiEditField');
handles.CwLabel = uicontrol('Parent', handles.FlowTab, 'Style', 'text', 'Units', 'pixels', 'Position', [582 529 25 22], ...
'String', 'Cw', 'HorizontalAlignment', 'right', 'Tag', 'CwLabel');
handles.FlowCommonCwEditField = uicontrol('Parent', handles.FlowTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [622 529 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'FlowCommonCwEditField');
handles.VwiLabel = uicontrol('Parent', handles.FlowTab, 'Style', 'text', 'Units', 'pixels', 'Position', [737 529 25 22], ...
'String', 'Vwi', 'HorizontalAlignment', 'right', 'Tag', 'VwiLabel');
handles.FlowCommonVwiEditField = uicontrol('Parent', handles.FlowTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [777 529 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'FlowCommonVwiEditField');
handles.CvwLabel = uicontrol('Parent', handles.FlowTab, 'Style', 'text', 'Units', 'pixels', 'Position', [896 529 28 22], ...
'String', 'Cvw', 'HorizontalAlignment', 'right', 'Tag', 'CvwLabel');
handles.FlowCommonCvwEditField = uicontrol('Parent', handles.FlowTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [939 529 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'FlowCommonCvwEditField');
handles.PGradThresholdLabel = uicontrol('Parent', handles.FlowTab, 'Style', 'text', 'Units', 'pixels', 'Position', [1037 529 93 22], ...
'String', 'PGradThreshold', 'HorizontalAlignment', 'right', 'Tag', 'PGradThresholdLabel');
handles.FlowCommonPGradThresholdEditField = uicontrol('Parent', handles.FlowTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [1145 529 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'FlowCommonPGradThresholdEditField');
handles.WaterLabel = uicontrol('Parent', handles.FlowTab, 'Style', 'text', 'Units', 'pixels', 'Position', [78 565 37 22], ...
'String', 'Water', 'HorizontalAlignment', 'left', 'Tag', 'WaterLabel');
handles.DensityGScLabel = uicontrol('Parent', handles.FlowTab, 'Style', 'text', 'Units', 'pixels', 'Position', [38 476 68 22], ...
'String', 'DensityGSc', 'HorizontalAlignment', 'right', 'Tag', 'DensityGScLabel');
handles.FlowCommonDensityGScEditField = uicontrol('Parent', handles.FlowTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [121 476 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'FlowCommonDensityGScEditField');
handles.GasPrgLabel = uicontrol('Parent', handles.FlowTab, 'Style', 'text', 'Units', 'pixels', 'Position', [244 476 46 22], ...
'String', 'GasPrg', 'HorizontalAlignment', 'right', 'Tag', 'GasPrgLabel');
handles.FlowCommonGasPrgEditField = uicontrol('Parent', handles.FlowTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [305 476 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'FlowCommonGasPrgEditField');
handles.GasBgiLabel = uicontrol('Parent', handles.FlowTab, 'Style', 'text', 'Units', 'pixels', 'Position', [418 476 44 22], ...
'String', 'GasBgi', 'HorizontalAlignment', 'right', 'Tag', 'GasBgiLabel');
handles.FlowCommonGasBgiEditField = uicontrol('Parent', handles.FlowTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [477 476 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'FlowCommonGasBgiEditField');
handles.GasCgLabel = uicontrol('Parent', handles.FlowTab, 'Style', 'text', 'Units', 'pixels', 'Position', [604 476 42 22], ...
'String', 'GasCg', 'HorizontalAlignment', 'right', 'Tag', 'GasCgLabel');
handles.FlowCommonGasCgEditField = uicontrol('Parent', handles.FlowTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [661 476 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'FlowCommonGasCgEditField');
handles.GasVgiLabel = uicontrol('Parent', handles.FlowTab, 'Style', 'text', 'Units', 'pixels', 'Position', [787 476 44 22], ...
'String', 'GasVgi', 'HorizontalAlignment', 'right', 'Tag', 'GasVgiLabel');
handles.FlowCommonGasVgiEditField = uicontrol('Parent', handles.FlowTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [846 476 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'FlowCommonGasVgiEditField');
handles.GasCvgLabel = uicontrol('Parent', handles.FlowTab, 'Style', 'text', 'Units', 'pixels', 'Position', [964 476 48 22], ...
'String', 'GasCvg', 'HorizontalAlignment', 'right', 'Tag', 'GasCvgLabel');
handles.FlowCommonGasCvgEditField = uicontrol('Parent', handles.FlowTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [1027 476 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'FlowCommonGasCvgEditField');
handles.GasVLLabel = uicontrol('Parent', handles.FlowTab, 'Style', 'text', 'Units', 'pixels', 'Position', [55 442 42 22], ...
'String', 'GasVL', 'HorizontalAlignment', 'right', 'Tag', 'GasVLLabel');
handles.FlowCommonGasVLEditField = uicontrol('Parent', handles.FlowTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [112 442 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'FlowCommonGasVLEditField');
handles.GasPLLabel = uicontrol('Parent', handles.FlowTab, 'Style', 'text', 'Units', 'pixels', 'Position', [246 442 42 22], ...
'String', 'GasPL', 'HorizontalAlignment', 'right', 'Tag', 'GasPLLabel');
handles.FlowCommonGasPLEditField = uicontrol('Parent', handles.FlowTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [303 442 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'FlowCommonGasPLEditField');
handles.GasKnLabel = uicontrol('Parent', handles.FlowTab, 'Style', 'text', 'Units', 'pixels', 'Position', [431 434 42 22], ...
'String', 'GasKn', 'HorizontalAlignment', 'right', 'Tag', 'GasKnLabel');
handles.FlowCommonGasKnEditField = uicontrol('Parent', handles.FlowTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [488 434 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'FlowCommonGasKnEditField');
handles.GasBetaNonDarcyLabel = uicontrol('Parent', handles.FlowTab, 'Style', 'text', 'Units', 'pixels', 'Position', [623 426 105 22], ...
'String', 'GasBetaNonDarcy', 'HorizontalAlignment', 'right', 'Tag', 'GasBetaNonDarcyLabel');
handles.FlowCommonGasBetaNonDarcyEditField = uicontrol('Parent', handles.FlowTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [743 426 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'FlowCommonGasBetaNonDarcyEditField');
handles.WellsTab = uipanel('Parent', handles.TabGroup, 'Title', 'Wells', 'Units', 'pixels', ...
'Position', [0 0 1247 698], 'Tag', 'WellsTab', 'Visible', 'off');
handles.Well1Table = uitable('Parent', handles.WellsTab, 'Units', 'pixels', 'Position', [43 194 446 167], ...
'ColumnName', {'well_name', 'nperf', 'index_xyz', 'rw', 'skin', 'well_type'}, ...
'ColumnWidth', {90, 55, 95, 55, 55, 90}, 'RowName', {}, 'ColumnEditable', true, 'Tag', 'Well1Table');
handles.FractureWellLocationTable = uitable('Parent', handles.WellsTab, 'Units', 'pixels', 'Position', [737 520 445 100], ...
'ColumnName', {'x', 'y', 'z'}, 'ColumnWidth', {140, 140, 140}, ...
'RowName', {}, 'ColumnEditable', true, 'Tag', 'FractureWellLocationTable');
handles.Well2Table = uitable('Parent', handles.WellsTab, 'Units', 'pixels', 'Position', [35 476 594 185], ...
'ColumnName', {'well_name', 'nperf', 'perfnum', 'rw', 'skin', 'well_type'}, ...
'ColumnWidth', {100, 70, 120, 70, 70, 130}, 'RowName', {}, 'ColumnEditable', true, 'Tag', 'Well2Table');
handles.ScheduleTable = uitable('Parent', handles.WellsTab, 'Units', 'pixels', 'Position', [552 176 362 185], ...
'ColumnName', {'Schedule'}, 'ColumnWidth', {100}, 'RowName', {}, 'ColumnEditable', true, 'Tag', 'ScheduleTable');
handles.TimeTextAreaLabel = uicontrol('Parent', handles.WellsTab, 'Style', 'text', 'Units', 'pixels', 'Position', [949 288 31 22], ...
'String', 'Time', 'HorizontalAlignment', 'right', 'Tag', 'TimeTextAreaLabel');
handles.TimeTextArea = uicontrol('Parent', handles.WellsTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [995 288 181 22], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'TimeTextArea');
handles.DtMinTextAreaLabel = uicontrol('Parent', handles.WellsTab, 'Style', 'text', 'Units', 'pixels', 'Position', [943 240 36 22], ...
'String', 'DtMin', 'HorizontalAlignment', 'right', 'Tag', 'DtMinTextAreaLabel');
handles.DtMinTextArea = uicontrol('Parent', handles.WellsTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [994 240 182 22], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'DtMinTextArea');
handles.DtMaxTextAreaLabel = uicontrol('Parent', handles.WellsTab, 'Style', 'text', 'Units', 'pixels', 'Position', [944 184 40 22], ...
'String', 'DtMax', 'HorizontalAlignment', 'right', 'Tag', 'DtMaxTextAreaLabel');
handles.DtMaxTextArea = uicontrol('Parent', handles.WellsTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [999 183 182 24], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'DtMaxTextArea');
handles.AddWell1RowButton = uicontrol('Parent', handles.WellsTab, 'Style', 'pushbutton', 'Units', 'pixels', 'Position', [144 128 100 41], ...
'String', 'AddWell1Row', 'Tag', 'AddWell1RowButton');
handles.DeleteWell1RowButton = uicontrol('Parent', handles.WellsTab, 'Style', 'pushbutton', 'Units', 'pixels', 'Position', [309 126 103 41], ...
'String', 'DeleteWell1Row', 'Tag', 'DeleteWell1RowButton');
handles.DeleteWell2RowButton = uicontrol('Parent', handles.WellsTab, 'Style', 'pushbutton', 'Units', 'pixels', 'Position', [414 425 103 23], ...
'String', 'DeleteWell2Row', 'Tag', 'DeleteWell2RowButton');
handles.AddWell2RowButton = uicontrol('Parent', handles.WellsTab, 'Style', 'pushbutton', 'Units', 'pixels', 'Position', [188 427 100 23], ...
'String', 'AddWell2Row', 'Tag', 'AddWell2RowButton');
handles.AddScheduleRowButton = uicontrol('Parent', handles.WellsTab, 'Style', 'pushbutton', 'Units', 'pixels', 'Position', [649 123 110 23], ...
'String', 'AddScheduleRow', 'Tag', 'AddScheduleRowButton');
handles.DeleteScheduleRowButton = uicontrol('Parent', handles.WellsTab, 'Style', 'pushbutton', 'Units', 'pixels', 'Position', [790 123 124 23], ...
'String', 'DeleteScheduleRow', 'Tag', 'DeleteScheduleRowButton');
handles.DeleteFracLocRowButton = uicontrol('Parent', handles.WellsTab, 'Style', 'pushbutton', 'Units', 'pixels', 'Position', [1096 466 117 23], ...
'String', 'DeleteFracLocRow', 'Tag', 'DeleteFracLocRowButton');
handles.AddFracLocRowButton = uicontrol('Parent', handles.WellsTab, 'Style', 'pushbutton', 'Units', 'pixels', 'Position', [954 464 104 23], ...
'String', 'AddFracLocRow', 'Tag', 'AddFracLocRowButton');
handles.ScheduleTimeConfigLabel = uicontrol('Parent', handles.WellsTab, 'Style', 'text', 'Units', 'pixels', 'Position', [1003 331 131 30], ...
'String', 'Schedule Time Config', 'HorizontalAlignment', 'left', 'Tag', 'ScheduleTimeConfigLabel');
handles.ConventionalWellsLabel = uicontrol('Parent', handles.WellsTab, 'Style', 'text', 'Units', 'pixels', 'Position', [27 130 108 40], ...
'String', 'Conventional Wells', 'HorizontalAlignment', 'left', 'Tag', 'ConventionalWellsLabel');
handles.FractureWellsLabel = uicontrol('Parent', handles.WellsTab, 'Style', 'text', 'Units', 'pixels', 'Position', [43 428 82 22], ...
'String', 'Fracture Wells', 'HorizontalAlignment', 'left', 'Tag', 'FractureWellsLabel');
handles.ScheduleLabel = uicontrol('Parent', handles.WellsTab, 'Style', 'text', 'Units', 'pixels', 'Position', [555 127 55 22], ...
'String', 'Schedule', 'HorizontalAlignment', 'left', 'Tag', 'ScheduleLabel');
handles.SelectedFractureWellLabel = uicontrol('Parent', handles.WellsTab, 'Style', 'text', 'Units', 'pixels', 'Position', [723 464 126 22], ...
'String', 'Selected Fracture Well', 'HorizontalAlignment', 'right', 'Tag', 'SelectedFractureWellLabel');
handles.SelectedFracWellDropDown = uicontrol('Parent', handles.WellsTab, 'Style', 'popupmenu', 'Units', 'pixels', 'Position', [864 464 70 22], ...
'String', {''}, 'Value', 1, 'Tag', 'SelectedFracWellDropDown');
setPopupDefaultValue(handles.SelectedFracWellDropDown, '');
handles.SolverRunTab = uipanel('Parent', handles.TabGroup, 'Title', 'Solver&Run', 'Units', 'pixels', ...
'Position', [0 0 1247 698], 'Tag', 'SolverRunTab', 'Visible', 'off');
handles.RunLogTextAreaLabel = uicontrol('Parent', handles.SolverRunTab, 'Style', 'text', 'Units', 'pixels', 'Position', [263 571 47 22], ...
'String', 'RunLog', 'HorizontalAlignment', 'right', 'Tag', 'RunLogTextAreaLabel');
handles.RunLogTextArea = uicontrol('Parent', handles.SolverRunTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [325 150 899 445], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'RunLogTextArea');
handles.RunProgressLabel = uicontrol('Parent', handles.SolverRunTab, 'Style', 'text', 'Units', 'pixels', 'Position', [313 624 209 22], ...
'String', 'RunProgress', 'HorizontalAlignment', 'left', 'Tag', 'RunProgressLabel');
handles.YitaPEditFieldLabel = uicontrol('Parent', handles.SolverRunTab, 'Style', 'text', 'Units', 'pixels', 'Position', [59 565 33 22], ...
'String', 'YitaP', 'HorizontalAlignment', 'right', 'Tag', 'YitaPEditFieldLabel');
handles.YitaPEditField = uicontrol('Parent', handles.SolverRunTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [113 565 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'YitaPEditField');
handles.YitaSEditFieldLabel = uicontrol('Parent', handles.SolverRunTab, 'Style', 'text', 'Units', 'pixels', 'Position', [57 515 33 22], ...
'String', 'YitaS', 'HorizontalAlignment', 'right', 'Tag', 'YitaSEditFieldLabel');
handles.YitaSEditField = uicontrol('Parent', handles.SolverRunTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [113 515 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'YitaSEditField');
handles.OmegaEditFieldLabel = uicontrol('Parent', handles.SolverRunTab, 'Style', 'text', 'Units', 'pixels', 'Position', [53 471 44 22], ...
'String', 'Omega', 'HorizontalAlignment', 'right', 'Tag', 'OmegaEditFieldLabel');
handles.OmegaEditField = uicontrol('Parent', handles.SolverRunTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [113 471 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'OmegaEditField');
handles.NmaxEditFieldLabel = uicontrol('Parent', handles.SolverRunTab, 'Style', 'text', 'Units', 'pixels', 'Position', [53 417 36 22], ...
'String', 'Nmax', 'HorizontalAlignment', 'right', 'Tag', 'NmaxEditFieldLabel');
handles.NmaxEditField = uicontrol('Parent', handles.SolverRunTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [113 418 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'NmaxEditField');
handles.EpsAveEditFieldLabel = uicontrol('Parent', handles.SolverRunTab, 'Style', 'text', 'Units', 'pixels', 'Position', [49 365 46 22], ...
'String', 'EpsAve', 'HorizontalAlignment', 'right', 'Tag', 'EpsAveEditFieldLabel');
handles.EpsAveEditField = uicontrol('Parent', handles.SolverRunTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [113 361 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'EpsAveEditField');
handles.EpsMaxEditFieldLabel = uicontrol('Parent', handles.SolverRunTab, 'Style', 'text', 'Units', 'pixels', 'Position', [49 308 48 22], ...
'String', 'EpsMax', 'HorizontalAlignment', 'right', 'Tag', 'EpsMaxEditFieldLabel');
handles.EpsMaxEditField = uicontrol('Parent', handles.SolverRunTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [113 308 100 22], ...
'HorizontalAlignment', 'left', 'String', '0', 'UserData', struct('Type', 'numeric'), 'Tag', 'EpsMaxEditField');
handles.ResultsTab = uipanel('Parent', handles.TabGroup, 'Title', 'Results', 'Units', 'pixels', ...
'Position', [0 0 1247 698], 'Tag', 'ResultsTab', 'Visible', 'off');
handles.ResultAxes = axes('Parent', handles.ResultsTab, 'Units', 'pixels', 'Position', [217 22 987 585], 'Tag', 'ResultAxes');
handles.Plot2DLayerButton = uicontrol('Parent', handles.ResultsTab, 'Style', 'pushbutton', 'Units', 'pixels', 'Position', [55 445 111 23], ...
'String', 'Plot2DLayer', 'Tag', 'Plot2DLayerButton');
handles.Plot3DDistributionButton = uicontrol('Parent', handles.ResultsTab, 'Style', 'pushbutton', 'Units', 'pixels', 'Position', [49 379 115 23], ...
'String', 'Plot3DDistribution', 'Tag', 'Plot3DDistributionButton');
handles.PlotPermButton = uicontrol('Parent', handles.ResultsTab, 'Style', 'pushbutton', 'Units', 'pixels', 'Position', [52 329 111 23], ...
'String', 'PlotPerm', 'Tag', 'PlotPermButton');
handles.PlotSPDPButton = uicontrol('Parent', handles.ResultsTab, 'Style', 'pushbutton', 'Units', 'pixels', 'Position', [47 278 116 23], ...
'String', 'PlotSPDP', 'Tag', 'PlotSPDPButton');
handles.PlotWellResponseButton = uicontrol('Parent', handles.ResultsTab, 'Style', 'pushbutton', 'Units', 'pixels', 'Position', [50 502 117 23], ...
'String', 'PlotWellResponse', 'Tag', 'PlotWellResponseButton');
handles.PlotLayerDropDownLabel = uicontrol('Parent', handles.ResultsTab, 'Style', 'text', 'Units', 'pixels', 'Position', [15 224 56 22], ...
'String', 'PlotLayer', 'HorizontalAlignment', 'right', 'Tag', 'PlotLayerDropDownLabel');
handles.PlotLayerDropDown = uicontrol('Parent', handles.ResultsTab, 'Style', 'popupmenu', 'Units', 'pixels', 'Position', [86 224 78 22], ...
'String', {''}, 'Value', 1, 'Tag', 'PlotLayerDropDown');
setPopupDefaultValue(handles.PlotLayerDropDown, '');
handles.PlotPropertyDropDownLabel = uicontrol('Parent', handles.ResultsTab, 'Style', 'text', 'Units', 'pixels', 'Position', [8 182 71 22], ...
'String', 'PlotProperty', 'HorizontalAlignment', 'right', 'Tag', 'PlotPropertyDropDownLabel');
handles.PlotPropertyDropDown = uicontrol('Parent', handles.ResultsTab, 'Style', 'popupmenu', 'Units', 'pixels', 'Position', [94 182 68 22], ...
'String', {''}, 'Value', 1, 'Tag', 'PlotPropertyDropDown');
setPopupDefaultValue(handles.PlotPropertyDropDown, '');
handles.PlotMetricDropDownLabel = uicontrol('Parent', handles.ResultsTab, 'Style', 'text', 'Units', 'pixels', 'Position', [5 97 58 22], ...
'String', 'PlotMetric', 'HorizontalAlignment', 'right', 'Tag', 'PlotMetricDropDownLabel');
handles.PlotMetricDropDown = uicontrol('Parent', handles.ResultsTab, 'Style', 'popupmenu', 'Units', 'pixels', 'Position', [78 97 86 22], ...
'String', {''}, 'Value', 1, 'Tag', 'PlotMetricDropDown');
setPopupDefaultValue(handles.PlotMetricDropDown, '');
handles.PlotWellDropDownLabel = uicontrol('Parent', handles.ResultsTab, 'Style', 'text', 'Units', 'pixels', 'Position', [12 139 49 22], ...
'String', 'PlotWell', 'HorizontalAlignment', 'right', 'Tag', 'PlotWellDropDownLabel');
handles.PlotWellDropDown = uicontrol('Parent', handles.ResultsTab, 'Style', 'popupmenu', 'Units', 'pixels', 'Position', [76 139 87 22], ...
'String', {''}, 'Value', 1, 'Tag', 'PlotWellDropDown');
setPopupDefaultValue(handles.PlotWellDropDown, '');
handles.PlotTimeStepSlider = uicontrol('Parent', handles.ResultsTab, 'Style', 'slider', 'Units', 'pixels', 'Position', [15 574 150 20], ...
'Min', 0, 'Max', 100, 'Value', 0, 'Tag', 'PlotTimeStepSlider');
handles.PlotTimeStepValueLabel = uicontrol('Parent', handles.ResultsTab, 'Style', 'text', 'Units', 'pixels', 'Position', [54 609 106 22], ...
'String', 'PlotTimeStepValue', 'HorizontalAlignment', 'left', 'Tag', 'PlotTimeStepValueLabel');
handles.ResultSummaryTextAreaLabel = uicontrol('Parent', handles.ResultsTab, 'Style', 'text', 'Units', 'pixels', 'Position', [312 625 90 21], ...
'String', 'ResultSummary', 'HorizontalAlignment', 'right', 'Tag', 'ResultSummaryTextAreaLabel');
handles.ResultSummaryTextArea = uicontrol('Parent', handles.ResultsTab, 'Style', 'edit', 'Units', 'pixels', 'Position', [460 619 636 44], ...
'Max', 2, 'Min', 0, 'HorizontalAlignment', 'left', 'String', '', 'Tag', 'ResultSummaryTextArea');
handles.NewConfigButton = uicontrol('Parent', fig, 'Style', 'pushbutton', 'Units', 'pixels', 'Position', [292 773 94 23], ...
'String', 'New Config', 'Tag', 'NewConfigButton');
title(handles.ResultAxes, 'Result');
xlabel(handles.ResultAxes, 'X');
ylabel(handles.ResultAxes, 'Y');
zlabel(handles.ResultAxes, 'Z');
set(fig, 'Visible', 'on');
end
function setPopupDefaultValue(handleObj, value)
items = get(handleObj, 'String');
if ischar(items), items = cellstr(items); end
idx = find(strcmp(items, char(string(value))), 1);
if isempty(idx), idx = 1; end
set(handleObj, 'Value', idx);
end
+55
View File
@@ -0,0 +1,55 @@
function edit_edfm_guide_page(pageName, figPath)
%EDIT_EDFM_GUIDE_PAGE Open EDFMSimulatorGuide.fig in GUIDE on one page.
% EDIT_EDFM_GUIDE_PAGE('Model') saves the main FIG with only the Model
% panel visible, then opens that same FIG in GUIDE.
%
% Save and close an already-open GUIDE editor before switching pages this
% way, otherwise GUIDE may keep an older in-memory copy.
if nargin < 2 || strlength(string(figPath)) == 0
figPath = fullfile(fileparts(mfilename('fullpath')), 'EDFMSimulatorGuide.fig');
end
if exist(figPath, 'file') ~= 2
error('edit_edfm_guide_page:MissingFig', 'FIG file not found: %s', figPath);
end
fig = openfig(figPath, 'invisible');
cleanupObj = onCleanup(@() closeFigureIfValid(fig));
show_edfm_guide_page(fig, pageName);
syncSelectorValue(fig, pageName);
set(fig, 'Visible', 'on');
savefig(fig, figPath);
close(fig);
delete(cleanupObj);
guide(figPath);
end
function syncSelectorValue(fig, pageName)
pageName = char(string(pageName));
setPopupValue(findobj(fig, 'Tag', 'PageDropDown'), pageName);
setPopupValue(findobj(fig, 'Tag', 'DiscretizationPageDropDown'), pageName);
setPopupValue(findobj(fig, 'Tag', 'FlowPageDropDown'), pageName);
end
function setPopupValue(handleObj, value)
if isempty(handleObj) || ~isgraphics(handleObj)
return;
end
items = get(handleObj, 'String');
if ischar(items)
items = cellstr(items);
end
idx = find(strcmp(items, value), 1);
if ~isempty(idx)
set(handleObj, 'Value', idx);
end
end
function closeFigureIfValid(fig)
if ~isempty(fig) && isgraphics(fig)
close(fig);
end
end
+4 -2
View File
@@ -1,5 +1,7 @@
function app = launch_edfm_simulator_app() function app = launch_edfm_simulator_app()
%LAUNCH_EDFM_SIMULATOR_APP Launch the EDFM Simulator App. %LAUNCH_EDFM_SIMULATOR_APP General EDFM GUI launcher.
% MATLAB R2022a-compatible GUIDE/uicontrol implementation is used by default.
startup; startup;
app = EDFMSimulatorApp(); app = EDFMSimulatorGuide();
end
@@ -0,0 +1,6 @@
function app = launch_edfm_simulator_guide()
%LAUNCH_EDFM_SIMULATOR_GUIDE Launch the MATLAB R2022a GUIDE-compatible EDFM GUI.
startup;
app = EDFMSimulatorGuide();
end
+91
View File
@@ -0,0 +1,91 @@
function show_edfm_guide_page(figOrPage, pageName)
%SHOW_EDFM_GUIDE_PAGE Show one GUIDE page panel and hide the others.
% SHOW_EDFM_GUIDE_PAGE('Flow') finds the open EDFM GUIDE figure.
% SHOW_EDFM_GUIDE_PAGE(FIG, 'Flow') uses the specified figure.
%
% This helper is intended for GUIDE editing. The GUIDE Object Browser can
% turn a hidden panel on, but another visible panel may still cover it.
if nargin == 1
pageName = figOrPage;
fig = findOpenEdfmGuideFigure();
else
fig = figOrPage;
end
if isempty(fig) || ~isgraphics(fig)
error('show_edfm_guide_page:InvalidFigure', ...
['No open EDFM GUIDE figure was found. Open EDFMSimulatorGuide.fig ', ...
'in GUIDE first, or call show_edfm_guide_page(fig, pageName).']);
end
pageTags = struct( ...
'model', 'ModelTab', ...
'grid', 'GridTab', ...
'fracture', 'FractureTab', ...
'discretization', 'DiscretizationTab', ...
'flow', 'FlowTab', ...
'wells', 'WellsTab', ...
'solverrun', 'SolverRunTab', ...
'solver_run', 'SolverRunTab', ...
'results', 'ResultsTab', ...
'sp', 'SPTab', ...
'dp', 'DPTab', ...
'gaswater', 'GasWaterTab', ...
'oilwater', 'OilWaterTab', ...
'multicomponent', 'MultiComponentTab');
key = lower(regexprep(char(string(pageName)), '[^a-zA-Z0-9_]', ''));
if ~isfield(pageTags, key)
error('show_edfm_guide_page:UnknownPage', 'Unknown page name: %s', char(string(pageName)));
end
targetTag = pageTags.(key);
groups = {
{'ModelTab', 'GridTab', 'FractureTab', 'DiscretizationTab', 'FlowTab', 'WellsTab', 'SolverRunTab', 'ResultsTab'}
{'SPTab', 'DPTab'}
{'GasWaterTab', 'OilWaterTab', 'MultiComponentTab'}
};
for groupIndex = 1:numel(groups)
group = groups{groupIndex};
if any(strcmp(group, targetTag))
for i = 1:numel(group)
panel = findobj(fig, 'Tag', group{i});
if ~isempty(panel)
if strcmp(group{i}, targetTag)
set(panel, 'Visible', 'on');
try
uistack(panel, 'top');
catch
end
else
set(panel, 'Visible', 'off');
end
end
end
end
end
end
function fig = findOpenEdfmGuideFigure()
fig = [];
figures = findall(0, 'Type', 'figure');
for i = 1:numel(figures)
if hasEdfmPagePanels(figures(i))
fig = figures(i);
return;
end
end
end
function tf = hasEdfmPagePanels(fig)
requiredTags = {'ModelTab', 'ResultsTab', 'PageDropDown'};
tf = true;
for i = 1:numel(requiredTags)
if isempty(findobj(fig, 'Tag', requiredTags{i}))
tf = false;
return;
end
end
end