9 #include "fei_sstream.hpp"
10 #include "fei_fstream.hpp"
12 #include "fei_utils.hpp"
14 #include "fei_TemplateUtils.hpp"
15 #include "fei_chk_mpi.hpp"
16 #include <fei_CommUtils.hpp>
17 #include <fei_set_shared_ids.hpp>
18 #include "snl_fei_Utils.hpp"
19 #include "fei_Record.hpp"
20 #include "snl_fei_RecordCollection.hpp"
21 #include "fei_ParameterSet.hpp"
22 #include "snl_fei_RecordMsgHandler.hpp"
23 #include "fei_SharedIDs.hpp"
24 #include "fei_Pattern.hpp"
25 #include "fei_VectorSpace.hpp"
26 #include "fei_FieldMask.hpp"
27 #include "snl_fei_PointBlockMap.hpp"
28 #include "fei_LogManager.hpp"
31 #define fei_file "fei_VectorSpace.cpp"
32 #include "fei_ErrMacros.hpp"
35 class RecordAttributeCounter :
public Record_Operator<int> {
37 RecordAttributeCounter(
int proc)
40 numLocallyOwnedIDs_(0),
41 numRemoteSharedDOF_(0),
45 virtual ~RecordAttributeCounter(){}
57 ++numLocallyOwnedIDs_;
64 numLocalDOF_ += numDOF;
69 int numLocallyOwnedIDs_;
70 int numRemoteSharedDOF_;
76 class BlkIndexAccessor :
public Record_Operator<int> {
80 int* globalBlkIndices,
84 lenBlkIndices_(lenBlkIndices),
85 globalBlkIndices_(globalBlkIndices),
90 BlkIndexAccessor(
int lenBlkIndices,
91 int* globalBlkIndices,
95 lenBlkIndices_(lenBlkIndices),
96 globalBlkIndices_(globalBlkIndices),
104 if (owner != proc_ && proc_ > -1) {
111 if (numBlkIndices_ < lenBlkIndices_) {
112 globalBlkIndices_[numBlkIndices_] = record.
getNumber();
113 blkSizes_[numBlkIndices_] = blkSize;
124 int* globalBlkIndices_;
131 fei::VectorSpace::Factory::createVectorSpace(MPI_Comm comm,
145 recordCollections_(),
149 sharedRecordsSynchronized_(true),
153 simpleProblem_(false),
154 firstLocalOffset_(-1),
155 lastLocalOffset_(-1),
158 initCompleteAlreadyCalled_(false),
160 dbgprefix_(
"VecSpc: "),
161 checkSharedIDs_(false)
174 globalOffsets_.assign(numProcs+1, 0);
175 globalIDOffsets_.assign(numProcs+1, 0);
183 int i, len = fieldMasks_.size();
184 for(i=0; i<len; ++i)
delete fieldMasks_[i];
186 len = recordCollections_.size();
187 for(i=0; i<len; ++i)
delete recordCollections_[i];
189 std::map<int,fei::comm_map*>::iterator
190 o_iter = ownerPatterns_.begin(), o_end = ownerPatterns_.end();
191 for(; o_iter != o_end; ++o_iter) {
192 delete o_iter->second;
195 std::map<int,fei::comm_map*>::iterator
196 s_iter = sharerPatterns_.begin(), s_end = sharerPatterns_.end();
197 for(; s_iter != s_end; ++s_iter) {
198 delete s_iter->second;
216 param->
getType() : fei::Param::BAD_TYPE;
217 if (ptype == fei::Param::STRING) {
221 param = paramset.
get(
"FEI_OUTPUT_LEVEL");
222 ptype = param != NULL ? param->
getType() : fei::Param::BAD_TYPE;
223 if (ptype == fei::Param::STRING) {
229 param = paramset.
get(
"FEI_LOG_EQN");
230 ptype = param != NULL ? param->
getType() : fei::Param::BAD_TYPE;
231 if (ptype == fei::Param::INT) {
235 param = paramset.
get(
"FEI_LOG_ID");
236 ptype = param != NULL ? param->
getType() : fei::Param::BAD_TYPE;
237 if (ptype == fei::Param::INT) {
241 param = paramset.
get(
"FEI_CHECK_SHARED_IDS");
242 ptype = param != NULL ? param->
getType() : fei::Param::BAD_TYPE;
243 if (ptype != fei::Param::BAD_TYPE) {
244 if (ptype == fei::Param::BOOL) {
247 else if (ptype == fei::Param::INT) {
248 checkSharedIDs_ = param->
getIntValue() > 0 ?
true :
false;
251 checkSharedIDs_ =
true;
255 checkSharedIDs_ =
false;
262 const int* fieldSizes,
263 const int* fieldTypes)
265 if (output_level_ >= fei::BRIEF_LOGS && output_stream_ != NULL) {
266 FEI_OSTREAM& os = *output_stream_;
267 os << dbgprefix_<<
"defineFields ";
268 for(
int j=0; j<numFields; ++j) {
269 os <<
"{"<<fieldIDs[j] <<
"," << fieldSizes[j] <<
"} ";
274 for (
int i=0; i<numFields; ++i) {
275 fieldDatabase_.insert(std::pair<int,unsigned>(fieldIDs[i], fieldSizes[i]));
276 if (fieldIDs[i] >= 0) {
277 if (fieldTypes != NULL) {
278 fieldDofMap_.add_field(fieldIDs[i], fieldSizes[i], fieldTypes[i]);
281 fieldDofMap_.add_field(fieldIDs[i], fieldSizes[i]);
291 if (output_level_ >= fei::BRIEF_LOGS && output_stream_ != NULL) {
292 FEI_OSTREAM& os = *output_stream_;
293 os << dbgprefix_<<
"defineIDTypes {";
294 for(
int j=0; j<numIDTypes; ++j) {
295 os << idTypes[j] <<
" ";
301 for (
int i=0; i<numIDTypes; ++i) {
311 void fei::VectorSpace::setIDMap(
int idType,
312 const int* localIDs_begin,
const int* localIDs_end,
313 const int* globalIDs_begin,
const int* globalIDs_end)
317 throw std::runtime_error(
"fei::VectorSpace::setIDMap ERROR, idType not found.");
320 recordCollections_[idx]->setIDMap(localIDs_begin, localIDs_end,
321 globalIDs_begin, globalIDs_end);
330 if (output_level_ > fei::BRIEF_LOGS && output_stream_ != NULL) {
331 FEI_OSTREAM& os = *output_stream_;
332 os << dbgprefix_<<
"addDOFs, fID=" << fieldID
335 for(
int j=0; j<numIDs; ++j) {
337 if (j>0 && j%20==0) os << FEI_ENDL << dbgprefix_;
342 if (numIDs <= 0)
return(0);
349 unsigned fieldSize = getFieldSize(fieldID);
350 recordCollections_[idx]->initRecords(fieldID, fieldSize,
354 sharedRecordsSynchronized_ =
false;
366 if (output_level_ > fei::BRIEF_LOGS && output_stream_ != NULL) {
367 FEI_OSTREAM& os = *output_stream_;
368 os << dbgprefix_<<
"addDOFs*, fID=" << fieldID
371 for(
int j=0; j<numIDs; ++j) {
373 if (j>0 && j%20==0) os << FEI_ENDL << dbgprefix_;
378 if (numIDs <= 0)
return(0);
382 FEI_OSTRINGSTREAM osstr;
383 osstr <<
"fei::VectorSpace::addDOFs: error, idType " << idType
384 <<
" not recognized. (idTypes need to be initialized via the"
385 <<
" method VectorSpace::defineIDTypes)";
386 throw std::runtime_error(osstr.str());
389 unsigned fieldSize = getFieldSize(fieldID);
390 recordCollections_[idx]->initRecords(fieldID, fieldSize,
392 fieldMasks_, records);
394 sharedRecordsSynchronized_ =
false;
404 if (output_level_ > fei::BRIEF_LOGS && output_stream_ != NULL) {
405 FEI_OSTREAM& os = *output_stream_;
406 os << dbgprefix_<<
"addDOFs idT=" <<idType<<
" {";
407 for(
int j=0; j<numIDs; ++j) {
409 if (j>0 && j%20==0) os << FEI_ENDL << dbgprefix_;
414 if (numIDs <= 0)
return(0);
417 if (idx < 0) ERReturn(-1);
419 recordCollections_[idx]->initRecords(numIDs, IDs, fieldMasks_);
422 sharedRecordsSynchronized_ =
false;
433 if (output_level_ > fei::BRIEF_LOGS && output_stream_ != NULL) {
434 FEI_OSTREAM& os = *output_stream_;
435 os << dbgprefix_<<
"addDOFs* idT=" <<idType<<
" {";
436 for(
int j=0; j<numIDs; ++j) {
438 if (j>0 && j%20==0) os << FEI_ENDL << dbgprefix_;
443 if (numIDs <= 0)
return(0);
446 if (idx < 0) ERReturn(-1);
448 recordCollections_[idx]->initRecords(numIDs, IDs,
449 fieldMasks_, records);
452 sharedRecordsSynchronized_ =
false;
460 const int* sharedIDs,
461 const int* numSharingProcsPerID,
462 const int* sharingProcs)
464 if (output_level_ >= fei::BRIEF_LOGS && output_stream_ != NULL) {
465 FEI_OSTREAM& os = *output_stream_;
466 os << dbgprefix_<<
"initSharedIDs n=" <<numShared<<
", idT="<<idType<< FEI_ENDL;
468 for(
int ns=0; ns<numShared; ++ns) {
469 os << dbgprefix_<<
"#sharedID="<<sharedIDs[ns] <<
", nprocs=" << numSharingProcsPerID[ns] <<
", procs: ";
470 for(
int sp=0; sp<numSharingProcsPerID[ns]; ++sp) {
471 os << sharingProcs[offset++] <<
" ";
478 if (numShared == 0)
return(0);
481 if (idx < 0) ERReturn(-1);
486 for(
int i=0; i<numShared; ++i) {
487 shIDs.
addSharedID(sharedIDs[i], numSharingProcsPerID[i],
488 &(sharingProcs[offset]));
489 offset += numSharingProcsPerID[i];
491 fei::Record<int>* rec = recordCollections_[idx]->getRecordWithID(sharedIDs[i]);
493 CHK_ERR( addDOFs(idType, 1, &(sharedIDs[i])) );
498 sharedRecordsSynchronized_ =
false;
506 const int* sharedIDs,
507 const int* numSharingProcsPerID,
508 const int*
const* sharingProcs)
510 if (output_level_ >= fei::BRIEF_LOGS && output_stream_ != NULL) {
511 FEI_OSTREAM& os = *output_stream_;
512 os << dbgprefix_<<
"initSharedIDs n=" <<numShared<<
", idT="<<idType<< FEI_ENDL;
513 for(
int ns=0; ns<numShared; ++ns) {
514 os << dbgprefix_<<
"#sharedID="<<sharedIDs[ns] <<
", nprocs=" << numSharingProcsPerID[ns] <<
", procs: ";
515 for(
int sp=0; sp<numSharingProcsPerID[ns]; ++sp) {
516 os << sharingProcs[ns][sp] <<
" ";
523 if (numShared == 0)
return(0);
528 if (idx < 0) ERReturn(-1);
530 for(
int i=0; i<numShared; ++i) {
531 shIDs.
addSharedID(sharedIDs[i], numSharingProcsPerID[i],
534 fei::Record<int>* rec = recordCollections_[idx]->getRecordWithID(sharedIDs[i]);
536 CHK_ERR( addDOFs(idType, 1, &(sharedIDs[i])) );
541 sharedRecordsSynchronized_ =
false;
546 int fei::VectorSpace::setOwners(
int numShared,
int idType,
const int* sharedIDs,
const int* owners)
549 if (idx < 0) ERReturn(-1);
550 for(
int i=0; i<numShared; ++i) {
551 fei::Record<int>* rec = recordCollections_[idx]->getRecordWithID(sharedIDs[i]);
553 throw std::runtime_error(
"shared id not found in setOwners");
564 idTypes_ = inputSpace->idTypes_;
566 std::map<int,unsigned>::const_iterator
567 f_iter = inputSpace->fieldDatabase_.begin(),
568 f_end = inputSpace->fieldDatabase_.end();
570 for(; f_iter != f_end; ++f_iter) {
571 const std::pair<const int,unsigned>& fpair = *f_iter;
572 int fieldsize = fpair.second;
573 defineFields(1, &(fpair.first), &fieldsize);
576 int i, len = inputSpace->fieldMasks_.size();
577 fieldMasks_.resize(len);
578 for(i=0; i<len; ++i) {
579 fieldMasks_[i] =
new fei::FieldMask(*(inputSpace->fieldMasks_[i]));
582 len = inputSpace->recordCollections_.size();
583 recordCollections_.resize(len);
584 for(i=0; i<len; ++i) {
585 recordCollections_[i] =
589 sharedIDTables_ = inputSpace->sharedIDTables_;
592 sharedRecordsSynchronized_ =
false;
598 void fei::VectorSpace::getSendProcs(std::vector<int>& sendProcs)
const
601 std::set<int> sendSet;
603 std::map<int,fei::SharedIDs<int> >::const_iterator
604 s_it = sharedIDTables_.begin(),
605 s_end= sharedIDTables_.end();
606 for(; s_it!=s_end; ++s_it) {
607 const std::vector<int>& owners = s_it->second.getOwningProcs();
608 for(
size_t i=0; i<owners.size(); ++i) {
609 sendSet.insert(owners[i]);
613 for(std::set<int>::iterator it=sendSet.begin(); it!=sendSet.end(); ++it) {
621 std::map<int,fei::SharedIDs<int> >::iterator
622 iter = sharedIDTables_.find(idType);
624 if (iter == sharedIDTables_.end()) {
632 void fei::VectorSpace::compute_shared_ids(
const std::vector<int>& global_min,
const std::vector<int>& global_max)
638 for(
size_t i=0; i<idTypes_.size(); ++i) {
649 if (output_level_ >= fei::BRIEF_LOGS && output_stream_ != NULL) {
650 FEI_OSTREAM& os = *output_stream_;
651 os <<dbgprefix_<<
"initComplete" << FEI_ENDL;
654 simpleProblem_ = (fieldMasks_.size()==1) && (fieldMasks_[0]->getNumFields()==1);
656 std::vector<int> local_data(recordCollections_.size()+1);
657 for(
size_t i=0; i<recordCollections_.size(); ++i) {
658 local_data[i] = recordCollections_[i]->getMaxID();
661 std::vector<int> global_max_data(recordCollections_.size()+1, 0);
664 int localInitData = newInitData_ ? 1 : 0;
665 local_data[local_data.size()-1] = localInitData;
668 int globalInitData = global_max_data[global_max_data.size()-1];
669 newInitData_ = globalInitData > 0 ?
true :
false;
679 bool need_to_compute_shared_ids =
false;
680 if (
fei::numProcs(comm_) > 1 && sharedIDTables_.size() < 1) {
681 need_to_compute_shared_ids =
true;
684 for(
size_t i=0; i<recordCollections_.size(); ++i) {
685 local_data[i] = recordCollections_[i]->getMinID();
687 int localNeedToCompute = need_to_compute_shared_ids ? 1 : 0;
688 local_data[local_data.size()-1] = localNeedToCompute;
690 std::vector<int> global_min_data(recordCollections_.size()+1);
692 int globalNeedToCompute = global_min_data[global_min_data.size()-1];
693 need_to_compute_shared_ids = globalNeedToCompute==1 ?
true :
false;
694 if (need_to_compute_shared_ids) {
695 compute_shared_ids(global_min_data, global_max_data);
703 for(
size_t i=0; i<recordCollections_.size(); ++i) {
704 recordCollections_[i]->setOwners_local();
711 if ( synchronizeSharedRecords() != 0) {
716 if ( calculateGlobalIndices() != 0) {
724 if ( exchangeGlobalIndices() != 0) {
729 newInitData_ =
false;
730 initCompleteAlreadyCalled_ =
true;
739 int whichComponentOfField,
743 if (idindex < 0)
return(-1);
745 unsigned fieldSize = 0;
746 if (fieldOffset > 0) {
747 fieldSize = getFieldSize(fieldID);
750 globalIndex = recordCollections_[idindex]->getGlobalIndex(ID,
754 whichComponentOfField,
756 int return_value = globalIndex >= 0 ? 0 : -1;
766 return( getGlobalIndex(idType, ID, fieldID, 0, 0, globalIndex) );
775 if (idindex < 0)
return(-1);
777 CHK_ERR(recordCollections_[idindex]->getGlobalBlkIndex(ID, globalBlkIndex));
790 if (idindex < 0)
return(-1);
792 unsigned fieldSize = getFieldSize(fieldID);
795 for(
int i=0; i<numIDs; ++i) {
796 globalIndices[offset] = recordCollections_[idindex]->getGlobalIndex(IDs[i],
798 0, 0, &eqnNumbers_[0]);
800 if (globalIndices[offset] >= 0) {
801 int eqn = globalIndices[offset];
802 for(
unsigned j=1; j<fieldSize; ++j) {
803 globalIndices[offset+j] = eqn+j;
807 for(
unsigned j=0; j<fieldSize; ++j) {
808 globalIndices[offset+j] = -1;
827 if (idindex < 0)
return(-1);
829 unsigned fieldSize = getFieldSize(fieldID);
832 for(
int i=0; i<numIDs; ++i) {
833 globalIndices[offset] = recordCollections_[idindex]->getGlobalIndexLocalID(localIDs[i],
835 0, 0, &eqnNumbers_[0]);
836 if (globalIndices[offset] >= 0) {
838 int eqn = globalIndices[offset];
839 for(
unsigned j=1; j<fieldSize; ++j) {
840 globalIndices[offset+j] = eqn+j;
845 for(
unsigned j=0; j<fieldSize; ++j) {
846 globalIndices[offset+j] = -1;
860 int* globalBlkIndices)
864 if (idindex < 0)
return(-1);
868 for(
int i=0; i<numIDs; ++i) {
869 err = recordCollections_[idindex]->getGlobalBlkIndex(IDs[i],
870 globalBlkIndices[offset]);
872 globalBlkIndices[offset] = -1;
889 for(
int i=0; i<numIDs; ++i) {
890 unsigned fieldSize = getFieldSize(fieldIDs[i]);
891 err = getGlobalIndex(idTypes[i], IDs[i], fieldIDs[i], 0, 0,
892 globalIndices[offset]);
894 for(
unsigned j=1; j<fieldSize; ++j) {
895 globalIndices[offset+j] = -1;
900 int eqn = globalIndices[offset];
901 for(
unsigned j=1; j<fieldSize; ++j) {
902 globalIndices[offset+j] = eqn+j;
915 std::vector<int>& indices)
918 indices.resize(numRecords);
920 getGlobalBlkIndices(numRecords, records, numRecords, &indices[0],
927 std::vector<int>& indices)
931 indices.resize(numIndices);
932 int* indices_ptr = &indices[0];
936 if (pType == fei::Pattern::GENERAL ||
937 pType == fei::Pattern::SINGLE_IDTYPE) {
942 std::vector<int> fieldSizes(totalNumFields);
944 for(
int j=0; j<totalNumFields; ++j) {
945 fieldSizes[j] = getFieldSize(fieldIDs[j]);
948 getGlobalIndices(numRecords, records, numFieldsPerID,
949 fieldIDs, &(fieldSizes[0]),
950 numIndices, indices_ptr, numIndices);
952 else if (pType == fei::Pattern::SIMPLE) {
955 int fieldID = fieldIDs[0];
956 unsigned fieldSize = getFieldSize(fieldID);
958 getGlobalIndices(numRecords, records,
960 numIndices, indices_ptr, numIndices);
962 else if (pType == fei::Pattern::NO_FIELD) {
963 getGlobalBlkIndices(numRecords, records, numIndices, indices_ptr, numIndices);
968 void fei::VectorSpace::getGlobalIndicesL(
const fei::Pattern* pattern,
970 std::vector<int>& indices)
975 indices.resize(numIndices);
976 int* indices_ptr = &indices[0];
980 if (pType == fei::Pattern::GENERAL ||
981 pType == fei::Pattern::SINGLE_IDTYPE) {
986 std::vector<int> fieldSizes(totalNumFields);
988 for(
int j=0; j<totalNumFields; ++j) {
989 fieldSizes[j] = getFieldSize(fieldIDs[j]);
992 getGlobalIndicesL(numRecords, recordCollections, records, numFieldsPerID,
993 fieldIDs, &(fieldSizes[0]),
994 numIndices, indices_ptr, numIndices);
996 else if (pType == fei::Pattern::SIMPLE) {
999 int fieldID = fieldIDs[0];
1000 unsigned fieldSize = getFieldSize(fieldID);
1002 getGlobalIndicesL(numRecords, recordCollections, records,
1004 numIndices, indices_ptr, numIndices);
1006 else if (pType == fei::Pattern::NO_FIELD) {
1007 getGlobalBlkIndicesL(numRecords, recordCollections, records, numIndices, indices_ptr, numIndices);
1016 int indicesAllocLen,
1021 int* eqnPtr = &eqnNumbers_[0];
1023 int len = numRecords;
1024 if (len*fieldSize >= indicesAllocLen) {
1025 len = indicesAllocLen/fieldSize;
1028 if (fieldSize == 1 && simpleProblem_) {
1029 for(
int i=0; i<len; ++i) {
1036 if (fieldSize == 1) {
1037 for(
int i=0; i<len; ++i) {
1045 indices[numIndices++] = err == 0 ? eqnNumbers[eqnOffset] : -1;
1049 for(
int i=0; i<len; ++i) {
1055 if (!simpleProblem_) {
1059 for(
int fs=0; fs<fieldSize; ++fs) {
1060 indices[numIndices++] = -1;
1066 for(
int fs=0; fs<fieldSize; ++fs) {
1067 indices[numIndices++] = eqnNumbers[eqnOffset+fs];
1074 void fei::VectorSpace::getGlobalIndicesL(
int numRecords,
1079 int indicesAllocLen,
1084 int* eqnPtr = &eqnNumbers_[0];
1086 int len = numRecords;
1087 if (len*fieldSize >= indicesAllocLen) {
1088 len = indicesAllocLen/fieldSize;
1091 if (fieldSize == 1 && simpleProblem_) {
1092 for(
int i=0; i<len; ++i) {
1093 const fei::Record<int>* record = recordCollections[i]->getRecordWithLocalID(records[i]);
1099 if (fieldSize == 1) {
1100 for(
int i=0; i<len; ++i) {
1101 const fei::Record<int>* record = recordCollections[i]->getRecordWithLocalID(records[i]);
1108 indices[numIndices++] = err == 0 ? eqnNumbers[eqnOffset] : -1;
1112 for(
int i=0; i<len; ++i) {
1113 const fei::Record<int>* record = recordCollections[i]->getRecordWithLocalID(records[i]);
1118 if (!simpleProblem_) {
1122 for(
int fs=0; fs<fieldSize; ++fs) {
1123 indices[numIndices++] = -1;
1129 for(
int fs=0; fs<fieldSize; ++fs) {
1130 indices[numIndices++] = eqnNumbers[eqnOffset+fs];
1139 const int* numFieldsPerID,
1140 const int* fieldIDs,
1141 const int* fieldSizes,
1142 int indicesAllocLen,
1148 int* eqnPtr = &eqnNumbers_[0];
1150 for(
int i=0; i<numRecords; ++i) {
1156 for(
int nf=0; nf<numFieldsPerID[i]; ++nf) {
1158 if (!simpleProblem_) {
1161 for(
int fs=0; fs<fieldSizes[fld_offset]; ++fs) {
1162 indices[numIndices++] = -1;
1168 for(
int fs=0; fs<fieldSizes[fld_offset]; ++fs) {
1169 indices[numIndices++] = eqnNumbers[eqnOffset+fs];
1178 void fei::VectorSpace::getGlobalIndicesL(
int numRecords,
1181 const int* numFieldsPerID,
1182 const int* fieldIDs,
1183 const int* fieldSizes,
1184 int indicesAllocLen,
1190 int* eqnPtr = &eqnNumbers_[0];
1192 for(
int i=0; i<numRecords; ++i) {
1193 const fei::Record<int>* record = recordCollections[i]->getRecordWithLocalID(records[i]);
1198 for(
int nf=0; nf<numFieldsPerID[i]; ++nf) {
1200 if (!simpleProblem_) {
1203 for(
int fs=0; fs<fieldSizes[fld_offset]; ++fs) {
1204 indices[numIndices++] = -1;
1210 for(
int fs=0; fs<fieldSizes[fld_offset]; ++fs) {
1211 indices[numIndices++] = eqnNumbers[eqnOffset+fs];
1222 int indicesAllocLen,
1227 for(
int i=0; i<numRecords; ++i) {
1228 if (numIndices < indicesAllocLen) {
1229 indices[numIndices++] = records[i]->
getNumber();
1236 void fei::VectorSpace::getGlobalBlkIndicesL(
int numRecords,
1239 int indicesAllocLen,
1244 for(
int i=0; i<numRecords; ++i) {
1245 if (numIndices < indicesAllocLen) {
1246 indices[numIndices++] = recordCollections[i]->getRecordWithLocalID(records[i])->getNumber();
1258 if (idindex < 0)
return(-1);
1260 fei::Record<int>* record = recordCollections_[idindex]->getRecordWithID(ID);
1261 if (record == NULL) {
1265 const int* eqnNums = &eqnNumbers_[0]
1268 if (eqnNums != NULL) { globalIndex = eqnNums[0];
return(0); }
1277 if (idindex < 0)
return(0);
1279 fei::Record<int>* record = recordCollections_[idindex]->getRecordWithID(ID);
1280 if (record == NULL) {
1290 return(fieldDatabase_.size());
1296 unsigned numFields = fieldDatabase_.size();
1298 fieldIDs.resize(numFields);
1300 fei::copyKeysToArray<std::map<int,unsigned> >(fieldDatabase_, numFields,
1307 return(idTypes_.size());
1313 size_t numIDTypes = idTypes_.size();
1314 idTypes.resize(numIDTypes);
1315 for(
size_t i=0; i<numIDTypes; ++i) idTypes[i] = idTypes_[i];
1323 if (idindex < 0)
return(0);
1325 fei::Record<int>* record = recordCollections_[idindex]->getRecordWithID(ID);
1326 if (record == NULL) {
1337 if (idindex < 0)
return(
false);
1339 fei::Record<int>* record = recordCollections_[idindex]->getRecordWithID(ID);
1340 if (record == NULL) {
1351 if (idindex < 0)
return(
false);
1353 fei::Record<int>* record = recordCollections_[idindex]->getRecordWithID(ID);
1354 if (record == NULL) {
1367 std::map<int,unsigned>::const_iterator
1368 f_iter = fieldDatabase_.find(fieldID);
1370 if (f_iter == fieldDatabase_.end()) {
1371 FEI_OSTRINGSTREAM osstr;
1372 osstr <<
"fei::VectorSpace";
1373 if (name_.length() > 0) {
1374 osstr <<
"(name: "<<name_<<
")";
1376 osstr <<
"::getFieldSize: fieldID " << fieldID <<
" not found.";
1377 throw std::runtime_error(osstr.str());
1380 return((*f_iter).second);
1392 fei::Record<int>* record = recordCollections_[idindex]->getRecordWithID(ID);
1393 if (record == NULL) {
1398 std::vector<int>& maskFieldIDs = fieldMask->
getFieldIDs();
1399 int numFields = maskFieldIDs.size();
1400 fieldIDs.resize(numFields);
1401 for(
int i=0; i<numFields; ++i) {
1402 fieldIDs[i] = maskFieldIDs[i];
1409 globalOffsets = globalOffsets_;
1415 globalBlkOffsets = globalIDOffsets_;
1421 if (globalIndex < 0)
return(-1);
1423 unsigned len = globalOffsets_.size();
1424 for(
int i=0; i<(int)(len-1); ++i) {
1425 if (globalIndex < globalOffsets_[i+1]) {
1436 if (globalIndex < 0)
return(-1);
1438 unsigned len = globalOffsets_.size();
1439 for(
int i=0; i<(int)(len-1); ++i) {
1440 if (globalIndex < globalIDOffsets_[i+1]) {
1452 if (idx < 0)
return(0);
1454 return( recordCollections_[idx]->getNumRecords() );
1461 if (idx < 0)
return(0);
1464 runRecords(attrCounter, idx);
1466 return( attrCounter.numLocallyOwnedIDs_ );
1472 numShared = sharedIDTables_[idType].getSharedIDs().size();
1484 if (idx < 0)
return(-1);
1488 std::map<int,int>::iterator
1489 it = global_to_local.begin(),
1490 end = global_to_local.end();
1492 int len = numLocalIDs;
1493 if (lenList < len) len = lenList;
1495 for(; it!=end; ++it) {
1496 int local_id = it->second;
1497 IDs[i++] = records->getRecordWithLocalID(local_id)->getID();
1498 if (i >= len)
break;
1511 if (idx < 0)
return(-1);
1516 std::map<int,int>::iterator
1517 it = global_to_local.begin(),
1518 end = global_to_local.end();
1522 for(; it!=end; ++it) {
1526 if (numLocalIDs < lenList) {
1527 IDs[numLocalIDs] = thisrecord.
getID();
1539 return(eqnNumbers_.size());
1545 if (eqnNumbers_.size() == 0) {
1546 globalIndices.resize(0);
1550 size_t numIndices = eqnNumbers_.size();
1551 const int* indicesPtr = &eqnNumbers_[0];
1553 globalIndices.resize(numIndices);
1554 for(
size_t i=0; i<numIndices; ++i) {
1555 globalIndices[i] = indicesPtr[i];
1565 for(
size_t i=0; i<recordCollections_.size(); ++i) {
1566 numBlkIndices += recordCollections_[i]->getNumRecords();
1574 int* globalBlkIndices,
1578 if (!sharedRecordsSynchronized_) {
1583 fei::BlkIndexAccessor blkIndAccessor(lenBlkIndices,
1584 globalBlkIndices, blkSizes);
1585 runRecords(blkIndAccessor);
1587 numBlkIndices = blkIndAccessor.numBlkIndices_;
1595 if (globalOffsets_.size() < 1)
return(0);
1596 return(globalOffsets_[globalOffsets_.size()-1]);
1602 if (!sharedRecordsSynchronized_) {
1607 int numIndices = globalOffsets_[localProc+1]-globalOffsets_[
localProc];
1615 if (!sharedRecordsSynchronized_) {
1616 globalIndices.clear();
1621 int numIndices = globalOffsets_[localProc+1]-globalOffsets_[
localProc];
1623 globalIndices.resize(numIndices);
1625 int firstOffset = globalOffsets_[
localProc];
1626 for(
int i=0; i<numIndices; ++i) {
1627 globalIndices[i] = firstOffset+i;
1636 if (!sharedRecordsSynchronized_) {
1642 numIndices = globalOffsets_[localProc+1]-globalOffsets_[
localProc];
1644 int len = lenIndices >= numIndices ? numIndices : lenIndices;
1646 int firstOffset = globalOffsets_[
localProc];
1647 for(
int i=0; i<len; ++i) {
1648 globalIndices[i] = firstOffset+i;
1657 if (!sharedRecordsSynchronized_) {
1662 int numBlkIndices = globalIDOffsets_[localProc+1]-globalIDOffsets_[
localProc];
1664 return(numBlkIndices);
1670 int numBlkIndices = 0;
1671 unsigned len = globalIDOffsets_.size();
1673 numBlkIndices = globalIDOffsets_[len-1];
1676 return(numBlkIndices);
1681 int* globalBlkIndices,
1685 if (!sharedRecordsSynchronized_) {
1691 fei::BlkIndexAccessor blkIndAccessor(localProc, lenBlkIndices,
1692 globalBlkIndices, blkSizes);
1693 runRecords(blkIndAccessor);
1695 numBlkIndices = blkIndAccessor.numBlkIndices_;
1705 if (idx < 0)
return(-1);
1707 records = recordCollections_[idx];
1716 if (idx < 0)
return(-1);
1718 records = recordCollections_[idx];
1723 void fei::VectorSpace::setOwners_shared()
1729 std::map<int, fei::SharedIDs<int> >::iterator
1730 s_iter = sharedIDTables_.begin(), s_end = sharedIDTables_.end();
1732 for(; s_iter != s_end; ++s_iter) {
1736 t_iter = shid_table.begin(),
1737 t_end = shid_table.end();
1739 for(; t_iter != t_end; ++t_iter) {
1740 std::set<int>& shProcs = t_iter->second;
1741 shProcs.insert(localProc);
1748 s_iter = sharedIDTables_.begin();
1749 for(; s_iter != s_end; ++s_iter) {
1752 std::vector<int>& owningProcs = s_iter->second.getOwningProcs();
1754 int len = shid_table.size();
1755 owningProcs.resize(len);
1759 t_iter = shid_table.begin(),
1760 t_end = shid_table.end();
1762 for(; t_iter != t_end; ++t_iter, ++j) {
1763 std::set<int>& shProcs = (*t_iter).second;
1764 int lowest = *(shProcs.begin());
1765 owningProcs[j] = lowest;
1770 throw std::runtime_error(
"internal error in fei::VectorSapce::setOwners_lowestSharing");
1773 if (output_level_ >= fei::FULL_LOGS && output_stream_ != NULL) {
1774 recordCollections_[idx]->setDebugOutput(output_stream_);
1777 recordCollections_[idx]->setOwners_lowestSharing(s_iter->second);
1782 int fei::VectorSpace::calculateGlobalIndices()
1786 std::vector<int> localOffsets(numProcs +1, 0);
1787 std::vector<int> localIDOffsets(numProcs+1, 0);
1788 globalOffsets_.resize(numProcs + 1, 0);
1790 globalIDOffsets_.assign(globalIDOffsets_.size(), 0);
1794 fei::RecordAttributeCounter counter(localProc);
1795 runRecords(counter);
1797 int numLocalDOF = counter.numLocalDOF_;
1798 int numLocalIDs = counter.numLocalIDs_;
1799 int numRemoteSharedDOF = counter.numRemoteSharedDOF_;
1801 eqnNumbers_.resize(numLocalDOF+numRemoteSharedDOF);
1806 localIDOffsets[
localProc] = numLocalIDs;
1807 CHK_MPI(
fei::GlobalMax(comm_, localIDOffsets, globalIDOffsets_) );
1813 int localOffset = 0;
1814 int localIDOffset = 0;
1816 numLocalDOF = globalOffsets_[p];
1817 globalOffsets_[p] = localOffset;
1818 localOffset += numLocalDOF;
1819 numLocalIDs = globalIDOffsets_[p];
1820 globalIDOffsets_[p] = localIDOffset;
1821 localIDOffset += numLocalIDs;
1823 globalOffsets_[
numProcs] = localOffset;
1824 globalIDOffsets_[
numProcs] = localIDOffset;
1826 firstLocalOffset_ = globalOffsets_[
localProc];
1827 lastLocalOffset_ = globalOffsets_[localProc+1] - 1;
1829 if (output_level_ >= fei::BRIEF_LOGS && output_stream_ != NULL) {
1830 FEI_OSTREAM& os = *output_stream_;
1831 os <<dbgprefix_<<
" firstLocalOffset_: " << firstLocalOffset_ <<
", lastLocalOffset_: "
1832 << lastLocalOffset_ << FEI_ENDL;
1836 CHK_ERR( setLocalEqnNumbers() );
1842 int fei::VectorSpace::synchronizeSharedRecords()
1844 if (output_level_ >= fei::FULL_LOGS && output_stream_ != NULL) {
1845 FEI_OSTREAM& os = *output_stream_;
1846 os<<dbgprefix_<<
"#synchronizeSharedRecords num-field-masks: "<<fieldMasks_.size()<<FEI_ENDL;
1847 for(
unsigned fm=0; fm<fieldMasks_.size(); ++fm) {
1848 os << dbgprefix_<<
"# maskID["<<fm<<
"]: " << fieldMasks_[fm]->getMaskID() << FEI_ENDL;
1852 bool safetyCheck = checkSharedIDs_;
1856 int numShTables = sharedIDTables_.size();
1859 sharedRecordsSynchronized_ =
true;
1864 if (localProc == 0 && output_level_ >= fei::BRIEF_LOGS) {
1865 FEI_COUT <<
"fei::VectorSpace: global consistency-check of shared ID"
1866 <<
" data (involves all-to-all communication). This is done "
1867 <<
"only if requested by parameter 'FEI_CHECK_SHARED_IDS true'."
1871 int totalNumShTables = 0;
1873 if (totalNumShTables != numShTables * numProcs) {
1879 safetyCheck =
false;
1891 for(
size_t i=0; i<idTypes_.size(); ++i) {
1900 std::map<int,fei::comm_map*>::iterator iter = ownerPatterns_.find(idTypes_[i]);
1901 if (iter == ownerPatterns_.end()) {
1902 ownerPatterns_.insert(std::make_pair(idTypes_[i], ownerPattern));
1905 delete iter->second;
1906 iter->second = ownerPattern;
1911 iter = sharerPatterns_.find(idTypes_[i]);
1912 if (iter == sharerPatterns_.end()) {
1913 sharerPatterns_.insert(std::make_pair(idTypes_[i], sharerPattern));
1916 delete iter->second;
1917 iter->second = sharerPattern;
1925 s_iter = shtable.begin(),
1926 s_end = shtable.end();
1929 for(; s_iter != s_end; ++s_iter, ++j) {
1930 int ID = (*s_iter).first;
1931 std::set<int>& shProcs = (*s_iter).second;
1933 int owner = owningProcs[j];
1935 if (owner == localProc) {
1936 std::set<int>::const_iterator
1937 p_iter = shProcs.begin(),
1938 p_end = shProcs.end();
1939 for(; p_iter != p_end; ++p_iter) {
1940 if (*p_iter != localProc) {
1953 fei::Barrier(comm_);
1954 if (output_level_ >= fei::FULL_LOGS && output_stream_ != NULL) {
1955 FEI_OSTREAM& os = *output_stream_;
1957 int numKeys = owner_map.size();
1958 fei::comm_map::map_type::const_iterator
1959 omap_iter = owner_map.begin(),
1960 omap_end = owner_map.end();
1962 os << dbgprefix_<<
"# synchronizeSharedRecords" << FEI_ENDL
1963 << dbgprefix_<<
"# ownerPattern, num-procs-to-send-to: " << numKeys << FEI_ENDL;
1964 for(
int sk=0; omap_iter != omap_end; ++sk, ++omap_iter) {
1965 os << dbgprefix_<<
"# sendProc["<<sk<<
"]: " << omap_iter->first <<
" IDs: ";
1966 fei::comm_map::row_type::const_iterator
1967 val_iter = omap_iter->second->begin(),
1968 val_end = omap_iter->second->end();
1969 for(; val_iter != val_end; ++val_iter) {
1970 os << *val_iter <<
" ";
1976 int numCheckKeys = check_map.size();
1977 fei::comm_map::map_type::const_iterator
1978 cmap_iter = check_map.begin(),
1979 cmap_end = check_map.end();
1981 os <<dbgprefix_<<
"# synchronizeSharedRecords" << FEI_ENDL
1982 <<dbgprefix_<<
"# checkPattern (send mirror), num-procs: "
1983 << numCheckKeys << FEI_ENDL;
1984 for(
int sk=0; cmap_iter != cmap_end; ++sk, ++cmap_iter) {
1985 os <<dbgprefix_<<
"# proc["<<sk<<
"]: " << cmap_iter->first <<
" IDs: ";
1986 fei::comm_map::row_type::const_iterator
1987 val_iter = cmap_iter->second->begin(),
1988 val_end = cmap_iter->second->end();
1989 for(; val_iter != val_end; ++val_iter) {
1990 os << *val_iter <<
" ";
1998 if (!checkPattern->
equal(*sharerPattern, quiet)) {
2006 delete checkPattern;
2008 if (globalErr != 0) {
2013 local_err += exchangeFieldInfo(ownerPattern, sharerPattern,
2014 recordCollections_[i], fieldMasks_);
2020 if (global_err != 0) {
2024 sharedRecordsSynchronized_ =
true;
2030 int fei::VectorSpace::exchangeGlobalIndices()
2032 for(
size_t i=0; i<idTypes_.size(); ++i) {
2034 recordCollections_[i], *ptBlkMap_,
2035 fieldMasks_, eqnNumbers_);
2036 recmsghndlr.setTask(snl_fei::RecordMsgHandler::_EqnNumbers_);
2038 recmsghndlr.setSendPattern(sharerPatterns_[idTypes_[i]]);
2039 recmsghndlr.setRecvPattern(ownerPatterns_[idTypes_[i]]);
2040 CHK_ERR( fei::exchange(comm_, &recmsghndlr) );
2049 for(
size_t rec=0; rec<recordCollections_.size(); ++rec) {
2052 std::map<int,int>::iterator
2056 for(; it!=end; ++it) {
2059 record_op(thisrecord);
2069 std::map<int,int>::iterator
2073 for(; it!=end; ++it) {
2076 record_op(thisrecord);
2081 int fei::VectorSpace::setLocalEqnNumbers()
2084 int eqnNumber = firstLocalOffset_;
2085 int idNumber = globalIDOffsets_[proc];
2090 if (ptBlkMap_ != NULL) {
2095 int maxNumIndices = 0;
2096 for(
unsigned i=0; i<fieldMasks_.size(); ++i) {
2097 if (fieldMasks_[i]->getNumIndices() > maxNumIndices) {
2098 maxNumIndices = fieldMasks_[i]->getNumIndices();
2102 if (maxNumIndices == 1) {
2106 FEI_OSTREAM* id2eqnStream = NULL;
2107 if (output_level_ >= fei::BRIEF_LOGS) {
2109 if (path ==
"") path =
".";
2110 FEI_OSTRINGSTREAM osstr;
2111 osstr << path <<
"/fei_ID2Eqn";
2112 if (name_.size() > 0) osstr <<
"_" << name_;
2113 osstr <<
"." <<numProcs<<
"." <<
localProc;
2115 id2eqnStream =
new FEI_OFSTREAM(osstr.str().c_str(), IOS_OUT);
2116 FEI_OSTREAM& os = *id2eqnStream;
2117 os <<
"# Each line contains:\n# ID blk-eqn eqn" << FEI_ENDL;
2120 int eqnNumberOffset = 0;
2123 for(
size_t rec=0; rec<recordCollections_.size(); ++rec) {
2127 std::map<int,int>::const_iterator
2128 it = rmap.begin(), it_end = rmap.end();
2130 int* eqnNumPtr = eqnNumbers_.empty() ? NULL : &eqnNumbers_[0];
2132 for(; it!=it_end; ++it) {
2140 if (owner == proc) {
2144 int* eqnNumbers = eqnNumPtr
2148 eqnNumberOffset += numDOF;
2150 if (output_level_ >= fei::BRIEF_LOGS) {
2151 for(
int ii=0; ii<numDOF; ++ii) {
2152 if (isLogEqn(eqnNumber+ii) && output_stream_ != NULL) {
2153 FEI_OSTREAM& os = *output_stream_;
2154 os <<dbgprefix_<<
"setLocalEqnNumbers: ID "<<thisrecord.
getID()
2155 <<
" <--> eqn " << eqnNumber+ii<<FEI_ENDL;
2160 if (owner == proc) {
2162 for(
int n=0; n<numDOF; ++n) {
2163 eqnNumbers[offset++] = eqnNumber++;
2167 if (numDOF > maxNumDOF) maxNumDOF = numDOF;
2169 if (owner == proc) {
2170 int thiseqn = eqnNumber-numDOF;
2171 int thisrecordnumber = thisrecord.
getNumber();
2172 if (maxNumIndices > 1) {
2173 CHK_ERR( ptBlkMap_->setEqn(thiseqn, thisrecordnumber, numDOF) );
2175 for(
int i=1; i<numDOF; ++i) {
2176 CHK_ERR( ptBlkMap_->setEqn(thiseqn+i, thisrecordnumber, numDOF) );
2182 if (id2eqnStream != NULL) {
2183 if (owner == proc) {
2184 FEI_OSTREAM& os = *id2eqnStream;
2185 for(
int n=0; n<numDOF; ++n) {
2187 << eqnNumber-numDOF+n<<FEI_ENDL;
2195 ptBlkMap_->setMaxBlkEqnSize(maxNumDOF);
2197 int globalMaxNumDOF;
2200 if (globalMaxNumDOF == 1) {
2201 ptBlkMap_->setPtEqualBlk();
2204 delete id2eqnStream;
2210 int fei::VectorSpace::exchangeFieldInfo(
fei::comm_map* ownerPattern,
2213 std::vector<fei::FieldMask*>& fieldMasks)
2233 if (numProcs < 2)
return(0);
2240 fieldMasks, eqnNumbers_);
2243 recMsgHandler.setTask(snl_fei::RecordMsgHandler::_FieldMasks_);
2245 recMsgHandler.setSendPattern(ownerPattern);
2246 recMsgHandler.setRecvPattern(sharerPattern);
2247 CHK_ERR( fei::exchange(comm_, &recMsgHandler) );
2250 recMsgHandler.setTask(snl_fei::RecordMsgHandler::_MaskIDs_);
2252 recMsgHandler.setSendPattern(ownerPattern);
2253 recMsgHandler.setRecvPattern(sharerPattern);
2254 CHK_ERR( fei::exchange(comm_, &recMsgHandler) );
2257 recMsgHandler.setTask(snl_fei::RecordMsgHandler::_FieldMasks_);
2259 recMsgHandler.setSendPattern(sharerPattern);
2260 recMsgHandler.setRecvPattern(ownerPattern);
2261 CHK_ERR( fei::exchange(comm_, &recMsgHandler) );
2264 recMsgHandler.setTask(snl_fei::RecordMsgHandler::_MaskIDs_);
2266 recMsgHandler.setSendPattern(sharerPattern);
2267 recMsgHandler.setRecvPattern(ownerPattern);
2268 CHK_ERR( fei::exchange(comm_, &recMsgHandler) );
2275 fei::VectorSpace::getFieldDofMap()
2277 return fieldDofMap_;
2281 void fei::VectorSpace::setName(
const char* name)
2283 if (name == NULL)
return;
2285 if (name_ == name)
return;
2288 dbgprefix_ =
"VecSpc_"+name_+
": ";
int getGlobalNumBlkIndices() const
int GlobalSum(MPI_Comm comm, std::vector< T > &local, std::vector< T > &global)
GlobalIDType getNumber() const
MPI_Comm getCommunicator() const
int sortedListInsert(const T &item, std::vector< T > &list)
int getGlobalIndicesLocalIDs(int numIDs, const int *localIDs, int idType, int fieldID, int *globalIndices)
int initSharedIDs(int numShared, int idType, const int *sharedIDs, const int *numSharingProcsPerID, const int *sharingProcs)
snl_fei::RecordCollection *const * getRecordCollections() const
int getBlkIndices_Owned(int lenBlkIndices, int *globalBlkIndices, int *blkSizes, int &numBlkIndices)
void setNumber(const GlobalIDType &num)
ParamType getType() const
VectorSpace(MPI_Comm comm, const char *name=NULL)
std::vector< int > & getOwningProcs()
int getGlobalNumIndices() const
int getIndices_SharedAndOwned(std::vector< int > &globalIndices) const
int getNumIndices() const
std::map< T, std::set< int > > map_type
const Param * get(const char *name) const
map_type & getSharedIDs()
const int * getNumFieldsPerID() const
const std::string & getOutputPath()
int mirrorCommPattern(MPI_Comm comm, comm_map *inPattern, comm_map *&outPattern)
fei::OutputLevel string_to_output_level(const std::string &str)
int getOwnedIDs(int idtype, int lenList, int *IDs, int &numLocalIDs)
bool getBoolValue() const
const int * getFieldIDs() const
void defineFields(int numFields, const int *fieldIDs, const int *fieldSizes, const int *fieldTypes=NULL)
int getTotalNumFields() const
void set_shared_ids(MPI_Comm comm, const snl_fei::RecordCollection &records, fei::SharedIDs< int > &sharedIDs, int lowest_global_id, int highest_global_id)
int addDOFs(int fieldID, int idType, int numIDs, const int *IDs)
int getNumIndices() const
int getBlkIndices_SharedAndOwned(int lenBlkIndices, int *globalBlkIndices, int *blkSizes, int &numBlkIndices)
void setParameters(const fei::ParameterSet ¶mset)
int addVectorSpace(fei::VectorSpace *inputSpace)
int getGlobalIndex(int idType, int ID, int fieldID, int fieldOffset, int whichComponentOfField, int &globalIndex)
void getIDTypes(std::vector< int > &idTypes) const
int getGlobalIndices(int numIDs, const int *IDs, int idType, int fieldID, int *globalIndices)
int binarySearch(const T &item, const T *list, int len)
size_t getNumRecords() const
int getOwnedAndSharedIDs(int idtype, int lenList, int *IDs, int &numOwnedAndSharedIDs)
int getNumOwnedIDs(int idType)
int getOwnerProcBlkIndex(int globalIndex)
size_t getNumFields() const
void setOutputLevel(OutputLevel olevel)
int getNumBlkIndices_SharedAndOwned(int &numBlkIndices) const
void defineIDTypes(int numIDTypes, const int *idTypes)
bool isLocallyOwned(int idType, int ID)
int GlobalMin(MPI_Comm comm, std::vector< T > &local, std::vector< T > &global)
PatternType getPatternType() const
int getOwnerProcPtIndex(int globalIndex)
void getGlobalBlkIndexOffsets(std::vector< int > &globalBlkOffsets) const
std::vector< int > & getFieldIDs()
int getNumSharedIDs(int idType, int &numShared)
void setOffsetIntoEqnNumbers(int offset)
int getGlobalBlkIndex(int idType, int ID, int &globalBlkIndex)
int getIndices_Owned(std::vector< int > &globalIndices) const
void getFields(std::vector< int > &fieldIDs)
void getGlobalIndexOffsets(std::vector< int > &globalOffsets) const
void setOwnerProc(int owner)
int GlobalMax(MPI_Comm comm, std::vector< T > &local, std::vector< T > &global)
const std::string & getStringValue() const
std::map< int, int > & getGlobalToLocalMap()
void addSharedID(const T &ID, size_t numSharingProcs, const int *sharingProcs)
int getNumBlkIndices_Owned() const
int getNumOwnedAndSharedIDs(int idType)
int localProc(MPI_Comm comm)
static LogManager & getLogManager()
int getNumIndices_SharedAndOwned() const
int getFieldEqnOffset(int fieldID, int &offset) const
GlobalIDType getID() const
unsigned getFieldSize(int fieldID)
void addIndices(int row, int numIndices, const int *indices)
bool equal(const RaggedTable< MAP_TYPE, SET_TYPE > &rhs, bool quiet=true) const
int getOffsetIntoEqnNumbers() const
int getNumDegreesOfFreedom(int idType, int ID)
fei::FieldMask * getFieldMask()
int getRecordCollection(int idType, snl_fei::RecordCollection *&records)
int getGlobalBlkIndices(int numIDs, const int *IDs, int idType, int *globalBlkIndices)
int numProcs(MPI_Comm comm)
int getNumIndices_Owned() const
bool isLocal(int idType, int ID)