Nectar-Developer: Find each element's coefficients from ExpList
Hi everyone, I currently working on a project and would like to do the following task and need some guidance. (1) Read an .fld file. (2) Load it into vector fields into expansions (exp_u, exp_v, exp_w) (3) Loop through each element in the mesh and do some processing in it and store the result in a new expansion. I have a problem in step (3). I am able loop through each expansion but unable to understand how should I retrieve coefficients for each element. Array<OneD,NekDouble> gcoeff = exp_u->GetCoeffs() - This gets me the coefficients of whole expansion. How do I match coefficients which belong to each element. These two statements used in the code seem to reorder the coefficients in the expansion, Can someone explain what they are doing. Exp_u->GlobalToLocal() Exp_u->LocalToGlobal() Would any of these functions reorder coefficients elementwise. So that I use access element[i]'s coefficients as gcoeff[I*numOfCoeffPerEle]. Ashok.
Hi Ashok, I am not sure if anyone else responded to this. Did we manage to answer any of this in our chat? There is an index array ExpList->GetCoeff_Offset(e) which gives an integer offset of the global list from GetCoeffs() to tell you where element ‘e’ starts. (There is a similar GetPhys_Offset(e) if you want to get the phys point location for element ‘e’). Cheers, Spencer. On 7 Feb 2016, at 23:53, ashok jallepalli <ash.nani@gmail.com<mailto:ash.nani@gmail.com>> wrote: Hi everyone, I currently working on a project and would like to do the following task and need some guidance. (1) Read an .fld file. (2) Load it into vector fields into expansions (exp_u, exp_v, exp_w) (3) Loop through each element in the mesh and do some processing in it and store the result in a new expansion. I have a problem in step (3). I am able loop through each expansion but unable to understand how should I retrieve coefficients for each element. Array<OneD,NekDouble> gcoeff = exp_u->GetCoeffs() * This gets me the coefficients of whole expansion. How do I match coefficients which belong to each element. These two statements used in the code seem to reorder the coefficients in the expansion, Can someone explain what they are doing. Exp_u->GlobalToLocal() Exp_u->LocalToGlobal() Would any of these functions reorder coefficients elementwise. So that I use access element[i]'s coefficients as gcoeff[I*numOfCoeffPerEle]. Ashok. Spencer Sherwin McLaren Racing/Royal Academy of Engineering Research Chair, Professor of Computational Fluid Mechanics, Department of Aeronautics, Imperial College London South Kensington Campus London SW7 2AZ s.sherwin@imperial.ac.uk<mailto:s.sherwin@imperial.ac.uk> +44 (0) 20 759 45052
Hi Spencer, Yes, this question was answered by you and Chris separately. Thank you for your clarification. Just to conclude this question thread for anyone referencing in future. ExpList->GetCoeff_Offset(e) is valid when the coefficients are ordered in Local expansion wise. i.e. (ExpList->GlobalToLocal()) Ashok On Sun, Feb 14, 2016 at 4:51 PM, Sherwin, Spencer J < s.sherwin@imperial.ac.uk> wrote:
Hi Ashok,
I am not sure if anyone else responded to this. Did we manage to answer any of this in our chat?
There is an index array ExpList->GetCoeff_Offset(e) which gives an integer offset of the global list from GetCoeffs() to tell you where element ‘e’ starts. (There is a similar GetPhys_Offset(e) if you want to get the phys point location for element ‘e’).
Cheers, Spencer.
On 7 Feb 2016, at 23:53, ashok jallepalli <ash.nani@gmail.com> wrote:
Hi everyone, I currently working on a project and would like to do the following task and need some guidance.
(1) Read an .fld file. (2) Load it into vector fields into expansions (exp_u, exp_v, exp_w) (3) Loop through each element in the mesh and do some processing in it and store the result in a new expansion.
I have a problem in step (3). I am able loop through each expansion but unable to understand how should I retrieve coefficients for each element.
Array<OneD,NekDouble> gcoeff = exp_u->GetCoeffs()
- This gets me the coefficients of whole expansion. How do I match coefficients which belong to each element.
These two statements used in the code seem to reorder the coefficients in the expansion, Can someone explain what they are doing. Exp_u->GlobalToLocal() Exp_u->LocalToGlobal()
Would any of these functions reorder coefficients elementwise. So that I use access element[i]'s coefficients as gcoeff[I*numOfCoeffPerEle].
Ashok.
Spencer Sherwin McLaren Racing/Royal Academy of Engineering Research Chair, Professor of Computational Fluid Mechanics, Department of Aeronautics, Imperial College London South Kensington Campus London SW7 2AZ
s.sherwin@imperial.ac.uk +44 (0) 20 759 45052
_______________________________________________ Nektar-users mailing list Nektar-users@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/nektar-users
participants (2)
- 
                
                ashok jallepalli
- 
                
                Sherwin, Spencer J