11 #ifndef _NORMALDERIVATIVEIMPLEM_H_ 12 #define _NORMALDERIVATIVEIMPLEM_H_ 14 #include "NamespaceHeader.H" 28 const int & a_direction,
29 const RvDim & a_point,
35 gradientComponent[BASISV_TM<int,dim>(a_direction)] = 1;
40 int magnitudeOfGradientPower = 1;
42 magnitudeOfGradientPower);
45 m_magnitudeOfGradient = 0.0;
47 for (
int idir = 0; idir <
dim; idir++)
49 Real firstPartial = a_implicitFunction->
value(BASISV_TM<int,dim>(idir),a_point);
50 m_magnitudeOfGradient += firstPartial*firstPartial;
53 m_magnitudeOfGradient = sqrt(m_magnitudeOfGradient);
55 Real value = expand(a_multiIndex,
66 return m_magnitudeOfGradient;
79 const RvDim & a_point,
85 for (firstNonZero = 0; firstNonZero <
dim; firstNonZero++)
87 if (a_multiIndex[firstNonZero] != 0)
94 if (firstNonZero == dim)
102 for (
typename DerivativeProduct::const_iterator it=curDerivativeProduct.begin();
103 it != curDerivativeProduct.end();
106 const IvDim& curMultiIndex = it->first;
107 const int& curExponent = it->second;
110 Real curValue = pow(a_implicitFunction->
value(curMultiIndex,a_point),curExponent);
115 if (m_magnitudeOfGradient != 0.0)
118 int curExponent = a_term.second;
119 value /= pow(m_magnitudeOfGradient,curExponent);
128 IvDim curPartialDerivative = BASISV_TM<int,dim>(firstNonZero);
131 IvDim reducedMultiIndex = a_multiIndex;
132 reducedMultiIndex[firstNonZero]--;
137 int curExponentOfMagnitudeOfGradient = a_term.second;
140 for (
typename DerivativeProduct::const_iterator it=curDerivativeProduct.begin();
141 it != curDerivativeProduct.end();
145 const IvDim& curMultiIndex = it->first;
146 const int& curExponent = it->second;
154 Real multiplier = curExponent;
156 if (curExponent == 1)
159 newDerivativeProduct.erase(curMultiIndex);
164 newDerivativeProduct[curMultiIndex] -= 1;
168 IvDim newMultiIndex = curMultiIndex;
169 newMultiIndex += curPartialDerivative;
172 newDerivativeProduct[newMultiIndex] += 1;
176 curExponentOfMagnitudeOfGradient);
179 Real curValue = multiplier * expand(reducedMultiIndex,
193 for (
int idir = 0; idir <
dim; idir++)
199 IvDim firstPartial = BASISV_TM<int,dim>(idir);
200 IvDim secondPartial = firstPartial + curPartialDerivative;
203 newDerivativeProduct[firstPartial] += 1;
204 newDerivativeProduct[secondPartial] += 1;
207 int newExponentOfMagnitudeOfGradient = curExponentOfMagnitudeOfGradient + 2;
210 Real multiplier = -curExponentOfMagnitudeOfGradient;
214 newExponentOfMagnitudeOfGradient);
217 Real curValue = multiplier * expand(reducedMultiIndex,
230 #include "NamespaceFooter.H" 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
pair< DerivativeProduct, int > PartialDerivativeTerm
Definition: NormalDerivative.H:46
NormalDerivative()
Null constructor.
Definition: NormalDerivativeImplem.H:17
double Real
Definition: REAL.H:33
virtual ~NormalDerivative()
Destructor.
Definition: NormalDerivativeImplem.H:22
Definition: IFSlicer.H:27
virtual Real value(const IndexTM< int, dim > &a_partialDerivative, const IndexTM< Real, dim > &a_point) const
Return the partial derivative evaluated at a_point.
Definition: IFSlicerImplem.H:60
Real getMagnitudeOfGradient()
Definition: NormalDerivativeImplem.H:64
map< IvDim, int, LexLT< IvDim > > DerivativeProduct
Definition: NormalDerivative.H:37
Real expand(const IvDim &a_multiIndex, const PartialDerivativeTerm &a_term, const RvDim &a_point, const IFSlicer< dim > *a_ifSlicer) const
Definition: NormalDerivativeImplem.H:77
int dim
Definition: EBInterface.H:146