xref: /petsc/src/dm/ftn-mod/petscdmmod.F90 (revision 6dd63270497ad23dcf16ae500a87ff2b2a0b7474)
1*6dd63270SBarry Smith        module petscdmdef
2*6dd63270SBarry Smith        use petscvecdef
3*6dd63270SBarry Smith        use petscmatdef
4*6dd63270SBarry Smith#include <../ftn/dm/petscall.h>
5*6dd63270SBarry Smith#include <../ftn/dm/petscspace.h>
6*6dd63270SBarry Smith#include <../ftn/dm/petscdualspace.h>
7*6dd63270SBarry Smith
8*6dd63270SBarry Smith       type ttPetscTabulation
9*6dd63270SBarry Smith         sequence
10*6dd63270SBarry Smith         PetscInt                K
11*6dd63270SBarry Smith         PetscInt                Nr
12*6dd63270SBarry Smith         PetscInt                Np
13*6dd63270SBarry Smith         PetscInt                Nb
14*6dd63270SBarry Smith         PetscInt                Nc
15*6dd63270SBarry Smith         PetscInt                cdim
16*6dd63270SBarry Smith         PetscReal2d, pointer :: T(:)
17*6dd63270SBarry Smith       end type ttPetscTabulation
18*6dd63270SBarry Smith
19*6dd63270SBarry Smith       type tPetscTabulation
20*6dd63270SBarry Smith         type(ttPetscTabulation), pointer :: ptr
21*6dd63270SBarry Smith       end type tPetscTabulation
22*6dd63270SBarry Smith
23*6dd63270SBarry Smith       end module petscdmdef
24*6dd63270SBarry Smith!     ----------------------------------------------
25*6dd63270SBarry Smith
26*6dd63270SBarry Smith!     Needed by Fortran stub petscdsgettabulation_()
27*6dd63270SBarry Smith      subroutine F90Array1dCreateTabulation(array,start,len,ptr)
28*6dd63270SBarry Smith      use petscdmdef
29*6dd63270SBarry Smith      implicit none
30*6dd63270SBarry Smith      PetscInt                    start,len
31*6dd63270SBarry Smith      PetscTabulation, target  :: array(start:start+len-1)
32*6dd63270SBarry Smith      PetscTabulation, pointer :: ptr(:)
33*6dd63270SBarry Smith      ptr => array
34*6dd63270SBarry Smith      print*,'create tab', array(1)%ptr%K,array(1)%ptr%cdim
35*6dd63270SBarry Smith      print*,ptr(1)%ptr%K,ptr(1)%ptr%cdim
36*6dd63270SBarry Smith      end subroutine
37*6dd63270SBarry Smith#if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
38*6dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT:: F90Array1dCreateTabulation
39*6dd63270SBarry Smith#endif
40*6dd63270SBarry Smith
41*6dd63270SBarry Smith      subroutine F90Array1dDestroyTabulation(ptr)
42*6dd63270SBarry Smith      use petscdmdef
43*6dd63270SBarry Smith      implicit none
44*6dd63270SBarry Smith      PetscTabulation, pointer :: ptr(:)
45*6dd63270SBarry Smith      nullify(ptr)
46*6dd63270SBarry Smith      end subroutine
47*6dd63270SBarry Smith#if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
48*6dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT:: F90Array1dDestroyTabulation
49*6dd63270SBarry Smith#endif
50*6dd63270SBarry Smith
51*6dd63270SBarry Smith        module petscdm
52*6dd63270SBarry Smith        use petscmat
53*6dd63270SBarry Smith        use petscdmdef
54*6dd63270SBarry Smith#include <../src/dm/ftn-mod/petscdm.h90>
55*6dd63270SBarry Smith#include <../src/dm/ftn-mod/petscdt.h90>
56*6dd63270SBarry Smith#include <../ftn/dm/petscall.h90>
57*6dd63270SBarry Smith#include <../ftn/dm/petscspace.h90>
58*6dd63270SBarry Smith#include <../ftn/dm/petscdualspace.h90>
59*6dd63270SBarry Smith
60*6dd63270SBarry Smith        interface PetscDSGetTabulationSetSizes
61*6dd63270SBarry Smith        subroutine PetscDSGetTabulationSetSizes(ds,i, tab,ierr)
62*6dd63270SBarry Smith          import tPetscDS, ttPetscTabulation
63*6dd63270SBarry Smith          PetscErrorCode              ierr
64*6dd63270SBarry Smith          type(ttPetscTabulation)     tab
65*6dd63270SBarry Smith          PetscDS                     ds
66*6dd63270SBarry Smith          PetscInt                    i
67*6dd63270SBarry Smith        end subroutine
68*6dd63270SBarry Smith        end interface
69*6dd63270SBarry Smith
70*6dd63270SBarry Smith        interface PetscDSGetTabulationSetPointers
71*6dd63270SBarry Smith        subroutine PetscDSGetTabulationSetPointers(ds,i, T,ierr)
72*6dd63270SBarry Smith          import tPetscDS, ttPetscTabulation,tPetscReal2d
73*6dd63270SBarry Smith          PetscErrorCode              ierr
74*6dd63270SBarry Smith          type(tPetscReal2d), pointer :: T(:)
75*6dd63270SBarry Smith          PetscDS                     ds
76*6dd63270SBarry Smith          PetscInt                    i
77*6dd63270SBarry Smith        end subroutine
78*6dd63270SBarry Smith        end interface
79*6dd63270SBarry Smith
80*6dd63270SBarry Smith        interface PetscDSGetTabulation
81*6dd63270SBarry Smith          module procedure PetscDSGetTabulation
82*6dd63270SBarry Smith       end interface
83*6dd63270SBarry Smith
84*6dd63270SBarry Smith        interface PetscDSRestoreTabulation
85*6dd63270SBarry Smith          module procedure PetscDSRestoreTabulation
86*6dd63270SBarry Smith       end interface
87*6dd63270SBarry Smith
88*6dd63270SBarry Smith       contains
89*6dd63270SBarry Smith
90*6dd63270SBarry Smith#include <../ftn/dm/petscall.hf90>
91*6dd63270SBarry Smith#include <../ftn/dm/petscspace.hf90>
92*6dd63270SBarry Smith#include <../ftn/dm/petscdualspace.hf90>
93*6dd63270SBarry Smith
94*6dd63270SBarry Smith        Subroutine PetscDSGetTabulation(ds,tab,ierr)
95*6dd63270SBarry Smith          PetscErrorCode              ierr
96*6dd63270SBarry Smith          PetscTabulation, pointer :: tab(:)
97*6dd63270SBarry Smith          PetscDS                     ds
98*6dd63270SBarry Smith
99*6dd63270SBarry Smith          PetscInt  Nf, i
100*6dd63270SBarry Smith          call PetscDSGetNumFields(ds, Nf, ierr)
101*6dd63270SBarry Smith          allocate(tab(Nf))
102*6dd63270SBarry Smith          do i=1,Nf
103*6dd63270SBarry Smith             allocate(tab(i)%ptr)
104*6dd63270SBarry Smith             CHKMEMQ
105*6dd63270SBarry Smith             call PetscDSGetTabulationSetSizes(ds, i, tab(i)%ptr, ierr)
106*6dd63270SBarry Smith             CHKMEMQ
107*6dd63270SBarry Smith             allocate(tab(i)%ptr%T(tab(i)%ptr%K+1))
108*6dd63270SBarry Smith             call PetscDSGetTabulationSetPointers(ds, i, tab(i)%ptr%T, ierr)
109*6dd63270SBarry Smith             CHKMEMQ
110*6dd63270SBarry Smith          enddo
111*6dd63270SBarry Smith        End Subroutine PetscDSGetTabulation
112*6dd63270SBarry Smith
113*6dd63270SBarry Smith        Subroutine PetscDSRestoreTabulation(ds,tab,ierr)
114*6dd63270SBarry Smith          PetscErrorCode              ierr
115*6dd63270SBarry Smith          PetscTabulation, pointer :: tab(:)
116*6dd63270SBarry Smith          PetscDS                     ds
117*6dd63270SBarry Smith
118*6dd63270SBarry Smith          PetscInt  Nf, i
119*6dd63270SBarry Smith          call PetscDSGetNumFields(ds, Nf, ierr)
120*6dd63270SBarry Smith          do i=1,Nf
121*6dd63270SBarry Smith             deallocate(tab(i)%ptr%T)
122*6dd63270SBarry Smith             deallocate(tab(i)%ptr)
123*6dd63270SBarry Smith          enddo
124*6dd63270SBarry Smith          deallocate(tab)
125*6dd63270SBarry Smith        End Subroutine PetscDSRestoreTabulation
126*6dd63270SBarry Smith
127*6dd63270SBarry Smith        end module petscdm
128*6dd63270SBarry Smith
129*6dd63270SBarry Smith!     ----------------------------------------------
130*6dd63270SBarry Smith
131*6dd63270SBarry Smith        module petscdmdadef
132*6dd63270SBarry Smith        use petscdmdef
133*6dd63270SBarry Smith        use petscaodef
134*6dd63270SBarry Smith        use petscpfdef
135*6dd63270SBarry Smith#include <petsc/finclude/petscao.h>
136*6dd63270SBarry Smith#include <petsc/finclude/petscdmda.h>
137*6dd63270SBarry Smith#include <../ftn/dm/petscdmda.h>
138*6dd63270SBarry Smith        end module petscdmdadef
139*6dd63270SBarry Smith
140*6dd63270SBarry Smith        module petscdmda
141*6dd63270SBarry Smith        use petscdm
142*6dd63270SBarry Smith        use petscdmdadef
143*6dd63270SBarry Smith
144*6dd63270SBarry Smith#include <../src/dm/ftn-mod/petscdmda.h90>
145*6dd63270SBarry Smith#include <../ftn/dm/petscdmda.h90>
146*6dd63270SBarry Smith
147*6dd63270SBarry Smith        contains
148*6dd63270SBarry Smith
149*6dd63270SBarry Smith#include <../ftn/dm/petscdmda.hf90>
150*6dd63270SBarry Smith        end module petscdmda
151*6dd63270SBarry Smith
152*6dd63270SBarry Smith!     ----------------------------------------------
153*6dd63270SBarry Smith
154*6dd63270SBarry Smith        module petscdmplex
155*6dd63270SBarry Smith        use petscdm
156*6dd63270SBarry Smith        use petscdmdef
157*6dd63270SBarry Smith#include <petsc/finclude/petscfv.h>
158*6dd63270SBarry Smith#include <petsc/finclude/petscdmplex.h>
159*6dd63270SBarry Smith#include <petsc/finclude/petscdmplextransform.h>
160*6dd63270SBarry Smith#include <../src/dm/ftn-mod/petscdmplex.h90>
161*6dd63270SBarry Smith#include <../ftn/dm/petscfv.h>
162*6dd63270SBarry Smith#include <../ftn/dm/petscdmplex.h>
163*6dd63270SBarry Smith#include <../ftn/dm/petscdmplextransform.h>
164*6dd63270SBarry Smith
165*6dd63270SBarry Smith#include <../ftn/dm/petscfv.h90>
166*6dd63270SBarry Smith#include <../ftn/dm/petscdmplex.h90>
167*6dd63270SBarry Smith#include <../ftn/dm/petscdmplextransform.h90>
168*6dd63270SBarry Smith
169*6dd63270SBarry Smith        contains
170*6dd63270SBarry Smith
171*6dd63270SBarry Smith#include <../ftn/dm/petscfv.hf90>
172*6dd63270SBarry Smith#include <../ftn/dm/petscdmplex.hf90>
173*6dd63270SBarry Smith#include <../ftn/dm/petscdmplextransform.hf90>
174*6dd63270SBarry Smith        end module petscdmplex
175*6dd63270SBarry Smith
176*6dd63270SBarry Smith!     ----------------------------------------------
177*6dd63270SBarry Smith
178*6dd63270SBarry Smith        module petscdmstag
179*6dd63270SBarry Smith        use petscdmdef
180*6dd63270SBarry Smith#include <petsc/finclude/petscdmstag.h>
181*6dd63270SBarry Smith#include <../ftn/dm/petscdmstag.h>
182*6dd63270SBarry Smith
183*6dd63270SBarry Smith#include <../ftn/dm/petscdmstag.h90>
184*6dd63270SBarry Smith
185*6dd63270SBarry Smith        contains
186*6dd63270SBarry Smith
187*6dd63270SBarry Smith#include <../ftn/dm/petscdmstag.hf90>
188*6dd63270SBarry Smith        end module petscdmstag
189*6dd63270SBarry Smith
190*6dd63270SBarry Smith!     ----------------------------------------------
191*6dd63270SBarry Smith
192*6dd63270SBarry Smith        module petscdmswarm
193*6dd63270SBarry Smith        use petscdm
194*6dd63270SBarry Smith        use petscdmdef
195*6dd63270SBarry Smith#include <petsc/finclude/petscdmswarm.h>
196*6dd63270SBarry Smith#include <../ftn/dm/petscdmswarm.h>
197*6dd63270SBarry Smith
198*6dd63270SBarry Smith#include <../src/dm/ftn-mod/petscdmswarm.h90>
199*6dd63270SBarry Smith#include <../ftn/dm/petscdmswarm.h90>
200*6dd63270SBarry Smith
201*6dd63270SBarry Smith        contains
202*6dd63270SBarry Smith
203*6dd63270SBarry Smith#include <../ftn/dm/petscdmswarm.hf90>
204*6dd63270SBarry Smith        end module petscdmswarm
205*6dd63270SBarry Smith
206*6dd63270SBarry Smith!     ----------------------------------------------
207*6dd63270SBarry Smith
208*6dd63270SBarry Smith        module petscdmcomposite
209*6dd63270SBarry Smith        use petscdm
210*6dd63270SBarry Smith#include <petsc/finclude/petscdmcomposite.h>
211*6dd63270SBarry Smith
212*6dd63270SBarry Smith#include <../src/dm/ftn-mod/petscdmcomposite.h90>
213*6dd63270SBarry Smith#include <../ftn/dm/petscdmcomposite.h90>
214*6dd63270SBarry Smith        end module petscdmcomposite
215*6dd63270SBarry Smith
216*6dd63270SBarry Smith!     ----------------------------------------------
217*6dd63270SBarry Smith
218*6dd63270SBarry Smith        module petscdmforest
219*6dd63270SBarry Smith        use petscdm
220*6dd63270SBarry Smith#include <petsc/finclude/petscdmforest.h>
221*6dd63270SBarry Smith#include <../ftn/dm/petscdmforest.h>
222*6dd63270SBarry Smith#include <../ftn/dm/petscdmforest.h90>
223*6dd63270SBarry Smith        end module petscdmforest
224*6dd63270SBarry Smith
225*6dd63270SBarry Smith!     ----------------------------------------------
226*6dd63270SBarry Smith
227*6dd63270SBarry Smith        module petscdmnetwork
228*6dd63270SBarry Smith        use petscdm
229*6dd63270SBarry Smith#include <petsc/finclude/petscdmnetwork.h>
230*6dd63270SBarry Smith#include <../ftn/dm/petscdmnetwork.h>
231*6dd63270SBarry Smith
232*6dd63270SBarry Smith#include <../ftn/dm/petscdmnetwork.h90>
233*6dd63270SBarry Smith
234*6dd63270SBarry Smith        contains
235*6dd63270SBarry Smith
236*6dd63270SBarry Smith#include <../ftn/dm/petscdmnetwork.hf90>
237*6dd63270SBarry Smith        end module petscdmnetwork
238*6dd63270SBarry Smith
239*6dd63270SBarry Smith!     ----------------------------------------------
240*6dd63270SBarry Smith
241*6dd63270SBarry Smith        module petscdmadaptor
242*6dd63270SBarry Smith        use petscdm
243*6dd63270SBarry Smith        use petscdmdef
244*6dd63270SBarry Smith!        use petscsnes
245*6dd63270SBarry Smith#include <petsc/finclude/petscdmadaptor.h>
246*6dd63270SBarry Smith#include <../ftn/dm/petscdmadaptor.h>
247*6dd63270SBarry Smith
248*6dd63270SBarry Smith!#include <../ftn/dm/petscdmadaptor.h90>
249*6dd63270SBarry Smith
250*6dd63270SBarry Smith        contains
251*6dd63270SBarry Smith
252*6dd63270SBarry Smith!#include <../ftn/dm/petscdmadaptor.hf90>
253*6dd63270SBarry Smith        end module petscdmadaptor
254