Static class containing useful routines for (weighted) least squares polynomial reconstruction.
More...
|
| static VoFStencil | getInterpolationStencil (CellLocation a_cellPos, CellLocation a_otherCellsPos, Connectivity a_connectivity, const VolIndex &a_startVof, const EBISBox &a_ebisbox, Real a_dx, int a_p, int a_radius, int a_order, bool a_addStartingVof) |
| | Get an interpolation stencil to a point in a cell with a specified order and radius.
|
| |
| static VoFStencil | getGradSten (const VolIndex &a_vof, CellLocation a_gradLocation, CellLocation a_cellLocation, const EBISBox &a_ebisbox, Real a_dx, int a_radius, int a_p, int a_order, const IntVectSet &a_knownTerms=IntVectSet()) |
| | Compute a least squares gradient stencil in a cell.
|
| |
| static VoFStencil | getGradSten (const FaceIndex &a_face, FaceLocation a_gradLocation, CellLocation a_cellLocation, const EBISBox &a_ebisbox, Real a_dx, int a_radius, int a_p, int a_order, const IntVectSet &a_knownTerms=IntVectSet()) |
| | Compute a least squares gradient stencil on a grid face.
|
| |
| static VoFStencil | getBndryGradSten (const VolIndex &a_vof, Neighborhood a_neighborhood, CellLocation a_cellPositions, const EBISBox &a_ebisbox, Real a_dx, int a_radius, int a_p, int a_order, bool a_addStartingVof) |
| | Compute a least squares gradient stencil on the EB centroid with specified order.
|
| |
| static Real | sumWeights (const VoFStencil &a_stencil, int a_variable) |
| | Return the sum of weights in the stencil, for a specific variable.
|
| |
| static Real | sumAllWeights (const VoFStencil &a_stencil) |
| | Compute the sum of all weights in a stencil.
|
| |
| static VoFStencil | projectGradSten (const VoFStencil &a_stencil, const RealVect &a_projection) |
| | Assuming that a_stencil is a gradient stencil, project it along a direction.
|
| |
| static RealVect | displacement (CellLocation a_from, CellLocation a_to, const VolIndex &a_fromVof, const VolIndex &a_toVof, const EBISBox &a_ebisbox, const Real &a_dx) |
| | Computes the distance between two Vofs that are defined on the same grid level.
|
| |
| static RealVect | displacement (FaceLocation a_fromLoc, CellLocation a_toLoc, const FaceIndex &a_fromFace, const VolIndex &a_toVof, const EBISBox &a_ebisbox, const Real &a_dx) |
| | Computes the distance between a vof and and a face.
|
| |
| static RealVect | displacement (CellLocation a_from, CellLocation a_to, const VolIndex &a_fromVof, const VolIndex &a_toVof, const EBISBox &a_ebisboxFrom, const EBISBox &a_ebisboxTo, const Real &a_dxFrom, const Real &a_dxTo) |
| | Computes the distance between two Vofs that are defined on two different grid levels.
|
| |
| static Vector< RealVect > | getDisplacements (CellLocation a_from, CellLocation a_to, const VolIndex &a_fromVof, const Vector< VolIndex > &a_toVofs, const EBISBox &a_ebisbox, const Real &a_dx) |
| | Get displacement vectors from a cell position to another cell position for a list of Vofs, i.e. x = (xFrom - xTo).
|
| |
| static Vector< RealVect > | getDisplacements (FaceLocation a_fromLoc, CellLocation a_to, const FaceIndex &a_fromFace, const Vector< VolIndex > &a_toVofs, const EBISBox &a_ebisbox, const Real &a_dx) |
| | Get displacement vectors from a cell position to another cell position for a list of Vofs, i.e. x = (xFrom - xTo).
|
| |
| static Vector< Real > | makeDiagWeights (const Vector< RealVect > &a_displacements, int a_pow) |
| | Create a list of weights. This routine returns a list of diagonal weights for a least squares system. The weights are given as 1/||x1-x0||^a where a is the power.
|
| |
| static VoFStencil | computeGradSten (const Vector< VolIndex > &a_allVofs, const Vector< RealVect > &a_displacements, int a_p, int a_order, const IntVectSet &a_knownTerms) |
| | Get a least squares gradient stencil solution for computing the gradient at a point. This routine eliminates the value in the point where the gradient is computed (which is assumed to be known.)
|
| |
| static VoFStencil | computeGradSten (const Vector< VolIndex > &a_allVofs, const Vector< RealVect > &a_displacements, const Vector< Real > &a_weights, int a_order, const IntVectSet &a_knownTerms) |
| | Get a least squares gradient stencil solution for a system of first-order Taylor extrapolation for computing the gradient at a point.
|
| |
| static int | getTaylorExpansionSize (int a_order) |
| | Get the size of a Taylor expansion for a given order.
|
| |
| static VoFStencil | computeInterpolationStencil (const Vector< VolIndex > &a_allVofs, const Vector< RealVect > &a_displacements, int a_pow, int a_order) |
| | Compute an interpolation stencil to specified order by solving a least squares system.
|
| |
| static VoFStencil | computeInterpolationStencil (const Vector< VolIndex > &a_allVofs, const Vector< RealVect > &a_displacements, const Vector< Real > &a_weights, int a_order) |
| | Compute an interpolation stencil to specified order by solving a least squares system.
|
| |
| static std::map< IntVect, VoFStencil > | computeSingleLevelStencils (const IntVectSet &a_derivs, const IntVectSet &a_knownTerms, const Vector< VolIndex > &a_allVofs, const Vector< RealVect > &a_displacements, int a_p, int a_order) |
| | Compute a least squares interpolation to a specified order.
|
| |
| static std::map< IntVect, VoFStencil > | computeSingleLevelStencils (const IntVectSet &a_derivs, const IntVectSet &a_knownTerms, const Vector< VolIndex > &a_allVofs, const Vector< RealVect > &a_displacements, const Vector< Real > &a_weights, int a_order) |
| | Compute a least squares interpolation to a specified order.
|
| |
| template<typename T > |
| static std::map< IntVect, std::pair< VoFStencil, VoFStencil > > | computeDualLevelStencils (const IntVectSet &a_derivs, const IntVectSet &a_knownTerms, const Vector< VolIndex > &a_fineVofs, const Vector< VolIndex > &a_coarVofs, const Vector< RealVect > &a_fineDisplacements, const Vector< RealVect > &a_coarDisplacements, int a_p, int a_order) |
| | Compute a least squares interpolation to a specified order. This version separates the stencils into two levels.
|
| |
| template<typename T > |
| static std::map< IntVect, std::pair< VoFStencil, VoFStencil > > | computeDualLevelStencils (const IntVectSet &a_derivs, const IntVectSet &a_knownTerms, const Vector< VolIndex > &a_fineVofs, const Vector< VolIndex > &a_coarVofs, const Vector< RealVect > &a_fineDisplacements, const Vector< RealVect > &a_coarDisplacements, const Vector< Real > &a_fineWeights, const Vector< Real > &a_coarWeights, int a_order) |
| | Compute a least squares interpolation to a specified order. This version separates the stencils into two levels.
|
| |
Static class containing useful routines for (weighted) least squares polynomial reconstruction.
| std::map< IntVect, std::pair< VoFStencil, VoFStencil > > LeastSquares::computeDualLevelStencils |
( |
const IntVectSet & |
a_derivs, |
|
|
const IntVectSet & |
a_knownTerms, |
|
|
const Vector< VolIndex > & |
a_fineVofs, |
|
|
const Vector< VolIndex > & |
a_coarVofs, |
|
|
const Vector< RealVect > & |
a_fineDisplacements, |
|
|
const Vector< RealVect > & |
a_coarDisplacements, |
|
|
const Vector< Real > & |
a_fineWeights, |
|
|
const Vector< Real > & |
a_coarWeights, |
|
|
int |
a_order |
|
) |
| |
|
static |
Compute a least squares interpolation to a specified order. This version separates the stencils into two levels.
This is the general version which lets the caller specify why derivatives he wants out of the interpolation. The user specifies this via a_derivs where each IntVect represent a differentiation. E.g. IntVect(0,0,0) is just f, IntVect(1,0,0) = d/dx, IntVect(1,1,2) = (d^4)/(dx dy dz^2) and so on. The stencils for the directional derivatives are coded onto the return map. E.g. if a_derivs contains IntVect(1,0,0) the stencil for d/dx is found in map.at(IntVect(1,0,0)). The user can solve a smaller system if some of the terms in the expansion are known, typically used when computing an approximation to the gradient at a point in space where the scalar value is known. Note that this will modify the right hand side of the system, and the user will have to figure out how to make sense of the stencil.
- Parameters
-
| [in] | a_derivs | Specification of which unknowns in the Taylor series will be returned. |
| [in] | a_knownTerms | Which terms in the Taylor series are known. |
| [in] | a_fineVofs | Fine-level vofs to include in the interpolation method. |
| [in] | a_coarVofs | Coar-level vofs to include in the interpolation method. |
| [in] | a_fineDisplacements | Displacement vectors from the fine Vofs to the interpolation point |
| [in] | a_coarDisplacements | Displacement vectors from the coar Vofs to the interpolation point |
| [in] | a_fineWeights | Weights for the fine level |
| [in] | a_coarWeights | Weights for the coarse level |
| [in] | a_order | Order of the interpolation. |
- Returns
- Stencils for each of the derivatives specified in the input argument. The first entry in the pair contains fine-grid vofs only, and the second entry contains the coar vofs.
- Note
- This will throw an error if you don't have enough equations for obtaining the specified order.
-
The return map is always initialized with empty stencils. If computing the pseudoinverse fails, the returned stencils are all empty.
-
T is the precision used by LAPACK
Compute a least squares interpolation to a specified order. This version separates the stencils into two levels.
This is the general version which lets the caller specify why derivatives he wants out of the interpolation. The user specifies this via a_derivs where each IntVect represent a differentiation. E.g. IntVect(0,0,0) is just f, IntVect(1,0,0) = d/dx, IntVect(1,1,2) = (d^4)/(dx dy dz^2) and so on. The stencils for the directional derivatives are coded onto the return map. E.g. if a_derivs contains IntVect(1,0,0) the stencil for d/dx is found in map.at(IntVect(1,0,0)). The user can solve a smaller system if some of the terms in the expansion are known, typically used when computing an approximation to the gradient at a point in space where the scalar value is known. Note that this will modify the right hand side of the system, and the user will have to figure out how to make sense of the stencil.
- Parameters
-
| [in] | a_derivs | Specification of which unknowns in the Taylor series will be returned. |
| [in] | a_knownTerms | Which terms in the Taylor series are known. |
| [in] | a_fineVofs | Fine-level vofs to include in the interpolation method. |
| [in] | a_coarVofs | Coar-level vofs to include in the interpolation method. |
| [in] | a_fineDisplacements | Displacement vectors from the fine Vofs to the interpolation point |
| [in] | a_coarDisplacements | Displacement vectors from the coar Vofs to the interpolation point |
| [in] | a_p | Weighting factor for weighted least squares |
| [in] | a_order | Order of the interpolation. |
- Returns
- Stencils for each of the derivatives specified in the input argument. The first entry in the pair contains fine-grid vofs only, and the second entry contains the coar vofs.
- Note
- This will throw an error if you don't have enough equations for obtaining the specified order.
-
The return map is always initialized with empty stencils. If computing the pseudoinverse fails, the returned stencils are all empty.
-
T is the precision used by LAPACK
Compute a least squares interpolation to a specified order.
This is the general version which lets the caller specify why derivatives he wants out of the interpolation. The user specifies this via a_derivs where each IntVect represent a differentiation. E.g. IntVect(0,0,0) is just f, IntVect(1,0,0) = d/dx, IntVect(1,1,2) = (d^4)/(dx dy dz^2) and so on. The stencils for the directional derivatives are coded onto the return map. E.g. if a_derivs contains IntVect(1,0,0) the stencil for d/dx is found in map.at(IntVect(1,0,0)). The user can solve a smaller system if some of the terms in the expansion are known, typically used when computing an approximation to the gradient at a point in space where the scalar value is known. Note that this will modify the right hand side of the system, and the user will have to figure out how to make sense of the stencil.
- Parameters
-
| [in] | a_derivs | Specification of which unknowns in the Taylor series will be returned. |
| [in] | a_knownTerms | Which terms in the Taylor series are known. |
| [in] | a_allVofs | Vofs to include in the interpolation method. |
| [in] | a_displacements | Displacement vectors from the Vofs to the interpolation point |
| [in] | a_weights | Weights for the least squares system. |
| [in] | a_order | Order of the returned interpolation. |
- Returns
- Stencils for each of the derivatives specified in the input argument.
- Note
- This will throw an error if you don't have enough equations for obtaining the specified order.
-
The return map is always initialized with empty stencils. If computing the pseudoinverse fails, the returned stencils are all empty.
Compute a least squares interpolation to a specified order.
This is the general version which lets the caller specify why derivatives he wants out of the interpolation. The user specifies this via a_derivs where each IntVect represent a differentiation. E.g. IntVect(0,0,0) is just f, IntVect(1,0,0) = d/dx, IntVect(1,1,2) = (d^4)/(dx dy dz^2) and so on. The stencils for the directional derivatives are coded onto the return map. E.g. if a_derivs contains IntVect(1,0,0) the stencil for d/dx is found in map.at(IntVect(1,0,0)). The user can solve a smaller system if some of the terms in the expansion are known, typically used when computing an approximation to the gradient at a point in space where the scalar value is known. Note that this will modify the right hand side of the system, and the user will have to figure out how to make sense of the stencil.
- Parameters
-
| [in] | a_derivs | Specification of which terms to obtain from the series. |
| [in] | a_knownTerms | Which terms in the Taylor series are known, and will be eliminated from the least squares system. |
| [in] | a_allVofs | Vofs to include in the interpolation method. |
| [in] | a_displacements | Displacement vectors from the Vofs to the interpolation point |
| [in] | a_p | Weighting order for the least squares system. Must be > 0 to have an effect. |
| [in] | a_order | Order of the interpolation. |
- Returns
- Stencils for each of the derivatives specified in the input argument.
- Note
- This calls the more general version.