Source

PetIGA / demo / CahnHilliard3D.c

Nathan Collier 204d9b7 


Nathan Collier 5bd977f 
Nathan Collier 204d9b7 
Nathan Collier 0b8e519 
Nathan Collier 23b17a3 

Nathan Collier 204d9b7 










Nathan Collier 5bd977f 










Lisandro Dalcin b62e97a 
Nathan Collier 5bd977f 




Lisandro Dalcin 9bb9f2d 

Nathan Collier 5bd977f 
Nathan Collier 23b17a3 
Nathan Collier 5bd977f 



Nathan Collier 204d9b7 



























Lisandro Dalcin f0d255a 
Nathan Collier 204d9b7 

Lisandro Dalcin 9bb9f2d 

Nathan Collier 204d9b7 






Lisandro Dalcin 9bb9f2d 

Nathan Collier 204d9b7 











































Lisandro Dalcin f0d255a 
Nathan Collier 204d9b7 

Lisandro Dalcin 9bb9f2d 

Nathan Collier 204d9b7 






Lisandro Dalcin 9bb9f2d 

Nathan Collier 204d9b7 









































































Nathan Collier a9d50c0 

Nathan Collier 204d9b7 


Nathan Collier a9d50c0 



Nathan Collier 204d9b7 

Nathan Collier acb42c0 
Nathan Collier 5bd977f 






Nathan Collier 23b17a3 
Nathan Collier 5bd977f 
Nathan Collier 23b17a3 
Nathan Collier acb42c0 
Nathan Collier 23b17a3 


Nathan Collier 5bd977f 


Nathan Collier 204d9b7 
Nathan Collier 23b17a3 






































Nathan Collier 886bcb7 
Nathan Collier 23b17a3 















































Nathan Collier 204d9b7 













Nathan Collier 0b8e519 
Nathan Collier 204d9b7 



Nathan Collier e706796 
Lisandro Dalcin 1798b28 




Nathan Collier 204d9b7 





Nathan Collier e706796 

Nathan Collier 204d9b7 
Nathan Collier 0b8e519 



Nathan Collier 204d9b7 









Nathan Collier acb42c0 
Lisandro Dalcin 1798b28 
Nathan Collier 23b17a3 
Nathan Collier 204d9b7 
Nathan Collier 5bd977f 

Nathan Collier acb42c0 
Lisandro Dalcin 1798b28 
Nathan Collier 5bd977f 
Nathan Collier 204d9b7 
Lisandro Dalcin 1798b28 
Nathan Collier 204d9b7 
Nathan Collier acb42c0 
Nathan Collier 204d9b7 

Lisandro Dalcin ce59474 
Nathan Collier 204d9b7 

Nathan Collier 23b17a3 

Lisandro Dalcin 16f254a 
Lisandro Dalcin 1798b28 
Lisandro Dalcin ce59474 
Lisandro Dalcin 16f254a 
Lisandro Dalcin ce59474 
Nathan Collier 204d9b7 





Nathan Collier 23b17a3 
  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
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
#include "petiga.h"

typedef struct { 
  IGA iga;
  PetscReal theta,cbar,alpha;
  PetscReal L0,lambda,tau;
  Vec X0,E;
  PetscScalar energy[3],time[3];
} AppCtx;

#undef  __FUNCT__
#define __FUNCT__ "Mobility"
void Mobility(AppCtx *user,PetscReal c,PetscReal *M,PetscReal *dM,PetscReal *d2M)
{
  if (M)   *M   = c*(1-c);
  if (dM)  *dM  = 1-2*c;
  if (d2M) *d2M = -2;
}

#undef __FUNCT__
#define __FUNCT__ "GinzburgLandauFreeEnergy"
PetscScalar GinzburgLandauFreeEnergy(PetscReal c,PetscReal cx,PetscReal cy,PetscReal cz,AppCtx *user)
{
  PetscReal E,omc = 1.0-c;
  E=c*log(c)+omc*log(omc)+2.0*user->theta*c*omc+user->theta/3.0/user->alpha*fabs(cx*cx+cy*cy+cz*cz);
  return E;
}

