Skip to content

About solving Allen-Cahn equation #10

@alessio1233

Description

@alessio1233

I trying to replicate the implementation of discrete time model of PINNs to solve the Allen-cahn equation. to do that, following the tutorial given, i set the initial condition and the boundary condition:

N0=200

mesh_s = pinnstorch.data.DiscreteMeshSampler(mesh = mesh,
idx_t=20,
num_sample=N0,
solution=['u'],
collection_points=['f'])

pe_b=pinnstorch.data.PeriodicBoundaryCondition(mesh=mesh,
idx_t=180,
derivative_order=1,
solution=['u'],
discrete=True)

val_s = pinnstorch.data.DiscreteMeshSampler(mesh = mesh,
idx_t=180,
solution = ['u'])

train_datasets = [mesh_s,pe_b]
val_dataset = val_s
datamodule = pinnstorch.data.PINNDataModule(train_datasets = train_datasets,
val_dataset = val_dataset,
pred_dataset = val_s)

Then, i set up the Runge-kutta method and the model:

net = pinnstorch.models.FCN(layers = [1, 200, 200, 200, 200, 101],
output_names=['u'],
lb=mesh.lb,
ub=mesh.ub,
discrete=True)

runge_kutta=pinnstorch.models.RungeKutta(root_dir='..',
t1=20,
t2=180,
time_domain=time_domain,
q=100)

model = pinnstorch.models.PINNModule(net = net,
pde_fn = pde_fn,
output_fn=None,
loss_fn='sse',
jit_compile=False,
runge_kutta=runge_kutta)

When i setu up trainer and i run the training, i get the following message:

C:\Users\userr\anaconda3\envs\lab\Lib\site-packages\lightning\pytorch\utilities\data.py:78: Trying to infer the batch_size from an ambiguous collection. The batch size we found is 512. To avoid any miscalculations, use self.log(..., batch_size=batch_size).

What's wrong whith my code? it seems to converge to real solution but, i cannot understand if the contranint are passed in the right way.

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions