Skip to content

Commit

Permalink
feat: ✨ make options a class with validated properties
Browse files Browse the repository at this point in the history
  • Loading branch information
djmaxus committed Aug 9, 2024
1 parent 4cd975c commit a02bf4a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion demo.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
%% Inputs

params = gen_params (); % rock and fluid parameters
options = gen_options(); % StrataTrapper options
options = Options(); % StrataTrapper options

%% Downscaling demo

Expand Down
8 changes: 8 additions & 0 deletions src/Options.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
classdef Options
properties
sat_num_points (1,1) uint32 {mustBePositive} = 40
sat_tol (1,1) double {mustBeNonnegative} = 1e-8
subscale (1,1) double {mustBePositive} = 50 * meter();
end
end

2 changes: 1 addition & 1 deletion src/downscale_upscale.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
dr (1,3) double
saturations (1,:) double
params (1,1) struct
options (1,1) struct
options (1,1) Options
end


Expand Down
7 changes: 0 additions & 7 deletions src/gen_options.m

This file was deleted.

2 changes: 1 addition & 1 deletion strata_trapper.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
rock (1,1) struct
mask (:,1) logical
params (1,1) struct
options (1,1) struct
options (1,1) Options = Options();
enable_waitbar (1,1) logical = false;
num_par_workers (1,1) uint32 = Inf;
end
Expand Down

0 comments on commit a02bf4a

Please sign in to comment.