Interface2DBC#

class pinnx.icbc.Interface2DBC(func, on_boundary1=<function Interface2DBC.<lambda>>, on_boundary2=<function Interface2DBC.<lambda>>, direction='normal')[source]#

2D interface boundary condition.

This BC applies to the case with the following conditions: (1) the network output has two elements, i.e., output = [y1, y2], (2) the 2D geometry is pinnx.geometry.Rectangle or pinnx.geometry.Polygon, which has two edges of the same length, (3) uniform boundary points are used, i.e., in pinnx.problem.PDE or pinnx.problem.TimePDE, train_distribution="uniform". For a pair of points on the two edges, compute <output_1, d1> for the point on the first edge and <output_2, d2> for the point on the second edge in the n/t direction (‘n’ for normal or ‘t’ for tangent). Here, <v1, v2> is the dot product between vectors v1 and v2; and d1 and d2 are the n/t vectors of the first and second edges, respectively. In the normal case, d1 and d2 are the outward normal vectors; and in the tangent case, d1 and d2 are the outward normal vectors rotated 90 degrees clockwise. The points on the two edges are paired as follows: the boundary points on one edge are sampled clockwise, and the points on the other edge are sampled counterclockwise. Then, compare the sum with ‘values’, i.e., the error is calculated as <output_1, d1> + <output_2, d2> - values, where ‘values’ is the argument func evaluated on the first edge.

Parameters:
collocation_points(X)[source]#

Return the collocation points for boundary conditions.

Parameters:

X – Collocation points.

Returns:

Collocation points for boundary conditions.

error(bc_inputs, bc_outputs, **kwargs)[source]#

Returns the loss for each component at the initial or boundary conditions.