- Thank you received: 0
Import field, interpolate as GridFunction
- jameslowman
- Topic Author
- Offline
- New Member
Less
More
5 years 9 months ago #1510
by jameslowman
Import field, interpolate as GridFunction was created 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?
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?
- christopher
- Offline
- Administrator
Less
More
- Thank you received: 101
5 years 8 months ago #1537
by christopher
Replied by christopher on topic Import field, interpolate as GridFunction
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
Best
Christopher
- jameslowman
- Topic Author
- Offline
- New Member
Less
More
- Thank you received: 0
5 years 8 months ago #1540
by jameslowman
Replied by jameslowman on topic Import field, interpolate as GridFunction
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
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
- christopher
- Offline
- Administrator
Less
More
- Thank you received: 101
5 years 7 months ago #1585
by christopher
Replied by christopher on topic Import field, interpolate as GridFunction
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
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.096 seconds