<< Click to Display Table of Contents >> boundary_constraint 

{ BOUNDARY_CONSTRAINT.PDE
This problem demonstrates the use of boundaryintegral CONSTRAINTS.
A heat equation is solved subject to the constraint that the average temperature
on the outer boundary must be 1.0.
Only natural (derivative) boundary conditions are applied, so the solution is
underdetermined subject to an arbitrary additive constant.
The constraint provides the additional information necessary to make the
solution unique.
}
title 'Boundary Constraint Test'
variables
u
equations
U: div(grad(u)) +x = 0;
constraints
{ force the average boundary value to 1 }
bintegral(u,"outer") = bintegral(1,"outer")
boundaries
Region 1
start "outer" (1,1)
natural(u) = 0 line to (1,1) to (1,1) to (1,1) to close
monitors
contour(u) report(bintegral(u,"outer"))
plots
contour(u) surface(u)
elevation(u) on "outer" report(bintegral(u,"outer")/bintegral(1,"outer")) as "Average"
summary
report("Constraint Validation:")
report(bintegral(u,"outer")/bintegral(1,"outer")) as "Average boundary value"
end