pihnn.bc.interface_bc#
- class pihnn.bc.interface_bc#
Bases:
scalar_bc
,linear_elasticity_bc
Interface condition for DD-PIHNNs.
For scalar problems:
where
is the solution and is the outward normal vector.For linear elasticity:
where
is the displacement vector, is the stress tensor and is the outward normal vector.In both cases,
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
) – evaluated at the ‘z’ coordinates.syy (
torch.tensor
) – evaluated at the ‘z’ coordinates.sxy (
torch.tensor
) – evaluated at the ‘z’ coordinates.ux (
torch.tensor
) – evaluated at the ‘z’ coordinates.uy (
torch.tensor
) – 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.