本文整理汇总了C++中scalarField::getMesh方法的典型用法代码示例。如果您正苦于以下问题:C++ scalarField::getMesh方法的具体用法?C++ scalarField::getMesh怎么用?C++ scalarField::getMesh使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scalarField
的用法示例。
在下文中一共展示了scalarField::getMesh方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: adapt
void refinement::adapt(const scalarField& sf)
{
setNewMesh(*sf.getMesh());
point P;
double SLmax = sf.getMesh()->getMaxSL();
double SLmin = sf.getMesh()->getMinSL();
for (int i=0; i<nbXquads; i++)
{
P.X = i*h + xmin;
for (int j=0; j<nbYquads; j++)
{
P.Y = j*h + ymin;
double val = max(0.0,min(abs(sf(P.X, P.Y)),1.0));
operator()(i,j) = (1-val)*SLmax + val*SLmin;
}
}
}
示例2: interpolationConstants
int interpolationConstants(const scalarField& f, int pos, double* con, bool useInner)
{
const pointSet* mesh = f.getMesh();
const point& P = mesh->P(pos);
vector<int> neighb;
//mesh->findPossibleNeighbours(P, neighb, useInner);
for (int i=0; i<mesh->getNIDX(pos); i++)
neighb.push_back(mesh->getIDX(pos,i));
int m = neighb.size();
double rhs[m];
int mi;
double A[15*m];
double weight;
double h2 = pow((mesh->getMaxSL()+mesh->getMinSL())/2,2);
int orderFac = 15;
if (m>14)
orderFac = 15;
else if (m>9)
orderFac = 10;
else if (m>5)
orderFac = 6;
else if (m>2)
orderFac = 3;
else
throw mfpmExcept(20);
for (int i=0; i<m; i++)
{
const point& Ptmp = mesh->P(neighb[i]);
mi = orderFac*i;
weight = exp(-2.00*P.dist2(Ptmp) / h2);
A[mi+0] = weight*1.0;
A[mi+1] = weight*Ptmp.X;
A[mi+2] = weight*Ptmp.Y;
if (orderFac>3)
{
A[mi+3] = weight*Ptmp.X*Ptmp.X;
A[mi+4] = weight*Ptmp.X*Ptmp.Y;
A[mi+5] = weight*Ptmp.Y*Ptmp.Y;
}
if (orderFac>6)
{
A[mi+6] = weight*Ptmp.X*Ptmp.X*Ptmp.X;
A[mi+7] = weight*Ptmp.X*Ptmp.X*Ptmp.Y;
A[mi+8] = weight*Ptmp.X*Ptmp.Y*Ptmp.Y;
A[mi+9] = weight*Ptmp.Y*Ptmp.Y*Ptmp.Y;
}
if (orderFac>10)
{
A[mi+10] = weight*Ptmp.X*Ptmp.X*Ptmp.X*Ptmp.X;
A[mi+11] = weight*Ptmp.X*Ptmp.X*Ptmp.X*Ptmp.Y;
A[mi+12] = weight*Ptmp.X*Ptmp.X*Ptmp.Y*Ptmp.Y;
A[mi+13] = weight*Ptmp.X*Ptmp.Y*Ptmp.Y*Ptmp.Y;
A[mi+14] = weight*Ptmp.Y*Ptmp.Y*Ptmp.Y*Ptmp.Y;
}
rhs[i] = weight*f(neighb[i]);
}
int n = orderFac;
double work[m+n];
int info, workl = m+n;
int one = 1;
char TN[] = "T";
dgels_(TN, &n, &m, &one, A, &n, rhs, &m, work, &workl, &info);
for (int i=0; i<orderFac; i++)
con[i] = rhs[i];
if (orderFac == 3)
return 1;
else if (orderFac == 6)
return 2;
else if (orderFac == 10)
return 3;
else if (orderFac > 10)
return 4;
return -1;
}