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

Initial Conditions #59

Open
lindsayad opened this issue Nov 26, 2024 · 2 comments
Open

Initial Conditions #59

lindsayad opened this issue Nov 26, 2024 · 2 comments

Comments

@lindsayad
Copy link
Contributor

AFAICT platypus doesn't currently support an ICs block. It looks like the MFEM code for creating initial conditions is pretty straightforward (as I'm sure you guys know). This is what INL's AI tool gave me

    // The initial solution GridFunction
    GridFunction u(&fespace);

    // Define the initial condition coefficient
    FunctionCoefficient u0(InitialCondition);

    // Project the initial condition onto the GridFunction
    u.ProjectCoefficient(u0);

where InitialCondition is a function taking Vector as an input argument. Are there any plans to add support for ICs?

@lindsayad
Copy link
Contributor Author

I am curious why this line in PlatypusApp.C:

  addTaskDependency("add_mfem_coefficients", "add_ic");

I was thinking that I would actually create an IC that takes a coefficient and then the IC does the coefficient projection onto the grid function, but then the dependency ordering would have to be reversed

@alexanderianblair
Copy link
Contributor

Yup - we have it on our task list, but I don't think anyone's had the chance to pick it up yet! The suggested approach (creating a Coefficient and then calling ProjectCoefficient) is exactly the route to take.

The task dependency looks vestigial to me, from a forerunner to Platypus that had mfem::GridFunctionCoefficient set up in an awkward way - can (and should) be reversed for general ICs here.

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

Successfully merging a pull request may close this issue.

2 participants