Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

Import field, interpolate as GridFunction

More
5 years 1 month ago #1510 by jameslowman
I am hoping to import a field from a numpy array, one defined on the same dimensions as the mesh. I then want to interpolate it and have it as a grid function to operate upon in my weak formulation.

The field would be bounded between 0 and 1, representing a diffuse interface (or diffuse immersed boundary) where 0 is outside of the computational domain, 1 is inside, and anything in-between represents the boundary.

Is this possible?
More
5 years 2 weeks ago #1537 by christopher
It is possible, but you have to know a little bit what you are doing. What space do you use and where do you have data of the function (is it for example in the vertices or at some grid,...)?
Best
Christopher
More
5 years 2 weeks ago #1540 by jameslowman
I am attempting to implement a diffuse immersed boundary on a structured grid. I wish to import a field where the points outside of the domain are marked with a "0" and the points inside the domain are marked with a "1", and the boundary will exist at any point between 0 and 1.

I was hoping to import a field from an outside source that would define this boundary/computational domain to then be interpolated where needed for the grid points in NGSolve
More
4 years 11 months ago #1585 by christopher
Have you had a look at ngsxfem already? There's some functionality implemented there to do things like this. The tutorials may be a good starting point.
Are the points where the function is defined the grid points of the mesh? Then it would be as easy as to set the first values of an H1 GridFunction accordingly.
Best
Christopher
Time to create page: 0.150 seconds