#undef  __FUNCT__
#define __FUNCT__ "Stats"
PetscErrorCode Stats(IGAPoint p,const PetscScalar *U,PetscInt n,PetscScalar *S,void *ctx)
{
  PetscFunctionBegin;
  AppCtx *user = (AppCtx *)ctx;
 
  PetscScalar c,c1[3];
  IGAPointFormValue(p,U,&c); 
  IGAPointFormGrad(p,U,&c1[0]);

  S[0] = GinzburgLandauFreeEnergy(c,c1[0],c1[1],c1[2],user); 
  
  PetscFunctionReturn(0);
}

#undef  __FUNCT__
#define __FUNCT__ "ChemicalPotential"
void ChemicalPotential(AppCtx *user,PetscReal c,PetscReal *mu,PetscReal *dmu,PetscReal *d2mu)
{
  if (mu) {
    (*mu)  = 0.5/user->theta*log(c/(1-c))+1-2*c;
    (*mu) *= user->L0*user->L0/user->lambda;
  }
  if (dmu) {
    (*dmu)  = 0.5/user->theta*1.0/(c*(1-c)) - 2;
    (*dmu) *= user->L0*user->L0/user->lambda;
  }
  if (d2mu) {
    (*d2mu)  = -0.5/user->theta*(1-2*c)/(c*c*(1-c)*(1-c));
    (*d2mu) *= user->L0*user->L0/user->lambda;
  }
}

#undef  __FUNCT__
#define __FUNCT__ "Residual"
PetscErrorCode Residual(IGAPoint p,PetscReal dt,
			PetscReal shift,const PetscScalar *V,
                        PetscReal t,const PetscScalar *U,
                        PetscScalar *R,void *ctx)
{
  AppCtx *user = (AppCtx *)ctx;

  PetscInt nen;
  IGAPointGetSizes(p,0,&nen,0);

  PetscScalar c,c_t;
  IGAPointFormValue(p,V,&c_t);
  IGAPointFormValue(p,U,&c);

  PetscReal M,dM;
  Mobility(user,c,&M,&dM,NULL);
  PetscReal dmu;
  ChemicalPotential(user,c,NULL,&dmu,NULL);

  PetscScalar c1[3],c2[3][3];
  IGAPointFormGrad(p,U,&c1[0]);
  IGAPointFormHess(p,U,&c2[0][0]);
  PetscScalar c_x  = c1[0],    c_y  = c1[1],    c_z  = c1[2];
  PetscScalar c_xx = c2[0][0], c_yy = c2[1][1], c_zz = c2[2][2];

  const PetscReal *N0,(*N1)[3],(*N2)[3][3];
  IGAPointGetShapeFuns(p,0,(const PetscReal**)&N0);
  IGAPointGetShapeFuns(p,1,(const PetscReal**)&N1);
  IGAPointGetShapeFuns(p,2,(const PetscReal**)&N2);

  PetscInt a;
  for (a=0; a<nen; a++) {
    PetscReal Na    = N0[a];
    PetscReal Na_x  = N1[a][0];
    PetscReal Na_y  = N1[a][1];
    PetscReal Na_z  = N1[a][2];
    PetscReal Na_xx = N2[a][0][0];
    PetscReal Na_yy = N2[a][1][1];
    PetscReal Na_zz = N2[a][2][2];
    /* ----- */
    PetscScalar Ra  = 0;
    // Na * c_t
    Ra += Na * c_t; 
    // grad(Na) . ((M*dmu + dM*del2(c))) grad(C)
    PetscScalar t1 = M*dmu + dM*(c_xx+c_yy+c_zz);
    Ra += Na_x * t1 * c_x;
    Ra += Na_y * t1 * c_y;
    Ra += Na_z * t1 * c_z;
    // del2(Na) * M * del2(c)
    Ra += (Na_xx+Na_yy+Na_zz) * M * (c_xx+c_yy+c_zz);
    /* ----- */
    R[a] = Ra;
  }
  return 0;
}

