This routine builds up the matrix for least square fit used in quadratic interpolation. We extract momentum information completely on the view of the source coordinate system Set the right hand side of the equation system Solve the problem, where b = rhs, x = coefficients Ax = b overdetermined, solve the least Square fit problem (A^T)Ax = (A^T)b x = ((A^T)A)^-1(A^T)b Solve linear system of equation with inverted matrix. Size of matrix: (nCoeffs, QQ) matrix_LSF = ((A^T)A)^-1(A^T)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_matrix_type), | intent(out) | :: | me | Matrix to fill |
||
integer, | intent(in) | :: | Number of stencil directions |
|||
integer, | intent(in) | :: | nDims | Number of dimensions |
||
integer, | intent(in) | :: | nSources | Number of sources from coarser found |
||
real(kind=rk), | intent(in) | :: | cxDirRK(3,QQ) | Stencil directions |
||
integer, | intent(in) | :: | neighDir(nSources) | direction in which sources are found |
||
integer, | intent(in) | :: | nCoeffs | nUnknown coeffs |
||
logical, | intent(out) | :: | success | success if false if matrix is singular reduce interpolation order |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | private | :: | iDir | ||||
integer, | private | :: | iSrc | ||||
type(tem_matrix_type), | private | :: | tmp_matrix | Each row represents a polynomial evaluated at coord of elements in |
|||
real(kind=rk), | private | :: | inv_AtA(nCoeffs,nCoeffs) | ||||
real(kind=rk), | private | :: | AtA(nCoeffs,nCoeffs) | ||||
integer, | private | :: | errCode |