People who code: we want your input. Take the Survey

Hot answers tagged

4

Use of Lagrange multipliers produces a saddle-point problem, $$ \begin{pmatrix} A & B^T \\ B & 0 \end{pmatrix} \begin{pmatrix} u \\ \lambda \end{pmatrix} = \begin{pmatrix} b \\ 0 \end{pmatrix} $$ As you've noticed, many preconditioners break down for this sort of system. One can use direct solvers that support pivoting, but if you want iterative ...


2

We can rewrite the equation as $ \frac{-2 f f'}{(1+f^2)^2} = \frac{f}{1+f^2} $ which reduces to $ f' = - \frac{1+f^2}{2} $ The latter does not have $1+f^2$ in the denominator, so it should not have the aforementioned numerical problem and can be easily integrated numerically. In fact, now the equation can be easily seen to have a trivial analytic solution, ...


2

If you're looking for an example, take a look at the MatrixBase class here: https://github.com/dealii/dealii/blob/master/include/deal.II/lac/petsc_matrix_base.h https://github.com/dealii/dealii/blob/master/source/lac/petsc_matrix_base.cc


1

It's a misunderstanding that you need two different meshes: The proper way to see things is that you are using the same mesh, but different polynomial spaces for the two variables. For example, for the Stokes equation, you'd have quadratic polynomials for the velocity $\mathbf u$ and linear polynomials for the pressure $p$. Appropriate parallelization ...


Only top voted, non community-wiki answers of a minimum length are eligible