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;
225 CHK_ERR(
fei->loadNodeBCs(numBCNodes, BCNodeIDs, BCFieldID,
226 offsetsIntoField, values) );
228 delete [] offsetsIntoField;
233 int numActiveNodes = 0;
234 CHK_ERR(
fei->getNumLocalNodes(numActiveNodes) );
235 if (numActiveNodes != (
int)testdata->
ids.size()) {
240 CHK_ERR(
fei->getLocalNodeIDList(numActiveNodes, localNodes, numActiveNodes) );
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];
250 CHK_ERR(
fei->getNodalSolution(numActiveNodes, localNodes,
254 delete [] localNodes;
261 double initTime, loadTime, solveTime, solnReturnTime;
262 CHK_ERR(
fei->cumulative_cpu_times(initTime, loadTime, solveTime,
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;
346 CHK_ERR(
fei->getNumBlockActNodes(0, numBlkActNodes) );
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;
372 CHK_ERR(
fei->loadNodeBCs(numBCNodes, BCNodeIDs, BCFieldID,
373 offsetsIntoField, values) );
375 delete [] offsetsIntoField;
380 int numActiveNodes = 0;
381 CHK_ERR(
fei->getNumLocalNodes(numActiveNodes) );
382 if (numActiveNodes != (
int)testdata->
ids.size()) {
387 CHK_ERR(
fei->getLocalNodeIDList(numActiveNodes, localNodes, numActiveNodes) );
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];
397 CHK_ERR(
fei->getNodalSolution(numActiveNodes, localNodes,
401 delete [] localNodes;
408 double initTime, loadTime, solveTime, solnReturnTime;
409 CHK_ERR(
fei->cumulative_cpu_times(initTime, loadTime, solveTime,
virtual ~test_FEI_Implementation()
std::vector< int > fieldSizes
#define FEI_LOWER_SYMM_ROW
test_FEI_Implementation(MPI_Comm comm)
#define FEI_UPPER_SYMM_ROW
std::vector< int > fieldIDs
#define FEI_Implementation
std::vector< int > sharedIDs
static void copyStiffness(const double *const *elemStiff, int numRows, int elemFormat, double **copy)
std::vector< int > sharingProcs
std::vector< int > numSharingProcsPerID
#define FEI_OSTRINGSTREAM
int compareCoefs(int n, const double *const *coefs1, const double *const *coefs2)