本文整理汇总了C++中Partition::createScalarData方法的典型用法代码示例。如果您正苦于以下问题:C++ Partition::createScalarData方法的具体用法?C++ Partition::createScalarData怎么用?C++ Partition::createScalarData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Partition
的用法示例。
在下文中一共展示了Partition::createScalarData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: compute
//.........这里部分代码省略.........
vectorDataObject[index]->getAddresses(&vectorDataU[index],
&vectorDataV[index],
&vectorDataW[index]);
if (numElem == vectorDataObject[index]->getNumPoints())
vectorDataBinding[index] = PER_ELEMENT;
else if (vectorDataObject[index]->getNumPoints() == numCoord)
vectorDataBinding[index] = PER_VERTEX;
else
vectorDataBinding[index] = NONE;
}
}
const char *gridName = p_gridOut->getObjName();
const char *scalarDataName[DATA_PORTS];
const char *vectorDataName[DATA_PORTS];
for (int numData = 0; numData < DATA_PORTS; numData++)
{
scalarDataName[numData] = p_scalarOut[numData]->getObjName();
vectorDataName[numData] = p_vectorOut[numData]->getObjName();
}
// create USG and data partitions
char buf[128];
for (int index = 0; index < nparts; index++)
{
Partition *p = partitions[index];
snprintf(buf, 128, "%s_%d", gridName, index);
p->createUSG(buf);
for (int numData = 0; numData < DATA_PORTS; numData++)
{
snprintf(buf, 128, "%s_%d", scalarDataName[numData], index);
p->createScalarData(numData, buf, scalarDataBinding[numData]);
snprintf(buf, 128, "%s_%d", vectorDataName[numData], index);
p->createVectorData(numData, buf, vectorDataBinding[numData]);
}
}
// set elements in the COVISE objects
// according to the partitions of the METIS mesh (epart)
int *curElem = new int[nparts]; // current USG element per part
int *curCoords = new int[nparts]; // current USG coord per part
memset(curElem, 0, nparts * sizeof(int));
memset(curCoords, 0, nparts * sizeof(int));
for (int index = 0; index < numElem; index++)
{
int part = epart[index];
Partition *p = partitions[part];
p->elem[curElem[part]] = curElem[part] * 8;
p->type[curElem[part]] = TYPE_HEXAEDER;
// if there are per-element data elements, insert them
for (int numData = 0; numData < DATA_PORTS; numData++)
{
if (scalarDataBinding[numData] == PER_ELEMENT)
p->setScalarData(numData, curElem[part],
scalarData[numData][index]);
if (vectorDataBinding[numData] == PER_ELEMENT)
p->setVectorData(numData, curElem[part],
vectorDataU[numData][index],
vectorDataV[numData][index],
vectorDataW[numData][index]);
}
for (int c = 0; c < 8; c++)