Skip to content

Commit db8514c

Browse files
committed
Revised comments on functions and error messages in if statements for consistency
1 parent 64398f2 commit db8514c

File tree

6 files changed

+30
-12
lines changed

6 files changed

+30
-12
lines changed

PDMATLAB2D.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function PDMATLAB2D(InputDeck)
3030
cd('InputFiles/')
3131
run(InputDeck);
3232

33-
% Run main function
33+
% Run Main script
3434
cd('../Source/')
3535
Main
3636

Source/ForceEnergyDensity.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,16 @@
5959
%
6060
% The input variable "model" currently only takes 'GPMB' as valid input.
6161
% Additional models can be added using the overall if statement by adding
62-
% an extra condition. As an example, if an 'X' model is needed, one could
63-
% extend the if statement as follows:
62+
% an elseif statement to specify a condition for each desired model. As an example,
63+
% if the 'X' model is needed, one could extend the if statement as follows:
6464
%
6565
% if strcmp(model,'GPMB')
6666
%
6767
% elseif strcmp(model,'X')
6868
%
6969
% else
7070
%
71-
% error('Model unknown.')
71+
% error('Invalid model.')
7272
%
7373
% end
7474

@@ -269,7 +269,7 @@
269269

270270
else
271271

272-
error('Model unknown.')
272+
error('Invalid model.')
273273

274274
end
275275

Source/Main.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
% ========================================================================
1212

1313
% ========================================================================
14-
% Main function for running a PDMATLAB2D simulation
14+
% Main script for running a PDMATLAB2D simulation
1515
% ========================================================================
1616

1717
% Check if simulation output directory exists and creates it otherwise

Source/NeighborAreaBondLengthCoord.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@
584584

585585
else
586586

587-
error('Unknown algorithm name.')
587+
error('Invalid AlgName.')
588588

589589
end
590590

Source/PDBondConstants.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,16 @@
5050
%
5151
% The input variable "model" currently only takes 'GPMB' as valid input.
5252
% Additional models can be added using the overall if statement by adding
53-
% an extra condition. As an example, if an 'X' model is needed, one could
54-
% extend the if statement as follows:
53+
% an elseif statement to specify a condition for each desired model. As an example,
54+
% if the 'X' model is needed, one could extend the if statement as follows:
5555
%
5656
% if strcmp(model,'GPMB')
5757
%
5858
% elseif strcmp(model,'X')
5959
%
6060
% else
6161
%
62-
% error('Model unknown.')
62+
% error('Invalid model.')
6363
%
6464
% end
6565

@@ -161,13 +161,13 @@
161161

162162
else
163163

164-
error('PlanarModel unknown.')
164+
error('Invalid PlanarModel.')
165165

166166
end
167167

168168
else
169169

170-
error('Model unknown.')
170+
error('Invalid model.')
171171

172172
end
173173

Source/TimeIntegrator.m

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,24 @@
6666
% W : macroleastic energy density for all nodes (at time t+dt)
6767
% u_NA : updated array of neighbor numbers for all nodes after possible bond breaking (at time t+dt)
6868

69+
% Discussion:
70+
% ----------
71+
% The input variable "TimeScheme" currently only takes 'VVerlet' as valid input.
72+
% Additional time-integration schemes can be added using the overall if statement
73+
% by adding an elseif statement to specify a condition for each desired
74+
% time-integration scheme. As an example, if the 'X' time-integration scheme
75+
% is needed, one could extend the if statement as follows:
76+
%
77+
% if strcmp(TimeScheme,'VVerlet')
78+
%
79+
% elseif strcmp(TimeScheme,'X')
80+
%
81+
% else
82+
%
83+
% error('Invalid TimeScheme.')
84+
%
85+
% end
86+
6987
function [v,w,Vv,Vw,Fv,Fw,bv,bw,W,u_NA] = TimeIntegrator(TimeScheme,xx,yy,v,w,Vv,Vw,Fv,Fw,bv,bw,t,bvfunc,bwfunc,dt,u_NA,IF_NA,V_NA,r_hat_NA,x_hat_NA,y_hat_NA,rho,c,model,flag_RDUG,so,mask_nofail,flag_BB)
7088

7189
% --------------------------------------------------------------------

0 commit comments

Comments
 (0)