To add a Weak Constraint node on a domain, boundary, edge, or point in any physics interface, click the
Show More Options button (
) and select
Equation-Based Contributions in the
Show More Options dialog box.
Then, depending on the geometric entity level, select
More>Weak Constraint at the domain or boundary level,
Edges>Weak Constraint, or
Points>Weak Constraint from the context menu. There is no global weak constraint option.
The Weak Constraint node adds an extra dependent variable, known as a Lagrange multiplier, and a weak equation, which together enforce the specified constraint.
Select an option from the Apply reaction terms on list:
All physics (symmetric) (the default) or
User defined. For either option, enter a
Constraint expression, which COMSOL Multiphysics
constrains to 0. For example, entering
2-(u+v) constrains
u+v to the value 2.
For User defined, also enter a
Constraint force expression. The constraint force expression must use the
test() or
var() operator. For example, write
test(-u) to enforce the constraint by modifying only the
u equation with reaction terms.
These settings affect the numerical integration, and you do normally not need to change them. The Use automatic quadrature settings check box is selected by default, meaning that the settings are taken from the main equation in the interface. If the check box is cleared, the following settings become available:
The Integration order is a positive integer that specifies the desired accuracy of integration during discretization. Polynomials of at most the given integration order are integrated without systematic errors. For smooth constraints, a sufficient integration order is typically twice the order of the shape function. For example, the default integration order for second-order Lagrange elements is 4.
The Integrate on frame setting determines which frame to base the integration on:
Spatial,
Material,
Mesh, or
Geometry. The default frame is the one used for the physics interface.
By default, the Multiply by 2πr check box is selected to make the Lagrange multiplier represent, for example, the flux per area rather than by length and full revolution. If the check box is cleared, the Lagrange multiplier is not multiplied by 2
π r where it is used in the constraint equation, and therefore represents flux per length and full revolution.
Enter a Lagrange multiplier variable (the default name is
lm) and an
Initial value. Change the name if required, for example, because a variable name conflicts.
Select an associated Element order (the order of the shape function for the element). The default is to use
Quadratic Lagrange elements.
The Frame list is available when there is more than one unique frame in the model. In this case, select
Spatial or
Material from the
Frame list. This affects only how derivatives of Lagrange multipliers are computed. These are normally not used in the constraint equations, but may be of interest for postprocessing.