Weak Constraint
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.
Weak 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.
Quadrature Settings
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:
Integration Order
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.
When constraints may be discontinuous at points inside the mesh elements, raising the integration order may improve accuracy.
Integrate on Frame
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.
Multiplication by 2πr
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.
When weak constraints are activated under Constraint Settings in other constraint-type boundary conditions, there is no automatic multiplication by 2π r for axial symmetry.
Lagrange Multiplier
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.
Discretization
Select a Shape function type (finite element types): Lagrange (the default), Hermite, Discontinuous Lagrange, Nodal discontinuous Lagrange, Discontinuous scalar density, Bubble, or Gauss point data.
Select an associated Element order (the order of the shape function for the element). The default is to use Quadratic Lagrange elements.
Always use the same shape function type for the weak constraint as for the variables that are constrained, possibly with lower-order elements for the weak constraint. In some cases (for example, when constraining derivatives) the system of equations can become singular. The reason is usually that there are redundant Lagrange multiplier degrees of freedom in the model. Try to lower the order of the Lagrange multiplier variables or use constraints on the Lagrange multiplier to remove some degrees of freedom.
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.
The value type of auxiliary dependent variables is always Complex when Split complex variables in real and imaginary parts is activated in the Compile Equations node of any solver sequence used.