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

Order of barycentric coordinates #15

Open
j-fu opened this issue May 28, 2022 · 1 comment
Open

Order of barycentric coordinates #15

j-fu opened this issue May 28, 2022 · 1 comment

Comments

@j-fu
Copy link
Member

j-fu commented May 28, 2022

Hi, I am trying to write a linear interpolation function from simplexgrids
to simplexgrids. The main loop is as follows:

   	cf = CellFinder(grid_from)
	for inode_to=1:nnodes_to
	@views icell_from=gFindLocal!(λ, cf, coord[:,inode_to]; icellstart)
		for i=1:dim+1
                       inode_from=cn_from[i,icell_from]
			u_to[inode_to]+=λ[i]*u_from[inode_from]
		end
	   icell_start=icell_from	   	
	end

This does not work. I figured out that I need to permute the λ values.
How is the sequence of barycentric coordinates defined with respect to cellnodes[:,icell] ?
And do we have a link with #1 ?

@chmerdon
Copy link
Member

I think it is (for Triangle2D):
λ[1] refers to cellnode[2,icell]
λ[2] refers to cellnode[3,icell]
1-λ[1]-λ[2] refers to cellnode[1,icell]

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

2 participants