Skip to content
Discussion options

You must be logged in to vote

Hi @jimenezastorga1990-arch,
you can try reformulating the hard boundary constraints as follows.

import os

os.environ["DDEBACKEND"] = "pytorch"

import torch
import deepxde as dde
import numpy as np


geom = dde.geometry.Rectangle([0, 0], [1, 1])
timedomain = dde.geometry.TimeDomain(0, 1)
geomtime = dde.geometry.GeometryXTime(geom, timedomain)

D = 1e-12
time = 100 * 365 * 24 * 3600
b = 1
h = 1
Lx = b
Ly = h


def pde(x, y):
    alpha = D * time / (Lx * Lx)
    dy_t = dde.grad.jacobian(y, x, i=0, j=2)
    dy_xx = dde.grad.hessian(y, x, i=0, j=0)
    dy_yy = dde.grad.hessian(y, x, i=0, j=1)
    residual = alpha * (dy_xx + dy_yy) - dy_t
    return residual


data = dde.data.TimePDE(
    ge…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@jimenezastorga1990-arch
Comment options

@vl-dud
Comment options

Answer selected by jimenezastorga1990-arch
Comment options

You must be logged in to vote
1 reply
@vl-dud
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants