[petsc-users] using SNES_VI_INF in variable initialization

Dharmendar Reddy dharmareddy84 at gmail.com
Fri Jan 17 15:38:27 CST 2014


Ok, i fixed my code with the values. But was making sure if the usage
pattern is correct.

Thanks
Reddy

On Fri, Jan 17, 2014 at 3:36 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
>
>   Sorry, it is missing from Fortran. Use 1.0e20 and -1.0e20 for the values
>
>    Barry
>
> Request-assigned: Barry define SNES_VI_INF and NINF for Fortran
>
> On Jan 17, 2014, at 3:17 PM, Dharmendar Reddy <dharmareddy84 at gmail.com> wrote:
>
>> Hello,
>>        I am not sure if this is a petsc related issue. I am trying to
>> use SNES_VI_{INF,NINF} to initialize a variable as shown below in the
>> code. The code does not compile...How do i fix it ? Looks like
>> SNES_VI_INF is not available via petscdef.h
>>
>> module test_m
>>  implicit none
>> #include "finclude/petscdef.h"
>>  type Var_t
>>    real :: lb = SNES_VI_NINF
>>    real :: ub = SNES_VI_INF
>>  end type Var_t
>> end module test_m
>>
>> program test
>>  implicit none
>> #include "finclude/petsc.h"
>>  PetscErrorCode ierr
>>  type(Var_t) :: Var
>>  call PetscInitialize(PETSC_NULL_CHARACTER, ierr)
>>   print*, 'lb=',Var%lb
>>   print*, 'ub=',Var%ub
>>  call PetscFinalize(ierr)
>> end program test
>



-- 
-----------------------------------------------------
Dharmendar Reddy Palle
Graduate Student
Microelectronics Research center,
University of Texas at Austin,
10100 Burnet Road, Bldg. 160
MER 2.608F, TX 78758-4445
e-mail: dharmareddy84 at gmail.com
Phone: +1-512-350-9082
United States of America.
Homepage: https://webspace.utexas.edu/~dpr342


More information about the petsc-users mailing list