20 #define fei_file "test_SNL_FEI_Structure.cpp"
51 int numNodesPerElem = testdata->
ids.size();
52 std::vector<int> numFieldsPerNode(numNodesPerElem, 1);
53 std::vector<int*>nodalFieldIDs(numNodesPerElem, &(testdata->
fieldIDs[0]));
66 &(testdata->
ids[0])) );
68 std::vector<int*> sharingProcs2D(testdata->
sharedIDs.size());
79 &sharingProcs2D[0]) );
85 if (numActiveNodes != (
int)testdata->
ids.size()) {
91 int numLocalEqns = fieldSize*2;
94 if (numLocalEqns != checkNumLocalEqns) {
98 int numGlobalEqns = fieldSize*(
numProcs_*2 + 2);
100 if (checkNumGlobalEqns != numGlobalEqns) {
104 std::vector<int> rowLengths;
108 for(
size_t j=0; j<rowLengths.size(); ++j) {
109 numNonzeros += rowLengths[j];
112 std::vector<int> colIndices_1d(numNonzeros);
113 std::vector<int*> colIndPtrs(rowLengths.size());
116 for(
size_t j=0; j<rowLengths.size(); ++j) {
117 colIndPtrs[j] = &(colIndices_1d[offset]);
118 offset += rowLengths[j];
139 int numNodesPerElem = testdata->
ids.size();
140 std::vector<int> numFieldsPerNode(numNodesPerElem, testdata->
fieldIDs.size());
141 std::vector<int*>nodalFieldIDs(numNodesPerElem, &(testdata->
fieldIDs[0]));
142 std::vector<int> elemDofFieldIDs = testdata->
fieldIDs;
147 &numFieldsPerNode[0],
149 elemDofFieldIDs.size(),
155 &(testdata->
ids[0])) );
157 std::vector<int*> sharingProcs2D(testdata->
sharedIDs.size());
168 &sharingProcs2D[0]) );
174 if (numActiveNodes != (
int)testdata->
ids.size()) {
178 int numEqnsPerNode = 0;
179 for(i=0; i<(int)testdata->
fieldSizes.size(); ++i) {
183 int numLocalEqns = 3*numEqnsPerNode;
185 if (
localProc_ == 0) numLocalEqns += 2*numEqnsPerNode;
187 if (numLocalEqns != checkNumLocalEqns) {
191 int numGlobalEqns = (
numProcs_*3+2)*numEqnsPerNode;
193 if (checkNumGlobalEqns != numGlobalEqns) {
197 std::vector<int> rowLengths;
201 for(
size_t j=0; j<rowLengths.size(); ++j) {
202 numNonzeros += rowLengths[j];
205 std::vector<int> colIndices_1d(numNonzeros);
206 std::vector<int*> colIndPtrs(rowLengths.size());
209 for(
size_t j=0; j<rowLengths.size(); ++j) {
210 colIndPtrs[j] = &(colIndices_1d[offset]);
211 offset += rowLengths[j];
int getFieldSize(int fieldID)
std::vector< int > fieldSizes
virtual ~test_SNL_FEI_Structure()
std::vector< int > fieldIDs
std::vector< int > sharedIDs
test_SNL_FEI_Structure(MPI_Comm comm)
int initElemBlock(GlobalID elemBlockID, int numElements, int numNodesPerElement, const int *numFieldsPerNode, const int *const *nodalFieldIDs, int numElemDofFieldsPerElement, const int *elemDofFieldIDs, int interleaveStrategy)
int initFields(int numFields, const int *fieldSizes, const int *fieldIDs, const int *fieldTypes=NULL)
int getMatrixRowLengths(std::vector< int > &rowLengths)
int getMatrixStructure(int **colIndices, std::vector< int > &rowLengths)
int initSharedNodes(int numSharedNodes, const GlobalID *sharedNodeIDs, const int *numProcsPerNode, const int *const *sharingProcIDs)
std::vector< int > sharingProcs
std::vector< int > numSharingProcsPerID
int initElem(GlobalID elemBlockID, GlobalID elemID, const GlobalID *elemConn)
int initComplete(bool generateGraph=true)