17 #ifdef HAVE_FEI_AZTECOO
28 #define fei_file "test_FEI_Implementation.cpp"
56 double** coefs =
new double*[n];
57 double** copy =
new double*[n];
58 double** correct =
new double*[n];
61 coefs[i] =
new double[n];
62 copy[i] =
new double[n];
63 correct[i] =
new double[n];
65 coefs[i][j] = (double)(i+j);
66 correct[i][j] = (double)(i+j);
74 for(j=0; j<n; ++j) coefs[i][j] = 0.0;
76 coefs[i][j-i] = (double)(i+j);
84 for(j=0; j<n; ++j) coefs[i][j] = 0.0;
87 coefs[i][j] = (double)(i+j);
108 const double*
const* coefs1,
109 const double*
const* coefs2)
111 for(
int i=0; i<n; ++i) {
112 for(
int j=0; j<n; ++j) {
113 double diff = coefs1[i][j] - coefs2[i][j];
114 if (diff > 1.e-20 || diff < -1.e-20) {
125 #ifdef HAVE_FEI_AZTECOO
135 char** params =
new char*[numParams];
136 params[0] =
new char[128];
137 strcpy(params[0],
"name test1");
139 params[1] =
new char[32];
140 strcpy(params[1],
"debugOutput .");
144 osstr <<
"debugOutput " <<
path_;
145 std::string str = osstr.str();
147 params[1] =
new char[str.size()+1];
148 strcpy(params[1], str.c_str());
162 1, &(testdata->
ids[0])) );
168 unsigned numNodesPerElem = testdata->
ids.size();
169 std::vector<int> numFieldsPerNode(numNodesPerElem, 1);
170 std::vector<int*>nodalFieldIDs(numNodesPerElem, &(testdata->
fieldIDs[0]));
175 &numFieldsPerNode[0],
183 &(testdata->
ids[0])) );
185 std::vector<int*> sharingProcs2D(testdata->
sharedIDs.size());
196 &sharingProcs2D[0]) );
201 std::vector<double> rhsData(testdata->
ids.size(), 1.0);
211 testdata->
ids.size(),
217 int BCFieldID = testdata->
fieldIDs[0];
218 double* values =
new double[numBCNodes];
219 int* offsetsIntoField =
new int[numBCNodes];
220 for(
int ii=0; ii<numBCNodes; ++ii) {
222 offsetsIntoField[ii] = 0;
226 offsetsIntoField, values) );
228 delete [] offsetsIntoField;
233 int numActiveNodes = 0;
235 if (numActiveNodes != (
int)testdata->
ids.size()) {
242 int totalFieldSize = 0;
243 for(
int ii=0; ii<(int)testdata->
fieldSizes.size(); ++ii) {
247 double* soln =
new double[numActiveNodes*totalFieldSize];
248 int* offsets =
new int[numActiveNodes+1];
254 delete [] localNodes;
261 double initTime, loadTime, solveTime, solnReturnTime;
278 char** params =
new char*[numParams];
279 params[0] =
new char[128];
280 strcpy(params[0],
"name test1");
282 params[1] =
new char[32];
283 strcpy(params[1],
"debugOutput .");
287 osstr <<
"debugOutput " <<
path_;
288 std::string str = osstr.str();
290 params[1] =
new char[str.size()+1];
291 strcpy(params[1], str.c_str());
306 1, &(testdata->
ids[0])) );
312 unsigned numNodesPerElem = testdata->
ids.size();
313 std::vector<int> numFieldsPerNode(numNodesPerElem, 1);
314 std::vector<int*>nodalFieldIDs(numNodesPerElem, &(testdata->
fieldIDs[0]));
319 &numFieldsPerNode[0],
327 &(testdata->
ids[0])) );
329 std::vector<int*> sharingProcs2D(testdata->
sharedIDs.size());
340 &sharingProcs2D[0]) );
345 int numBlkActNodes = 0;
348 std::vector<double> rhsData(testdata->
ids.size(), 1.0);
358 testdata->
ids.size(),
364 int BCFieldID = testdata->
fieldIDs[0];
365 double* values =
new double[numBCNodes];
366 int* offsetsIntoField =
new int[numBCNodes];
367 for(
int ii=0; ii<numBCNodes; ++ii) {
369 offsetsIntoField[ii] = 0;
373 offsetsIntoField, values) );
375 delete [] offsetsIntoField;
380 int numActiveNodes = 0;
382 if (numActiveNodes != (
int)testdata->
ids.size()) {
389 int totalFieldSize = 0;
390 for(
int ii=0; ii<(int)testdata->
fieldSizes.size(); ++ii) {
394 double* soln =
new double[numActiveNodes*totalFieldSize];
395 int* offsets =
new int[numActiveNodes+1];
401 delete [] localNodes;
408 double initTime, loadTime, solveTime, solnReturnTime;
virtual ~test_FEI_Implementation()
int setRHSScalars(int numScalars, const int *IDs, const double *scalars)
std::vector< int > fieldSizes
#define FEI_LOWER_SYMM_ROW
test_FEI_Implementation(MPI_Comm comm)
#define FEI_UPPER_SYMM_ROW
int loadNodeBCs(int numNodes, const GlobalID *nodeIDs, int fieldID, const int *offsetsIntoField, const double *prescribedValues)
int getNodalSolution(int numNodes, const GlobalID *nodeIDs, int *offsets, double *results)
int setIDLists(int numMatrices, const int *matrixIDs, int numRHSs, const int *rhsIDs)
std::vector< int > fieldIDs
#define FEI_Implementation
std::vector< int > sharedIDs
int resetInitialGuess(double s=0.0)
int initElemBlock(GlobalID elemBlockID, int numElements, int numNodesPerElement, const int *numFieldsPerNode, const int *const *nodalFieldIDs, int numElemDofFieldsPerElement, const int *elemDOFFieldIDs, int interleaveStrategy)
int loadComplete(bool applyBCs=true, bool globalAssemble=true)
static void copyStiffness(const double *const *elemStiff, int numRows, int elemFormat, double **copy)
int initElem(GlobalID elemBlockID, GlobalID elemID, const GlobalID *elemConn)
int setCurrentRHS(int rhsID)
int cumulative_cpu_times(double &initTime, double &loadTime, double &solveTime, double &solnReturnTime)
int parameters(int numParams, const char *const *paramStrings)
std::vector< int > sharingProcs
int initFields(int numFields, const int *fieldSizes, const int *fieldIDs, const int *fieldTypes=NULL)
int putIntoRHS(int IDType, int fieldID, int numIDs, const GlobalID *IDs, const double *rhsEntries)
std::vector< int > numSharingProcsPerID
int initSharedNodes(int numSharedNodes, const GlobalID *sharedNodeIDs, const int *numProcsPerNode, const int *const *sharingProcIDs)
int getNumLocalNodes(int &numNodes)
int getLocalNodeIDList(int &numNodes, GlobalID *nodeIDs, int lenNodeIDs)
int setMatScalars(int numScalars, const int *IDs, const double *scalars)
#define FEI_OSTRINGSTREAM
int compareCoefs(int n, const double *const *coefs1, const double *const *coefs2)
int getFieldSize(int fieldID, int &numScalars)
int getNumBlockActNodes(GlobalID blockID, int &numNodes) const
int setCurrentMatrix(int matID)