Type: FORTRAN routine
userf - subroutine frame for the definition of linear form F
userf is the subroutine which defines the linear form F. F depends linearly on one argument called test function and depends on the time T, the searched solution U and its derivative UT with respect to time in an arbitrary way. The dependency on U is considered by the calling routines veme02 and the general case, which is the dependency on T, U and UT, is considered by the calling routines vemp02.
F is a sum over the component COMPV of the test functions (COMPV=1,... ,NK) and the manifolds M(CLASS) (CLASS=0,1,... ,DIM), which are defined by the elements of CLASS. The terms of the sum are integrals with M(CLASS) as domain of integration and the test functions and their derivatives with respect to the space direction/tangential direction multiplied by coefficients F0 and F1 as the kernel of integration. The routine userf defines the values of the coefficients F0 and F1. They may depend on the location, the integer and real parameter sets of the elements, the node parameter set and its derivative with respect to space, the time, the solution and its derivative with respect to space, and the T-derivative of the solution and its derivative with respect to space.
You have to enter the statements, which define the coefficients into a subroutine with the argument list of userf. The name of the routine may be changed. The name has to be declared by the EXTERNAL statement and has to be entered instead of USERF into the argument list of veme00, veme02 and vemp02.
By one call the coefficients of the component COMPV of the test functions and the manifold M(CLASS) have to be set for a set (called stripe) of NELIS points which are in different elements of the group GROUP. Since normally NELIS<>NE, userf is called several times for one group and so it is very important that the vector parameters are selected with the offset LAST. For a pair (COMPV, GROUP) userf is called by veme00, veme02 and vemp02, if MASKF(COMPV, GROUP)=true and NELTYP>0 for component COMPV in group GROUP. In the other case the coefficients F1 and F0 are set to zero by the calling program.
See also vemexamples. In the following examples we have NK=2 and DIM=2. ViXj denotes the derivative of the i-th component of V with respect to the j-th space direction and ViTAUj denotes the derivative of the i-th component of V with respect to the j-th tangential direction TAUj. VT denotes the derivative of V with respect of time T.
This is a typical example for veme00. The integration kernel for manifold M(2) and the first right hand side is
A * V1 + B1 * V2X1 + B2 * V2X2 ,
where A, B1 and B2 are real constants, which are non-zero in group 1 and zero in group 2. MASKF has the following entries:
MASKF(.,1)=( true , true ) MASKF(.,2)=( false , false )
The following statements have to be entered into userf:
IF ((RHS.EQ.1).AND.(COMPV.EQ.1).AND.(GROUP.EQ.1)) THEN
DO 10 Z=1,NELIS
F0(Z) = A
10 CONTINUE
ENDIF
IF ((RHS.EQ.1).AND.(COMPV.EQ.2).AND.(GROUP.EQ.1)) THEN
DO 20 Z=1,NELIS
F1(Z,1) = B1
F1(Z,2) = B2
20 CONTINUE
ENDIF
The case GROUP=2 does not have to be specified.
This is a typical example for veme02. The integration kernel for manifold M(2) is
V1X1 * U1X1 + V1X2 * U1X2 + V1 * C1*U1*U2 + V2X1 * U2X1 + V2X2 * U2X2 + V2 * C2*U2 ,
where C1 and C2 are real numbers. It is assumed that the value of C1 depends on the element number and was stored as the third real vector parameter for all groups of CLASS=DIM. C2 is a given distribution on the domain and it is defined by its values at the geometrical nodes of the domain. These values constitute the second node parameter set in the main program. In the case of NGROUP=1, MASKF has the following entries:
MASKF(.,1)=( true , true )
The following statements have to be entered into userf:
IF ((COMPV.EQ.1).AND.(CLASS.EQ.DIM)) THEN
DO 10 Z=1,NELIS
F1(Z,1)=DUDX(Z,1,1)
F1(Z,2)=DUDX(Z,1,2)
F0(Z) =RVPARM(LAST+Z,3)*U(Z,1)*U(Z,2)
10 CONTINUE
ENDIF
IF ((COMPV.EQ.2).AND.(CLASS.EQ.DIM)) THEN
DO 20 Z=1,NELIS
F1(Z,1)=DUDX(Z,2,1)
F1(Z,2)=DUDX(Z,2,2)
F0(Z) =NOPARM(Z,2)*U(Z,2)
20 CONTINUE
ENDIF
This is a typical example for vemp02. The integration kernel for manifold M(2) is
V1X1 * U1X1 + V1X2 * U1X2 + V1 * SIN(X1*C) * U1T*U2T + V2X1 * U2X1 + V2X2 * U2X2 + V2 * COS(U2T)
where C is a real value. It is assumed that the value of C varies over the domain. C equals a constant C1 on a special set of the elements and equals C2 on the remaining elements. The values of C1 and C2 are stored as the first and second real scalar parameter. The first integer vector marks the case C=C1 by 1. The remaining elements get the mark 0. In the case of NGROUP=1, MASKF has the following entries:
MASKF(.,1)=( true , true )
The following statements have to be entered into userf:
IF ((COMPV.EQ.1).AND.(CLASS.EQ.DIM)) THEN
DO 10 Z=1,NELIS
IF (IVPARM(LAST+Z,1).EQ.1) THEN
C=RSPARM(1)
ELSE
C=RSPARM(2)
ENDIF
F1(Z,1)=DUDX(Z,1,1)
F1(Z,2)=DUDX(Z,1,2)
F0(Z) =SIN(X(Z,1)*C)*UT(Z,1)*UT(Z,2)
10 CONTINUE
ENDIF
IF ((COMPV.EQ.2).AND.(CLASS.EQ.DIM)) THEN
DO 20 Z=1,NELIS
F1(Z,1)=DUDX(Z,2,1)
F1(Z,2)=DUDX(Z,2,2)
F0(Z) =COS(UT(Z,2))
20 CONTINUE
ENDIF
Another possibility to distinguish the cases C=C1 and C=C2 is the subdivision of the elements into two groups.
The integration kernel for manifold M(1) is
V2 *C*U1T*U2TAU1
where C is a real value. It is assumed that the value of C depends on the element number and was stored as the third real vector parameter for all groups of CLASS=1. In the case that the elements in group 2 describe the manifold M(1), MASKF has the following entries:
MASKF(.,2)=( false , true )
The following statements have to be entered into userf:
IF ((COMPV.EQ.2).AND.(CLASS.EQ.1)) THEN
DO 10 Z=1,NELIS
F0(Z)=RVPARM(LAST+Z,3)*UT(Z,1)*DUDX(Z,2,1)
10 CONTINUE
ENDIF
The case COMPV=1 and CLASS=1 does not have to be specified.
VECFEM, mesh, vemexamples, equation, usrfu, userl, veme00, veme02, vemfre, vemp02.
Copyrights by Universitaet Karlsruhe 1989-1996. Copyrights by Lutz Grosz 1996. All rights reserved. More details see VECFEM.
By L. Grosz, Auckland, 4 June, 2000.