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