&t - Summation convention tensor multiplication operator
Synopsis:
Examples:
> read(femLego); > a[i] &t b[i]; a[1] b[1] + a[2] b[2] + a[3] b[3] > s &t a[k]; s a[k] > r &t s; r s > u[i](x,y,z) &t nab(u[j](x,y,z))[i]; / d \ / d \ u[1](x, y, z) |---- u[j](x, y, z)| + u[2](x, y, z) |---- u[j](x, y, z)| \ dx / \ dy / / d \ + u[3](x, y, z) |---- u[j](x, y, z)| \ dz / > epsilon[1,j,k] &t a[j] &t b[k]; a[2] b[3] - a[3] b[2] > for i from 1 to 3 do epsilon[i,j,k] &t a[j] &t b[k] od; a[2] b[3] - a[3] b[2] - a[1] b[3] + a[3] b[1] a[1] b[2] - a[2] b[1]
nab - Nabla operator for use with tensor arithmetic.
Calling sequence:
nab(f)[i]
Parameters:
f - an expression or function depending on x,y,z.
Synopsis:
Examples:
> nab(u(x,y,z))[i]; nab(u(x, y, z))[i] > nab(phi(x,y,z))[i] &t nab(u(x,y,z))[i] ; / d \ / d \ / d \ / d \ |---- phi(x, y, z)| |---- u(x, y, z)| + |---- phi(x, y, z)| |---- u(x, y, z)| \ dx / \ dx / \ dy / \ dy / / d \ / d \ + |---- phi(x, y, z)| |---- u(x, y, z)| \ dz / \ dz / > delta[i,j] &t nab( nab(u(x,y,z))[i] )[j]; / 2 \ / 2 \ / 2 \ | d | | d | | d | |----- u(x, y, z)| + |----- u(x, y, z)| + |----- u(x, y, z)| | 2 | | 2 | | 2 | \ dx / \ dy / \ dz / > delta[i,j] &t nab( nab(u(x,y))[i] )[j]; / 2 \ / 2 \ | d | | d | |----- u(x, y)| + |----- u(x, y)| | 2 | | 2 | \ dx / \ dy /
delta[i,j] - Predefined Kronecker delta
Synopsis:
Examples:
> delta[1,1]; 1 > delta[1,2]; 0 > A[i,j] &t delta[j,k] &t b[k,n]; A[i, 1] b[1, n] + A[i, 2] b[2, n] + A[i, 3] b[3, n]
epsilon[i,j,k] - Predefined permutation tensor
Synopsis:
Examples:
> epsilon[1,1,1]; 0 > epsilon[1,2,3]; 1 > epsilon[1,3,2]; -1 > epsilon[1,j,k] &t a[j] &t b[k]; a[2] b[3] - a[3] b[2] > for i from 1 to 3 do epsilon[i,j,k] &t a[j] &t b[k] od; i:='i': a[2] b[3] - a[3] b[2] - a[1] b[3] + a[3] b[1] a[1] b[2] - a[2] b[1]
partInt - Do partial integrations
Calling sequence:
partInt(expr,var):
Parameters
expr - The expression that is to be partially integrated.
var - variable or list of variables appearing inside ElementInt() in expr.
Synopsis:
Examples:
> partInt(ElementInt(f(x)*diff(g(x),x)),g(x)); /d \ -ElementInt(g(x) |-- f(x)|) + BoundaryInt(BdNx g(x) f(x)) \dx /
> partInt( 0 = ElementInt(f(x)*diff(g(x),x)) ,g(x)); /d \ 0 = -ElementInt(g(x) |-- f(x)|) + BoundaryInt(BdNx g(x) f(x)) \dx /
> Lapl:= nab(nab(u(x,y))[i])[j] &t delta[i,j]; / 2 \ / 2 \ |d | |d | Lapl := |--- u(x, y)| + |--- u(x, y)| | 2 | | 2 | \dx / \dy / > partInt( ElementInt(test(x,y)*Lapl) ,u(x,y)); /d \ /d \ -ElementInt(|-- u(x, y)| |-- test(x, y)|) \dx / \dx / /d \ + BoundaryInt(BdNx |-- u(x, y)| test(x, y)) \dx / /d \ /d \ - ElementInt(|-- u(x, y)| |-- test(x, y)|) \dy / \dy / /d \ + BoundaryInt(BdNy |-- u(x, y)| test(x, y)) \dy /
BCsubs - Substitute boundary conditions in partially integrated variational forms
Calling sequence:
BCsubs(bclist,expr):
Parameters
bclist - A list of equalities specifying boundary conditions. The left hand sides must be either variables, or derivatives of variables, appearing inside BoundaryInt() in expr.
expr - An expression containing BoundaryInt()s, typically as a result of using partInt.
Synopsis:
Examples:
> femform:=0=partInt(ElementInt(test(x)*diff(v(x),x,x)),v(x)); /d \ /d \ femform := 0 = -ElementInt(|-- v(x)| |-- test(x)|) \dx / \dx / /d \ + BoundaryInt(BdNx |-- v(x)| test(x)) \dx / > BCsubs([diff(v(x),x)=q],femform); /d \ /d \ 0 = -ElementInt(|-- v(x)| |-- test(x)|) + BoundaryInt(BdNx q test(x)) \dx / \dx /
variation - Compute the variation
Calling sequence:
variation(expr,var,dvar)
Parameters
expr - An expression containing the variables in var.
var - A variable, or a list of variables, to perform the variation with respect to.
dvar - the names of the variations of the variables in var. Must have same length as var
Synopsis:
Examples:
> J:=ElementInt(u(x)^2); 2 J := ElementInt(u(x) ) > variation( J , u(x),du(x)); ElementInt(2 u(x) du(x)) > F:=ElementInt(u(x,y)^2 + v(x,y)^2); 2 2 F := ElementInt(u(x, y) + v(x, y) ) > variation(F,[u(x,y),v(x,y)],[du(x,y),dv(x,y)]); ElementInt(2 u(x, y) du(x, y)) + ElementInt(2 v(x, y) dv(x, y)) > BClist:=[u(x)=0,diff(u(x),x)=q]; d BClist := [u(x) = 0, -- u(x) = q] dx > variation(BClist,u(x),du(x)); d [du(x) = 0, -- du(x) = 0] dx
test_subs - Generate equations from variational forms
Calling sequence:
test_subs(test_list,testfcn,expr)
Parameters
test_list - a list of test functions
test_fcn - a name of a variable to be used as a test function
expr - An expression.
Synopsis:
Examples:
> ueq:=0=diff(u(x),x,x); 2 d ueq := 0 = --- u(x) 2 dx > veq:=u(x)=diff(v(x),x,x); 2 d veq := u(x) = --- v(x) 2 dx > varForm:=ElementInt(ut(x) * (lhs(ueq)-rhs(ueq)))+ ElementInt(vt(x) * (lhs(veq)-rhs(veq))) =0: > pivarForm:=partInt(varForm,[u(x),v(x)]): > BCpivarForm:=BCsubs([diff(u(x),x)=q,diff(v(x),x)=0],pivarForm); /d \ /d \ BCpivarForm := ElementInt(|-- u(x)| |-- ut(x)|) \dx / \dx / - BoundaryInt(BdNx q ut(x)) + ElementInt(vt(x) u(x)) /d \ /d \ + ElementInt(|-- v(x)| |-- vt(x)|) = 0 \dx / \dx / > eqns:=test_subs([ut(x),vt(x)],test(x),BCpivarForm): > eqns[1];eqns[2]; /d \ /d \ ElementInt(|-- u(x)| |-- test(x)|) - BoundaryInt(BdNx q test(x)) = 0 \dx / \dx / /d \ /d \ ElementInt(test(x) u(x)) + ElementInt(|-- v(x)| |-- test(x)|) = 0 \dx / \dx /
getFemLabInput - Generate code to read meshes from FEMLAB
Calling sequence:
getFemLabInput(params_list):
Parameters
params_list - A list of scalar input parameters.
Synopsis:
Examples:
> # get files to read input from femlab;
> getFemLabInput(params_list)
rdinpt.f
rdpara.f
indata_sample
getFemLabInputP2P1 - Generate code to use meshes from FEMLAB with P2/P1 mixed elements.
Calling sequence:
getFemLabInputP2P1(params_list):
Parameters
params_list - A list of scalar input parameters.
Synopsis:
Examples:
> # get files to read input from femlab;
> getFemLabInput(params_list)
rdinpt.f
rdpara.f
indata_sample
FemLabPlot - Set up to view 2D results using FEMLAB
Calling sequence:
FemLabPlot(plot_list,menu_list, unknown_list);
Parameters
plot_list - A list of items to plot. If an item is a list of two variables, it will be plotted as a vector field by FEMLAB.
menu_list - A list of strings to appear in the FEMLAB menus. There should be one entry for each entry in plot_list.
unknown_list - The list of unknowns as discussed above.
Synopsis:
Examples:
> # plot u(x,y), v(x,y) as two scalar fields;
> FemLabPlot([u(x,y) ,v(x,y)],[u,v],unknown_list);
.femlab_modules
wroutp
sv2fml
> # plot u(x,y),v(x,y) as a vector field and p(x,y) as a scalar;
> FemLabPlot([[u(x,y),v(x,y)], p(x,y)] [uv_vector,pressure],unknown_list);
.femlab_modules
wroutp
sv2fml
get3DP1_input - set up to read a 3D tetrahedral mesh.
Calling sequence:
get3DP1_input(params_list);
Parameters:
params_list - A list of scalar input parameters.
Synopsis:
Examples:
> # set up to read input data: copies rdinpt.f to ./source;
> get3DP1_input(params_list);
rdinpt.f
rdpara.f
indata_sample
mk3DP1_cube - make uniform 3D grid in a box
Calling sequence:
mk3DP1_cube(box,npts);
Parameters:
box - a list of the form [xlo, xhi, ylo, yhi, zlo, zhi], where xlo - zhi are numeric values that specify the range of the three coordinates x,y,z.
npts - a list with three integer entries, specifying the number of nodes in the x,y and z directions.
Synopsis:
Examples:
> # make a 10x10x10 mesh in the unit cube:
> # box:=[xlo, xhi, ylo, yhi, zlo, zhi];
> box:=[0.,1., 0.,1., 0.,1.];
> npts:=[10,10,10];
> mk3DP1_cube(box,npts);
[1331,6000]
mk3DP1_bcond- make boundary conditions for 3D grid in a box
Calling sequence:
mk3DP1_bcond(bc_list);
Parameters:
bc_list - a list of the form [u_bc, v_bc, ..], with one entry for each dependent variable in the problem. Each of the u_bc have the form [[c1,r1], [c2,r2], [c3,r3], [c4,r4], [c5,r5], [c6,r6]], There is one pair [c, r] for each face of the block. The first member can be either D or N: c=N will give Neumann boundary conditions, c=D: Dirichlet. The second member r should be a numerical value which is made available to the solver as qBCval. The faces are numbered acccording to 1: y = ylo, 2: x=xhi, 3: y=yhi, 4: x=xlo, 5: z=zlo, 6: z=zhi.
Synopsis:
Examples:
> # make boundary conditions file (bcond.scratch);
> # supply a pair [c, r] for each face of the block:
> # c=N: Neumann BC. The numerical value r is available as qBCval.
> # c=D: Dirichlet BC. The numerical value r is available as qBCval.
> # The faces are numbered acccording to
# 1: y = ylo, 2: x=xhi, 3: y=yhi, 4: x=xlo, 5: z=zlo, 6: z=zhi;
> u_bc:=[[N,0.],[N,0.],[N,0.],[N,0.],[D,0.],[N,1.]];
> v_bc:=[[D,0.],[D,0.],[D,0.],[D,0.],[D,0.],[N,1.]];
> mk3DP1_bcond( [u_bc, v_bc] );
AVSPlot_3DP1 - set up to save 3D results for viewing with AVS
Calling sequence:
AVSPlot_3DP1(unknown_list);
Parameters
unknown_list - The list of unknowns as discussed above.
Synopsis:
Examples:
> # set up to save results to plot with AVS:
> AVSPlot_3DP1(unknown_list);
wroutp
mkDirBC - Specify Dirichlet boundary conditions
Calling sequence:
mkDirBC(DBCeq, unknown_list, old_unknown_list, params_list, bsf_file)
Parameters:
DBCeq - A list of equations specifying Dirichlet boundary conditions. Each entry in the list is an equation of the form u(x,y)=expr, where u(x,y) is a variable in unknown_list. For those variables in unknown_list, which do not appear in DBCeq, a default Dirichlet boundary condition is used. This is u(x,y) = qBCval, where qBCval is a predefined value which is specified with the mesh.
If one of the entries in DBCeq is SinglePoint(var), where var is one of the variables in unknown_list, a Dirichlet condition is applied at one single node, prescribing the variable to be zero at that node.
unknown_list - The list of unknowns as discussed above.
old_unknown_list - The list of unknowns at the previous timestep, as discussed above.
params_list - A list of scalar input parameters.
bsf_file - A file containing a Maple description of a particular finite element.
Synopsis:
Examples:
> # set up lists:
> eq_list:= [ueq,veq,peq]:
> unknown_list:= [u(x,y),v(x,y),p(x,y)]:
> old_unknown_list:= [uo(x,y),vo(x,y),po(x,y)]:
> params_list:= [Diffusivity,bigQ,BCpara]:
> # Dirichlet BCs;
> # The call below creates the following boundary conditions:
# u(x,y)=x*BCpara on Dirichlet parts of the boundary, ;
# v(x,y)=qBCval on Dirichlet parts of the boundary;
# p(x,y)=0 at one single node;
> DBCueq:= u(x,y)=x*BCpara:
> mkDirBC([DBCueq,SinglePoint(p(x,y))],unknown_list,
old_unknown_list,params_list,`2DP1_gsq_bsf`):
mkDirBC2 - Specify Dirichlet boundary conditions
Calling sequence:
mkDirBC2(DBCeq, unknown_list, old_unknown_list, params_list,unkntestlist,testbsflist)
Parameters:
DBCeq - A list of equations specifying Dirichlet boundary conditions. Each entry in the list is an equation of the form u(x,y)=expr, where u(x,y) is a variable in unknown_list. For those variables in unknown_list, which do not appear in DBCeq, a default Dirichlet boundary condition is used. This is u(x,y) = qBCval, where qBCval is a predefined value which is specified with the mesh.
If one of the entries in DBCeq is SinglePoint(var), where var is one of the variables in unknown_list, a Dirichlet condition is applied at one single node, prescribing the variable to be zero at that node.
unknown_list - The list of unknowns as discussed above.
old_unknown_list - The list of unknowns at the previous timestep, as discussed above.
params_list - A list of scalar input parameters.
unkntestlist - A list of testfunction names that couple a certain testfunction with a certain unknown. The number of entries in unkntestlist must be the same as in unknown_list and old_unknown_list. The usage is the same as for the corresponding argument to mkFem2.
testbsflist - A list containing three entries, the first two being names of testfunctions, the last the name of a file that contins the definitions of the basefunctions. The two basefunction names are identified with the actual basefunctions via ordering and the name of this file, i.e., with testbsflist:=[v(x,y),q(x,y),`2DP2P1_gsq_bsf`], v(x,y) is P2 and q(x,y) is P1. The usage is the same as for the corresponding argument to mkFem2.
Synopsis:
Examples:
> # set up lists:
> eq_list:= [u1eq,u2eq,peq]:
> unknown_list:= [u1(x,y),u2(x,y),p(x,y)]:
> old_unknown_list:= [uo1(x,y),uo2(x,y),po(x,y)]:
> params_list:=[Diffusivity,bigQ,BCpara]:
> unkntestlist:=[v(x,y),v(x,y),q(x,y)]:
> testbsflist:=[v(x,y),q(x,y),`2DP2P1_gsq_bsf`]:
> # The unknowns u1(x,y),u2(x,y) are associated with
> # the test function v(x,y), and p(x,y) with q(x,y).
> # v(x,y) represents P2 basefunctions, and q(x,y) represents P1.
>
> # Dirichlet BCs;
> # The call below creates the following boundary conditions:
# u(x,y)=x*BCpara on Dirichlet parts of the boundary, ;
# v(x,y)=qBCval on Dirichlet parts of the boundary;
# p(x,y)=0 at one single node;
> DBCueq:= u(x,y)=x*BCpara:
> mkDirBC([DBCueq,SinglePoint(p(x,y))],unknown_list,
old_unknown_list,params_list,`2DP1_gsq_bsf`):
mkIC - Specify initial conditions
Calling sequence:
mkIC(ICeq, unknown_list, params_list, bsf_file);
Parameters:
ICeq - A list of equations specifying initial conditions. Each entry in the list is an equation of the form u(x,y)=expr, where u(x,y) is a variable in unknown_list. Those variables in unknown_list which do not appear on the left hand side of an equation in ICeq, are set to zero initially.
unknown_list - The list of unknowns as discussed above.
params_list - A list of scalar input parameters.
bsf_file - A file containing a Maple description of a particular finite element.
Synopsis:
Examples:
> # make initial conditions. ic_eq is on the form 'unknown = expr':
> # variables that do not enter in lhs of an ic_eq are given the
# intial value 0:
> mkIC([ v(x,y)=x*x+y*y ], unknown_list, params_list ,
`2DP1_gsq_bsf`);
ic_init
icmkre
icamdp
icadr1
icadm1
icadr2
icadm2
mkICcopy - Specify initial conditions by copying nodal values
Calling sequence:
mkICcopy(ICeq, unknown_list, params_list, bsf_file);
Parameters:
ICeq - A list of equations specifying initial conditions. Each entry in the list is an equation of the form u(x,y)=expr, where u(x,y) is a variable in unknown_list. Those variables in unknown_list which do not appear on the left hand side of an equation in ICeq, are set to zero initially.
unknown_list - The list of unknowns as discussed above.
params_list - A list of scalar input parameters.
bsf_file - A file containing a Maple description of a particular finite element.
Synopsis:
Examples:
> # make initial conditions. ic_eq is on the form 'unknown = expr':
> # variables that do not enter in lhs of an ic_eq are given the
# intial value 0:
> mkICcopy([ v(x,y)=x*x+y*y ], unknown_list, params_list ,
`2DP1_gsq_bsf`);
ic_init
mkICcopy2 - Specify initial conditions for mixed formulations
Calling sequence:
mkICcopy2(ICeq, unknown_list, params_list, unkntestlist,testbsflist);
Parameters:
ICeq - A list of equations specifying initial conditions. Each entry in the list is an equation of the form u(x,y)=expr, where u(x,y) is a variable in unknown_list. Those variables in unknown_list which do not appear on the left hand side of an equation in ICeq, are set to zero initially.
unknown_list - The list of unknowns as discussed above.
params_list - A list of scalar input parameters.
unkntestlist - A list of testfunction names that couple a certain testfunction with a certain unknown. The number of entries in unkntestlist must be the same as in unknown_list and old_unknown_list. The usage is the same as for the corresponding argument to mkFem2.
testbsflist - A list containing three entries, the first two being names of testfunctions, the last the name of a file that contins the definitions of the basefunctions. The two basefunction names are identified with the actual basefunctions via ordering and the name of this file, i.e., with testbsflist:=[v(x,y),q(x,y),`2DP2P1_gsq_bsf`], v(x,y) is P2 and q(x,y) is P1. The usage is the same as for the corresponding argument to mkFem2.
Synopsis:
Examples:
> # make initial conditions. ic_eq is on the form 'unknown = expr':
> # variables that do not enter in lhs of an ic_eq are given the
# intial value 0:
> mkICcopy2([ v(x,y)=x*x+y*y ], unknown_list, params_list, unkntestlist, testbsflist);
ic_init
mkSolve - Specify linear algebra solvers
Calling sequence:
mkSolve(solve_list,eq_list)
Parameters:
solve_list - List of keywords to denote different linear systems solver. One keyword for each equation in eq_list.
eq_list - List of equations to be solved.
Synopsis:
iccg
Calls the Incomplete Cholesky preconditioned Conjugate Gradient solver in SLAP. It requires the linear system to be symmetric and positive definite.
gmres
Calls the GMRES iterative solver in SLAP. This allows the system to be nonsymmetric but is considerably slower than iccg for symmetric systems.
diag
This assumes the matrix to be diagonal, and solves the system directly. Typically this solver would be used in explicit time stepping schemes together with the Lump modifer to mkFem.
Examples:
> # set up different solvers to use with different equations:
> solve_list:=[iccg,iccg]:
> mkSolve(solve_list,eq_list);
solve
mkFem - Create the core of the solver
Calling sequence:
mkFem(eq_list, unknown_list, old_unknown_list, params_list, testfcn, bsf_file);
Parameters:
eq_list - A list of equations defining a PDE problem in variational form.
unknown_list - The list of unknowns as discussed above.
old_unknown_list - The list of unknowns at the previous timestep, as discussed above.
params_list - A list of scalar input parameters.
testfcn - The name of the test function used in the equations in eq_list.
bsf_file - A file containing a Maple description of a particular finite element.
Synopsis:
ElementInt(expr)
Generates local residuals by integration over an element. The equations in eq_list must consist of terms enclosed in ElementInt or BoundaryInt calls.
BoundaryInt(expr)
The BoundaryInt call is used to evaluate the boundary integrals that appear in natural boundary conditions in variational formulations. BoundaryInt generates local residuals by integration over element sides. These are assembled for sides located on parts of the boundary that have 'Neumann' boundary conditions. If the string 'qBCval' is encountered it will be replaced by a number read with the mesh when the solver is run. The equations in eq_list must consist of terms enclosed in ElementInt or BoundaryInt calls.
NoExpand(expr)
This is meaningful only when used in the argument of an ElementInt or BoundaryInt function. It alters the way the symbolic calculations are done, but should not affect the numerical results. It can be used to prevent Maple from expanding nonlinear expressions of variables into huge, awkward expressions. For example: ElementInt(test(x,y)*(NoExpand(u(x,y)) )^3) could produce less code than ElementInt(test(x,y)*(u(x,y))^3).
Lump(expr)
This is an implementation of the familiar FEM-trick of 'lumping the mass matrix'. Typically this is useful in explicit schemes when the unknown u(x,y) is to be solved from something like ElementInt(test(x,y)*u(x,y))=RHS. 'Lumping the mass matrix' means to replace the system matrix on the left hand side by a diagonal matrix ('lumping' the nodes onto the diagonal). So if instead we write ElementInt( Lump(test(x,y)*u(x,y)) ) = RHS, this equation can be solved faster by using the diagonal solver (diag in mkSolve). Lump() is meaningful only when used in the argument of an ElementInt or BoundaryInt function.
PointWise(expr)
This is an implementation of a trick sometimes used in FEM, for cheaper evaluation of nonlinear expressions. It will apply a nonlinear expression to the nodal values directly, instead of first expanding the unknown in base functions, i.e.: u(x,y)^3 is expanded in base functions as
sum_i( u_i^3 * test_i) instead of ( sum_i( ui * test_i))^3. PointWise() is meaningful only when used in the argument of an ElementInt or BoundaryInt function.
Examples:
> # create residual computations etc:
> size_parameters:=mkFem(eq_list,unknown_list,old_unknown_list,params_list,test(x,y), `2DP1_gsq_bsf`);
mkresi
amedsp
addr1
addm1
addr2
addm2
grbcrs
bdedsp
adbr1
adbm1
adbr2
adbm2
addini
check include/size.h:
nvar: 2
nobf: 3
bnobf: 2
changing jacobians list:
false false
mkFem2 - Create the core of the solver for mixed elements
Calling sequence:
mkFem2(eq_list, unknown_list, old_unknown_list, params_list, unkntestlist, testbsflist);
Parameters:
eq_list - A list of equations defining a PDE problem in variational form.
unknown_list - The list of unknowns as discussed above.
old_unknown_list - The list of unknowns at the previous timestep, as discussed above.
params_list - A list of scalar input parameters.
unkntestlist - A list of testfunction names that couple a certain testfunction with a certain unknown. The number of entries in unkntestlist must be the same as in unknown_list and old_unknown_list.
testbsflist - A list containing three entries, the first two being names of testfunctions, the last the name of a file that contins the definitions of the basefunctions. The two basefunction names are identified with the actual basefunctions via ordering and the name of this file, i.e., with testbsflist:=[v(x,y),q(x,y),`2DP2P1_gsq_bsf`], v(x,y) is P2 and q(x,y) is P1.
Synopsis:
ElementInt(expr)
Generates local residuals by integration over an element. The equations in eq_list must consist of terms enclosed in ElementInt or BoundaryInt calls.
ElementIntHiQ(expr)
This can be used to invoke an alternate integral evaluation, replacing ElementInt(), for selected terms, giving for instance a more accurate Gauss quadrature fomula. It relies on finding a definition of the procedure myElIntHiQ in the basefunction file.
BoundaryInt(expr)
The BoundaryInt call is used to evaluate the boundary integrals that appear in natural boundary conditions in variational formulations. BoundaryInt generates local residuals by integration over element sides. These are assembled for sides located on parts of the boundary that have 'Neumann' boundary conditions. If the string 'qBCval' is encountered it will be replaced by a number read with the mesh when the solver is run. The equations in eq_list must consist of terms enclosed in ElementInt or BoundaryInt calls.
NoExpand(expr)
This is meaningful only when used in the argument of an ElementInt or BoundaryInt function. It alters the way the symbolic calculations are done, but should not affect the numerical results. It can be used to prevent Maple from expanding nonlinear expressions of variables into huge, awkward expressions. For example: ElementInt(test(x,y)*(NoExpand(u(x,y)) )^3) could produce less code than ElementInt(test(x,y)*(u(x,y))^3).
Lump2(expr)
This is an implementation of the familiar FEM-trick of 'lumping the mass matrix'. Typically this is useful in explicit schemes when the unknown u(x,y) is to be solved from something like ElementInt(test(x,y)*u(x,y))=RHS. 'Lumping the mass matrix' means to replace the system matrix on the left hand side by a diagonal matrix ('lumping' the nodes onto the diagonal). So if instead we write ElementInt( Lump(test(x,y)*u(x,y)) ) = RHS, this equation can be solved faster by using the diagonal solver (diag in mkSolve). Lump() is meaningful only when used in the argument of an ElementInt or BoundaryInt function.
PointWise(expr)
This is an implementation of a trick sometimes used in FEM, for cheaper evaluation of nonlinear expressions. It will apply a nonlinear expression to the nodal values directly, instead of first expanding the unknown in base functions, i.e.: u(x,y)^3 is expanded in base functions as
sum_i( u_i^3 * test_i) instead of ( sum_i( ui * test_i))^3. PointWise() is meaningful only when used in the argument of an ElementInt or BoundaryInt function.
Examples:
> # create residual computations etc:
> size_parameters:=mkFem(eq_list,unknown_list,old_unknown_list,params_list,test(x,y), `2DP1_gsq_bsf`);
mkresi
amedsp
addr1
addm1
addr2
addm2
grbcrs
bdedsp
adbr1
adbm1
adbr2
adbm2
addini
check include/size.h:
nvar: 2
nobf: 3
bnobf: 2
changing jacobians list:
false false