Merge remote-tracking branch 'origin/release'
Fix MPI_Comm_rank/size API mixups in helpers (#1865,#1866)
Add automatic generated fortran support for setting and returning contextsMajor cleanup of the code for setting and returning application (previously called user) contexts - PetscCtx ctx is now t
Add automatic generated fortran support for setting and returning contextsMajor cleanup of the code for setting and returning application (previously called user) contexts - PetscCtx ctx is now the standard for passing in contexts - PetscCtxRt ctx is the standard for passing out contexts, including context destroy routines based on PetscCtxDestroyFnBoth of these are typedef to void*Also removed most use of user and userctx for context arguments now consistently named ctxImproved documentation on PetscCtx and PetscCtxRt and on how to use contexts (including getting them) from Fortran
show more ...
Improve the propagation of function domain error handling in SNES, especially in the line search routines.Due to the object layering of SNESLineSearch under SNES there is some code duplication incl
Improve the propagation of function domain error handling in SNES, especially in the line search routines.Due to the object layering of SNESLineSearch under SNES there is some code duplication include both SNESLineSearchReason and SNESConvergedReason and SNESCheckFunctionNorm() and SNESLineSearchCheckFunctionNorm() and Jacobian friendsReported-by: david.knezevic@akselos.com
Housekeeping
checkbadSource: enforce proper style in makefiles
Remove unnecessary braces around one-linersgit grep -lE "[ ]*(if|for|while) \(.*\) {[^;]*;[^;]*}$" -- '*.c' '*.cxx' '*.cu' '*.h' '*.hpp' '*.cpp' | xargs sed -i '' -E 's#([ ]*)(if|for|while) \((.*)\
Remove unnecessary braces around one-linersgit grep -lE "[ ]*(if|for|while) \(.*\) {[^;]*;[^;]*}$" -- '*.c' '*.cxx' '*.cu' '*.h' '*.hpp' '*.cpp' | xargs sed -i '' -E 's#([ ]*)(if|for|while) \((.*)\) {([^;]*);([^;]*)}$#\1\2 \(\3\)\4;\5#'
Merge branch 'barry/2025-05-18/mv-pcsetpresolve-to-pcsetpostprocesssetup' into 'main'Refactor PCSetPreSolve as PCSetPostSetUpSee merge request petsc/petsc!8419
MatMumpsSetIcntl() and MatMumpsSetCntl() are allowed to be called (and ignored) if MUMPS is not installed.
Refactor PCSetPreSolve as PCSetPostSetUpPCSetPreSolve is clunky and confusing since it mixes with the unrelated ->ops->presolve functionality. So instead introduce PCSetPostSetUp() that gets called
Refactor PCSetPreSolve as PCSetPostSetUpPCSetPreSolve is clunky and confusing since it mixes with the unrelated ->ops->presolve functionality. So instead introduce PCSetPostSetUp() that gets called at the end of PCSetUp() and can be used with TAOPDIPM
Fortran 90: fully embrace After 34 years!- deprecate use of 'F90' in Fortran function names- use Fortran pointers when appropriate- the new Fortran API is not backward compatible with previous ve
Fortran 90: fully embrace After 34 years!- deprecate use of 'F90' in Fortran function names- use Fortran pointers when appropriate- the new Fortran API is not backward compatible with previous versions!- also clean up inconsistent PETSc code detected by new Fortran generation tools- drop use of bfort- automatically generate all the Fortran PETSc objects, enums etc from the include files- generate most of the Fortran interface definitions and functions from the source code- simplify the number and organization of Fortran modulesCo-authored-by: Jose E. Roman <jroman@dsic.upv.es>
Brain dead fixes for useless casts
Remove unneeded parentheses
Fix MPIU_* routines to always return MPI error codes and thus be usable with PetscCallMPI()Introduce MPIU_Count to be used when MPI_Count is not available
Deprecate PETSC_DEFAULT for Tao parameters with PETSC_CURRENT and add support for PETSC_DETEREMINE to use default
Remove multiple parentheses and extra semicolongit grep -l -E "\(\([a-zA-Z0-9_]+\)\(\*[a-zA-Z0-9_]+\)[, )]" | xargs sed -r -i'' 's#\(\(([a-zA-Z0-9_]+)\)\(\*([a-zA-Z0-9_]+)\)([, )])#\(\(\1\)\*\2\3#g
Remove multiple parentheses and extra semicolongit grep -l -E "\(\([a-zA-Z0-9_]+\)\(\*[a-zA-Z0-9_]+\)[, )]" | xargs sed -r -i'' 's#\(\(([a-zA-Z0-9_]+)\)\(\*([a-zA-Z0-9_]+)\)([, )])#\(\(\1\)\*\2\3#g'git grep -l -E "Petsc(.)*\(\(\*[a-zA-Z0-9_]*\)," | xargs sed -r -i'' 's#Petsc([a-zA-Z0-9_]*)\(\(\*([a-zA-Z0-9_]*)\), #Petsc\1(*\2, #g'git grep -l -E "([\!\&\~\*\(]|\)\)|\([^,\*\(]+\**\))\(([a-zA-Z0-9_]+((\.|->)[a-zA-Z0-9_]+|\[[a-zA-Z0-9_ \%\+\*\-]+\])+)\)" | xargs sed -r -i'' 's#([\!\&\~\*\(]|\)\)|\([^,\*\(]+\**\))\(([a-zA-Z0-9_]+((\.|->)[a-zA-Z0-9_]+|\[[a-zA-Z0-9_ \%\+\*\-]+\])+)\)#\1\2#g'
checkbadSource: rules for PetscFunctionBegin and derivatives
Fix words appearing twice in a row for no good reason
add typedef for functions passed to SNESSetFunction() etc to match approach in TSI never liked Jed's use of typedef for function prototypes for a couple of reasons1) you don't see immediately tha
add typedef for functions passed to SNESSetFunction() etc to match approach in TSI never liked Jed's use of typedef for function prototypes for a couple of reasons1) you don't see immediately that the argument to the function is a function pointer instead of standard variable when looking at source2) you don't see at the exact location in the code the prototype of the function being passed inbut there is something to say for using these typedefs soI've prototyped the change for SNES but slightly differently than what Jed did for TS1) I append the typedef with _Ftn to mark that it is a function (helping to relieve the problem 1 above)2) I made the typedef to be for a function, not a function pointer so it can also be used directly for things likePETSC_EXTERN SNESJacobian_Ftn SNESComputeJacobianDefault;I think the TS usage could be switched to this style without user code breakage, and deprecate the current TS typedefThoughts?Just do SNES the same way as TS and live with less clarity?
LIBBASE is no longer used in make so remove it
Rename rules.doc and rules.utils because GitLab treats the former as a MS Word document.Thanks-to: Jed Brown
Convert all header guards to pragma once
Add static to internal functions
Allow generatefortranstubs.py to generate the stubs and module files in the PETSC_ARCH directory
Fix PetscCallMPI(MPI_Allreduce()) with PETSc types
123456