Skip to content

PETSc Options

Sophie Blondel edited this page Nov 17, 2022 · 15 revisions

To solve the ADR equations Xolotl uses PETSc (the Portable, Extensible Toolkit for Scientific Computation), and PETSc can be told what to do through PETSc options. The list of these options can be very long but here are gathered the ones that we consider important for Xolotl use. The Benchmark Problems give you default ones and you can easily change them by modifying the text parameter file.

Native PETSc Options

-log_view: prints an ASCII version of performance data at program’s conclusion. Note: setting it directly in the petscArgs Xolotl option will not work because of how the code deals with the PETSc options. To use this option, set it in the PETSC_OPTIONS environment variable.

-ts_max_time: sets the final time in second of the simulation. PETSc will stop the simulation once it reaches this value, this means that most of the time the real final time will be bigger than this value.

-ts_dt: sets the value of the initial time step in second. The PETSc time-stepper method used in Xolotl is an adaptive one, which means that the length of the time step will change from a time step to another. This length is computed by PETSc and depends on the stiffness of the problem at a given time.

-ts_adapt_dt_max: sets the maximum value for the time step in second. The default value is 10 s.

-ts_adapt_clip: sets the admissible decrease/increase factor in step size (-ts_adapt_clip 0.1,1.1). The default values are 0.1 and 10.

-ts_adapt_wnormtype INFINITY: switches the type of norm used to determine the size of the adaptive time step to infinite instead of the default norm two.

-ts_max_steps: sets the maximum number of time step that PETSc can use. The solving of the ADR equations is stopped when PETSc reaches first either the final time or the maximum number of time steps.

-ts_monitor: will make PETSc print information about the time-stepper, that is the absolute time and the length of the following step for each time step.

-snes_monitor and -ksp_monitor: will make PETSc print information about the non-linear equation solver and the Krylov subspace method. It can help monitor the convergence of the solver.

-snes_test_display -snes_test_jacobian_view -snes_test_jacobian 1.0e-10: will make PETSc print the Jacobians used to solve. These options have to be used carefully and are more for developper purpose.

Preconditioner options: in the 1D case it is recommended to use -pc_type fieldsplit -fieldsplit_0_pc_type sor -fieldsplit_1_pc_type redundant, whereas -pc_type fieldsplit -fieldsplit_0_pc_type sor -fieldsplit_1_pc_type gamg -fieldsplit_1_ksp_type gmres -ksp_type fgmres is recommended in 2D/3D. The difference resides in the structure of the matrix to solve: in 1D it is banded but it is not the case anymore in 2D/3D. Note: If you are running a problem on a large 1D grid and on many cores it could be beneficial to use the 2D preconditioner options: even if the solver will take more time to run it scales well in memory, which is not the case at all for the 1D options.

Preconditioner options (bis): if the gamg preconditioner is used and the "Have un-symmetric graph (apparently)." PETSc error appears, add -fieldsplit_1_pc_gamg_threshold -1 to the list of PETSc option like what the PETSc comment suggest. It should solve your problem.

-snes_force_iteration: forces the SNES solver to take at least one iteration regardless of the initial residual norm. Can be useful in case the solution vector stops changing with time but should be changing.

-snes_stol: convergence tolerance in terms of the norm of the change in the solution between steps. Can be useful in case the solution vector stops changing with time but should be changing.

-ts_adapt_time_step_increase_delay: the number of timesteps to wait after a decrease in the timestep due to failed solver before increasing the time step. Can be useful in case the solution vector stops changing with time but should be changing.

Xolotl Specific Options

Additionally to the previous options, some are specific to Xolotl use. They will make PETSc set monitors that are defined in xolotlSolver/monitor/. To use these options you simply have to add them to the list of PETSc options. For the plotting ones, VTK-m need to be installed and the visualization handler needs to be set to std (see [Preprocessor]). Different options are available for 0D, 1D, 2D, and 3D. Some of the options are only meaningful for specific physics cases (PSI, NE, Iron, Alloy) reflecting the material that is modeled. Here are their descriptions.