#undef  __FUNCT__
#define __FUNCT__ "Tangent"
PetscErrorCode Tangent(IGAPoint p,PetscReal dt,
		       PetscReal shift,const PetscScalar *V,
		       PetscReal t,const PetscScalar *U,
                       PetscScalar *K,void *ctx)
{
  AppCtx *user = (AppCtx *)ctx;

  PetscInt nen;
  IGAPointGetSizes(p,0,&nen,0);

  PetscScalar c_t,c;
  IGAPointFormValue(p,V,&c_t);
  IGAPointFormValue(p,U,&c);

  PetscReal M,dM,d2M;
  Mobility(user,c,&M,&dM,&d2M);
  PetscReal dmu,d2mu;
  ChemicalPotential(user,c,NULL,&dmu,&d2mu);

  PetscScalar c1[3],c2[3][3];
  IGAPointFormGrad(p,U,&c1[0]);
  IGAPointFormHess(p,U,&c2[0][0]);
  PetscScalar c_x  = c1[0],    c_y  = c1[1],    c_z  = c1[2];
  PetscScalar c_xx = c2[0][0], c_yy = c2[1][1], c_zz = c2[2][2];

  const PetscReal *N0,(*N1)[3],(*N2)[3][3];
  IGAPointGetShapeFuns(p,0,(const PetscReal**)&N0);
  IGAPointGetShapeFuns(p,1,(const PetscReal**)&N1);
  IGAPointGetShapeFuns(p,2,(const PetscReal**)&N2);

  PetscInt a,b;
  for (a=0; a<nen; a++) {
    PetscReal Na    = N0[a];
    PetscReal Na_x  = N1[a][0];
    PetscReal Na_y  = N1[a][1];
    PetscReal Na_z  = N1[a][2];
    PetscReal Na_xx = N2[a][0][0];
    PetscReal Na_yy = N2[a][1][1];
    PetscReal Na_zz = N2[a][2][2];
    for (b=0; b<nen; b++) {
      PetscReal Nb    = N0[b];
      PetscReal Nb_x  = N1[b][0];
      PetscReal Nb_y  = N1[b][1];
      PetscReal Nb_z  = N1[b][2];
      PetscReal Nb_xx = N2[b][0][0];
      PetscReal Nb_yy = N2[b][1][1];
      PetscReal Nb_zz = N2[b][2][2];
      /* ----- */
      PetscScalar Kab = 0;
      // shift*Na*Nb
      Kab += shift*Na*Nb;
      // grad(Na) . (M*dmu+dM*del2(c)) grad(Nb)
      PetscScalar t1 = M*dmu + dM*(c_xx+c_yy+c_zz);
      Kab += Na_x * t1 * Nb_x;
      Kab += Na_y * t1 * Nb_y;
      Kab += Na_z * t1 * Nb_z;
      // grad(Na) . ((dM*dmu+M*d2mu+d2M*del2(c))*Nb + dM*del2(Nb)) grad(C)
      PetscScalar t2 = (dM*dmu+M*d2mu+d2M*(c_xx+c_yy+c_zz))*Nb + dM*(Nb_xx+Nb_yy+Nb_zz);
      Kab += Na_x * t2 * c_x;
      Kab += Na_y * t2 * c_y;
      Kab += Na_z * t2 * c_z;
      // del2(Na) * ((dM*del2(c)*Nb + M*del2(Nb))
      Kab += (Na_xx+Na_yy+Na_zz) * (dM*(c_xx+c_yy+c_zz)*Nb + M*(Nb_xx+Nb_yy+Nb_zz));
      /* ----- */
      K[a*nen+b] = Kab;
    }
  }
  return 0;
}

