12 #ifndef CD_LeastSquares_H
13 #define CD_LeastSquares_H
18 #include <IntVectSet.H>
25 #include <CD_NamespaceHeader.H>
64 const VolIndex& a_startVof,
65 const EBISBox& a_ebisbox,
70 const bool a_addStartingVof);
89 const EBISBox& a_ebisbox,
94 const IntVectSet a_knownTerms = IntVectSet());
113 const EBISBox& a_ebisbox,
118 const IntVectSet a_knownTerms = IntVectSet());
138 const EBISBox& a_ebisbox,
143 const bool a_addStartingVof);
152 sumWeights(
const VoFStencil& a_stencil,
const int a_variable);
170 projectGradSten(
const VoFStencil& a_stencil,
const RealVect& a_projection);
185 const VolIndex& a_fromVof,
186 const VolIndex& a_toVof,
187 const EBISBox& a_ebisbox,
203 const FaceIndex& a_fromFace,
204 const VolIndex& a_toVof,
205 const EBISBox& a_ebisbox,
223 const VolIndex& a_fromVof,
224 const VolIndex& a_toVof,
225 const EBISBox& a_ebisboxFrom,
226 const EBISBox& a_ebisboxTo,
227 const Real& a_dxFrom,
239 static Vector<RealVect>
242 const VolIndex& a_fromVof,
243 const Vector<VolIndex>& a_toVofs,
244 const EBISBox& a_ebisbox,
256 static Vector<RealVect>
259 const FaceIndex& a_fromFace,
260 const Vector<VolIndex>& a_toVofs,
261 const EBISBox& a_ebisbox,
270 inline static Vector<Real>
271 makeDiagWeights(
const Vector<RealVect>& a_displacements,
const int a_pow);
285 const Vector<RealVect>& a_displacements,
288 const IntVectSet a_knownTerms);
303 const Vector<RealVect>& a_displacements,
304 const Vector<Real>& a_weights,
306 const IntVectSet a_knownTerms);
327 const Vector<RealVect>& a_displacements,
343 const Vector<RealVect>& a_displacements,
344 const Vector<Real>& a_weights,
365 static std::map<IntVect, VoFStencil>
367 const IntVectSet& a_knownTerms,
368 const Vector<VolIndex>& a_allVofs,
369 const Vector<RealVect>& a_displacements,
392 static std::map<IntVect, VoFStencil>
394 const IntVectSet& a_knownTerms,
395 const Vector<VolIndex>& a_allVofs,
396 const Vector<RealVect>& a_displacements,
397 const Vector<Real>& a_weights,
423 template <
typename T>
424 static std::map<IntVect, std::pair<VoFStencil, VoFStencil>>
426 const IntVectSet& a_knownTerms,
427 const Vector<VolIndex>& a_fineVofs,
428 const Vector<VolIndex>& a_coarVofs,
429 const Vector<RealVect>& a_fineDisplacements,
430 const Vector<RealVect>& a_coarDisplacements,
458 template <
typename T>
459 static std::map<IntVect, std::pair<VoFStencil, VoFStencil>>
461 const IntVectSet& a_knownTerms,
462 const Vector<VolIndex>& a_fineVofs,
463 const Vector<VolIndex>& a_coarVofs,
464 const Vector<RealVect>& a_fineDisplacements,
465 const Vector<RealVect>& a_coarDisplacements,
466 const Vector<Real>& a_fineWeights,
467 const Vector<Real>& a_coarWeights,
471 #include <CD_NamespaceFooter.H>
473 #include <CD_LeastSquaresImplem.H>
Declaration of cell positions.
Various functions for getting Vofs near cut-cells.
Static class containing useful routines for (weighted) least squares polynomial reconstruction.
Definition: CD_LeastSquares.H:31
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 int a_p, const int a_order)
Compute a least squares interpolation to a specified order. This version separates the stencils into ...
Definition: CD_LeastSquaresImplem.H:41
static Vector< RealVect > getDisplacements(const CellLocation a_from, const 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,...
Definition: CD_LeastSquares.cpp:278
static RealVect displacement(const CellLocation a_from, const 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.
Definition: CD_LeastSquares.cpp:232
static int getTaylorExpansionSize(const int a_order)
Get the size of a Taylor expansion for a given order.
Definition: CD_LeastSquares.cpp:416
static VoFStencil computeInterpolationStencil(const Vector< VolIndex > &a_allVofs, const Vector< RealVect > &a_displacements, const int a_pow, const int a_order)
Compute an interpolation stencil to specified order by solving a least squares system.
Definition: CD_LeastSquares.cpp:425
static VoFStencil computeGradSten(const Vector< VolIndex > &a_allVofs, const Vector< RealVect > &a_displacements, const int a_p, const int a_order, const IntVectSet a_knownTerms)
Get a least squares gradient stencil solution for computing the gradient at a point....
Definition: CD_LeastSquares.cpp:317
static VoFStencil getGradSten(const VolIndex &a_vof, const CellLocation a_gradLocation, const CellLocation a_cellLocation, const EBISBox &a_ebisbox, const Real a_dx, const int a_radius, const int a_p, const int a_order, const IntVectSet a_knownTerms=IntVectSet())
Compute a least squares gradient stencil in a cell.
Definition: CD_LeastSquares.cpp:57
static Real sumAllWeights(const VoFStencil &a_stencil)
Compute the sum of all weights in a stencil.
Definition: CD_LeastSquares.cpp:404
static Real sumWeights(const VoFStencil &a_stencil, const int a_variable)
Return the sum of weights in the stencil, for a specific variable.
Definition: CD_LeastSquares.cpp:388
static VoFStencil getInterpolationStencil(const CellLocation a_cellPos, const CellLocation a_otherCellsPos, const Connectivity a_connectivity, const VolIndex &a_startVof, const EBISBox &a_ebisbox, const Real a_dx, const int a_p, const int a_radius, const int a_order, const bool a_addStartingVof)
Get an interpolation stencil to a point in a cell with a specified order and radius.
Definition: CD_LeastSquares.cpp:19
static VoFStencil projectGradSten(const VoFStencil &a_stencil, const RealVect &a_projection)
Assuming that a_stencil is a gradient stencil, project it along a direction.
Definition: CD_LeastSquares.cpp:370
~LeastSquares()=delete
Static class, no destruction here.
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 int a_p, const int a_order)
Compute a least squares interpolation to a specified order.
Definition: CD_LeastSquares.cpp:463
LeastSquares()=delete
Static class, no construction here.
static VoFStencil getBndryGradSten(const VolIndex &a_vof, const Neighborhood a_neighborhood, const CellLocation a_cellPositions, const EBISBox &a_ebisbox, const Real a_dx, const int a_radius, const int a_p, const int a_order, const bool a_addStartingVof)
Compute a least squares gradient stencil on the EB centroid with specified order.
Definition: CD_LeastSquares.cpp:153
static Vector< Real > makeDiagWeights(const Vector< RealVect > &a_displacements, const int a_pow)
Create a list of weights. This routine returns a list of diagonal weights for a least squares system....
Definition: CD_LeastSquaresImplem.H:22
Neighborhood
Neighborhood type.
Definition: CD_VofUtils.H:55
Connectivity
Class for specifying connectivity of Vofs.
Definition: CD_VofUtils.H:42
Cell
Enum for distinguishing between cell locations.
Definition: CD_Location.H:30
Face
Enum for distinguishing between face locations.
Definition: CD_Location.H:40