11 #ifndef _MINIMALCCCMIMPLEM_H_ 12 #define _MINIMALCCCMIMPLEM_H_ 27 #include "NamespaceHeader.H" 36 :m_cutCellMoments(a_MinimalCCCM.m_cutCellMoments)
46 for (
int hilo = 0; hilo < 2; ++hilo)
48 for (
int idir = 0; idir <
dim; ++idir)
64 if (reducedInfo.m_allVerticesOn)
80 const int & a_degreePmax)
83 int zerothOrderOfAccuracy = 0;
84 int highestDegree = a_orderPmax + a_degreePmax;
87 for (
int i = 0; i < 3; i++)
92 for (
int i = 0; i <= highestDegree; i++)
109 for (
typename PthMoment::const_iterator it = copyMoments.begin();
110 it != copyMoments.end(); ++it)
112 IvDim mono = it->first;
117 for (
typename PthMoment::const_iterator it = copyEBMoments.begin(); it != copyEBMoments.end(); ++it)
119 IvDim mono = it->first;
128 it->second.changeMomentCoordinatesToCellCenter();
133 const int & a_degreePmax)
135 CH_TIME(
"computemomentsRecursively");
143 for (
int iOrder = 0; iOrder <= a_orderPmax; ++iOrder)
149 for (
typename PthMomentLoc::const_iterator it = monDegreeP.begin(); it != monDegreeP.end(); ++it)
155 for (
typename PthMomentLoc::const_iterator it = monDegreePLess1.begin(); it != monDegreePLess1.end(); ++it)
163 for (
int iOrder = 0; iOrder <= a_orderPmax; ++iOrder)
169 for (
typename PthMomentLoc::const_iterator it = monDegreeP.begin(); it != monDegreeP.end(); ++it)
175 for (
typename PthMomentLoc::const_iterator it = monDegreePLess1.begin(); it != monDegreePLess1.end(); ++it)
190 subProblem.computeMoments(a_orderPmax,a_degreePmax+1);
191 it->second = subProblem.m_cutCellMoments;
207 pout() <<
"Geometry generation least squares problem failed with residual:" 210 pout () <<
"Problem occurred generating geometry for these cut cell moments: " <<
m_cutCellMoments << endl;
217 for (
typename PthMomentLoc::const_iterator it = monDegreePLess1.begin();
218 it != monDegreePLess1.end(); ++it)
224 for (
typename PthMomentLoc::const_iterator it = monDegreeP.begin(); it != monDegreeP.end(); ++it)
231 if (a_degreePmax > 0)
239 const int & a_orderPmax)
249 for (
typename LocPthMoment::const_iterator it = locMap.begin(); it != locMap.end(); ++it)
252 IvDim mono = it->second;
258 for (
int idir = 0; idir <
dim; ++idir)
262 for (
int jdir = 0; jdir <
dim; ++jdir)
266 mono1Less[jdir] = mono[jdir];
268 else if (jdir > idir)
270 mono1Less[jdir-1] = mono[jdir];
282 int exponent = it->second[idir];
295 Real loFactor =
POW(loSideValue,exponent);
296 Real hiFactor =
POW(hiSideValue,exponent);
298 rhs[(dim*jth) + idir] = hiMom*hiFactor - loMom*loFactor;
301 for (
int order = 1; order <= a_orderPmax; order++)
307 for (
int i = 0; i < taylorMonomials.
size(); i++)
309 const IvDim & taylorMonomial = taylorMonomials[i];
311 IvDim totalMonomial = mono + taylorMonomial;
321 rhs[(dim*jth) + idir] += normalDerivative * moment / fact;
325 MayDay::Error(
"Unable to find needed monomial for Taylor series");
348 if (
this != &a_MinimalCCCM)
357 a_MinimalCCCM.
print(a_out);
365 for (
int i = 0; i <
dim; i++)
367 for (
int j = 2; j <= a_multiIndex[i]; j++)
376 #include "NamespaceFooter.H" std::ostream & pout()
Use this in place of std::cout for program output.
map< int, IvDim > LocPthMoment
Definition: MinimalCCCM.H:42
#define BDID_HILO
Definition: Notation.H:89
void dump() const
Definition: MinimalCCCMImplem.H:339
void print(ostream &a_out) const
Definition: LSProblemImplem.H:560
MinimalCCCM()
Definition: MinimalCCCMImplem.H:30
#define CH_assert(cond)
Definition: CHArray.H:37
#define LARGEREALVAL
Definition: Notation.H:77
CutCellMoments< dim > m_cutCellMoments
Definition: MinimalCCCM.H:78
Definition: MinimalCCCM.H:31
Real getUnknown(int loc)
Definition: LSProblem.H:104
Definition: ComputeCutCellMoments.H:35
Real POW(const Real &a_x, const int &a_p)
computes x^p
Definition: Factorial.H:33
ostream & operator<<(ostream &a_out, const MinimalCCCM< dim > &a_MinimalCCCM)
Definition: MinimalCCCMImplem.H:354
Real factorial(const IvDim &a_multiIndex) const
Definition: MinimalCCCMImplem.H:361
bool m_boundaryMomentsComputed
Definition: MinimalCCCM.H:81
map< IvDim, Real > PthMoment
Definition: MinimalCCCM.H:37
Vector< Real > computeRhs(LSProblem< dim > &a_lsp, const int &a_order)
Definition: MinimalCCCMImplem.H:238
#define CH_TIME(name)
Definition: CH_Timer.H:82
const PthMomentLoc & getMonomialLocMapDegreeP() const
Definition: LSProblem.H:94
const PthMomentLoc & getMonomialLocMapDegreePLess1() const
Definition: LSProblem.H:99
#define BDID_DIR
Definition: Notation.H:88
void operator=(const MinimalCCCM< dim > &a_MinimalCCCM)
Definition: MinimalCCCMImplem.H:345
double Real
Definition: REAL.H:33
int invertNormalEq(const Vector< Real > &a_rhs, Vector< Real > &a_residual)
Definition: LSProblemImplem.H:317
size_t size() const
Definition: Vector.H:192
static void Error(const char *const a_msg=m_nullString, int m_exitCode=CH_DEFAULT_ERROR_CODE)
Print out message to cerr and exit with the specified exit code.
const LocPthMoment & getLocMonomialMapDegreeP() const
Definition: LSProblem.H:89
void print(ostream &out) const
Definition: MinimalCCCMImplem.H:334
int getNumberDegP()
Definition: LSProblem.H:109
void computeMoments(const int &a_orderPmax, const int &a_degreePmax)
Definition: MinimalCCCMImplem.H:79
int m_maxOrder
Definition: IFData.H:67
~MinimalCCCM()
Definition: MinimalCCCMImplem.H:73
void generateMultiIndices(Vector< IndexTM< int, dim > > &a_indices, const int &a_magnitude)
Definition: MultiIndexImplem.H:18
int dim
Definition: EBInterface.H:146
map< IvDim, int > PthMomentLoc
Definition: MinimalCCCM.H:43
Definition: CutCellMoments.H:32
void computeMomentsRecursively(const int &a_orderPmax, const int &a_degreePmax)
Definition: MinimalCCCMImplem.H:132