22 #ifdef HAVE_FEI_AZTECOO
27 #define fei_file "test_LinearSystem.cpp"
57 #ifdef HAVE_FEI_AZTECOO
59 std::vector<int>& fieldIDs = testdata->
fieldIDs;
60 std::vector<int>& idTypes = testdata->
idTypes;
61 std::vector<int>& ids = testdata->
ids;
65 char* param =
new char[64];
66 sprintf(param,
"debugOutput .");
76 false,
false,
"U_LS2", factory);
80 false,
false,
"U_LS2", vectorSpacePtr,
83 std::vector<int> crIDTypes(2);
84 std::vector<int> crFieldIDs(2);
85 crIDTypes[0] = idTypes[0]; crIDTypes[1] = idTypes[0];
86 crFieldIDs[0] = fieldIDs[0]; crFieldIDs[1] = fieldIDs[0];
88 CHK_ERR( matrixGraphPtr->initLagrangeConstraint(0, idTypes[1],
94 CHK_ERR( matrixGraphPtr->initComplete() );
108 int numIndices = matrixGraphPtr->getConnectivityNumIndices(blockID);
110 std::vector<int> indicesArray(numIndices);
111 int* indicesPtr = &indicesArray[0];
113 int checkNumIndices = 0;
114 CHK_ERR( matrixGraphPtr->getConnectivityIndices(blockID, 0,
115 numIndices, indicesPtr,
118 std::vector<double> data(ids.size(), 1.0);
119 double* dptr = &data[0];
120 std::vector<double*> coefPtrs(ids.size());
121 std::vector<double> crdata(2);
125 for(
unsigned ii=0; ii<ids.size(); ++ii) coefPtrs[ii] = dptr;
127 CHK_ERR( mat_lsc->
sumIn(numIndices, indicesPtr, numIndices, indicesPtr,
130 CHK_ERR( vec_lsc->sumInFieldData(fieldIDs[0], idTypes[0],
142 std::vector<int> crindices;
144 if (crindices.size() != 2) {
158 #ifdef HAVE_FEI_AZTECOO
160 std::vector<int>& fieldIDs = testdata->
fieldIDs;
161 std::vector<int>& idTypes = testdata->
idTypes;
162 std::vector<int>& ids = testdata->
ids;
166 char* param =
new char[64];
167 sprintf(param,
"debugOutput .");
176 false,
false,
"U_LS3", factory);
180 false,
false,
"U_LS3", vectorSpacePtr,
183 std::vector<int> crIDTypes(2);
184 std::vector<int> crFieldIDs(2);
185 crIDTypes[0] = idTypes[0]; crIDTypes[1] = idTypes[0];
186 crFieldIDs[0] = fieldIDs[0]; crFieldIDs[1] = fieldIDs[0];
188 CHK_ERR( matrixGraphPtr->initPenaltyConstraint(0, idTypes[1],
194 CHK_ERR( matrixGraphPtr->initComplete() );
211 int numIndices = matrixGraphPtr->getConnectivityNumIndices(blockID);
213 std::vector<int> indicesArray(numIndices);
214 int* indicesPtr = &indicesArray[0];
216 int checkNumIndices = 0;
217 CHK_ERR( matrixGraphPtr->getConnectivityIndices(blockID, 0,
218 numIndices, indicesPtr,
221 std::vector<double> data(ids.size(), 1.0);
222 double* dptr = &data[0];
223 std::vector<double*> coefPtrs(ids.size());
224 std::vector<double> crdata(2);
228 for(
unsigned ii=0; ii<ids.size(); ++ii) coefPtrs[ii] = dptr;
230 CHK_ERR( mat_lsc->
sumIn(numIndices, indicesPtr, numIndices, indicesPtr,
233 CHK_ERR( vec_lsc->sumInFieldData(fieldIDs[0], idTypes[0],
255 #ifdef HAVE_FEI_AZTECOO
257 std::vector<int>& fieldIDs = testdata->
fieldIDs;
258 std::vector<int>& idTypes = testdata->
idTypes;
259 std::vector<int>& ids = testdata->
ids;
263 char* param =
new char[64];
264 sprintf(param,
"debugOutput .");
274 false,
false,
"U_LS4", factory);
278 false,
false,
"U_LS4", vectorSpacePtr,
281 std::vector<int> crIDTypes(2);
282 std::vector<int> crFieldIDs(2);
283 crIDTypes[0] = idTypes[0]; crIDTypes[1] = idTypes[0];
284 crFieldIDs[0] = fieldIDs[0]; crFieldIDs[1] = fieldIDs[0];
286 CHK_ERR( matrixGraphPtr->initLagrangeConstraint(0, idTypes[1],
292 CHK_ERR( matrixGraphPtr->initComplete() );
306 int numIndices = matrixGraphPtr->getConnectivityNumIndices(blockID);
308 std::vector<int> indicesArray(numIndices);
309 int* indicesPtr = &indicesArray[0];
311 int checkNumIndices = 0;
312 CHK_ERR( matrixGraphPtr->getConnectivityIndices(blockID, 0,
313 numIndices, indicesPtr,
316 std::vector<double> data(ids.size(), 1.0);
317 double* dptr = &data[0];
318 std::vector<double*> coefPtrs(ids.size());
319 std::vector<double> crdata(2);
323 for(
unsigned ii=0; ii<ids.size(); ++ii) coefPtrs[ii] = dptr;
325 CHK_ERR( mat_lsc->
sumIn(numIndices, indicesPtr, numIndices, indicesPtr,
328 CHK_ERR( vec_lsc->sumInFieldData(fieldIDs[0], idTypes[0],
329 ids.size(), &ids[0], &data[0]) );
virtual void setMatrix(fei::SharedPtr< fei::Matrix > &matrix)
virtual int loadLagrangeConstraint(int constraintID, const double *weights, double rhsValue)=0
virtual int parameters(int numParams, const char *const *paramStrings)=0
virtual void setSolutionVector(fei::SharedPtr< fei::Vector > &soln)
virtual int loadPenaltyConstraint(int constraintID, const double *weights, double penaltyValue, double rhsValue)=0
std::vector< int > fieldIDs
virtual void setRHS(fei::SharedPtr< fei::Vector > &rhs)
std::vector< int > idTypes
static fei::SharedPtr< fei::MatrixGraph > create_MatrixGraph(testData *testdata, int localProc, int numProcs, bool bothFields, bool nonSymmetric, const char *name, fei::SharedPtr< fei::VectorSpace > vectorSpacePtr, fei::SharedPtr< fei::Factory > factory, const std::string &path, bool turnOnDebugOutput=false)
virtual int loadComplete(bool applyBCs=true, bool globalAssemble=true)=0
test_LinearSystem(MPI_Comm comm)
virtual int sumIn(int numRows, const int *rows, int numCols, const int *cols, const double *const *values, int format=0)=0
virtual void getConstrainedEqns(std::vector< int > &crEqns) const =0
virtual int matrixLoadComplete()=0
virtual int parameters(int numParams, const char *const *params)=0
virtual int writeSystem(const char *name)=0
virtual int gatherFromOverlap(bool accumulate=true)=0
virtual ~test_LinearSystem()
static fei::SharedPtr< fei::VectorSpace > create_VectorSpace(MPI_Comm comm)