calculating spline coefficients?

Dear Lammps Gurus,

I am working on some code to add a new potential to lammps based on REBO. Does anybody know if there is code buried in lammps somewhere to calculate bicubic and tricubic spline coefficients from spline knot values and there derivatives.

At present, Lammps REBO reads in these precalculated spline coefficients from CH.airebo in order to do use them later for interpolations. One problem with that is that it makes it difficult your average user to adjust parameters. For example a number of papers dealing with REBO adjust a couple of spline knots to optimize the properties for some specific systems…The way I have done this in the past is to take Brenner’s serial REBO code, have it calculate the coefficients and dump it into a file to create a new CH.airebo data file. It requires a lot of work and is nontrivial. I’d like to fix that by having Lammps read in the published spline knots and derivatives and calculate the coefficients, rather than just read in the coefficients.

Thanks,

Dave

You could look at pair_eam.cpp and pair_table.cpp.
Both read in a list of values and create splines. For EAM,
it is cubic splines. For pair table, it has several options,
like linear, but one of them is cubic splines.
Paul Crozier wrote that latter piece of code if I recall.

Steve

Also, if the license is not a problem, take a look at the GSL
http://www.gnu.org/software/gsl/
I'm not familiar with REBO, but I mention this because, if, for some
reason you need cyclic splines, there is some nice code for doing that
there. Check out the "tridiag.c" written by Gerard Jungman available
there.
Cheers

Andrew