PETSc伴随解的微分计算
Computing Derivatives for PETSc Adjoint Solvers using Algorithmic Differentiation
摘要:
大多数非线性偏微分方程(PDE)求解器需要与微分算子相关联的雅可比矩阵。在PETSc中,这通常通过解析推导或数值近似方法(例如有限差分)来实现。对于复杂的应用程序,手工编码雅可比矩阵可能很耗时且容易出错,但计算效率很高。虽然有限差分近似是直接实现的,但它们具有高算术复杂度和低精度。或者,可以使用算法微分(AD)计算雅可比矩阵,产生与解析推导相同的导数,具有实现独立于问题的额外益处。在这项工作中,运营商重载AD工具ADOL-C适用于生成雅可比矩阵的时间依赖,非线性偏微分方程及其伴随。考虑了各种策略,包括压缩和无矩阵方法。在2D扩散-反应模型的数值实验中,这些策略的性能进行了研究,并与手工导出的版本进行了比较。
英文摘要:
Most nonlinear partial differential equation (PDE) solvers require the Jacobian matrix associated to the differential operator. In PETSc, this is typically achieved by either an analytic derivation or numerical approximation method such as finite differences. For complex applications, hand-coding the Jacobian can be time-consuming and error-prone, yet computationally efficient. Whilst finite difference approximations are straight-forward to implement, they have high arithmetic complexity and low accuracy. Alternatively, one may compute Jacobians using algorithmic differentiation (AD), yielding the same derivatives as an analytic derivation, with the added benefit that the implementation is problem independent. In this work, the operator overloading AD tool ADOL-C is applied to generate Jacobians for time-dependent, nonlinear PDEs and their adjoints. Various strategies are considered, including compressed and matrix-free approaches. In numerical experiments with a 2D diffusion-reaction model, the performance of these strategies has been studied and compared to the hand-derived version.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。