[petsc-users] Refinement on TS

Amir mhbaghaei at mail.sjtu.edu.cn
Thu Jul 5 05:38:58 CDT 2018


Hello
Trying to loop over the TSolve() to apply the refinement, I used the below procedure. However, this only goes 1 level of refinement and then it exits. Do you think this is a right algorithm?
Thanks for your great time.
Amir

PetscInt GRID=1;
for (GRID=1;GRID<GRID_MAX;){
//
// FIND THE ADAPTED SOLUTION
// USING PREVIOUS SOLUTION VECTORS
//
//
// BUILDING THE ADAPTED SOLUTION AND DM
//
DMDACreate1d();
DMSetFromOptions();
DMSetUp();
DMCreateGlobalVector();
//
// INTERPOLATE FROM COARSE TO REFINE
//
// DESTROYING THE FINE TEMPERORAY VECS AND
// RESETTING THE COARSE VECS WITH REFINED NEW VECS
//
//
// BUILDING TS
//
TSCreate();
TSSetApplicationContext();
TSSetDM();
TSSetProblemType(ts,TS_NONLINEAR);
TSSetType(ts,TSPSEUDO);
TSSetIFunction();
TSSetTimeStep();
//
TSSolve();
//
TSDestroy();
DMDestroy();
//
GRID=GRID+1;
//
}//end GRID-loop

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180705/c54cbc07/attachment.html>


More information about the petsc-users mailing list