phlower.nn.Slip¶
- class phlower.nn.Slip(activation, normal_name, flag_name, nodes=None)[source]¶
Bases:
IGenericPhlowerCoreModule[IPhlowerLayerParameters,PhlowerTensor],ModuleSlip is a neural network module that applies the slip boundary condition
u <- u - (u . n) non the slip boundary nodes.The three inputs are identified by name: the surface normal
(N, d, 1)and the flag(N, 1), the remaining input being the value(N, d, F), a rank-1 tensor. Each input may have a time-series axis (first axis).- Parameters:
activation (str) – Name of the activation function to apply to the output.
normal_name (str) – Name of the surface normal field. NaN is treated as zero.
flag_name (str) – Name of the flag field, which is one on slip boundary nodes and NaN or zero elsewhere.
nodes (list[int] | None (optional)) – List of feature dimension sizes (The last value of tensor shape). Defaults to None.
Examples
>>> slip = Slip( ... activation="identity", ... normal_name="normal", ... flag_name="slip_flag", ... ) >>> slip(data)
Methods
forward(data, *[, field_data])forward function which overloads torch.nn.Module
from_setting(setting)Create Slip from setting object
Return name of Slip
Attributes
T_destinationcall_super_initdump_patchestraining- forward(data, *, field_data=None, **kwards)[source]¶
forward function which overloads torch.nn.Module
- Parameters:
data (IPhlowerTensorCollections) – IPhlowerTensorCollections data which receives from predecessors
field_data (ISimulationField | None) – ISimulationField | None Constant information through training or prediction
- Returns:
Tensor object
- Return type:
PhlowerTensor