| 7 | |
| 8 | Here is an example where bcg is used only for the stress balance analysis. The direct solver (MUMPS) is used for the rest (mass transport analysis, etc). Also, the recovery solver (MUMPS) is not called if bcg fails in a Picard iteration (linear solver). The only criterion is the mechanical equilibrium, which controls the non-linear solver as a whole. This scheme may compromise the monotonicity of the non-linear solver, but it is faster than calling MUMPS every time bgc fails. |
| 9 | |
| 10 | md.toolkits=toolkits(); % to be sure that Mumps is the default solver for all analysis |
| 11 | md.toolkits=addoptions(md.toolkits,'StressbalanceAnalysis',bcgslbjacobioptions()); % add bcg for stress balance analysis only |
| 12 | md.settings.solver_residue_threshold=NaN; % the solver may fail during a Picard iteration (linear solver); no need to call the recovery solver (MUMPS) |
| 13 | md.stressbalance.maxiter=50; |
| 14 | md.stressbalance.restol=0.0001; % this is the default value and the only criterion used here; this threshold controls the non-linear solver (Picard iteration) as a whole |
| 15 | md.stressbalance.reltol=NaN; % no need |
| 16 | md.stressbalance.abstol=NaN; % no need |
| 17 | |
| 18 | Note: SSA is very stable, so bcg should convert fast. For HO(3D), bcg may not converge even after 50 iterations. In this case, look at the stress balance convergence (set |
| 19 | md.verbose=verbose('convergence',true,'solution',true);) and check if it is necessary to relax a little bit the restol value. The scheme above have being used for SSA (~250,000 elements) and for HO (~1,000,000 elements). |