deepxde.icbc¶
deepxde.icbc.boundary_conditions module¶
Boundary conditions.
-
class
deepxde.icbc.boundary_conditions.
BC
(geom, on_boundary, component)[source]¶ Bases:
abc.ABC
Boundary condition base class.
Parameters: - geom – A
deepxde.geometry.Geometry
instance. - on_boundary – A function: (x, Geometry.on_boundary(x)) -> True/False.
- component – The output component satisfying this BC.
- geom – A
-
class
deepxde.icbc.boundary_conditions.
DirichletBC
(geom, func, on_boundary, component=0)[source]¶ Bases:
deepxde.icbc.boundary_conditions.BC
Dirichlet boundary conditions: y(x) = func(x).
-
class
deepxde.icbc.boundary_conditions.
NeumannBC
(geom, func, on_boundary, component=0)[source]¶ Bases:
deepxde.icbc.boundary_conditions.BC
Neumann boundary conditions: dy/dn(x) = func(x).
-
class
deepxde.icbc.boundary_conditions.
OperatorBC
(geom, func, on_boundary)[source]¶ Bases:
deepxde.icbc.boundary_conditions.BC
General operator boundary conditions: func(inputs, outputs, X) = 0.
Parameters: - geom –
Geometry
. - func – A function takes arguments (inputs, outputs, X) 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 – (x, Geometry.on_boundary(x)) -> True/False.
Warning
If you use X in func, then do not set
num_test
when you definedde.data.PDE
ordde.data.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.- geom –
-
class
deepxde.icbc.boundary_conditions.
PeriodicBC
(geom, component_x, on_boundary, derivative_order=0, component=0)[source]¶ Bases:
deepxde.icbc.boundary_conditions.BC
Periodic boundary conditions on component_x.
-
class
deepxde.icbc.boundary_conditions.
PointSetBC
(points, values, component=0, batch_size=None, shuffle=True)[source]¶ Bases:
object
Dirichlet boundary condition for a set of points.
Compare the output (that associates with points) with values (target data). If more than one component is provided via a list, the resulting loss will be the addative loss of the provided componets.
Parameters: - points – An array of points where the corresponding target values are known and used for training.
- values – A scalar or a 2D-array of values that gives the exact solution of the problem.
- component – Integer or a list of integers. The output components satisfying this BC. List of integers only supported for the backend PyTorch.
- batch_size – The number of points per minibatch, or None to return all points. This is only supported for the backend PyTorch and PaddlePaddle. Note, If you want to use batch size here, you should also set callback ‘dde.callbacks.PDEPointResampler(bc_points=True)’ in training.
- shuffle – Randomize the order on each pass through the data when batching.
-
class
deepxde.icbc.boundary_conditions.
PointSetOperatorBC
(points, values, func)[source]¶ Bases:
object
General operator boundary conditions for a set of points.
- Compare the function output, func, (that associates with points)
- with values (target data).
Parameters: - points – An array of points where the corresponding target values are known and used for training.
- values – An array of values which output of function should fulfill.
- func – A function takes arguments (inputs, outputs, X) 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.
-
class
deepxde.icbc.boundary_conditions.
RobinBC
(geom, func, on_boundary, component=0)[source]¶ Bases:
deepxde.icbc.boundary_conditions.BC
Robin boundary conditions: dy/dn(x) = func(x, y).
deepxde.icbc.initial_conditions module¶
Initial conditions.