Closed davidkleiven closed 5 years ago
Currently derivative is performed via local least squares
double TwoPhaseLandau::partial_deriv_conc(double x[]) const{ const unsigned int N = 5; const double dx = 0.05/N; double current_conc = x[0]-dx/2.0; double concs[N]; double energies[N]; for (unsigned int i=0;i<N;i++){ concs[i] = current_conc; x[0] = current_conc; current_conc += dx; energies[i] = this->evaluate(x); } return least_squares_slope(concs, energies, N);
Maybe it is faster to calculate the slope via local least squares before, and interpolate the result at runtime.
Difficult to use pre calculations since the derivative depend on all four fields.
Currently derivative is performed via local least squares
Maybe it is faster to calculate the slope via local least squares before, and interpolate the result at runtime.