[petsc-users] Declaring struct to represent field for dof > 1 for DM in Fortran

2012-07-10 Thread TAY wee-beng
On 10/7/2012 8:48 PM, Randall Mackie wrote: > > On Jul 10, 2012, at 11:29 AM, Jed Brown wrote: > >> On Tue, Jul 10, 2012 at 1:22 PM, TAY wee-beng > > wrote: >> >> Do you mean DMDAVecGetArrayDOFF90 ? I tried to compile but it >> gives the error during linking: >>

[petsc-users] Declaring struct to represent field for dof > 1 for DM in Fortran

2012-07-10 Thread Barry Smith
On Jul 10, 2012, at 11:05 AM, Matthew Knepley wrote: >> >>Matt > Ok, I'll try to use another mtd. > > Btw, if I declare: > > PetscScalar,pointer :: array2(:,:,:) > > with DMDACreate2d using dof = 2, > > call DMDAVecGetArrayF90(da,x_local,array2,ierr) > > access array2 > > call DM

[petsc-users] Declaring struct to represent field for dof > 1 for DM in Fortran

2012-07-10 Thread TAY wee-beng
On 10/7/2012 6:05 PM, Matthew Knepley wrote: > On Tue, Jul 10, 2012 at 11:03 AM, TAY wee-beng > wrote: > > > Yours sincerely, > > TAY wee-beng > > On 10/7/2012 2:07 PM, Matthew Knepley wrote: >> On Tue, Jul 10, 2012 at 5:39 AM, TAY wee-beng >

[petsc-users] Declaring struct to represent field for dof > 1 for DM in Fortran

2012-07-10 Thread TAY wee-beng
Yours sincerely, TAY wee-beng On 10/7/2012 2:07 PM, Matthew Knepley wrote: > On Tue, Jul 10, 2012 at 5:39 AM, TAY wee-beng > wrote: > > Hi, > > I read in the manual in page 50 that it's recommended to declare > struct to represent field for dof > 1 for DM

[petsc-users] Declaring struct to represent field for dof > 1 for DM in Fortran

2012-07-10 Thread Jed Brown
On Tue, Jul 10, 2012 at 1:22 PM, TAY wee-beng wrote: > Do you mean DMDAVecGetArrayDOFF90 ? I tried to compile but it gives the > error during linking: > > 1>dm_test2d.obj : error LNK2019: unresolved external symbol > DMDAVECGETARRAYDOFF90 referenced in function MAIN__ > Matt was suggesting that

[petsc-users] Declaring struct to represent field for dof > 1 for DM in Fortran

2012-07-10 Thread TAY wee-beng
Hi, I read in the manual in page 50 that it's recommended to declare struct to represent field for dof > 1 for DM. I'm using Fortran and for testing, I use dof = 1 and write as: /type field //PetscScalar//u(or real(8) :: u) end type field type(field), pointer :: field_u(:,:)/ When I

[petsc-users] Declaring struct to represent field for dof > 1 for DM in Fortran

2012-07-10 Thread Randall Mackie
On Jul 10, 2012, at 11:29 AM, Jed Brown wrote: > On Tue, Jul 10, 2012 at 1:22 PM, TAY wee-beng wrote: > Do you mean DMDAVecGetArrayDOFF90 ? I tried to compile but it gives the error > during linking: > > 1>dm_test2d.obj : error LNK2019: unresolved external symbol > DMDAVECGETARRAYDOFF90 refer

[petsc-users] Declaring struct to represent field for dof > 1 for DM in Fortran

2012-07-10 Thread Matthew Knepley
On Tue, Jul 10, 2012 at 11:03 AM, TAY wee-beng wrote: > > Yours sincerely, > > TAY wee-beng > > On 10/7/2012 2:07 PM, Matthew Knepley wrote: > > On Tue, Jul 10, 2012 at 5:39 AM, TAY wee-beng wrote: > >> Hi, >> >> I read in the manual in page 50 that it's recommended to declare struct >> to repr

[petsc-users] Declaring struct to represent field for dof > 1 for DM in Fortran

2012-07-10 Thread Matthew Knepley
On Tue, Jul 10, 2012 at 5:39 AM, TAY wee-beng wrote: > Hi, > > I read in the manual in page 50 that it's recommended to declare struct to > represent field for dof > 1 for DM. > We mean C struct. C makes it easy (just use a pointer type cast). Fortran makes it hard unfortunately. Matt > I