1D case

-start_stop: will create a HDF5 file storing the network and the cluster concentrations at each time step. If a number b is following the option, the concentrations will be written only every b seconds.

-helium_retention: will compute and print the helium, deuterium, tritium, vacancy, and interstitial integrated content in the material at each time step. It will also create a file named "retentionOut.txt" containing a new line per time step, where the first column is the fluence in #/nm2, the second the helium content in #/nm2, then the deuterium, tritium, vacancy, and interstitial content; the first line will describe the values in each column. (PSI)

-xenon_retention: will compute and print the xenon content in the material at each time step. A "retentionOut.txt" file is also created and contains one line per time step, where the first column is the time in s, the second column is the integrated xenon content in #/nm2, the third is the average radius, and the last one the average radius taking into account only the clusters of size larger than the parameter file option "radiusSize"; the first line will describe the values in each column. (NE)

-alloy: will compute and write in a file at each time step: the time step number, the current time, the interstitial average density and average diameter, the vacancy average density and diameter, same with void, faulted and perfect loops, frank, followed by partial densities and diameter for void, faulted, perfect, frank, partial meaning that the average is computed starting with a minimum size defined by the parameter file option "radiusSize"; the first line will describe the values in each column. (Alloy)

-plot_1d: will represent at each timestep the size distribution of xenon clusters on the middle of the grid. (NE)

-plot_series: will represent at each time step the concentration of the first 18 clusters in the network, with a different color for each of them.

-plot_perf: will represent the time given by the solver timer for each core. For this to work, one needs to run in parallel and have the performance handler set to os (see [Parameter-File]).

-check_negative: will check if there is a concentration which absolute value is smaller than a threshold (by default 1.0e-30) and will set it to the threshold if it is. If a number b is following the option, the threshold will be b.

-check_collapse: will check if the time step decreases to a value smaller than 1.0e-16, or the given value, and stops the simulation if it does. It will also create a solverStatus.txt file at the end of the simulation describing why it stopped ("collapsed", "diverged", "good", "overgrid").

-tridyn: will create an HDF5 file containing the total concentration of He, D, T, V, I, and temperature at each depth, at each time step. (PSI)

-temp_profile: will create the tempProf.txt file which first line corresponds to the grid points location, and each following line is the temperature at each grid point for this timestep.

-largest_conc: will monitor the concentration of the largest cluster in the network at each time step; if its value gets larger than 1.0e-12 , or a given value, the simulation will be interrupted.

2D case

-start_stop: same as in 1D.

-helium_retention: same as in 1D.

-xenon_retention: same as in 1D.

-plot_perf: same as in 1D.

-check_collapse: same as in 1D.

-largest_conc: same as in 1D.

-plot_2d: will represent the concentration of a specific cluster at each time step as a function of the depth and y direction.

3D case

-start_stop: same as in 1D.

-helium_retention: same as in 1D.

-xenon_retention: same as in 1D.

-plot_perf: same as in 1D.

-check_collapse: same as in 1D.

-largest_conc: same as in 1D.

-plot_2d_xy: will represent the concentration of a specific cluster at each time step as a function of the depth and y direction, integrated over the z direction.

-plot_2d_xz: will represent the concentration of a specific cluster at each time step as a function of the depth and z direction, integrated over the y direction.

0D case

-start_stop: same as in 1D.

-check_collapse: same as in 1D.

-xenon_retention: same as in 1D.

-alloy: same as in 1D.

-largest_conc: same as in 1D.

-plot_1d: will represent at each timestep the size distribution of xenon clusters. (NE)

-bubble: will create a file at each time step containing the size or boundaries of each bubble followed by its concentration. (Iron)

-alpha_zr: will compute and write in a file at each time step: the time step number, the current time; the vacancy density, atomic density, and diameter, the vacancy partial density, atomic density, and diameter; the same quantities for Basal and interstitials; partial meaning that the values are computed starting with a minimum size defined by the parameter file option "radiusSize"; the first line will describe the values in each column. (AlphaZr)

Clone this wiki locally