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);
354 const Vector<RealVect>& a_displacements,
370 const Vector<RealVect>& a_displacements,
371 const Vector<Real>& a_weights,
394 static std::map<IntVect, VoFStencil>
396 const IntVectSet& a_knownTerms,
397 const Vector<VolIndex>& a_allVofs,
398 const Vector<RealVect>& a_displacements,
423 static std::map<IntVect, VoFStencil>
425 const IntVectSet& a_knownTerms,
426 const Vector<VolIndex>& a_allVofs,
427 const Vector<RealVect>& a_displacements,
428 const Vector<Real>& a_weights,
457 template <
typename T>
458 static std::map<IntVect, std::pair<VoFStencil, VoFStencil>>
460 const IntVectSet& a_knownTerms,
461 const Vector<VolIndex>& a_fineVofs,
462 const Vector<VolIndex>& a_coarVofs,
463 const Vector<RealVect>& a_fineDisplacements,
464 const Vector<RealVect>& a_coarDisplacements,
495 template <
typename T>
496 static std::map<IntVect, std::pair<VoFStencil, VoFStencil>>
498 const IntVectSet& a_knownTerms,
499 const Vector<VolIndex>& a_fineVofs,
500 const Vector<VolIndex>& a_coarVofs,
501 const Vector<RealVect>& a_fineDisplacements,
502 const Vector<RealVect>& a_coarDisplacements,
503 const Vector<Real>& a_fineWeights,
504 const Vector<Real>& a_coarWeights,
508#include <CD_NamespaceFooter.H>
Implementation of CD_LeastSquares.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:32
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:429
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 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
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:467
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:49
static int getTaylorExpansionSize(int a_order)
Get the size of a Taylor expansion for a given order.
Definition CD_LeastSquares.cpp:420
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