#undef __FUNCT__
#define __FUNCT__ "FormInitialCondition"
PetscErrorCode FormInitialCondition(AppCtx *user,IGA iga,const char datafile[],Vec C)
{
  PetscErrorCode ierr;
  PetscFunctionBegin;
  if (datafile[0] != 0) { /* initial condition from datafile */
    MPI_Comm comm;
    PetscViewer viewer;
    ierr = PetscObjectGetComm((PetscObject)C,&comm);CHKERRQ(ierr);
    ierr = PetscViewerBinaryOpen(comm,datafile,FILE_MODE_READ,&viewer);CHKERRQ(ierr);
    ierr = VecLoad(C,viewer);CHKERRQ(ierr);
    ierr = PetscViewerDestroy(&viewer);
  } else { /* initial condition is random */
    PetscRandom rctx;    
    ierr = PetscRandomCreate(PETSC_COMM_WORLD,&rctx);CHKERRQ(ierr);
    ierr = PetscRandomSetFromOptions(rctx);CHKERRQ(ierr);
    ierr = PetscRandomSetInterval(rctx,user->cbar-0.05,user->cbar+0.05);CHKERRQ(ierr); 
    ierr = PetscRandomSeed(rctx);CHKERRQ(ierr);
    ierr = VecSetRandom(C,rctx);CHKERRQ(ierr); 
    ierr = PetscRandomDestroy(&rctx);CHKERRQ(ierr); 
  }
  PetscFunctionReturn(0); 
}

#undef __FUNCT__
#define __FUNCT__ "OutputMonitor"
PetscErrorCode OutputMonitor(TS ts,PetscInt it_number,PetscReal c_time,Vec U,void *mctx)
{
  PetscFunctionBegin;
  PetscErrorCode ierr;
  AppCtx *user = (AppCtx *)mctx;
  char           filename[256];
  sprintf(filename,"./ch3d%d.dat",it_number);
  ierr = IGAWriteVec(user->iga,U,filename);CHKERRQ(ierr);
  PetscFunctionReturn(0);
}

#undef __FUNCT__
#define __FUNCT__ "StatsMonitor"
PetscErrorCode StatsMonitor(TS ts,PetscInt step,PetscReal t,Vec U,void *mctx)
{
  PetscErrorCode ierr;
  PetscFunctionBegin;
  AppCtx *user = (AppCtx *)mctx;
  if (!user->E) PetscFunctionReturn(0);

  PetscScalar dt;
  ierr = TSGetTimeStep(ts,&dt);CHKERRQ(ierr);
  PetscPrintf(PETSC_COMM_WORLD,"%.6e %.6e %.16e\n",t,dt,user->energy[0]);
  
  if(user->energy[0] > user->energy[1]) PetscPrintf(PETSC_COMM_WORLD,"WARNING: Ginzburg-Landau free energy increased!\n");

  PetscFunctionReturn(0);
}

PetscScalar EstimateSecondDerivative(AppCtx user)
{
  PetscScalar dE = user.time[0]*(user.energy[2]-user.energy[1]);
  dE += user.time[1]*(user.energy[0]-user.energy[2]);
  dE += user.time[2]*(user.energy[1]-user.energy[0]);
  dE /= (user.time[0]*(user.time[0]*user.time[1]-user.time[0]*user.time[2]-user.time[1]*user.time[1]+user.time[2]*user.time[2]) + user.time[1]*user.time[1]*user.time[2] - user.time[1]*user.time[2]*user.time[2]);
  return dE;
}

