xref: /libCEED/tests/t521-operator-f.f90 (revision 15910d16b955338d1102d4e730fc58bca8f202b9)
152d6035fSJeremy L Thompson!-----------------------------------------------------------------------
252d6035fSJeremy L Thompson!
352d6035fSJeremy L Thompson! Header with common subroutine
452d6035fSJeremy L Thompson!
552bfb9bbSJeremy L Thompson      include 't320-basis-f.h'
652d6035fSJeremy L Thompson!-----------------------------------------------------------------------
752d6035fSJeremy L Thompson      subroutine setup(ctx,q,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,&
852d6035fSJeremy L Thompson&           u15,u16,v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15,v16,ierr)
952d6035fSJeremy L Thompson      real*8 ctx
1052d6035fSJeremy L Thompson      real*8 u1(1)
1152d6035fSJeremy L Thompson      real*8 u2(1)
1252d6035fSJeremy L Thompson      real*8 v1(1)
1352d6035fSJeremy L Thompson      integer q,ierr
1452d6035fSJeremy L Thompson
1552d6035fSJeremy L Thompson      do i=1,q
1652d6035fSJeremy L Thompson        v1(i)=u1(i)*(u2(i+q*0)*u2(i+q*3)-u2(i+q*1)*u2(i+q*2))
1752d6035fSJeremy L Thompson      enddo
1852d6035fSJeremy L Thompson
1952d6035fSJeremy L Thompson      ierr=0
2052d6035fSJeremy L Thompson      end
2152d6035fSJeremy L Thompson!-----------------------------------------------------------------------
2252d6035fSJeremy L Thompson      subroutine mass(ctx,q,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,&
2352d6035fSJeremy L Thompson&           u15,u16,v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15,v16,ierr)
2452d6035fSJeremy L Thompson      real*8 ctx
2552d6035fSJeremy L Thompson      real*8 u1(1)
2652d6035fSJeremy L Thompson      real*8 u2(1)
2752d6035fSJeremy L Thompson      real*8 v1(1)
2852d6035fSJeremy L Thompson      integer q,ierr
2952d6035fSJeremy L Thompson
3052d6035fSJeremy L Thompson      do i=1,q
3152d6035fSJeremy L Thompson        v1(i)=u2(i)*u1(i)
3252d6035fSJeremy L Thompson      enddo
3352d6035fSJeremy L Thompson
3452d6035fSJeremy L Thompson      ierr=0
3552d6035fSJeremy L Thompson      end
3652d6035fSJeremy L Thompson!-----------------------------------------------------------------------
3752d6035fSJeremy L Thompson      program test
3852d6035fSJeremy L Thompson
3952d6035fSJeremy L Thompson      include 'ceedf.h'
4052d6035fSJeremy L Thompson
4152d6035fSJeremy L Thompson      integer ceed,err,i,j,k
4261dbc9d2Sjeremylt      integer imode
4361dbc9d2Sjeremylt      parameter(imode=ceed_noninterlaced)
44*15910d16Sjeremylt      integer stridesutet(3),stridesuhex(3)
45*15910d16Sjeremylt      integer erestrictxtet,erestrictutet,erestrictuitet,&
46*15910d16Sjeremylt&             erestrictxhex,erestrictuhex,erestrictuihex
4752d6035fSJeremy L Thompson      integer bxtet,butet,bxhex,buhex
4852d6035fSJeremy L Thompson      integer qf_setuptet,qf_masstet,qf_setuphex,qf_masshex
4952d6035fSJeremy L Thompson      integer op_setuptet,op_masstet,op_setuphex,op_masshex,op_setup,op_mass
5052d6035fSJeremy L Thompson      integer qdatatet,qdatahex,x,u,v
5152d6035fSJeremy L Thompson      integer nelemtet,nelemhex,ptet,phex,qtet,qhex,d
5252d6035fSJeremy L Thompson      integer row,col,offset
5352d6035fSJeremy L Thompson      parameter(nelemtet=6)
5452d6035fSJeremy L Thompson      parameter(ptet=6)
5552d6035fSJeremy L Thompson      parameter(qtet=4)
5652d6035fSJeremy L Thompson      parameter(nelemhex=6)
5752d6035fSJeremy L Thompson      parameter(phex=3)
5852d6035fSJeremy L Thompson      parameter(qhex=4)
5952d6035fSJeremy L Thompson      parameter(d=2)
6052d6035fSJeremy L Thompson      integer ndofs,nqptstet,nqptshex,nqpts,nx,ny,nxtet,nytet,nxhex
6152d6035fSJeremy L Thompson      parameter(nx=3)
6252d6035fSJeremy L Thompson      parameter(ny=3)
6352d6035fSJeremy L Thompson      parameter(nxtet=3)
6452d6035fSJeremy L Thompson      parameter(nytet=1)
6552d6035fSJeremy L Thompson      parameter(nxhex=3)
6652d6035fSJeremy L Thompson      parameter(ndofs=(nx*2+1)*(ny*2+1))
6752d6035fSJeremy L Thompson      parameter(nqptstet=nelemtet*qtet)
6852d6035fSJeremy L Thompson      parameter(nqptshex=nelemhex*qhex*qhex)
6952d6035fSJeremy L Thompson      parameter(nqpts=nqptstet+nqptshex)
7052d6035fSJeremy L Thompson      integer indxtet(nelemtet*ptet),indxhex(nelemhex*phex*phex)
7152d6035fSJeremy L Thompson      real*8 arrx(d*ndofs)
72c8b9fe72Sjeremylt      integer*8 voffset,xoffset
7352d6035fSJeremy L Thompson
7452d6035fSJeremy L Thompson      real*8 qref(d*qtet)
7552d6035fSJeremy L Thompson      real*8 qweight(qtet)
7652d6035fSJeremy L Thompson      real*8 interp(ptet*qtet)
7752d6035fSJeremy L Thompson      real*8 grad(d*ptet*qtet)
7852d6035fSJeremy L Thompson
7952d6035fSJeremy L Thompson      real*8 hv(ndofs)
8052d6035fSJeremy L Thompson      real*8 total
8152d6035fSJeremy L Thompson
8252d6035fSJeremy L Thompson      character arg*32
8352d6035fSJeremy L Thompson
8452d6035fSJeremy L Thompson      external setup,mass
8552d6035fSJeremy L Thompson
8652d6035fSJeremy L Thompson      call getarg(1,arg)
8752d6035fSJeremy L Thompson
8852d6035fSJeremy L Thompson      call ceedinit(trim(arg)//char(0),ceed,err)
8952d6035fSJeremy L Thompson
9052d6035fSJeremy L Thompson! DoF Coordinates
9152d6035fSJeremy L Thompson      do i=0,ny*2
9252d6035fSJeremy L Thompson        do j=0,nx*2
9352d6035fSJeremy L Thompson          arrx(i+j*(ny*2+1)+0*ndofs+1)=1.d0*i/(2*ny)
9452d6035fSJeremy L Thompson          arrx(i+j*(ny*2+1)+1*ndofs+1)=1.d0*j/(2*nx)
9552d6035fSJeremy L Thompson        enddo
9652d6035fSJeremy L Thompson      enddo
9752d6035fSJeremy L Thompson
9852d6035fSJeremy L Thompson      call ceedvectorcreate(ceed,d*ndofs,x,err)
99c8b9fe72Sjeremylt      xoffset=0
100c8b9fe72Sjeremylt      call ceedvectorsetarray(x,ceed_mem_host,ceed_use_pointer,arrx,xoffset,err)
10152d6035fSJeremy L Thompson
10252d6035fSJeremy L Thompson! Qdata Vectors
10352d6035fSJeremy L Thompson      call ceedvectorcreate(ceed,nqptstet,qdatatet,err)
10452d6035fSJeremy L Thompson      call ceedvectorcreate(ceed,nqptshex,qdatahex,err)
10552d6035fSJeremy L Thompson
10652d6035fSJeremy L Thompson! Tet Elements
10752d6035fSJeremy L Thompson      do i=0,2
10852d6035fSJeremy L Thompson        col=mod(i,nx)
10952d6035fSJeremy L Thompson        row=i/nx
11052d6035fSJeremy L Thompson        offset=col*2+row*(nx*2+1)*2
11152d6035fSJeremy L Thompson
11252d6035fSJeremy L Thompson        indxtet(i*2*ptet+1)=2+offset
11352d6035fSJeremy L Thompson        indxtet(i*2*ptet+2)=9+offset
11452d6035fSJeremy L Thompson        indxtet(i*2*ptet+3)=16+offset
11552d6035fSJeremy L Thompson        indxtet(i*2*ptet+4)=1+offset
11652d6035fSJeremy L Thompson        indxtet(i*2*ptet+5)=8+offset
11752d6035fSJeremy L Thompson        indxtet(i*2*ptet+6)=0+offset
11852d6035fSJeremy L Thompson
11952d6035fSJeremy L Thompson        indxtet(i*2*ptet+7)=14+offset
12052d6035fSJeremy L Thompson        indxtet(i*2*ptet+8)=7+offset
12152d6035fSJeremy L Thompson        indxtet(i*2*ptet+9)=0+offset
12252d6035fSJeremy L Thompson        indxtet(i*2*ptet+10)=15+offset
12352d6035fSJeremy L Thompson        indxtet(i*2*ptet+11)=8+offset
12452d6035fSJeremy L Thompson        indxtet(i*2*ptet+12)=16+offset
12552d6035fSJeremy L Thompson      enddo
12652d6035fSJeremy L Thompson
12752d6035fSJeremy L Thompson! -- Restrictions
12861dbc9d2Sjeremylt      call ceedelemrestrictioncreate(ceed,imode,nelemtet,ptet,ndofs,d,&
129a8d32208Sjeremylt     & ceed_mem_host,ceed_use_pointer,indxtet,erestrictxtet,err)
13052d6035fSJeremy L Thompson
13161dbc9d2Sjeremylt      call ceedelemrestrictioncreate(ceed,imode,nelemtet,ptet,ndofs,1,&
132a8d32208Sjeremylt     & ceed_mem_host,ceed_use_pointer,indxtet,erestrictutet,err)
1337509a596Sjeremylt      stridesutet=[1,qtet,qtet]
1347509a596Sjeremylt      call ceedelemrestrictioncreatestrided(ceed,nelemtet,qtet,nqptstet,&
1357509a596Sjeremylt     & 1,stridesutet,erestrictuitet,err)
13652d6035fSJeremy L Thompson
13752d6035fSJeremy L Thompson! -- Bases
13852d6035fSJeremy L Thompson      call buildmats(qref,qweight,interp,grad)
13952d6035fSJeremy L Thompson      call ceedbasiscreateh1(ceed,ceed_triangle,d,ptet,qtet,interp,grad,qref,&
14052d6035fSJeremy L Thompson     & qweight,bxtet,err)
14152d6035fSJeremy L Thompson      call buildmats(qref,qweight,interp,grad)
14252d6035fSJeremy L Thompson      call ceedbasiscreateh1(ceed,ceed_triangle,1,ptet,qtet,interp,grad,qref,&
14352d6035fSJeremy L Thompson     & qweight,butet,err)
14452d6035fSJeremy L Thompson
14552d6035fSJeremy L Thompson! -- QFunctions
14652d6035fSJeremy L Thompson      call ceedqfunctioncreateinterior(ceed,1,setup,&
1472d50dd3dSjeremylt     &SOURCE_DIR&
148a05f9790Sjeremylt     &//'t510-operator.h:setup'//char(0),qf_setuptet,err)
14952d6035fSJeremy L Thompson      call ceedqfunctionaddinput(qf_setuptet,'_weight',1,ceed_eval_weight,err)
1504d537eeaSYohann      call ceedqfunctionaddinput(qf_setuptet,'dx',d*d,ceed_eval_grad,err)
15152d6035fSJeremy L Thompson      call ceedqfunctionaddoutput(qf_setuptet,'rho',1,ceed_eval_none,err)
15252d6035fSJeremy L Thompson
15352d6035fSJeremy L Thompson      call ceedqfunctioncreateinterior(ceed,1,mass,&
1542d50dd3dSjeremylt     &SOURCE_DIR&
155a05f9790Sjeremylt     &//'t510-operator.h:mass'//char(0),qf_masstet,err)
15652d6035fSJeremy L Thompson      call ceedqfunctionaddinput(qf_masstet,'rho',1,ceed_eval_none,err)
15752d6035fSJeremy L Thompson      call ceedqfunctionaddinput(qf_masstet,'u',1,ceed_eval_interp,err)
15852d6035fSJeremy L Thompson      call ceedqfunctionaddoutput(qf_masstet,'v',1,ceed_eval_interp,err)
15952d6035fSJeremy L Thompson
16052d6035fSJeremy L Thompson! -- Operators
16152d6035fSJeremy L Thompson! ---- Setup Tet
162442e7f0bSjeremylt      call ceedoperatorcreate(ceed,qf_setuptet,ceed_qfunction_none,&
163442e7f0bSjeremylt     & ceed_qfunction_none,op_setuptet,err)
164*15910d16Sjeremylt      call ceedoperatorsetfield(op_setuptet,'_weight',&
165*15910d16Sjeremylt     & ceed_elemrestriction_none,bxtet,ceed_vector_none,err)
16652d6035fSJeremy L Thompson      call ceedoperatorsetfield(op_setuptet,'dx',erestrictxtet,&
167a8d32208Sjeremylt     & bxtet,ceed_vector_active,err)
16852d6035fSJeremy L Thompson      call ceedoperatorsetfield(op_setuptet,'rho',erestrictuitet,&
169a8d32208Sjeremylt     & ceed_basis_collocated,qdatatet,err)
17052d6035fSJeremy L Thompson! ---- Mass Tet
171442e7f0bSjeremylt      call ceedoperatorcreate(ceed,qf_masstet,ceed_qfunction_none,&
172442e7f0bSjeremylt     & ceed_qfunction_none,op_masstet,err)
17352d6035fSJeremy L Thompson      call ceedoperatorsetfield(op_masstet,'rho',erestrictuitet,&
174a8d32208Sjeremylt     & ceed_basis_collocated,qdatatet,err)
17552d6035fSJeremy L Thompson      call ceedoperatorsetfield(op_masstet,'u',erestrictutet,&
176a8d32208Sjeremylt     & butet,ceed_vector_active,err)
17752d6035fSJeremy L Thompson      call ceedoperatorsetfield(op_masstet,'v',erestrictutet,&
178a8d32208Sjeremylt     & butet,ceed_vector_active,err)
17952d6035fSJeremy L Thompson
18052d6035fSJeremy L Thompson! Hex Elements
18152d6035fSJeremy L Thompson      do i=0,nelemhex-1
18252d6035fSJeremy L Thompson        col=mod(i,nx)
18352d6035fSJeremy L Thompson        row=i/nx
18452d6035fSJeremy L Thompson        offset=(nxtet*2+1)*(nytet*2)*(1+row)+col*2
18552d6035fSJeremy L Thompson        do j=0,phex-1
18652d6035fSJeremy L Thompson          do k=0,phex-1
18752d6035fSJeremy L Thompson            indxhex(phex*(phex*i+k)+j+1)=offset+k*(nxhex*2+1)+j
18852d6035fSJeremy L Thompson          enddo
18952d6035fSJeremy L Thompson        enddo
19052d6035fSJeremy L Thompson      enddo
19152d6035fSJeremy L Thompson
19252d6035fSJeremy L Thompson! -- Restrictions
19361dbc9d2Sjeremylt      call ceedelemrestrictioncreate(ceed,imode,nelemhex,phex*phex,ndofs,d,&
19452d6035fSJeremy L Thompson     & ceed_mem_host,ceed_use_pointer,indxhex,erestrictxhex,err)
19552d6035fSJeremy L Thompson
19661dbc9d2Sjeremylt      call ceedelemrestrictioncreate(ceed,imode,nelemhex,phex*phex,ndofs,1,&
19752d6035fSJeremy L Thompson     & ceed_mem_host,ceed_use_pointer,indxhex,erestrictuhex,err)
1987509a596Sjeremylt      stridesuhex=[1,qhex*qhex,qhex*qhex]
1997509a596Sjeremylt      call ceedelemrestrictioncreatestrided(ceed,nelemhex,qhex*qhex,&
2007509a596Sjeremylt     & nqptshex,1,stridesuhex,erestrictuihex,err)
20152d6035fSJeremy L Thompson
20252d6035fSJeremy L Thompson! -- Bases
20352d6035fSJeremy L Thompson      call ceedbasiscreatetensorh1lagrange(ceed,d,d,phex,qhex,ceed_gauss,&
20452d6035fSJeremy L Thompson     & bxhex,err)
20552d6035fSJeremy L Thompson      call ceedbasiscreatetensorh1lagrange(ceed,d,1,phex,qhex,ceed_gauss,&
20652d6035fSJeremy L Thompson     & buhex,err)
20752d6035fSJeremy L Thompson
20852d6035fSJeremy L Thompson! -- QFunctions
20952d6035fSJeremy L Thompson      call ceedqfunctioncreateinterior(ceed,1,setup,&
2102d50dd3dSjeremylt     &SOURCE_DIR&
211872c4ebbSjeremylt     &//'t510-operator.h:setup'//char(0),qf_setuphex,err)
21252d6035fSJeremy L Thompson      call ceedqfunctionaddinput(qf_setuphex,'_weight',1,ceed_eval_weight,err)
2134d537eeaSYohann      call ceedqfunctionaddinput(qf_setuphex,'dx',d*d,ceed_eval_grad,err)
21452d6035fSJeremy L Thompson      call ceedqfunctionaddoutput(qf_setuphex,'rho',1,ceed_eval_none,err)
21552d6035fSJeremy L Thompson
21652d6035fSJeremy L Thompson      call ceedqfunctioncreateinterior(ceed,1,mass,&
2172d50dd3dSjeremylt     &SOURCE_DIR&
218872c4ebbSjeremylt     &//'t510-operator.h:mass'//char(0),qf_masshex,err)
21952d6035fSJeremy L Thompson      call ceedqfunctionaddinput(qf_masshex,'rho',1,ceed_eval_none,err)
22052d6035fSJeremy L Thompson      call ceedqfunctionaddinput(qf_masshex,'u',1,ceed_eval_interp,err)
22152d6035fSJeremy L Thompson      call ceedqfunctionaddoutput(qf_masshex,'v',1,ceed_eval_interp,err)
22252d6035fSJeremy L Thompson
22352d6035fSJeremy L Thompson! -- Operators
22452d6035fSJeremy L Thompson! ---- Setup Hex
225442e7f0bSjeremylt      call ceedoperatorcreate(ceed,qf_setuphex,ceed_qfunction_none,&
226442e7f0bSjeremylt     & ceed_qfunction_none,op_setuphex,err)
227*15910d16Sjeremylt      call ceedoperatorsetfield(op_setuphex,'_weight',&
228*15910d16Sjeremylt     & ceed_elemrestriction_none,bxhex,ceed_vector_none,err)
22952d6035fSJeremy L Thompson      call ceedoperatorsetfield(op_setuphex,'dx',erestrictxhex,&
230a8d32208Sjeremylt     & bxhex,ceed_vector_active,err)
23152d6035fSJeremy L Thompson      call ceedoperatorsetfield(op_setuphex,'rho',erestrictuihex,&
232a8d32208Sjeremylt     & ceed_basis_collocated,qdatahex,err)
23352d6035fSJeremy L Thompson! ---- Mass Hex
234442e7f0bSjeremylt      call ceedoperatorcreate(ceed,qf_masshex,ceed_qfunction_none,&
235442e7f0bSjeremylt     & ceed_qfunction_none,op_masshex,err)
23652d6035fSJeremy L Thompson      call ceedoperatorsetfield(op_masshex,'rho',erestrictuihex,&
237a8d32208Sjeremylt     & ceed_basis_collocated,qdatahex,err)
23852d6035fSJeremy L Thompson      call ceedoperatorsetfield(op_masshex,'u',erestrictuhex,&
239a8d32208Sjeremylt     & buhex,ceed_vector_active,err)
24052d6035fSJeremy L Thompson      call ceedoperatorsetfield(op_masshex,'v',erestrictuhex,&
241a8d32208Sjeremylt     & buhex,ceed_vector_active,err)
24252d6035fSJeremy L Thompson
24352d6035fSJeremy L Thompson! Composite Operators
24452d6035fSJeremy L Thompson      call ceedcompositeoperatorcreate(ceed,op_setup,err)
24552d6035fSJeremy L Thompson      call ceedcompositeoperatoraddsub(op_setup,op_setuptet,err)
24652d6035fSJeremy L Thompson      call ceedcompositeoperatoraddsub(op_setup,op_setuphex,err)
24752d6035fSJeremy L Thompson
24852d6035fSJeremy L Thompson      call ceedcompositeoperatorcreate(ceed,op_mass,err)
24952d6035fSJeremy L Thompson      call ceedcompositeoperatoraddsub(op_mass,op_masstet,err)
25052d6035fSJeremy L Thompson      call ceedcompositeoperatoraddsub(op_mass,op_masshex,err)
25152d6035fSJeremy L Thompson
25252d6035fSJeremy L Thompson! Apply Setup Operator
253e97ff134Sjeremylt      call ceedoperatorapply(op_setup,x,ceed_vector_none,&
254e97ff134Sjeremylt     & ceed_request_immediate,err)
25552d6035fSJeremy L Thompson
25652d6035fSJeremy L Thompson! Apply Mass Operator
25752d6035fSJeremy L Thompson      call ceedvectorcreate(ceed,ndofs,u,err)
25852d6035fSJeremy L Thompson      call ceedvectorsetvalue(u,1.d0,err)
25952d6035fSJeremy L Thompson      call ceedvectorcreate(ceed,ndofs,v,err)
26052d6035fSJeremy L Thompson
26152d6035fSJeremy L Thompson      call ceedoperatorapply(op_mass,u,v,ceed_request_immediate,err)
26252d6035fSJeremy L Thompson
26352d6035fSJeremy L Thompson! Check Output
26452d6035fSJeremy L Thompson      call ceedvectorgetarrayread(v,ceed_mem_host,hv,voffset,err)
26552d6035fSJeremy L Thompson      total=0.
26652d6035fSJeremy L Thompson      do i=1,ndofs
26752d6035fSJeremy L Thompson        total=total+hv(voffset+i)
26852d6035fSJeremy L Thompson      enddo
26952d6035fSJeremy L Thompson      if (abs(total-1.)>1.0d-10) then
270a2546046Sjeremylt! LCOV_EXCL_START
27152d6035fSJeremy L Thompson        write(*,*) 'Computed Area: ',total,' != True Area: 1.0'
272de996c55Sjeremylt! LCOV_EXCL_STOP
27352d6035fSJeremy L Thompson      endif
27452d6035fSJeremy L Thompson      call ceedvectorrestorearrayread(v,hv,voffset,err)
27552d6035fSJeremy L Thompson
27652d6035fSJeremy L Thompson! Cleanup
27752d6035fSJeremy L Thompson      call ceedqfunctiondestroy(qf_setuptet,err)
27852d6035fSJeremy L Thompson      call ceedqfunctiondestroy(qf_masstet,err)
27952d6035fSJeremy L Thompson      call ceedoperatordestroy(op_setuptet,err)
28052d6035fSJeremy L Thompson      call ceedoperatordestroy(op_masstet,err)
28152d6035fSJeremy L Thompson      call ceedqfunctiondestroy(qf_setuphex,err)
28252d6035fSJeremy L Thompson      call ceedqfunctiondestroy(qf_masshex,err)
28352d6035fSJeremy L Thompson      call ceedoperatordestroy(op_setuphex,err)
28452d6035fSJeremy L Thompson      call ceedoperatordestroy(op_masshex,err)
28552d6035fSJeremy L Thompson      call ceedoperatordestroy(op_setup,err)
28652d6035fSJeremy L Thompson      call ceedoperatordestroy(op_mass,err)
28752d6035fSJeremy L Thompson      call ceedelemrestrictiondestroy(erestrictutet,err)
28852d6035fSJeremy L Thompson      call ceedelemrestrictiondestroy(erestrictxtet,err)
28952d6035fSJeremy L Thompson      call ceedelemrestrictiondestroy(erestrictuitet,err)
29052d6035fSJeremy L Thompson      call ceedelemrestrictiondestroy(erestrictuhex,err)
29152d6035fSJeremy L Thompson      call ceedelemrestrictiondestroy(erestrictxhex,err)
29252d6035fSJeremy L Thompson      call ceedelemrestrictiondestroy(erestrictuihex,err)
29352d6035fSJeremy L Thompson      call ceedbasisdestroy(butet,err)
29452d6035fSJeremy L Thompson      call ceedbasisdestroy(bxtet,err)
29552d6035fSJeremy L Thompson      call ceedbasisdestroy(buhex,err)
29652d6035fSJeremy L Thompson      call ceedbasisdestroy(bxhex,err)
29752d6035fSJeremy L Thompson      call ceedvectordestroy(x,err)
29852d6035fSJeremy L Thompson      call ceedvectordestroy(u,err)
29952d6035fSJeremy L Thompson      call ceedvectordestroy(v,err)
30052d6035fSJeremy L Thompson      call ceedvectordestroy(qdatatet,err)
30152d6035fSJeremy L Thompson      call ceedvectordestroy(qdatahex,err)
30252d6035fSJeremy L Thompson      call ceeddestroy(ceed,err)
30352d6035fSJeremy L Thompson      end
30452d6035fSJeremy L Thompson!-----------------------------------------------------------------------
305