13#ifndef CD_LEASTSQUARES_H
14#define CD_LEASTSQUARES_H
19#include <IntVectSet.H>
26#include <CD_NamespaceHeader.H>
72 const VolIndex& a_startVof,
73 const EBISBox& a_ebisbox,
78 bool a_addStartingVof);
99 const EBISBox& a_ebisbox,
104 const IntVectSet& a_knownTerms = IntVectSet());
125 const EBISBox& a_ebisbox,
130 const IntVectSet& a_knownTerms = IntVectSet());
153 const EBISBox& a_ebisbox,
158 bool a_addStartingVof);
167 sumWeights(
const VoFStencil& a_stencil,
int a_variable);
185 projectGradSten(
const VoFStencil& a_stencil,
const RealVect& a_projection);
200 const VolIndex& a_fromVof,
201 const VolIndex& a_toVof,
202 const EBISBox& a_ebisbox,
218 const FaceIndex& a_fromFace,
219 const VolIndex& a_toVof,
220 const EBISBox& a_ebisbox,
238 const VolIndex& a_fromVof,
239 const VolIndex& a_toVof,
240 const EBISBox& a_ebisboxFrom,
241 const EBISBox& a_ebisboxTo,
242 const Real& a_dxFrom,
256 static Vector<RealVect>
259 const VolIndex& a_fromVof,
260 const Vector<VolIndex>& a_toVofs,
261 const EBISBox& a_ebisbox,
275 static Vector<RealVect>
278 const FaceIndex& a_fromFace,
279 const Vector<VolIndex>& a_toVofs,
280 const EBISBox& a_ebisbox,
290 inline static Vector<Real>
307 const Vector<RealVect>& a_displacements,
310 const IntVectSet& a_knownTerms);
330 const Vector<RealVect>& a_displacements,
331 const Vector<Real>& a_weights,
333 const IntVectSet& a_knownTerms);
364 const Vector<RealVect>& a_displacements,
380 const Vector<RealVect>& a_displacements,
381 const Vector<Real>& a_weights,
404 static std::map<IntVect, VoFStencil>
406 const IntVectSet& a_knownTerms,
407 const Vector<VolIndex>& a_allVofs,
408 const Vector<RealVect>& a_displacements,
434 static std::map<IntVect, VoFStencil>
436 const IntVectSet& a_knownTerms,
437 const Vector<VolIndex>& a_allVofs,
438 const Vector<RealVect>& a_displacements,
439 const Vector<Real>& a_weights,
469 template <
typename T>
470 static std::map<IntVect, std::pair<VoFStencil, VoFStencil>>
472 const IntVectSet& a_knownTerms,
473 const Vector<VolIndex>& a_fineVofs,
474 const Vector<VolIndex>& a_coarVofs,
475 const Vector<RealVect>& a_fineDisplacements,
476 const Vector<RealVect>& a_coarDisplacements,
508 template <
typename T>
509 static std::map<IntVect, std::pair<VoFStencil, VoFStencil>>
511 const IntVectSet& a_knownTerms,
512 const Vector<VolIndex>& a_fineVofs,
513 const Vector<VolIndex>& a_coarVofs,
514 const Vector<RealVect>& a_fineDisplacements,
515 const Vector<RealVect>& a_coarDisplacements,
516 const Vector<Real>& a_fineWeights,
517 const Vector<Real>& a_coarWeights,
521#include <CD_NamespaceFooter.H>
Implementation of CD_LeastSquares.H.
Declaration of cell positions.
Various functions for getting Vofs near cut-cells.
Location::Face FaceLocation
Face type alias.
Definition CD_LeastSquares.H:47
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....
Definition CD_LeastSquares.cpp:321
static Real sumWeights(const VoFStencil &a_stencil, int a_variable)
Return the sum of weights in the stencil, for a specific variable.
Definition CD_LeastSquares.cpp:392
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.
Definition CD_LeastSquares.cpp:441
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....
Definition CD_LeastSquaresImplem.H:23
static Real getLengthScale(const Vector< RealVect > &a_displacements) noexcept
Get the length scale that the least squares systems are built in.
Definition CD_LeastSquares.cpp:420
VofUtils::Neighborhood Neighborhood
Neighborhood type alias.
Definition CD_LeastSquares.H:51
static Real sumAllWeights(const VoFStencil &a_stencil)
Compute the sum of all weights in a stencil.
Definition CD_LeastSquares.cpp:408
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.
Definition CD_LeastSquares.cpp:157
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,...
Definition CD_LeastSquares.cpp:282
VofUtils::Connectivity Connectivity
Connectivity type alias.
Definition CD_LeastSquares.H:49
Location::Cell CellLocation
Cell type alias.
Definition CD_LeastSquares.H:45
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:374
~LeastSquares()=delete
Static class, no destruction here.
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.
Definition CD_LeastSquares.cpp:236
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.
Definition CD_LeastSquares.cpp:479
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.
Definition CD_LeastSquares.cpp:20
LeastSquares()=delete
Static class, no construction here.
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.
Definition CD_LeastSquares.cpp:58
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 ...
Definition CD_LeastSquaresImplem.H:46
static int getTaylorExpansionSize(int a_order)
Get the size of a Taylor expansion for a given order.
Definition CD_LeastSquares.cpp:432
Neighborhood
Neighborhood type.
Definition CD_VofUtils.H:57
Connectivity
Class for specifying connectivity of Vofs.
Definition CD_VofUtils.H:44
Cell
Enum for distinguishing between cell locations.
Definition CD_Location.H:31
Face
Enum for distinguishing between face locations.
Definition CD_Location.H:41