xref: /petsc/doc/changes/34.md (revision 174dc0c8cee294b82b85e4dd3b331b29396264fc)
1# Changes: 3.4
2
3```{rubric} General:
4```
5
6- PetscGetTime() is replaced with PetscTime(), in C you must include
7  petsctime.h to use
8- PetscViewerBinaryMatlabOpen() and friends are all removed, simply
9  use PetscViewerBinaryOpen() followed by
10  PetscViewerPushFormat(viewer,PETSC_VIEWER_BINARY_MATLAB)
11- Users should use new `PetscFunctionBeginUser` in there code
12  instead of `PetscFunctionBegin` to get more relevant
13  diagnostics.
14- Replaced the hodge-podge of -xxx_view -xxx_view_yyy with a single
15  consistent scheme: -xxx_view
16  [ascii,binary,draw,socket,matlab,vtk][:filename][:ascii_info,ascii_info_detail,ascii_matlab,draw_contour,etc].
17- In PETSc options files, the comment characters `!` and `%` are
18  no longer supported, use `#`.
19- `PetscFList` and `PetscOList` have been changed to
20  `PetscFunctionList` and `PetscObjectList`.
21  `PetscFunctionListFind()` no longer takes the path to a shared
22  library or the string name of the function. Plugins distributed as
23  shared libraries should register their implementations by calling
24  suitable `XXRegister()` functions from within their
25  `PetscDLLibraryRegister_basename()`, see documentation for
26  PetscDLLibraryOpen().
27- MatRegisterDynamic(), PCRegisterDynamic(), KSPRegisterDynamic(),
28  etc., have been simplified to drop the string function name
29  argument, and are simply named MatRegister(), PCRegister(),
30  KSPRegister(), etc. PetscObjectComposeFunctionDynamic() also drops
31  the string function name argument and is called
32  PetscObjectComposeFunction().
33- The configure options `--with-c-support` and
34  `--with-c++-support` have been removed. A PETSc library built
35  using C or C++ can be called from either C or C++. The primary
36  functional reason to use `--with-clanguage=C++` is to use
37  `std::complex` data types. Other users will likely prefer
38  `--with-clanguage=C` (the default) because it compiles somewhat
39  faster. The --with-c-support option is no longer needed because it
40  is now the default behavior when using --with-clanguage=c++.
41
42```{rubric} Logging:
43```
44
45```{rubric} config/configure.py:
46```
47
48```{rubric} PetscSF:
49```
50
51- PetscSF was split into interface and impls. The internal
52  interfaces PetscSFGetDataTypes(), PetscSFGetWindow(),
53  PetscSFFindWindow(), andd PetscSFRestoreWindow() were made
54  private. (It is unlikely that any users were calling these
55  routines.) PetscSFSetSynchronizationType() and the enum
56  PetscSFSynchronizationType were renamed to
57  PetscSFWindowSetSyncType() and PetscSFWindowSyncType respectively.
58- The location arguments to `PetscSFGetRanks()` were changed from
59  `PetscMPIInt` (aka `int`) to `PetscInt` to (eventually)
60  support very large local memory. The "window" implementation will
61  not support such large sizes due to technical limitations of MPI
62  one sided and "basic" does not currently due to
63  PetscGatherMessageLengths().
64
65```{rubric} IS:
66```
67
68- PetscSection was moved to IS and has become a PetscObject, thus
69  reference counting works as usual, with functions like
70  DMSetLocalSection() taking a reference to the PetscSection. The
71  caller is thus obliged to release their reference using
72  PetscSectionDestroy().
73
74```{rubric} PF:
75```
76
77```{rubric} Vec:
78```
79
80- The options -vec_view, -vec_view_matlab, -vec_view_socket,
81  -vec_view_binary, -vec_view_draw, -vec_view_lg have been replace
82  by a more general systematic scheme of -vec_view
83  [ascii,binary,draw, or socket][:filename][:format], for these
84  cases they are exactly: -vec_view -vec_view ::ascii_matlab
85  -vec_view socket -vec_view binary -vec_view draw -vec_view
86  draw::draw_lg
87- VecDotNorm2() now returns the square of the norm in a real number
88  (PetscReal) rather than the real part of a complex number
89  (PetscScalar)
90- Added VecDotRealPart()
91- The private header `petsc/private/vecimpl.h` is no longer
92  included by `petscvec.h`. Users requiring direct access to
93  internal members of Vec may need to include the private header,
94  but may want to explain their use case to
95  `petsc-maint@mcs.anl.gov` so that we can provide a stable API.
96- VecGetArray()/VecRestoreArray() and
97  VecGhostGetLocalForm()/VecGhostRestoreLocalForm() are logically
98  collective operations because their use invalidates norms, which
99  must be known collectively. This is not a change in behavior, but
100  prior documentation did not mark them as collective. Users should
101  not rely on use such as lazy access occurring inside loops that
102  could have length zero on some processors because it could lead to
103  deadlock in a subsequent norm computation. VecGetArrayRead() and
104  VecRestoreArrayRead() are not collective.
105
106```{rubric} VecScatter:
107```
108
109```{rubric} Mat:
110```
111
112- The options -mat_view, -mat_view_info, -mat_view_info_detailed
113  -mat_view_matlab, -mat_view_socket, -mat_view_binary,
114  -mat_view_draw, -mat_view_contour have been replace by a more
115  general systematic scheme of -mat_view [ascii,binary,draw, or
116  socket][:filename][:format], for these cases they are exactly:
117  -mat_view -mat_view ::ascii_info -mat_view ::ascii_info_detail
118  -mat_view ::ascii_matlab -mat_view socket -mat_view binary
119  -mat_view draw -mat_view draw::draw_contour
120- `MatGetArray()/MatRestoreArray()` have been remove d. Use
121  `MatDenseGetArray()/MatDenseRestoreArray()` or
122  `MatSeqAIJGetArray()/MatSeqAIJRestoreArray()`
123- PLAPACK interface has been removed.
124- MatGetRowIJ() and MatGetColumnIJ() have been made const-correct;
125  the index arrays have always been read-only.
126- MatRestoreRow() and MatRestoreRowIJ() now zero their arguments.
127  They should never have been accessed after restoring.
128- MatPermute() can now be used for MPIAIJ, but contrary to prior
129  documentation, the column IS should be parallel and contain only
130  owned columns.
131
132```{rubric} PC:
133```
134
135- The default behavior for PCILU was changed from
136  -pc_factor_shift_type nonzero to -pc_factor_shift_type inblock
137  (note it is -sub_pc_factor_shift_type if the ILU is used inside
138  block Jacobi). If previously you had convergence of iterative
139  solvers with ILU and now for the same code you get zero pivot
140  errors or PC setup errors then try the option
141  -pc_factor_shift_type nonzero.
142- Merged PCBJacobiSetUseTrueLocal(), `-pc_bjacobi_true_local`,
143  PCKSPSetUseTrue(), `-pc_ksp_true`, PCCompositeSetUseTrue()
144  `-pc_composite_true`, PCFieldSplitSetRealDiagonal
145  `-pc_fieldpslit_real_diagonal` to PCSetUseAmat(),
146  `-pc_use_amat`.
147- Added `PCISSetSubdomainDiagonalScaling()` if a user wants to set
148  a custom scaling at the interface.
149- Added initial version of FETI-DP in PCBDDC code.
150- Added `PCBDDCCreateFETIDPOperators()` for creation of FETI-DP
151  mat and the related Dirichlet preconditioner using an already
152  existing PCBDDC object.
153- Added `PCBDDCMatFETIDPGetRHS()` for assembling of right-hand
154  side of FETI-DP linear system.
155- Added `PCBDDCMatFETIDPGetSolution()` for assembling of physical
156  solution from FETI-DP solution.
157- Added support to deal with linear systems with non-trivial kernels
158  via `PCBDDCSetNullSpace()`.
159- Added `PCBDDCSetMaxLevels()` to control the maximum number of
160  levels when doing multilevel.
161- Added `PCBDDCSetCoarseningRatio()` to control the coarsening
162  ratio when doing multilevel.
163- Added `PCISSetUseStiffnessScaling()` to build partition of unity
164  using local matrices' diagonal.
165- Removed PETSc interface to
166  [Prometheus](http://www.columbia.edu/~ma2325/prometheus/). Use
167  "-pc_type gamg -pc_gamg_type agg" as alternative.
168- PC_FIELDSPLIT_SCHUR_PRE_DIAG changed to
169  PC_FIELDSPLIT_SCHUR_PRE_A11.
170
171```{rubric} KSP:
172```
173
174- Replace -ksp_view_binary with either -ksp_view_mat binary - save
175  matrix to the default binary viewer or-ksp_view_pmat binary - save
176  matrix to the default binary viewer followed by -ksp_view_rhs
177  binary - save right-hand side vector to the default binary viewer.
178  Also many other combinations are possible.
179
180```{rubric} SNES:
181```
182
183- Added added -snes_check_jacobian a very powerful way to check if
184  your Jacobian is correct for small problems, see
185  SNESUpdateCheckJacobian()
186- SNESVIRS "virs" changed to SNESVINEWTONRSLS vinewtonrsls to
187  clarify exactly what they do
188- SNESVISS "viss" changed to SNESVINEWTONSSLS vinewtonssls
189- SNESLS "ls" changed to SNESNEWTONLS newtonls
190- SNESTR "tr" changed to SNESNEWTONTR newtontr
191- SNESDefaultComputeJacobian(), SNESDefaultComputeJacobianColor(),
192  SNESDefaultObjectiveComputeFunctionFD(), SNESDefaultConverged()
193  changed to SNESComputeJacobianDefault(),
194  SNESComputeJacobianDefaultColor(), SNESConvergedDefault(),
195  SNESObjectiveComputeFunctionDefaultFD() to match more consistent
196  naming standards.
197- Added nonlinear additive Schwarz as SNESNASM "nasm"
198- Added helper SNES type SNESASPIN "aspin" for setting up additive
199  Schwarz preconditioned inexact Newton.
200- Added Anderson Mixing as SNESANDERSON "anderson"
201- SNESGetSNESLineSearch() and SNESSetSNESLineSearch() renamed to
202  SNESGetLineSearch() and SNESSetLineSearch().
203
204```{rubric} SNESLineSearch:
205```
206
207```{rubric} TS:
208```
209
210- Option `-ts_monitor_solution` changed to
211  `-ts_monitor_draw_solution`. See
212  `TSSetFromOptions`
213  for additional monitoring options.
214- TSSetExactFinalTime() now takes an enum instead of PetscBool,
215  which includes a new feature `TS_EXACTFINALTIME_MATCHSTEP` that
216  adjusts time step sizes to match an exact final time. See
217  `TSExactFinalTimeOption`.
218
219```{rubric} DM/DA:
220```
221
222- DMDAGetCoordinateDA(), DMDAGet/SetCoordinates(),
223  DMDAGet/SetGhostedCoordinates(), and DMComplexGetCoordinateVec()
224  have been removed in favor of DMGetCoordinateDM(),
225  DMGet/SetCoordinates(), and DMGet/SetCoordinatesLocal()
226- DMDASetLocalFunction() and DMDASetLocalJacobian() have been
227  replaced with DMDASNESSetFunctionLocal() and
228  DMDASNESSetJacobianLocal() -- note that the calling sequences of
229  these functions are different and also the calling sequence of the
230  Jacobian function you provide
231- DMSetFunction() and DMSetJacobian() have been removed use
232  SNESSetFunction() and SNESSetJacobian() instead, note the calling
233  sequences are slightly different
234- DMDACreatePatchIS() for getting the indices of an arbitrary
235  subdomain on a DMDA
236- DMDAGet/SetOverlap(),DMDAGet/SetOffset() for manipulating DMDA
237  subdomains
238- DMCreateDomainDecompositionScatters() gives VecScatter objects for
239  transferring to/from subdomain DMs
240- DMGet/RestoreNamedLocalVector()
241
242```{rubric} DMComplex/DMPlex:
243```
244
245- DMComplex was renamed to DMPlex.
246- There is now a manual section on unstructured grids.
247
248```{rubric} DMMesh:
249```
250
251- This is deprecated in favor of DMPlex, and will be removed in 3.5.
252- SectionRealToVecDM() was created to removed overloading.
253
254```{rubric} DMMG:
255```
256
257```{rubric} PetscViewer:
258```
259
260```{rubric} SYS:
261```
262
263- `PetscPClose()` has an additional argument to return a nonzero
264  error code without raising an error.
265- Added `PetscSortMPIInt()` and `PetscSortRemoveDupsMPIInt()`.
266
267```{rubric} AO:
268```
269
270```{rubric} Sieve:
271```
272
273```{rubric} Fortran:
274```
275
276```{rubric} ExternalPackages:
277```
278
279- Added Elemental interface
280- Remove Spooles interface
281