... in debug mode. (Optimized is much faster.)

And note that this example is the nonlinear Bratu problem, which while very
similar to a Laplacian, is not the same and performs multiple linear solves.
On Oct 3, 2013 8:21 AM, "Matthew Knepley" <[email protected]> wrote:

> On Thu, Oct 3, 2013 at 8:04 AM, mary sweat <[email protected]> wrote:
>
>>  Hi all
>> I am very new to petsc and to c programming. I need to build a huge
>> sparse matrix with a block structure.
>> The problem is that my matrx may be huge (200000*200000) so i Need a way
>> to define it through the kronecker product or memorizing just the
>> overdiagonal, diagonal and subdiagonal block.
>> Is it possible in petsc? any suggestions?
>> thanks a million in advance
>>
>
> This is the 2D Laplacian with a 5-point FD stencil. There are many PETSc
> examples which
> form and solve this. For example, here is an example:
>
>   1,640,961 unknowns (on the fine level)
>
>   8,199,681 nonzeros
>
>   ./ex5 -da_grid_x 21 -da_grid_y 21 -da_refine 6 -ksp_rtol 1.0e-9 -pc_type
> mg -pc_mg_levels 4 -snes_monitor -snes_view
>
> This takes 375s on my underpowered Mac Air laptop.
>
>   Thanks,
>
>      Matt
>
> --
> What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which their
> experiments lead.
> -- Norbert Wiener
>

Reply via email to