当前位置: 首页>>代码示例>>C++>>正文


C++ Partition::createScalarData方法代码示例

本文整理汇总了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++)
开发者ID:xyuan,项目名称:covise,代码行数:67,代码来源:PartitionHexaUSG.cpp


注:本文中的Partition::createScalarData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。