#undef __FUNCT__
#define __FUNCT__ "CHAdapt"
PetscErrorCode CHAdapt(TS ts,PetscReal t,Vec X,Vec Xdot, PetscReal *nextdt,PetscBool *ok,void *ctx)
{
  SNES                 snes;
  SNESConvergedReason  snesreason;
  PetscReal            dt,normE,normX,Emax,scale;
  PetscErrorCode       ierr;
  PetscFunctionBegin;

  AppCtx *th = (AppCtx *)ctx;

  ierr = TSGetTimeStep(ts,&dt);CHKERRQ(ierr);
  th->time[0]=t-dt;
  ierr = IGAFormScalar(th->iga,X,1,&th->energy[0],Stats,ctx);CHKERRQ(ierr);

  if (!th->E){
    th->energy[1] = 1.01*th->energy[0];
    th->energy[2] = 1.02*th->energy[0];
    th->time[1] = -dt;
    th->time[2] = -2.0*dt;
  }

  PetscScalar scale_min = 0.5;
  PetscScalar scale_max = 1.5;
  PetscScalar    dt_min = 1.0e-15;
  PetscScalar    dt_max = 1.0e+10;
  PetscScalar      rtol = 1.0e-3;
  PetscScalar      atol = 1.0e-3;
  PetscScalar       rho = 0.9;
  //PetscScalar       dE2 = EstimateSecondDerivative(*th);
  
  /* If the SNES fails, reject the step and reduce the step by the
     maximum amount */
  ierr = TSGetSNES(ts,&snes);CHKERRQ(ierr);
  ierr = SNESGetConvergedReason(snes,&snesreason);CHKERRQ(ierr);
  if (snesreason < 0 || th->energy[0] > th->energy[1]) {
    *ok = PETSC_FALSE;
    *nextdt *= scale_min;
    *nextdt = PetscMax(*nextdt,dt_min);
    PetscFunctionReturn(0);
  }

  /* first-order aproximation to the local error */
  /* E = (X0 + dt*Xdot) - X */
  ierr = TSGetTimeStep(ts,&dt);CHKERRQ(ierr);
  if (!th->E) {ierr = VecDuplicate(th->X0,&th->E);CHKERRQ(ierr);}
  ierr = VecWAXPY(th->E,dt,Xdot,th->X0);CHKERRQ(ierr);
  ierr = VecAXPY(th->E,-1,X);CHKERRQ(ierr);
  ierr = VecNorm(th->E,NORM_2,&normE);CHKERRQ(ierr);
  /* compute maximum allowable error */
  ierr = VecNorm(X,NORM_2,&normX);CHKERRQ(ierr);
  if (normX == 0) {ierr = VecNorm(th->X0,NORM_2,&normX);CHKERRQ(ierr);}
  Emax =  rtol * normX + atol;
  /* compute next time step */
  if (normE > 0) {
    scale = rho * PetscRealPart(PetscSqrtScalar((PetscScalar)(Emax/normE)));
    scale = PetscMax(scale,scale_min);
    scale = PetscMin(scale,scale_max);
    if (!(*ok))
      scale = PetscMin(1.0,scale);
    *nextdt *= scale;
  }
  /* accept or reject step */
  if (normE <= Emax){
    ierr = VecCopy(X,th->X0);CHKERRQ(ierr);
    th->energy[2] = th->energy[1];
    th->energy[1] = th->energy[0];
    th->time[2] = th->time[1];
    th->time[1] = th->time[0];
    *ok = PETSC_TRUE;
  }else{
    *ok = PETSC_FALSE;
  }

  *nextdt = PetscMax(*nextdt,dt_min);
  *nextdt = PetscMin(*nextdt,dt_max);
  PetscFunctionReturn(0);
}

