11 #ifndef _DIVNORMALREFINEMENTIMPLEM_H_ 12 #define _DIVNORMALREFINEMENTIMPLEM_H_ 16 #include "NamespaceHeader.H" 23 const int& a_maxNumberOfRefinements)
25 setMaxChangeThreshold(a_maxChangeThreshold);
26 setMaxNumberOfRefinements(a_maxNumberOfRefinements);
35 const int & a_numberOfRefinements)
40 if (a_numberOfRefinements < m_maxNumberOfRefinements)
42 Real changeInNormal = approximateDivNormal(a_ccm);
45 if (changeInNormal > m_maxChangeThreshold)
60 typedef map<EdgeIndex,Real,LexLT<EdgeIndex> > EdgeIntersections;
62 Real changeInNormal = 0.0;
71 const EdgeIndex& edgeIndex = it->first;
72 const Real& intercept = it->second;
74 int varyDir = edgeIndex[0];
76 RvDim intersectPt = RvDim::Zero;
77 intersectPt[varyDir] = intercept;
79 for (
int i = 1; i <
dim; i++)
94 intersectPt[curDir] = loHi - 0.5;
100 RvDim intersectPtNormal;
101 for (
int idir = 0; idir <
dim; idir++)
110 Real dotProduct = 0.0;
111 for (
int idir = 0; idir <
dim; idir++)
113 dotProduct += intersectPtNormal[idir]*normal[idir];
116 if (
Abs(dotProduct - 1.0) > changeInNormal)
118 changeInNormal =
Abs(dotProduct -1.0);
121 return changeInNormal;
126 if (a_maxChangeThreshold < 0)
128 MayDay::Abort(
"DivNormalRefinement<dim>::setMaxChangeThreshold - maxChangeThreshold must be >= 0");
131 m_maxChangeThreshold = a_maxChangeThreshold;
136 return m_maxChangeThreshold;
141 if (a_maxNumberOfRefinements < 0)
143 MayDay::Abort(
"DivNormalRefinement<dim>::setMaxNumberOfRefinements - maxNumberOfRefinents must be >= 0");
146 m_maxNumberOfRefinements = a_maxNumberOfRefinements;
151 return m_maxNumberOfRefinements;
154 #include "NamespaceFooter.H" NormalDerivatives m_normalDerivatives
Definition: IFData.H:61
virtual bool doRefine(IndexTM< int, dim > &a_refineInDir, const CutCellMoments< dim > &a_ccm, const int &a_numberOfRefinements)
Definition: DivNormalRefinementImplem.H:33
virtual ~DivNormalRefinement()
Destructor.
Definition: DivNormalRefinementImplem.H:29
virtual Real evaluate(const IvDim &a_multiIndex, const int &a_direction, const RvDim &a_point, const IFSlicer< dim > *a_ifSlicer)
Evaluate derivatives of the normal of an IFSlicer class.
Definition: NormalDerivativeImplem.H:27
This computes the derivatives of the normal of a sliced implicit function.
Definition: NormalDerivative.H:25
IFSlicer< dim > * m_function
Definition: IFData.H:53
IFData< dim > m_IFData
Definition: CutCellMoments.H:147
CoordinateSystem< dim > m_globalCoord
Definition: IFData.H:55
virtual Real approximateDivNormal(const CutCellMoments< dim > &a_ccm)
Definition: DivNormalRefinementImplem.H:55
double Real
Definition: REAL.H:33
T Abs(const T &a_a)
Definition: Misc.H:53
virtual void setMaxNumberOfRefinements(const int &a_maxNumberOfRefinements)
Definition: DivNormalRefinementImplem.H:139
virtual Real getMaxChangeThreshold()
Get threshold.
Definition: DivNormalRefinementImplem.H:134
CoordinateSystem< dim > m_cellCenterCoord
Definition: IFData.H:56
DivNormalRefinement()
Null constructor.
Definition: DivNormalRefinementImplem.H:18
virtual void setMaxChangeThreshold(const Real &a_maxChangeThreshold)
Definition: DivNormalRefinementImplem.H:124
EdgeIntersections m_intersections
Definition: IFData.H:52
virtual int getMaxNumberOfRefinements()
Get threshold.
Definition: DivNormalRefinementImplem.H:149
int dim
Definition: EBInterface.H:146
Definition: CutCellMoments.H:32
static void Abort(const char *const a_msg=m_nullString)
Print out message to cerr and exit via abort() (if serial) or MPI_Abort() (if parallel).