idies / pyJHTDB

Python wrapper for the Johns Hopkins turbulence database library
Apache License 2.0
96 stars 47 forks source link

print spline polynomials #6

Closed chichilalescu closed 9 years ago

chichilalescu commented 9 years ago

Add code to print spline polynomials in various formats, most importantly C/C# subroutines. Also, for the case of y polynomials in the channel flow, put the coefficients in some format that can be ingested into a database. or something like that. @KKanov, please take a minute to think about the format you'd like the polynomial coefficients to be put in, and let me know. Specifically, do you want a big multidimensional array, or just a 3D array for each MN pair? (3D because there's y index, then neighbour index and then power of y).

KKanov commented 9 years ago

Chichi,

You can take a look at the files in the "channel-baryctrwt" directory of the turbulence project to get an idea of how the y-coefficients that are used currently are stored. For example, the file "baryctrwt-y-lag4.dat" stores the y-coefficients used with the Lag4 interpolation option. The first values are the cell_index, offset_index, stencil_start_index and the stencil_end_index, following those are the actual weights. With a file like this the coefficients can be easily loaded into a database table with a script like the following:

BULK INSERT [turblib].[dbo].[barycentric_weights_y_4] FROM N'C:\Users\kalin\Documents\turbulence\channel-baryctrwt\baryctrwt-y-lag4.dat' WITH ( FIELDTERMINATOR = ' ', ROWTERMINATOR = '\n' )

Kalin

On Oct 24, 2014, at 9:57 AM, Cristian C Lalescu notifications@github.com wrote:

Add code to print spline polynomials in various formats, most importantly C/C# subroutines. Also, for the case of y polynomials in the channel flow, put the coefficients in some format that can be ingested into a database. or something like that. @KKanov, please take a minute to think about the format you'd like the polynomial coefficients to be put in, and let me know. Specifically, do you want a big multidimensional array, or just a 3D array for each MN pair? (3D because there's y index, then neighbour index and then power of y).

— Reply to this email directly or view it on GitHub.

chichilalescu commented 9 years ago

solved as of commit db7eee53c6469c96accecf113f3561deaac792f8