OperatorBC#
- class pinnx.icbc.OperatorBC(func, on_boundary=<function OperatorBC.<lambda>>)[source]#
General operator boundary conditions: func(inputs, outputs) = 0.
- Parameters:
func (
Union[Callable[[Dict[str,Union[Array,ndarray,bool,number,bool,int,float,complex,Quantity]],Dict[str,Union[Array,ndarray,bool,number,bool,int,float,complex,Quantity]],...],Dict[str,Union[Array,ndarray,bool,number,bool,int,float,complex,Quantity]]],Callable[[Dict[str,Union[Array,ndarray,bool,number,bool,int,float,complex,Quantity]],Dict[str,Union[Array,ndarray,bool,number,bool,int,float,complex,Quantity]]],Dict[str,Union[Array,ndarray,bool,number,bool,int,float,complex,Quantity]]]]) – A function takes arguments (inputs, outputs) and outputs a tensor of size N x 1, where N is the length of inputs. inputs and outputs are the network input and output tensors, respectively; X are the NumPy array of the inputs.on_boundary (
Callable[[Dict[str,Union[Array,ndarray,bool,number,bool,int,float,complex,Quantity]],array],array]) – (x, Geometry.on_boundary(x)) -> True/False.
Warning
If you use X in func, then do not set
num_testwhen you definepinnx.problem.PDEorpinnx.problem.TimePDE, otherwise DeepXDE would throw an error. In this case, the training points will be used for testing, and this will not affect the network training and training loss. This is a bug of DeepXDE, which cannot be fixed in an easy way for all backends.