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

Multiple functions for Condition to handle in the same domain. #92

Closed
dario-coscia opened this issue May 6, 2023 · 6 comments
Closed

Comments

@dario-coscia
Copy link
Collaborator

Although my demonstration involved PDEs, I want to clarify that my point applies to a broader range of scenarios. For instance, restrictions such as the positivity of 'u' over the domain Omega can be effectively addressed with this approach. However, at present, I must define a new condition for each constraint, even if it pertains to the same domain.

Additionally, if I understand correctly, PINA allows for minimizing 'u' given specific input and output data. However, how about handle input and output data that correspond to derivatives of the function 'u.'
In mechanics, there is another approach to consider where multiple functions correspond to each other through a mapping but need to solve different PDEs over the same domain Omega. For instance, the functions "strain," "stress," and "displacement" may need to be determined. Stresses are subject to the PDE 'div(stress)=f,' while strains must satisfy the PDE 'grad(displacement)=strain.' These two functions, strains and stresses, are related through a mapping 'C(strain)=stress,' which may be quite complex.

In this scenario, three conditions would be required over the same domain. It's worth noting that this approach has applications in various fields, including engineering and physics.

Originally posted by @LoveFrootLoops in #90 (comment)

@dario-coscia
Copy link
Collaborator Author

👋🏼 @ndem0 I opened this issue after brought out this interesting point.

I still don't know if to update the condition class now or to solve it in #85 for the new release.

@ndem0
Copy link
Member

ndem0 commented May 8, 2023

If I understood correctly, PINA already supports for these cases, since they are quite common in many field, as you reported. I admit that right now it's pretty challenging to understand how doing so, but for example the https://github.com/mathLab/PINA/blob/master/examples/problems/stokes.py file contains an example where two equations need to be satisfied on the same domain, i.e. continuity and momentum equations from Stokes problem.

The new version anyway proposes a (hopefully) simpler way to deal with system of equations, as you can see here. Let me know if I misunderstood something!

@LoveFrootLoops
Copy link

If I understood correctly, PINA already supports for these cases, since they are quite common in many field, as you reported. I admit that right now it's pretty challenging to understand how doing so, but for example the https://github.com/mathLab/PINA/blob/master/examples/problems/stokes.py file contains an example where two equations need to be satisfied on the same domain, i.e. continuity and momentum equations from Stokes problem.

The new version anyway proposes a (hopefully) simpler way to deal with system of equations, as you can see here. Let me know if I misunderstood something!

Yes I saw this example but it is not working right now with the updated PINA. The new version can’t deal with the command ‘function=[momentum,continuity]’.

@LoveFrootLoops
Copy link

@ndem0 I was wondering if you might have any suggestion for the problem. I'm currently working on a system with multiple boundary conditions that all apply to the same boundary domain. It's starting to look highly cluttered, since I have do define multiple 'Condition(...)' for the same boundary domain. I was wondering if there might be a workaround that could help me simplify things a bit.

@ndem0
Copy link
Member

ndem0 commented May 9, 2023

It was a quick fix, I implemented in #93.
As soon as all the tests will pass, I'll merge it to master branch and you should be able to pass again a list of functions (remember to clone again the repo, pip package will update only June 1st)

@dario-coscia
Copy link
Collaborator Author

Perfect, thanks @ndem0 for the change. I close the isse since it is resolved.

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

3 participants