[petsc-users] issues with VecSetValues in petsc 3.19

Edoardo alinovi edoardo.alinovi at gmail.com
Mon Apr 17 05:00:14 CDT 2023


Hey Matt,

Thanks for the help. Here is the error:

[0]PETSC ERROR: --------------------- Error Message
--------------------------------------------------------------
[0]PETSC ERROR: Object is in wrong state
[0]PETSC ERROR: Not for unassembled vector, did you call
VecAssemblyBegin()/VecAssemblyEnd()?
[0]PETSC ERROR: WARNING! There are option(s) set that were not used! Could
be the program crashed before they were used or a spelling mistake, etc!
[0]PETSC ERROR:   Option left: name:-UPeqn_fieldsplit_p_ksp_rtol value:
0.10000000000000000E-0001 source: code
[0]PETSC ERROR:   Option left: name:-UPeqn_fieldsplit_p_pc_type value:
hypre source: code
[0]PETSC ERROR:   Option left: name:-UPeqn_fieldsplit_u_ksp_rtol value:
0.10000000000000000E-0001 source: code
[0]PETSC ERROR:   Option left: name:-UPeqn_fieldsplit_u_pc_type value:
bjacobi source: code
[0]PETSC ERROR: See https://petsc.org/release/faq/ for trouble shooting.
[0]PETSC ERROR: Petsc Release Version 3.19.0, unknown
[0]PETSC ERROR: flubio_coupled on a arch-gnu named betelgeuse by edo Mon
Apr 17 12:05:28 2023
[0]PETSC ERROR: Configure options PETSC_ARCH=arch-gnu FOPTFLAGS=-O3
COPTFLAGS=-O3 CXXOPTFLAGS=-O3 -with-debugging=no
-with-mpi-dir=/home/edo/user_software_repository/openmpi-4.1.2/build
-download-fblaslapack=1 -download-superlu_dist -download-mumps
-download-hypre -download-metis -download-parmetis -download-scalapack
--download-ml -download-slepc -download-spai -download-fftw
[0]PETSC ERROR: #1 MatMult() at
/home/edo/user_software_repository/petsc/src/mat/interface/matrix.c:2557
[1]PETSC ERROR: --------------------- Error Message
--------------------------------------------------------------
[1]PETSC ERROR: Object is in wrong state
[1]PETSC ERROR: Not for unassembled vector, did you call
VecAssemblyBegin()/VecAssemblyEnd()?
[1]PETSC ERROR: WARNING! There are option(s) set that were not used! Could
be the program crashed before they were used or a spelling mistake, etc!
[1]PETSC ERROR:   Option left: name:-UPeqn_fieldsplit_p_ksp_rtol value:
0.10000000000000000E-0001 source: code
[1]PETSC ERROR:   Option left: name:-UPeqn_fieldsplit_p_pc_type value:
hypre source: code
[1]PETSC ERROR:   Option left: name:-UPeqn_fieldsplit_u_ksp_rtol value:
0.10000000000000000E-0001 source: code
[1]PETSC ERROR:   Option left: name:-UPeqn_fieldsplit_u_pc_type value:
bjacobi source: code
[1]PETSC ERROR: See https://petsc.org/release/faq/ for trouble shooting.
[1]PETSC ERROR: Petsc Release Version 3.19.0, unknown
[1]PETSC ERROR: flubio_coupled on a arch-gnu named betelgeuse by edo Mon
Apr 17 12:05:28 2023
[1]PETSC ERROR: Configure options PETSC_ARCH=arch-gnu FOPTFLAGS=-O3
COPTFLAGS=-O3 CXXOPTFLAGS=-O3 -with-debugging=no
-with-mpi-dir=/home/edo/user_software_repository/openmpi-4.1.2/build
-download-fblaslapack=1 -download-superlu_dist -download-mumps
-download-hypre -download-metis -download-parmetis -download-scalapack
--download-ml -download-slepc -download-spai -download-fftw
[1]PETSC ERROR: #1 MatMult() at
/home/edo/user_software_repository/petsc/src/mat/interface/matrix.c:2557
[2]PETSC ERROR: --------------------- Error Message
--------------------------------------------------------------
[2]PETSC ERROR: Object is in wrong state
[2]PETSC ERROR: Not for unassembled vector, did you call
VecAssemblyBegin()/VecAssemblyEnd()?
[2]PETSC ERROR: WARNING! There are option(s) set that were not used! Could
be the program crashed before they were used or a spelling mistake, etc!
[2]PETSC ERROR:   Option left: name:-UPeqn_fieldsplit_p_ksp_rtol value:
0.10000000000000000E-0001 source: code
[2]PETSC ERROR:   Option left: name:-UPeqn_fieldsplit_p_pc_type value:
hypre source: code
[2]PETSC ERROR:   Option left: name:-UPeqn_fieldsplit_u_ksp_rtol value:
0.10000000000000000E-0001 source: code
[2]PETSC ERROR:   Option left: name:-UPeqn_fieldsplit_u_pc_type value:
bjacobi source: code
[2]PETSC ERROR: [3]PETSC ERROR: --------------------- Error Message
--------------------------------------------------------------
[3]PETSC ERROR: Object is in wrong state
[3]PETSC ERROR: Not for unassembled vector, did you call
VecAssemblyBegin()/VecAssemblyEnd()?
[3]PETSC ERROR: WARNING! There are option(s) set that were not used! Could
be the program crashed before they were used or a spelling mistake, etc!
[3]PETSC ERROR:   Option left: name:-UPeqn_fieldsplit_p_ksp_rtol value:
0.10000000000000000E-0001 source: code
[3]PETSC ERROR:   Option left: name:-UPeqn_fieldsplit_p_pc_type value:
hypre source: code
[3]PETSC ERROR:   Option left: name:-UPeqn_fieldsplit_u_ksp_rtol value:
0.10000000000000000E-0001 source: code
[3]PETSC ERROR:   Option left: name:-UPeqn_fieldsplit_u_pc_type value:
bjacobi source: code
See https://petsc.org/release/faq/ for trouble shooting.
[2]PETSC ERROR: Petsc Release Version 3.19.0, unknown
[2]PETSC ERROR: flubio_coupled on a arch-gnu named betelgeuse by edo Mon
Apr 17 12:05:28 2023
[2]PETSC ERROR: Configure options PETSC_ARCH=arch-gnu FOPTFLAGS=-O3
COPTFLAGS=-O3 CXXOPTFLAGS=-O3 -with-debugging=no
-with-mpi-dir=/home/edo/user_software_repository/openmpi-4.1.2/build
-download-fblaslapack=1 -download-superlu_dist -download-mumps
-download-hypre -download-metis -download-parmetis -download-scalapack
--download-ml -download-slepc -download-spai -download-fftw
[3]PETSC ERROR: See https://petsc.org/release/faq/ for trouble shooting.
[3]PETSC ERROR: Petsc Release Version 3.19.0, unknown
[3]PETSC ERROR: flubio_coupled on a arch-gnu named betelgeuse by edo Mon
Apr 17 12:05:28 2023
[3]PETSC ERROR: Configure options PETSC_ARCH=arch-gnu FOPTFLAGS=-O3
COPTFLAGS=-O3 CXXOPTFLAGS=-O3 -with-debugging=no
-with-mpi-dir=/home/edo/user_software_repository/openmpi-4.1.2/build
-download-fblaslapack=1 -download-superlu_dist -download-mumps
-download-hypre -download-metis -download-parmetis -download-scalapack
--download-ml -download-slepc -download-spai -download-fftw
[2]PETSC ERROR: #1 MatMult() at
/home/edo/user_software_repository/petsc/src/mat/interface/matrix.c:2557
[3]PETSC ERROR: #1 MatMult() at
/home/edo/user_software_repository/petsc/src/mat/interface/matrix.c:2557

Here the way I am doing:

        ! Duplicate vector
        call VecDuplicate(this%rhs, x, ierr)
        call VecZeroEntries(x, ierr)

        call VecDuplicate(this%rhs, vres, ierr)
        ! Set the current solution
        call VecSetValues(x, numberOfElements, mesh%cellGlobalAddr-1,
field%phi(1:numberOfElements,iComp), INSERT_VALUES, ierr)
        call flubioStopMsg('HELLO')

cheers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230417/3da54995/attachment.html>


More information about the petsc-users mailing list