-
Notifications
You must be signed in to change notification settings - Fork 24
/
SiStER_MAIN.m
93 lines (69 loc) · 2.83 KB
/
SiStER_MAIN.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
% SiStER_MAIN.m
%
% Simple Stokes solver with Exotic Rheologies
%
% Main routine doing initialization, time loop and outputs
%
%
% J.-A. Olive, B.Z. Klein, E. Mittelstaedt, M. Behn, G. Ito, S. Howell
% jaolive <at> ldeo.columbia.edu
% March 2011 - April 2017
close all
% INITIALIZATION
% Input File: loads parameter values, model geometry, boundary conditions
if exist('running_from_SiStER_RUN','var')==0
clear
InpFil = input('Input file ? ','s');
end
run(InpFil)
% construct grid and initialize marker / node arrays
SiStER_Initialize
% BEGIN TIME LOOP %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
time=0;
for t=1:Nt % time loop
disp(['STARTING ITERATION: ' num2str(t) ' out of ' num2str(Nt)])
% update time
time=time+dt_m;
% Here we prepare nodal arrays to feed the Stokes solver
SiStER_material_props_on_nodes
%%% SOLVE STOKES WITH NON-LINEAR RHEOLOGY HERE
SiStER_flow_solve
% GET STRAIN RATE FROM CURRENT SOLUTION
epsIIm=SiStER_interp_shear_nodes_to_markers(epsII_s,x,y,xm,ym,icn,jcn);
% USE STRAIN RATE TO UPDATE STRESSES ON MARKERS
SiStER_update_marker_stresses;
% BUILD UP PLASTIC STRAIN IN YIELDING AREAS IF PLASTICITY IS ACTIVATED
if (PARAMS.YNPlas==1)
SiStER_update_ep;
end
% OUTPUT VARIABLES OF INTEREST (prior to rotation & advection)
if (mod(t,dt_out)==0 && dt_out>0) || t==1 || t==Nt % SAVING SELECTED OUTPUT
disp('SAVING SELECTED VARIABLES TO OUTPUT FILE')
filename=num2str(t);
[etam]=SiStER_interp_shear_nodes_to_markers(etas,x,y,xm,ym,icn,jcn); % to visualize viscosity on markers
save(filename,'X','Y','vx','vy','p','time','xm','ym','etam','rhom','BC','etan','Tm','im','idm','epsIIm','sxxm','sxym','ep','epNH','icn','jcn','qd','topo_x','topo_y')
end
% SET ADVECTION TIME STEP BASED ON CURRENT FLOW SOLUTION
[dt_m]=SiStER_set_timestep(dx,dy,vx,vy,PARAMS);
% ROTATE ELASTIC STRESSES IN CURRENT FLOW FIELD
if (PARAMS.YNElast==1)
SiStER_rotate_stresses;
end
% EVOLVE TEMPERATURE FIELD THROUGH DIFFUSION
if PARAMS.Tsolve==1
SiStER_thermal_update;
end
% MARKER ADVECTION, REMOVAL, AND ADDITION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SiStER_move_remove_and_reseed_markers;
% advect markers in current flow field
% remove markers if necessary
% add markers if necessary
SiStER_update_topography_markers
% here we do the same for the marker chain that keeps track of topography
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
disp('---------------')
disp(['END OF ITERATION: ' num2str(t) ' out of ' num2str(Nt) ' - SIMULATION TIME: ' num2str(time/365.25/24/3600/1000) ' kyrs.'])
disp('--------------------------------')
disp('--------------------------------')
end
disp('FIN')