Re: [petsc-users] Fortran interface of MatNullSpaceCreate

2018-02-26 Thread Smith, Barry F.
> On Feb 26, 2018, at 5:38 PM, Sanjay Govindjee wrote: > > If PETSc is expecting an integer, I presume it is fine to pass > PETSC_NULL_INTEGER(1)? Not if the function has an interface definition. Fortran interfaces distinguish between passing an integer a and an integer a(1) so you can o

Re: [petsc-users] Fortran interface of MatNullSpaceCreate

2018-02-26 Thread Sanjay Govindjee
If PETSc is expecting an integer, I presume it is fine to pass PETSC_NULL_INTEGER(1)? On 2/26/18 11:53 PM, Smith, Barry F. wrote: PETSC_NULL_INTEGER is actually declared as an array of size 1 (this is why you get the confusing message about no specific subroutine that matches). PETSC_NULL_INT

Re: [petsc-users] Fortran interface of MatNullSpaceCreate

2018-02-26 Thread Smith, Barry F.
> On Feb 26, 2018, at 4:47 PM, frank wrote: > > Hello, > > It works after changing PETSC_NULL_INTEGER to 0. Thank you so much. > > Does this mean the 3rd argument is a Fortran integer rather than PestcInt? No it is actually a PetscInt so technically you should declare PetscInt zero

Re: [petsc-users] Fortran interface of MatNullSpaceCreate

2018-02-26 Thread Smith, Barry F.
It should be > call MatNullSpaceCreate( PETSC_COMM_WORLD, PETSC_TRUE, 0, dummyVecs, > nullspace, ierr) If this doesn't work please send your test code that I can compile myself and figure out what is going on. Barry > On Feb 26, 2018, at 4:18 PM, frank wrote: > > Hello, > > I ha

[petsc-users] Fortran interface of MatNullSpaceCreate

2018-02-26 Thread frank
Hello, I have a question of the Fortran interface of subroutine MatNullSpaceCreate. I tried to call the subroutine in the following form: Vec :: dummyVec, dummyVecs(1) MatNullSpace :: nullspace INTEGER :: ierr (a) call MatNullSpaceCreate( PETSC_COMM_WORLD, PETSC_TRUE,

Re: [petsc-users] Check if allocated in Fortran

2018-02-26 Thread Sanjay Govindjee
Thanks.  That did the trick. On 2/26/18 7:11 PM, Satish Balay wrote: Perhaps the following code? Vec x x = PETSC_NULL_VEC if (x .eq. PETSC_NULL_VEC) then print*,'vec is null' endif Satish On Mon, 26 Feb 2018, Sanjay Govindjee wrote: I am t

Re: [petsc-users] Check if allocated in Fortran

2018-02-26 Thread Satish Balay
Perhaps the following code? Vec x x = PETSC_NULL_VEC if (x .eq. PETSC_NULL_VEC) then print*,'vec is null' endif Satish On Mon, 26 Feb 2018, Sanjay Govindjee wrote: > I am trying to update some code that works in version 3.7.6 to version 3.8.3. > >

[petsc-users] Check if allocated in Fortran

2018-02-26 Thread Sanjay Govindjee
I am trying to update some code that works in version 3.7.6 to version 3.8.3. What is the recommended way to check if a petsc type, such as Vec, has already been created? Current code looks like: Vec xvec if(xvec.eq.0) then  ! Check if xvec needs to be created   call VecCreate(PETSC