#undef __FUNCT__
#define __FUNCT__ "main"
int main(int argc, char *argv[]) {

  PetscErrorCode  ierr;
  ierr = PetscInitialize(&argc,&argv,0,0);CHKERRQ(ierr);

  /* Define simulation specific parameters */
  AppCtx user;
  user.cbar  = 0.63;   /* average concentration */
  user.alpha = 200.0;  /* thickess interface parameter */
  user.theta = 1.5;    /* temperature/critical temperature */
  user.L0    = 1.0;    /* length scale */
  user.tau   = 1.0;

  PetscBool output = PETSC_FALSE; 
  PetscBool monitor = PETSC_FALSE; 
  char initial[PETSC_MAX_PATH_LEN] = {0};
  ierr = PetscOptionsBegin(PETSC_COMM_WORLD,"","CahnHilliard3D Options","CH3D");CHKERRQ(ierr);
  ierr = PetscOptionsString("-ch_initial","Load initial solution from file",__FILE__,initial,initial,sizeof(initial),NULL);CHKERRQ(ierr);
  ierr = PetscOptionsBool("-ch_output","Enable output files",__FILE__,output,&output,NULL);CHKERRQ(ierr);
  ierr = PetscOptionsBool("-ch_monitor","Compute and show statistics of solution",__FILE__,monitor,&monitor,NULL);CHKERRQ(ierr);
  ierr = PetscOptionsReal("-ch_cbar","Initial average concentration",__FILE__,user.cbar,&user.cbar,NULL);CHKERRQ(ierr);
  ierr = PetscOptionsReal("-ch_alpha","Characteristic parameter",__FILE__,user.alpha,&user.alpha,NULL);CHKERRQ(ierr);
  ierr = PetscOptionsEnd();CHKERRQ(ierr);

  IGA iga;
  ierr = IGACreate(PETSC_COMM_WORLD,&iga);CHKERRQ(ierr);
  ierr = IGASetDim(iga,3);CHKERRQ(ierr);
  ierr = IGASetDof(iga,1);CHKERRQ(ierr);
  ierr = IGASetFromOptions(iga);CHKERRQ(ierr);
  ierr = IGASetUp(iga);CHKERRQ(ierr);

  PetscReal h = 1.0/sqrt(iga->elem_sizes[0]*iga->elem_sizes[0]+
			 iga->elem_sizes[1]*iga->elem_sizes[1]+
			 iga->elem_sizes[2]*iga->elem_sizes[2]);
  user.lambda = user.tau*h*h; /* mesh size parameter */

  ierr = IGASetUserIFunction(iga,Residual,&user);CHKERRQ(ierr);
  ierr = IGASetUserIJacobian(iga,Tangent,&user);CHKERRQ(ierr);

  TS ts;
  ierr = IGACreateTS(iga,&ts);CHKERRQ(ierr);
  ierr = TSSetDuration(ts,10000,1.0);CHKERRQ(ierr);
  ierr = TSSetTimeStep(ts,1e-10);CHKERRQ(ierr);
  ierr = TSSetType(ts,TSALPHA);CHKERRQ(ierr);
  ierr = TSAlphaSetRadius(ts,0.5);CHKERRQ(ierr);

  user.E = NULL;
  ierr = TSAlphaSetAdapt(ts,CHAdapt,&user);CHKERRQ(ierr); 

  if (monitor) {
    user.iga = iga;
    PetscPrintf(PETSC_COMM_WORLD,"#Time        dt           Free Energy            Second moment          Third moment\n");
    ierr = TSMonitorSet(ts,StatsMonitor,&user,NULL);CHKERRQ(ierr);
  }
  if (output) {
    ierr = TSMonitorSet(ts,OutputMonitor,&user,NULL);CHKERRQ(ierr);
  }

  ierr = TSSetFromOptions(ts);CHKERRQ(ierr);

  Vec U;
  ierr = IGACreateVec(iga,&U);CHKERRQ(ierr);
  ierr = FormInitialCondition(&user,iga,initial,U);CHKERRQ(ierr);
  ierr = VecDuplicate(U,&user.X0);CHKERRQ(ierr);
  ierr = VecCopy(U,user.X0);CHKERRQ(ierr);
#if PETSC_VERSION_LE(3,3,0)
  ierr = TSSolve(ts,U,NULL);CHKERRQ(ierr);
#else
  ierr = TSSolve(ts,U);CHKERRQ(ierr);
#endif
  ierr = VecDestroy(&U);CHKERRQ(ierr);
  ierr = TSDestroy(&ts);CHKERRQ(ierr);
  ierr = IGADestroy(&iga);CHKERRQ(ierr);
  ierr = PetscFinalize();CHKERRQ(ierr);
  return 0;
}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.