pihnn.bc.interface_bc#
- class pihnn.bc.interface_bc#
Bases:
scalar_bc
,linear_elasticity_bc
Interface condition for DD-PIHNNs.
For scalar problems:
\[[u] = [\nabla u \cdot n] = 0,\]where \(u\) is the solution and \(n\) is the outward normal vector.
For linear elasticity:
\[[u] = [\sigma \cdot n] = 0,\]where \(u\) is the displacement vector, \(\sigma\) is the stress tensor and \(n\) is the outward normal vector.
In both cases, \([\cdot]\) denotes the discontinuity across 2 domains.
- __call__(*args)#
- Calculate residual of the boundary condition.It employs
call_for_scalar()
orcall_for_linear_elasticity()
based on the types of arguments.
- call_for_scalar(z, u, normal, rhs)#
Calculate residual of the boundary condition (for scalar problems).
- Parameters:
z (
torch.tensor
) – Coordinates of the points where the BC is evaluated.u (
torch.tensor
) – Solution evaluated at the ‘z’ coordinates.normal (
torch.tensor
) – Boundary outward normal vectors at the ‘z’ coordinates.rhs (
torch.tensor
) – Boundary condition RHS assigned value at the ‘z’ coordinates.
- Returns:
error (
torch.tensor
) - Residual of the boundary condition at the ‘z’ coordinates.
- call_for_linear_elasticity(z, sxx, syy, sxy, ux, uy, normal, rhs)#
Calculate residual of the boundary condition (for linear elasticity problems).
- Parameters:
z (
torch.tensor
) – Coordinates of the points where the BC is evaluated.sxx (
torch.tensor
) – \(\sigma_{xx}\) evaluated at the ‘z’ coordinates.syy (
torch.tensor
) – \(\sigma_{yy}\) evaluated at the ‘z’ coordinates.sxy (
torch.tensor
) – \(\sigma_{xy}\) evaluated at the ‘z’ coordinates.ux (
torch.tensor
) – \(u_{x}\) evaluated at the ‘z’ coordinates.uy (
torch.tensor
) – \(u_{y}\) evaluated at the ‘z’ coordinates.normal (
torch.tensor
) – Boundary outward normal vectors at the ‘z’ coordinates.rhs (
torch.tensor
) – Boundary condition RHS assigned value at the ‘z’ coordinates.
- Returns:
error (
torch.tensor
) - Residual of the boundary condition at the ‘z’ coordinates.