本文整理汇总了C++中fei::SharedPtr::getSharedIDs方法的典型用法代码示例。如果您正苦于以下问题:C++ SharedPtr::getSharedIDs方法的具体用法?C++ SharedPtr::getSharedIDs怎么用?C++ SharedPtr::getSharedIDs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fei::SharedPtr
的用法示例。
在下文中一共展示了SharedPtr::getSharedIDs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setFEVector
fei::Vector_Impl<T>::Vector_Impl(fei::SharedPtr<fei::VectorSpace> vecSpace,
T* vector, int numLocalEqns,
bool isSolutionVector,
bool deleteVector)
: Vector_core(vecSpace, numLocalEqns),
vector_(vector),
isSolution_(isSolutionVector),
deleteVector_(deleteVector),
localProc_(0),
numProcs_(1),
dbgprefix_("VecImpl: ")
{
if (strcmp(snl_fei::FEVectorTraits<T>::typeName(), "unsupported")) {
setFEVector(true);
}
else {
setFEVector(false);
}
localProc_ = fei::localProc(vecSpace->getCommunicator());
numProcs_ = fei::numProcs(vecSpace->getCommunicator());
if (output_level_ >= fei::BRIEF_LOGS && output_stream_ != NULL) {
FEI_OSTREAM& os = *output_stream_;
os << dbgprefix_<<" ctor, numLocalEqns="<<numLocalEqns
<<", typeName: "<<typeName()<<FEI_ENDL;
}
std::vector<int> idTypes;
vecSpace->getIDTypes(idTypes);
std::vector<int> eqns;
std::vector<double> zeros;
for(size_t i=0; i<idTypes.size(); ++i) {
int idType = idTypes[i];
fei::SharedIDs<int>& sharedIDs = vecSpace->getSharedIDs(idType);
const fei::SharedIDs<int>::map_type& idMap = sharedIDs.getSharedIDs();
fei::SharedIDs<int>::map_type::const_iterator
iter = idMap.begin(), iterEnd = idMap.end();
for(; iter!=iterEnd; ++iter) {
int ID = iter->first;
int eqn;
vecSpace->getGlobalIndex(idType, ID, eqn);
int ndof = vecSpace->getNumDegreesOfFreedom(idType, ID);
eqns.resize(ndof);
zeros.resize(ndof, 0.0);
for(int j=0; j<ndof; ++j) eqns[j] = eqn+j;
if (!isSolutionVector) {
sumIn(ndof, &eqns[0], &zeros[0]);
}
else {
copyIn(ndof, &eqns[0], &zeros[0]);
}
}
}
setCommSizes();
std::vector<CSVec*>& remoteVecs = remotelyOwned();
for(size_t i=0; i<remoteVecs.size(); ++i) {
remoteVecs[i]->clear();
}
}