171 std::vector<std::string> windowNames(nwindows);
172 std::vector< std::vector< std::vector<double> > > coords(nwindows);
173 std::vector< std::vector< std::vector<int> > > elements(nwindows);
174 std::vector< std::vector< std::vector<double> > > soln(nwindows);
175 std::vector< std::vector< std::vector<double> > > comp(nwindows);
178 std::cout <<
"Initializing Roccom and Rocface" << std::endl;
196 for(
int i=0;
i < nwindows;
i++)
198 std::stringstream ss;
200 ss >> windowNames[
i];
202 std::cout <<
"Creating window " << ss.str() << std::endl;
206 for(
int i=0; i < nwindows; i++){
207 std::string &windowName(windowNames[i]);
216 std::cout << windowName <<
":" << std::endl;
217 std::cout << nrow <<
" by " << ncol << std::endl;
219 coords[
i].resize(npanes);
220 elements[
i].resize(npanes);
221 soln[
i].resize(npanes);
222 comp[
i].resize(npanes);
224 for(
int j=0;
j < npanes;
j++){
229 nrow,ncol,j,npanes,meshType,
234 soln[
i][
j].resize( coords[i][
j].size() );
235 comp[
i][
j].resize( coords[i][
j].size() );
237 for(
int k=0;
k < soln[
i][
j].size();
k++){
238 soln[
i][
j][
k] = coords[
i][
j][
k];
239 comp[
i][
j][
k] = -1.0;
247 std::string connectivityName;
248 connectivityName = ((meshType < 2) ? (windowName+
".:t3:") :
249 (windowName+
".:q4:"));
313 const char *format =
"HDF";
317 std::cout <<
"Overlaying meshes..." << std::endl;
328 COM_call_function( RFC_write, &tri0_mesh, &quad_mesh,
"tri02",
"quad20", format);
332 COM_call_function( RFC_write, &tri1_mesh, &quad_mesh,
"tri12",
"quad21", format);
349 COM_call_function( RFC_read, &tri0_mesh, &tri1_mesh, NULL,
"tri01",
"tri10", format);
353 std::vector<std::vector< double > >::iterator paneIt = comp[check_id].begin();
354 std::vector<std::vector< double > >::iterator paneIt2 = coords[check_id].begin();
356 double compTol = 1e-5;
357 while(paneIt != comp[check_id].end()){
358 std::vector<double> &paneComp(*paneIt++);
359 std::vector<double> &paneCoords(*paneIt2++);
360 std::vector<double>::iterator pcIt = paneComp.begin();
361 std::vector<double>::iterator pcIt2 = paneCoords.begin();
362 while(pcIt != paneComp.end()){
363 double solnDiff = std::fabs(*pcIt - *pcIt2);
364 if(solnDiff > compTol){
366 std::cout << *pcIt <<
" != " << *pcIt2
367 <<
" (" << solnDiff <<
")" << std::endl;
373 std::cout <<
"Nodal transfer from Triangles 1 to Triangles 0 "
374 << (pass ?
"passed" :
"failed") <<
"." << std::endl;
378 paneIt = comp[check_id].begin();
379 paneIt2 = coords[check_id].begin();
381 while(paneIt != comp[check_id].end()){
382 std::vector<double> &paneComp(*paneIt++);
383 std::vector<double> &paneCoords(*paneIt2++);
384 std::vector<double>::iterator pcIt = paneComp.begin();
385 std::vector<double>::iterator pcIt2 = paneCoords.begin();
386 while(pcIt != paneComp.end()){
387 double solnDiff = std::fabs(*pcIt - *pcIt2);
388 if(solnDiff > compTol){
390 std::cout << *pcIt <<
" != " << *pcIt2
391 <<
" (" << solnDiff <<
")" << std::endl;
397 std::cout <<
"Nodal transfer from Triangles 0 to Triangles 1 "
398 << (pass ?
"passed" :
"failed") <<
"." << std::endl;
402 COM_call_function( RFC_read, &tri0_mesh, &quad_mesh, NULL,
"tri02",
"quad20", format);
405 paneIt = comp[check_id].begin();
406 paneIt2 = coords[check_id].begin();
408 while(paneIt != comp[check_id].end()){
409 std::vector<double> &paneComp(*paneIt++);
410 std::vector<double> &paneCoords(*paneIt2++);
411 std::vector<double>::iterator pcIt = paneComp.begin();
412 std::vector<double>::iterator pcIt2 = paneCoords.begin();
413 while(pcIt != paneComp.end()){
414 double solnDiff = std::fabs(*pcIt - *pcIt2);
415 if(solnDiff > compTol){
417 std::cout << *pcIt <<
" != " << *pcIt2
418 <<
" (" << solnDiff <<
")" << std::endl;
424 std::cout <<
"Nodal transfer from Triangles 0 to Quads "
425 << (pass ?
"passed" :
"failed") <<
"." << std::endl;
429 paneIt = comp[check_id].begin();
430 paneIt2 = coords[check_id].begin();
432 while(paneIt != comp[check_id].end()){
433 std::vector<double> &paneComp(*paneIt++);
434 std::vector<double> &paneCoords(*paneIt2++);
435 std::vector<double>::iterator pcIt = paneComp.begin();
436 std::vector<double>::iterator pcIt2 = paneCoords.begin();
437 while(pcIt != paneComp.end()){
438 double solnDiff = std::fabs(*pcIt - *pcIt2);
439 if(solnDiff > compTol){
441 std::cout << *pcIt <<
" != " << *pcIt2
442 <<
" (" << solnDiff <<
")" << std::endl;
448 std::cout <<
"Nodal transfer from Quads to Triangles 0 "
449 << (pass ?
"passed" :
"failed") <<
"." << std::endl;
453 COM_call_function( RFC_read, &tri1_mesh, &quad_mesh, NULL,
"tri12",
"quad21", format);
456 paneIt = comp[check_id].begin();
457 paneIt2 = coords[check_id].begin();
459 while(paneIt != comp[check_id].end()){
460 std::vector<double> &paneComp(*paneIt++);
461 std::vector<double> &paneCoords(*paneIt2++);
462 std::vector<double>::iterator pcIt = paneComp.begin();
463 std::vector<double>::iterator pcIt2 = paneCoords.begin();
464 while(pcIt != paneComp.end()){
465 double solnDiff = std::fabs(*pcIt - *pcIt2);
466 if(solnDiff > compTol){
468 std::cout << *pcIt <<
" != " << *pcIt2
469 <<
" (" << solnDiff <<
")" << std::endl;
475 std::cout <<
"Nodal transfer from Triangles 1 to Quads "
476 << (pass ?
"passed" :
"failed") <<
"." << std::endl;
480 paneIt = comp[check_id].begin();
481 paneIt2 = coords[check_id].begin();
483 while(paneIt != comp[check_id].end()){
484 std::vector<double> &paneComp(*paneIt++);
485 std::vector<double> &paneCoords(*paneIt2++);
486 std::vector<double>::iterator pcIt = paneComp.begin();
487 std::vector<double>::iterator pcIt2 = paneCoords.begin();
488 while(pcIt != paneComp.end()){
489 double solnDiff = std::fabs(*pcIt - *pcIt2);
490 if(solnDiff > compTol){
492 std::cout << *pcIt <<
" != " << *pcIt2
493 <<
" (" << solnDiff <<
")" << std::endl;
499 std::cout <<
"Nodal transfer from Quads to Triangles 1 "
500 << (pass ?
"passed" :
"failed") <<
"." << std::endl;
504 for(
int i=0; i < nwindows; i++){
void initUnstructuredMesh(std::vector< double > &coors, std::vector< int > &elmts, int nrow, int ncol, int rank, int nproc, int type, int &nnodes, int &nelem)
void COM_delete_window(const char *wname)
void makeWindow(std::string name)
void COM_set_size(const char *wa_str, int pane_id, int size, int ng=0)
Set sizes of for a specific attribute.
int COM_get_attribute_handle(const char *waname)
void COM_window_init_done(const char *w_str, int pane_changed=true)
void COM_set_profiling(int i)
void COM_call_function(const int wf, int argc,...)
void COM_set_array(const char *wa_str, int pane_id, void *addr, int strd=0, int cap=0)
Associates an array with an attribute for a specific pane.
void COM_init(int *argc, char ***argv)
#define COM_LOAD_MODULE_STATIC_DYNAMIC(moduleName, windowString)
int COM_get_function_handle(const char *wfname)