Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation and prediction at different time snaps #6

Open
RoboticAutonomy opened this issue Jan 6, 2025 · 0 comments
Open

Validation and prediction at different time snaps #6

RoboticAutonomy opened this issue Jan 6, 2025 · 0 comments

Comments

@RoboticAutonomy
Copy link

RoboticAutonomy commented Jan 6, 2025

@rezaakb Hello, I was trying to predict at different time snaps, but I don't know what I should modify at the prediction function and loop also the plotting function. Here is my config file for NS:

pred_dataset:

  • mesh_sampler:
    target: pinnstf2.data.MeshSampler
    partial: true
    idx_t: 50
    solution:
    - u
    - v
    - p

  • mesh_sampler:
    target: pinnstf2.data.MeshSampler
    partial: true
    idx_t: 100
    solution:
    - u
    - v
    - p

  • mesh_sampler:
    target: pinnstf2.data.MeshSampler
    partial: true
    idx_t: 150
    solution:
    - u
    - v
    - p
    def plot_navier_stokes(mesh, preds, train_datasets, val_dataset, file_name):
    """Plot Navier-Stokes continuous inverse PDE."""

    x, t, u = train_datasets[0][:]
    p_star = mesh.solution["p"][:, 100]
    p_pred = preds["p"].reshape(p_star.shape)
    X_star = np.hstack(mesh.spatial_domain)
    lb = X_star.min(0)
    ub = X_star.max(0)
    nn = 200
    x = np.linspace(lb[0], ub[0], nn)
    y = np.linspace(lb[1], ub[1], nn)
    X, Y = np.meshgrid(x, y)
    x_star = X_star[:, 0:1]
    y_star = X_star[:, 1:2]

    PP_star = griddata(X_star, p_pred.flatten(), (X, Y), method="cubic")
    P_exact = griddata(X_star, p_star.flatten(), (X, Y), method="cubic")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant