13 #include <fei_macros.hpp>
15 #include <fei_CSVec.hpp>
17 #include <test_utils/Poisson_Elem.hpp>
19 #include <test_utils/PoissonData.hpp>
24 static int int_sqrt(
int x) {
26 return((
int)std::ceil(std::sqrt((
double)x)));
30 PoissonData::PoissonData(
int L,
31 int numProcs,
int localProc,
int outputLevel)
47 numLocalElements_ = 0;
50 localProc_ = localProc;
51 outputLevel_ = outputLevel;
55 elem_ =
new Poisson_Elem();
56 int err = elem_->allocateInternals(1);
57 err += elem_->allocateLoad(1);
58 err += elem_->allocateStiffness(1);
59 if (err) messageAbort(
"Allocation error in element.");
61 fieldArraysAllocated_ =
false;
62 elemIDsAllocated_ =
false;
69 calculateDistribution();
72 elemBlockID_ = (GlobalID)0;
79 initializeFieldStuff();
83 PoissonData::~PoissonData() {
90 if (elemIDsAllocated_)
delete [] elemIDs_;
92 elem_->deleteMemory();
97 void PoissonData::check1() {
104 if (L_ <= 0) messageAbort(
"bar length L <= 0.");
105 if (numProcs_ <= 0) messageAbort(
"numProcs <= 0.");
106 if (L_%int_sqrt(numProcs_))
107 messageAbort(
"L must be an integer multiple of sqrt(numProcs).");
108 if (localProc_ < 0) messageAbort(
"localProc < 0.");
109 if (localProc_ >= numProcs_) messageAbort(
"localProc >= numProcs.");
110 if (outputLevel_ < 0) messageAbort(
"outputLevel < 0.");
114 void PoissonData::calculateDistribution() {
130 numLocalElements_ = (L_*L_)/numProcs_;
132 elemIDs_ =
new GlobalID[numLocalElements_];
133 if (!elemIDs_) messageAbort(
"ERROR allocating elemIDs_.");
134 elemIDsAllocated_ =
true;
137 procX_ = localProc_%int_sqrt(numProcs_);
140 maxProcX_ = int_sqrt(numProcs_) - 1;
143 procY_ = localProc_/int_sqrt(numProcs_);
146 maxProcY_ = int_sqrt(numProcs_) - 1;
148 int sqrtElems = int_sqrt(numLocalElements_);
149 int sqrtProcs = int_sqrt(numProcs_);
152 startElement_ = 1 + procY_*sqrtProcs*numLocalElements_ + procX_*sqrtElems;
154 if (outputLevel_>1) {
155 FEI_COUT << localProc_ <<
", calcDist.: numLocalElements: "
156 << numLocalElements_ <<
", startElement: " << startElement_
158 FEI_COUT << localProc_ <<
", procX: " << procX_ <<
", procY_: " << procY_
159 <<
", maxProcX: " << maxProcX_ <<
", maxProcY: " << maxProcY_
164 for(
int i=0; i<sqrtElems; i++) {
165 for(
int j=0; j<sqrtElems; j++) {
166 elemIDs_[offset] = (GlobalID)(startElement_ + i*L_ + j);
173 void PoissonData::messageAbort(
const char* message) {
175 << FEI_ENDL <<
" Aborting." << FEI_ENDL;
180 GlobalID* PoissonData::getElementConnectivity(GlobalID elemID)
183 elem_->setElemID(elemID);
184 elem_->setElemLength(1.0/L_);
185 elem_->setTotalLength(1.0);
190 GlobalID* elemConn = elem_->getElemConnPtr(size);
191 if (size == 0) messageAbort(
"loadElements: bad conn ptr.");
193 calculateConnectivity(elemConn, size, elemID);
199 double** PoissonData::getElemStiffness(GlobalID elemID)
201 elem_->setElemID(elemID);
202 elem_->setElemLength(1.0/L_);
203 elem_->setTotalLength(1.0);
208 GlobalID* elemConn = elem_->getElemConnPtr(size);
209 if (size == 0) messageAbort(
"loadElemStiffnesses: bad conn ptr.");
211 calculateConnectivity(elemConn, size, elemID);
213 elem_->calculateCoords();
215 if (outputLevel_>1) {
216 double* x = elem_->getNodalX(size);
217 double* y = elem_->getNodalY(size);
218 FEI_COUT << localProc_ <<
", elemID " << elemID <<
", nodes: ";
219 for(
int j=0; j<size; j++) {
220 FEI_COUT << elemConn[j] <<
" ";
221 FEI_COUT <<
"("<<x[j]<<
","<<y[j]<<
") ";
223 FEI_COUT << FEI_ENDL;
226 elem_->calculateStiffness();
228 return( elem_->getElemStiff(size) );
232 double* PoissonData::getElemLoad(GlobalID elemID)
234 elem_->setElemID(elemID);
235 elem_->setElemLength(1.0/L_);
236 elem_->setTotalLength(1.0);
241 GlobalID* elemConn = elem_->getElemConnPtr(size);
242 if (size == 0) messageAbort(
"loadElemLoads: bad conn ptr.");
244 calculateConnectivity(elemConn, size, elemID);
246 elem_->calculateCoords();
248 if (outputLevel_>1) {
249 double* x = elem_->getNodalX(size);
250 double* y = elem_->getNodalY(size);
251 FEI_COUT << localProc_ <<
", elemID " << elemID <<
", nodes: ";
252 for(
int j=0; j<size; j++) {
253 FEI_COUT << elemConn[j] <<
" ";
254 FEI_COUT <<
"("<<x[j]<<
","<<y[j]<<
") ";
256 FEI_COUT << FEI_ENDL;
259 elem_->calculateLoad();
261 return( elem_->getElemLoad(size));
266 void PoissonData::calculateConnectivity(GlobalID* conn,
int size,
277 int elemX = (int)elemID%L_;
278 if (elemX == 0) elemX = L_;
281 int elemY = ((int)elemID - elemX)/L_ + 1;
284 GlobalID lowerLeft = elemID + (GlobalID)(elemY-1);
285 GlobalID lowerRight = lowerLeft + (GlobalID)1;
286 GlobalID upperRight = lowerRight + (GlobalID)(L_+1);
287 GlobalID upperLeft = upperRight - (GlobalID)1;
294 conn[1] = lowerRight;
295 conn[2] = upperRight;
300 void PoissonData::initializeFieldStuff() {
308 numFields_ =
new int[nodesPerElement_];
309 fieldIDs_ =
new int*[nodesPerElement_];
310 for(
int i=0; i<nodesPerElement_; i++) {
311 numFields_[i] = fieldsPerNode_;
312 fieldIDs_[i] =
new int[fieldsPerNode_];
313 for(
int j=0; j<fieldsPerNode_; j++) {
314 fieldIDs_[i][j] = fieldsPerNode_;
317 fieldArraysAllocated_ =
true;
321 void PoissonData::deleteFieldArrays() {
323 if (fieldArraysAllocated_) {
325 for(
int i=0; i<nodesPerElement_; i++) {
326 delete [] fieldIDs_[i];
330 delete [] numFields_;
332 fieldArraysAllocated_ =
false;
336 void PoissonData::getLeftSharedNodes(
int& numShared, GlobalID* sharedNodeIDs,
337 int* numProcsPerSharedNode,
338 int** sharingProcs) {
345 if (numProcs_ == 1) {
353 if (procY_ < maxProcY_) {
358 int topLeftElemIndex = numLocalElements_ -
359 int_sqrt(numLocalElements_);
361 elem_->setElemID(elemIDs_[topLeftElemIndex]);
366 GlobalID* elemConn = elem_->getElemConnPtr(size);
367 if (size == 0) messageAbort(
"loadElements: bad conn ptr.");
369 calculateConnectivity(elemConn, size, elemIDs_[topLeftElemIndex]);
371 sharedNodeIDs[0] = elemConn[3];
372 numProcsPerSharedNode[0] = 2;
373 sharingProcs[0][0] = localProc_;
374 sharingProcs[0][1] = localProc_ + int_sqrt(numProcs_);
386 numShared = int_sqrt(numLocalElements_);
387 int lowerLeftElemIndex = 0;
389 int sqrtElems = int_sqrt(numLocalElements_);
392 for(
int i=0; i<sqrtElems; i++){
396 int elemIndex = lowerLeftElemIndex+i*sqrtElems;
398 elem_->setElemID(elemIDs_[elemIndex]);
402 GlobalID* nodes = elem_->getElemConnPtr(size);
403 if (size == 0) messageAbort(
": bad conn ptr.");
405 calculateConnectivity(nodes, size, elemIDs_[elemIndex]);
408 sharedNodeIDs[shOffset] = nodes[3];
409 sharingProcs[shOffset][0] = localProc_-1;
410 sharingProcs[shOffset][1] = localProc_;
411 numProcsPerSharedNode[shOffset++] = 2;
414 if (procY_ < maxProcY_) {
418 numProcsPerSharedNode[shOffset] = 4;
419 sharingProcs[shOffset][2] = localProc_ + int_sqrt(numProcs_);
420 sharingProcs[shOffset][3] = sharingProcs[shOffset][2] - 1;
426 void PoissonData::getRightSharedNodes(
int& numShared, GlobalID* sharedNodeIDs,
427 int* numProcsPerSharedNode,
428 int** sharingProcs) {
435 if (numProcs_ == 1) {
440 if (procX_ == maxProcX_) {
448 int lowerRightElemIndex = int_sqrt(numLocalElements_) - 1;
450 elem_->setElemID(elemIDs_[lowerRightElemIndex]);
455 GlobalID* nodes = elem_->getElemConnPtr(size);
456 if (size == 0) messageAbort(
": bad conn ptr.");
458 calculateConnectivity(nodes, size, elemIDs_[lowerRightElemIndex]);
460 sharedNodeIDs[0] = nodes[1];
461 numProcsPerSharedNode[0] = 2;
462 sharingProcs[0][0] = localProc_;
463 sharingProcs[0][1] = localProc_ - int_sqrt(numProcs_);
475 numShared = int_sqrt(numLocalElements_);
476 int upperRightElemIndex = numLocalElements_ - 1;
478 int sqrtElems = int_sqrt(numLocalElements_);
481 for(
int i=0; i<sqrtElems; i++){
484 int elemIndex = upperRightElemIndex-i*sqrtElems;
485 elem_->setElemID(elemIDs_[elemIndex]);
489 GlobalID* nodes = elem_->getElemConnPtr(size);
490 if (size == 0) messageAbort(
": bad conn ptr.");
492 calculateConnectivity(nodes, size, elemIDs_[elemIndex]);
495 sharedNodeIDs[shOffset] = nodes[1];
496 sharingProcs[shOffset][0] = localProc_+1;
497 sharingProcs[shOffset][1] = localProc_;
498 numProcsPerSharedNode[shOffset++] = 2;
505 numProcsPerSharedNode[shOffset] = 4;
506 sharingProcs[shOffset][2] = localProc_ - int_sqrt(numProcs_);
507 sharingProcs[shOffset][3] = sharingProcs[shOffset][2] + 1;
513 void PoissonData::getTopSharedNodes(
int& numShared, GlobalID* sharedNodeIDs,
514 int* numProcsPerSharedNode,
515 int** sharingProcs) {
522 if (numProcs_ == 1) {
527 if (procY_ == maxProcY_) {
530 if (procX_ < maxProcX_) {
535 int elemIndex = numLocalElements_ - 1;
537 elem_->setElemID(elemIDs_[elemIndex]);
542 GlobalID* nodes = elem_->getElemConnPtr(size);
543 if (size == 0) messageAbort(
": bad conn ptr.");
545 calculateConnectivity(nodes, size, elemIDs_[elemIndex]);
547 sharedNodeIDs[0] = nodes[2];
548 numProcsPerSharedNode[0] = 2;
549 sharingProcs[0][0] = localProc_;
550 sharingProcs[0][1] = localProc_ + 1;
562 numShared = int_sqrt(numLocalElements_);
563 int topLeftElemIndex = numLocalElements_ - int_sqrt(numLocalElements_);
565 int sqrtElems = int_sqrt(numLocalElements_);
568 for(
int i=0; i<sqrtElems; i++){
571 int elemIndex = topLeftElemIndex+i;
573 elem_->setElemID(elemIDs_[elemIndex]);
577 GlobalID* nodes = elem_->getElemConnPtr(size);
578 if (size == 0) messageAbort(
": bad conn ptr.");
580 calculateConnectivity(nodes, size, elemIDs_[elemIndex]);
583 sharedNodeIDs[shOffset] = nodes[2];
584 sharingProcs[shOffset][0] = localProc_+int_sqrt(numProcs_);
585 sharingProcs[shOffset][1] = localProc_;
586 numProcsPerSharedNode[shOffset++] = 2;
588 if (procX_ < maxProcX_) {
592 numProcsPerSharedNode[shOffset] = 4;
593 sharingProcs[shOffset][2] = localProc_ + 1;
594 sharingProcs[shOffset][3] = sharingProcs[shOffset][0] + 1;
600 void PoissonData::getBottomSharedNodes(
int& numShared, GlobalID* sharedNodeIDs,
601 int* numProcsPerSharedNode,
602 int** sharingProcs) {
609 if (numProcs_ == 1) {
624 elem_->setElemID(elemIDs_[elemIndex]);
629 GlobalID* nodes = elem_->getElemConnPtr(size);
630 if (size == 0) messageAbort(
": bad conn ptr.");
632 calculateConnectivity(nodes, size, elemIDs_[elemIndex]);
634 sharedNodeIDs[0] = nodes[0];
635 numProcsPerSharedNode[0] = 2;
636 sharingProcs[0][0] = localProc_;
637 sharingProcs[0][1] = localProc_ - 1;
649 numShared = int_sqrt(numLocalElements_);
650 int lowerRightElemIndex = int_sqrt(numLocalElements_) - 1;
652 int sqrtElems = int_sqrt(numLocalElements_);
655 for(
int i=0; i<sqrtElems; i++){
659 int elemIndex = lowerRightElemIndex-i;
661 elem_->setElemID(elemIDs_[elemIndex]);
665 GlobalID* nodes = elem_->getElemConnPtr(size);
666 if (size == 0) messageAbort(
": bad conn ptr.");
668 calculateConnectivity(nodes, size, elemIDs_[elemIndex]);
671 sharedNodeIDs[shOffset] = nodes[0];
672 sharingProcs[shOffset][0] = localProc_ - int_sqrt(numProcs_);
673 sharingProcs[shOffset][1] = localProc_;
674 numProcsPerSharedNode[shOffset++] = 2;
680 numProcsPerSharedNode[shOffset] = 4;
681 sharingProcs[shOffset][2] = localProc_ - 1;
682 sharingProcs[shOffset][3] = sharingProcs[shOffset][0] - 1;
688 void PoissonData::printSharedNodes(
const char* str,
689 int numShared, GlobalID* nodeIDs,
690 int** shareProcs,
int* numShareProcs)
692 for(
int i=0; i<numShared; i++) {
693 FEI_COUT << localProc_ <<
", " << str <<
" node: " << (int) nodeIDs[i];
694 FEI_COUT <<
", procs: ";
695 for(
int j=0; j<numShareProcs[i]; j++) {
696 FEI_COUT << shareProcs[i][j] <<
" ";
698 FEI_COUT << FEI_ENDL;
703 void PoissonData::calculateBCs() {
708 for(
int i=0; i<numLocalElements_; i++) {
709 elem_->setElemID(elemIDs_[i]);
710 elem_->setElemLength(1.0/L_);
711 elem_->setTotalLength(1.0);
716 GlobalID* nodeIDs = elem_->getElemConnPtr(size);
717 if (size == 0) messageAbort(
"loadElements: bad conn ptr.");
719 calculateConnectivity(nodeIDs, size, elemIDs_[i]);
721 elem_->calculateCoords();
723 double* xcoord = elem_->getNodalX(size);
724 double* ycoord = elem_->getNodalY(size);
727 for(
int j=0; j<size; j++) {
728 if ((std::abs(xcoord[j]) < 1.e-49) || (std::abs(xcoord[j] - 1.0) < 1.e-49) ||
729 (std::abs(ycoord[j]) < 1.e-49) || (std::abs(ycoord[j] - 1.0) < 1.e-49)) {
731 addBCNode(nodeIDs[j], xcoord[j], ycoord[j]);
738 void PoissonData::addBCNode(GlobalID nodeID,
double x,
double y){
740 std::vector<GlobalID>::iterator
741 iter = std::lower_bound(BCNodeIDs_.begin(), BCNodeIDs_.end(), nodeID);
743 if (iter == BCNodeIDs_.end() || *iter != nodeID) {
744 unsigned offset = iter - BCNodeIDs_.begin();
745 BCNodeIDs_.insert(iter, nodeID);
747 double bcValue = std::pow(x, 2.0) + std::pow(y, 2.0);
749 BCValues_.insert(BCValues_.begin()+offset, bcValue);
754 int init_elem_connectivities(
FEI* fei, PoissonData& poissonData)
759 GlobalID elemBlockID = poissonData.getElemBlockID();
760 int numLocalElements = poissonData.getNumLocalElements();
761 int numNodesPerElement = poissonData.getNumNodesPerElement();
762 int* numFieldsPerNode = poissonData.getNumFieldsPerNodeList();
763 int** fieldIDsTable = poissonData.getNodalFieldIDsTable();
777 GlobalID* elemIDs = poissonData.getLocalElementIDs();
779 for(
int elem=0; elem<numLocalElements; elem++) {
780 GlobalID* elemConnectivity =
781 poissonData.getElementConnectivity(elemIDs[elem]);
783 CHK_ERR( fei->
initElem(elemBlockID, elemIDs[elem], elemConnectivity) );
790 int set_shared_nodes(
FEI* fei, PoissonData& poissonData)
792 int numLocalElements = poissonData.getNumLocalElements();
793 int maxNumSharedNodes = (int)std::sqrt((
double)numLocalElements);
794 GlobalID* sharedNodeIDs =
new GlobalID[maxNumSharedNodes];
795 int* numProcsPerSharedNode =
new int[maxNumSharedNodes];
796 int** sharingProcs =
new int*[maxNumSharedNodes];
797 for(
int i=0; i<maxNumSharedNodes; i++) sharingProcs[i] =
new int[4];
803 poissonData.getLeftSharedNodes(numShared, sharedNodeIDs,
804 numProcsPerSharedNode, sharingProcs);
807 numProcsPerSharedNode, sharingProcs));
811 poissonData.getRightSharedNodes(numShared, sharedNodeIDs,
812 numProcsPerSharedNode, sharingProcs);
815 numProcsPerSharedNode, sharingProcs));
819 poissonData.getBottomSharedNodes(numShared, sharedNodeIDs,
820 numProcsPerSharedNode, sharingProcs);
823 numProcsPerSharedNode, sharingProcs));
827 poissonData.getTopSharedNodes(numShared, sharedNodeIDs,
828 numProcsPerSharedNode, sharingProcs);
831 numProcsPerSharedNode, sharingProcs));
833 for(
int j=0; j<maxNumSharedNodes; j++)
delete [] sharingProcs[j];
834 delete [] sharingProcs;
835 delete [] numProcsPerSharedNode;
836 delete [] sharedNodeIDs;
842 int load_elem_data(
FEI* fei, PoissonData& poissonData)
844 GlobalID elemBlockID = poissonData.getElemBlockID();
845 int numLocalElements = poissonData.getNumLocalElements();
846 GlobalID* elemIDs = poissonData.getLocalElementIDs();
848 for(
int elem=0; elem<numLocalElements; elem++) {
849 GlobalID* elemConnectivity =
850 poissonData.getElementConnectivity(elemIDs[elem]);
851 double** elemStiffness = poissonData.getElemStiffness(elemIDs[elem]);
854 elemConnectivity, elemStiffness,
855 poissonData.getElemFormat()));
857 double* elemLoad = poissonData.getElemLoad(elemIDs[elem]);
860 elemConnectivity, elemLoad));
867 int load_elem_data_putrhs(
FEI* fei, PoissonData& poissonData)
869 GlobalID elemBlockID = poissonData.getElemBlockID();
870 int numLocalElements = poissonData.getNumLocalElements();
871 GlobalID* elemIDs = poissonData.getLocalElementIDs();
873 int numIDs = poissonData.getNumNodesPerElement();
875 int* fieldID = poissonData.getFieldIDs();
879 for(
int elem=0; elem<numLocalElements; elem++) {
880 GlobalID* elemConnectivity =
881 poissonData.getElementConnectivity(elemIDs[elem]);
882 double** elemStiffness = poissonData.getElemStiffness(elemIDs[elem]);
885 elemConnectivity, elemStiffness,
886 poissonData.getElemFormat()));
888 double* elemLoad = poissonData.getElemLoad(elemIDs[elem]);
890 for(
int i=0; i<numIDs; ++i) {
891 fei::add_entry(rhs, elemConnectivity[i], elemLoad[i]);
898 &(rhs.indices()[0]), &(rhs.coefs()[0]));
904 int load_BC_data(
FEI* fei, PoissonData& poissonData)
907 poissonData.calculateBCs();
909 int numBCNodes = poissonData.getNumBCNodes();
910 GlobalID* nodeIDs = poissonData.getBCNodeIDs();
911 int fieldID = poissonData.getBCFieldID();
912 double* values = poissonData.getBCValues();
914 std::vector<int> offsets(numBCNodes, 0);
916 CHK_ERR( fei->
loadNodeBCs(numBCNodes, nodeIDs, fieldID,
917 &offsets[0], values) );
924 PoissonData& poissonData)
929 GlobalID elemBlockID = poissonData.getElemBlockID();
930 int numLocalElements = poissonData.getNumLocalElements();
931 int numNodesPerElement = poissonData.getNumNodesPerElement();
932 int** fieldIDsTable = poissonData.getNodalFieldIDsTable();
938 nodeIDType, fieldIDsTable[0][0]);
941 numLocalElements, patternID) );
946 GlobalID* elemIDs = poissonData.getLocalElementIDs();
948 for(
int elem=0; elem<numLocalElements; elem++) {
949 GlobalID* elemConnectivity =
950 poissonData.getElementConnectivity(elemIDs[elem]);
962 int numLocalElements = poissonData.getNumLocalElements();
963 int maxNumSharedNodes = (int)std::sqrt((
double)numLocalElements);
964 GlobalID* sharedNodeIDs =
new GlobalID[maxNumSharedNodes];
965 int* numProcsPerSharedNode =
new int[maxNumSharedNodes];
966 int** sharingProcs =
new int*[maxNumSharedNodes];
967 for(
int i=0; i<maxNumSharedNodes; i++) sharingProcs[i] =
new int[4];
973 poissonData.getLeftSharedNodes(numShared, sharedNodeIDs,
974 numProcsPerSharedNode, sharingProcs);
977 CHK_ERR( nodeSpace->
initSharedIDs(numShared, nodeIDType, sharedNodeIDs,
978 numProcsPerSharedNode, sharingProcs));
982 poissonData.getRightSharedNodes(numShared, sharedNodeIDs,
983 numProcsPerSharedNode, sharingProcs);
985 CHK_ERR( nodeSpace->
initSharedIDs(numShared, nodeIDType, sharedNodeIDs,
986 numProcsPerSharedNode, sharingProcs));
990 poissonData.getBottomSharedNodes(numShared, sharedNodeIDs,
991 numProcsPerSharedNode, sharingProcs);
993 CHK_ERR( nodeSpace->
initSharedIDs(numShared, nodeIDType, sharedNodeIDs,
994 numProcsPerSharedNode, sharingProcs));
998 poissonData.getTopSharedNodes(numShared, sharedNodeIDs,
999 numProcsPerSharedNode, sharingProcs);
1001 CHK_ERR( nodeSpace->
initSharedIDs(numShared, nodeIDType, sharedNodeIDs,
1002 numProcsPerSharedNode, sharingProcs));
1004 for(
int j=0; j<maxNumSharedNodes; j++)
delete [] sharingProcs[j];
1005 delete [] sharingProcs;
1006 delete [] numProcsPerSharedNode;
1007 delete [] sharedNodeIDs;
1015 PoissonData& poissonData)
1017 GlobalID elemBlockID = poissonData.getElemBlockID();
1018 int numLocalElements = poissonData.getNumLocalElements();
1019 GlobalID* elemIDs = poissonData.getLocalElementIDs();
1023 std::vector<int> indicesArray(numIndices);
1024 int* indicesPtr = &indicesArray[0];
1026 for(
int elem=0; elem<numLocalElements; elem++) {
1027 double** elemStiffness = poissonData.getElemStiffness(elemIDs[elem]);
1029 int checkNumIndices = 0;
1031 numIndices, indicesPtr,
1033 if (checkNumIndices != numIndices)
return(-1);
1035 CHK_ERR( mat->
sumIn(elemBlockID, elemIDs[elem],
1038 double* elemLoad = poissonData.getElemLoad(elemIDs[elem]);
1040 CHK_ERR( rhs->
sumIn(numIndices, indicesPtr, elemLoad));
1050 poissonData.calculateBCs();
1052 int numBCNodes = poissonData.getNumBCNodes();
1053 GlobalID* nodeIDs = poissonData.getBCNodeIDs();
1054 int fieldID = poissonData.getBCFieldID();
1055 double* values = poissonData.getBCValues();
1057 CHK_ERR( linSys->
loadEssentialBCs(numBCNodes, nodeIDs, 0, fieldID, 0, values) );
int initSharedIDs(int numShared, int idType, const int *sharedIDs, const int *numSharingProcsPerID, const int *sharingProcs)
virtual int sumInElemMatrix(GlobalID elemBlockID, GlobalID elemID, const GlobalID *elemConn, const double *const *elemStiffness, int elemFormat)=0
virtual int loadEssentialBCs(int numIDs, const int *IDs, int idType, int fieldID, int offsetIntoField, const double *prescribedValues)
virtual int loadNodeBCs(int numNodes, const GlobalID *nodeIDs, int fieldID, const int *offsetsIntoField, const double *prescribedValues)=0
virtual int putIntoRHS(int IDType, int fieldID, int numIDs, const GlobalID *IDs, const double *coefficients)=0
virtual int getConnectivityNumIndices(int blockID) const =0
virtual int initConnectivity(int blockID, int connectivityID, const int *connectedIdentifiers)=0
virtual int initSharedNodes(int numSharedNodes, const GlobalID *sharedNodeIDs, const int *numProcsPerNode, const int *const *sharingProcIDs)=0
virtual int initElemBlock(GlobalID elemBlockID, int numElements, int numNodesPerElement, const int *numFieldsPerNode, const int *const *nodalFieldIDs, int numElemDofFieldsPerElement, const int *elemDOFFieldIDs, int interleaveStrategy)=0
virtual int sumIn(int numRows, const int *rows, int numCols, const int *cols, const double *const *values, int format=0)=0
virtual int getConnectivityIndices(int blockID, int connectivityID, int indicesAllocLen, int *indices, int &numIndices)=0
virtual int sumIn(int numValues, const int *indices, const double *values, int vectorIndex=0)=0
std::ostream & console_out()
virtual int loadComplete(bool applyBCs=true, bool globalAssemble=true)=0
virtual int sumInElemRHS(GlobalID elemBlockID, GlobalID elemID, const GlobalID *elemConn, const double *elemLoad)=0
virtual int definePattern(int numIDs, int idType)=0
virtual int initElem(GlobalID elemBlockID, GlobalID elemID, const GlobalID *elemConn)=0
virtual int initConnectivityBlock(int blockID, int numConnectivityLists, int patternID, bool diagonal=false)=0