[petsc-users] On PCFIELDSPLIT and its implementation

Edoardo alinovi edoardo.alinovi at gmail.com
Thu Nov 10 14:06:58 CST 2022


Hi Barry,

Thanks a lot for getting back to me, I am quite stuck at the moment!

Matt kindly added them in a dev branch I am using right now to test this pc.

You are right I am declaring them badly, I am an idiot! My small test works
now, but I'm still in trouble with the main code unfortunately. There the
indices are integers, but I am invoking the field splitting before
assembling the matrix (thus doing MatAssemblyBegin/End). Does the matrix
need to be fully assembled before calling PCFieldSplitSetFields?


Il Gio 10 Nov 2022, 20:14 Barry Smith <bsmith at petsc.dev> ha scritto:

>
>   These beasts should be PetscInt, not real
>
>  real :: ufields(2), pfields(1)
>
>
>    Side note. We do not recommend using options like *-fdefault-real-8 *because
> the compiler may change values in surprising ways.  You can use PetscReal
> to declare real numbers and this will automatically match with single or
> double precision based on the PETSc configure options.
>
>    What version of PETSc are you using? We don't have Fortran stubs for
> the calls to PCFieldSplitSetFields in the latest release. I should add them.
>
>
>
> On Nov 9, 2022, at 12:00 PM, Edoardo alinovi <edoardo.alinovi at gmail.com>
> wrote:
>
> Hi Matt,
>
> it took a bit more than 1s, but I can reproduce the error in the
> attached file.
>
> To compile:
> *mpifort -L$PETSC_DIR/$PETSC_ARCH/lib -lpetsc -fdefault-real-8 -o test
> test.F90 -I$PETSC_DIR/include -I$PETSC_DIR/$PETSC_ARCH/include*
>
> Please run it in serial as I have hardcoded some dimensions to code this
> up faster.
>
> Thank you!
> <test.F90>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20221110/a48e4a67/attachment.html>


More information about the petsc-users mailing list