Photon-AI-Research / NeuralSolvers

Neural network based solvers for partial differential equations and inverse problems :milky_way:. Implementation of physics-informed neural networks in pytorch.
MIT License
138 stars 46 forks source link

Extend the PINN function to accept only one boundary condition #19

Closed juesuarezca closed 3 years ago

juesuarezca commented 3 years ago

the function PINNFramewrok.PINN(.., boundary_condition,...) only accepts as input argument for boundary_condition elements of the form boundary_condition= [bc1,bc2,.. ], but even for only one bc it requires the input to be [bc]. Otherwise it raises 'KeyError' because it cannot call the bc from its name without the list form.

StillerPatrick commented 3 years ago

I was able to resolve the bug with adding the single instance boundary condition to the joinded condition. See the lines below. This will be updated in mid of june.

                if isinstance(boundary_condition, BoundaryCondition):
                    self.boundary_condition = boundary_condition
                    joined_datasets[boundary_condition.name] = boundary_condition.dataset