ElmerFoamFSI  2.0
ElmerFoamFSI is fluid-solid interaction simulation application built up from OpenFOAM CFD and Elmer CSM coupled through the IMPACT multiphysics software integration infrastructure.
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Macros Groups Pages
ElmerModuleDriverTest.H
Go to the documentation of this file.
1 #ifndef __ELMERMODULEDRIVER_TEST_H__
13 #define __ELMERMODULEDRIVER_TEST_H__
14 #ifdef _ELMERMODULEDRIVER_PARALLEL_
15 #include "COMM.H"
16 #endif
17 #include "Testing.H"
18 #include "ExampleHeader.H"
19 #include "Profiler.H"
20 #include <vector>
21 #include <cmath>
22 #include <iomanip>
23 #include "com.h"
24 #include "com_devel.hpp"
25 #include "UnixUtils.H"
26 
27 COM_EXTERN_MODULE( ElmerCSC );
28 COM_EXTERN_MODULE( ElmerCSCParallel );
29 
30 namespace ElmerModuleDriver {
31 
35  namespace TestFixture {
41  double F1(double x) { return (2.0*x); };
47  double F2(double x) { return (3.0*x*x); };
48  };
58 
77  template<typename ResultsType>
78  class TestingObject : public IRAD::Util::TestingObject<ResultsType>
79  {
80  typedef IRAD::Util::TestingObject<ResultsType> TestingObjectBaseType;
81  protected:
82  // Example test fixtures for ElmerModuleDriver testing.
83  //
84  // In a real project, there would be many test fixtures
85  // in the TestingObject.
89  std::string ExampleTestFixture;
93  std::vector<int> N;
97  std::string SourceDirPath;
98  public:
103 
107  void SetSourceDirPath(std::string input){
108  SourceDirPath = input;
109  }
110 
111 
115  virtual void Epilogue() {};
116 
124  virtual void Prologue(){
125  ExampleTestFixture.assign("ExampleTestData");
126  for(int i = 10;i < 10000000;i*=10) N.push_back(i);
127  }
133  double F1(double x) { return (2.0*x); };
139  double F2(double x) { return (3.0*x*x); };
154  virtual void Test__ExampleFunction(ResultsType &result) {
155  // This is an actual test of the function called
156  // ExampleFunction. The name Test__XXXXX will
157  // eventually help automated utilities with
158  // running tests by name.
159  std::string ExampleResult(ExampleFunction(ExampleTestFixture));
160  result.UpdateResult("ExampleFunction:Works",
161  ExampleResult == ExampleTestFixture);
162  result.UpdateResult("ExampleFunction:Fails",
163  ExampleResult != ExampleTestFixture);
164  }
179  virtual void Test__TrapezoidQuadrature(ResultsType &result) {
180  std::ostringstream Ostr;
181  std::vector<double> E;
182  size_t n = 2*N.size();
183  bool runs = true;
184  for(std::vector<int>::iterator i = N.begin();i != N.end();i++){
185  double Ii = 0.0;
186  try {
188  } catch (...) {
189  runs = false;
190  }
191  E.push_back(std::fabs(Ii-1.0));
192  }
193  bool order2 = (E[0] < 1e-14);
194  for(std::vector<int>::iterator i = N.begin();i != N.end();i++){
195  double Ii = 0.0;
196  try {
198  } catch (...) {
199  runs = false;
200  }
201  E.push_back(std::fabs(Ii-1.0));
202  }
203  result.UpdateResult("TrapezoidQuadrature:Runs",runs);
204  result.UpdateResult("TrapezoidQuadrature:Accurate",E[n-1] < 1e-12);
205  for(int i = N.size();i < n - 1;i++){
206  double e = E[i+1]/E[i];
207  double n1 = static_cast<double>(N[i-N.size()])/static_cast<double>(N[(i-N.size())+1]);
208  double p = std::log(e)/std::log(n1);
209  p -= 2;
210  p = std::abs(p);
211  if(p > 2e-2){
212  order2 = false;
213  }
214  }
215  result.UpdateResult("TrapezoidQuadrature:Order2",order2);
216  }
217 
231  virtual void Test__MidPointQuadrature(ResultsType &result) {
232  std::ostringstream Ostr;
233  std::vector<double> Ibar;
234  std::vector<double> E;
235  size_t n = 2*N.size();
236  bool runs = true;
237  bool order2 = true;
238  for(std::vector<int>::iterator i = N.begin();i != N.end();i++){
239  double Ii = 0.0;
240  try {
242  } catch (...) {
243  runs = false;
244  }
245  Ibar.push_back(Ii);
246  E.push_back(std::fabs(Ii-1.0));
247  }
248  order2 = (E[0] < 1e-14);
249  for(std::vector<int>::iterator i = N.begin();i != N.end();i++){
250  double Ii = 0.0;
251  try {
253  } catch (...) {
254  runs = false;
255  }
256  Ibar.push_back(Ii);
257  E.push_back(std::fabs(Ii-1.0));
258  }
259  result.UpdateResult("MidPointQuadrature:Runs",runs);
260  result.UpdateResult("MidPointQuadrature:Accurate",E[n-1] < 1e-12);
261  for(int i = N.size();i < n - 1;i++){
262  double e = E[i+1]/E[i];
263  double n1 = static_cast<double>(N[i-N.size()])/static_cast<double>(N[(i-N.size())+1]);
264  double p = std::log(e)/std::log(n1);
265  p -= 2;
266  p = std::abs(p);
267  if(p > 1e-2){
268  order2 = false;
269  }
270  }
271  result.UpdateResult("MidPointQuadrature:Order2",order2);
272  }
273 
274 
281  //
282  // Example use:
283  // std::ifstream Inf1;
284  // std::ifstream Inf2;
285  // Inf1.open("file1");
286  // Inf2.open("file2");
287  //
288  // Just find out if they differ....
289  // if(streamdiff(Inf1,Inf2))
290  // std::cout << "Files differ." << std::endl;
291  //
292  // Report the differences....
293  // (reset the files)
294  // streamdiff(Inf1,Inf2,&std::cout);
295  //
296  int streamdiff(std::istream &stream1,std::istream &stream2,std::stringstream *ss = NULL){
297  int retval = 0;
298  std::string line1,line2;
299  while(!stream1.eof()){
300  std::getline(stream1,line1);
301  if(!stream2.eof())
302  std::getline(stream2,line2);
303  if(line1 != line2){
304  if(ss){
305  *ss << "1> " << line1 << std::endl
306  << "2> " << line2 << std::endl;
307  retval = 1;
308  }
309  else
310  return(1);
311  }
312  }
313  if(stream1.eof() != stream2.eof()){
314  return(1);
315  }
316  return(0);
317  }
318 
325  virtual int GetInputData(std::string suffix,std::string TestDir){
326 
327  std::cout << "In GetInputData" << std::endl;
328  std::string DirName;
329  std::string OrgDir;
330 
331  //Save original working directory for later
332  OrgDir = IRAD::Sys::CWD();
333 
334  //Create full path for test input data directory
335  DirName = SourceDirPath + suffix;
336 
337  //Check if data directory exists
338  if(!IRAD::Sys::FILEEXISTS(DirName)){
339  std::cout << "GetInputData Error: Could not find data directory, "
340  << DirName << ". Exiting (fail)." << std::endl;
341  return -1;
342  }
343 
344  std::ifstream Inf;
345  std::ofstream Ouf;
346  std::string InFileName;
347  std::string OutFileName;
348  int IntDir;
349 
350  //Create TestDir directory in current directory (if it doesn't
351  //already exist) to run our tests in.
352  if(!IRAD::Sys::FILEEXISTS(TestDir)){
353  IntDir = IRAD::Sys::CreateDirectory(TestDir);
354  if(IntDir == -1){
355  std::cout << "GetInputData Error: Could not make directory, "
356  << TestDir << ". Exiting (fail)." << std::endl;
357  return -1;
358  }
359  }
360 
361  //Open the input test data directory
362  IRAD::Sys::Directory SourceDir(DirName);
363 
364  //Change directories to TestDir directory for running
365  IntDir = IRAD::Sys::ChDir(TestDir);
366  if(IntDir == -1){
367  std::cout << "GetInputData Error: Could not change directories to "
368  << TestDir << ". Exiting (fail)." << std::endl;
369  return -1;
370  }
371 
372  //Copy input data to TestDir directory for running
373  for(std::vector<std::string>::iterator it = SourceDir.begin();
374  it != SourceDir.end(); ++it){
375  InFileName = DirName + "/" + *it;
376  OutFileName = IRAD::Sys::CWD() + "/" + *it;
377  // copy source to distnation recursively
378  if(IRAD::Sys::ISLINK(InFileName))
379  // preserve links, don't traverse
380  int IntDir = IRAD::Sys::SymLink(InFileName, OutFileName);
381  else if(IRAD::Sys::ISDIR(InFileName)) {
382  // recursively copy directories
383  int IntDir = GetInputData(InFileName, OutFileName);
384  } else {
385  // copy files, travserse into directories recursively
386  Inf.open(InFileName.c_str());
387  Ouf.open(OutFileName.c_str());
388  Ouf << Inf.rdbuf();
389  Ouf.close();
390  Inf.close();
391  }
392 
393  }
394 
395  //Change directories to back to original directory
396  IntDir = IRAD::Sys::ChDir(OrgDir);
397  if(IntDir == -1){
398  std::cout << "GetInputData Error: Could not change directories to "
399  << OrgDir << ". Exiting (fail)." << std::endl;
400  return -1;
401  }
402 
403  return 0;
404  }
405 
406 
415  virtual void Test__ElmerUnitTests(ResultsType &result){
416  std::cout << "Running Test__ElmerUnitTests" << std::endl;
417 
418  int IntDir;
419  std::string OrgDir, TestDir;
420  bool ItAllWorks = true;
421 
422  // Arrays that old data for check *******************************************
423  double CoordCheck[15][3] =
424  { {2.2999999999999998, 0.19296300000000000, 0.0000000000000000},
425  {2.2999999999999998, 0.00000000000000000, 0.0000000000000000},
426  {2.2999999999999998, 0.39523399999999997, 0.0000000000000000},
427  {2.2999999999999998, 0.60476600000000003, 0.0000000000000000},
428  {2.2999999999999998, 0.80703700000000000, 0.0000000000000000},
429  {2.2999999999999998, 1.00000000000000000, 0.0000000000000000},
430  {2.3585799999999999, 1.14142000000000010, 0.0000000000000000},
431  {2.5000000000000000, 1.20000000000000000, 0.0000000000000000},
432  {2.6414200000000001, 1.14142000000000010, 0.0000000000000000},
433  {2.7000000000000002, 1.00000000000000000, 0.0000000000000000},
434  {2.7000000000000002, 0.80703700000000000, 0.0000000000000000},
435  {2.7000000000000002, 0.60476600000000003, 0.0000000000000000},
436  {2.7000000000000002, 0.39523399999999997, 0.0000000000000000},
437  {2.7000000000000002, 0.19296300000000000, 0.0000000000000000},
438  {2.7000000000000002, 0.00000000000000000, 0.0000000000000000} };
439  int ConnCheck[14][2] =
440  { {1,2}, {3,1}, {4,3}, {5,4}, {6,5}, {7,6}, {8,7}, {9,8}, {10,9},
441  {11,10}, {12,11}, {13,12}, {14,13}, {15,14} };
442 
443  // Getting Input data********************************************************
444  //***************************************************************************
445 
446  //Call GetInputData to copy input test data to temp directory for running tests.
447  std::string suffix = "/share/Testing/test_data/FSIobstacle";
448 
449  //Make path for directory to run the test in.
450  TestDir = IRAD::Sys::CWD() + "/UnitTestData";
451  IntDir = GetInputData(suffix, TestDir);
452 
453  //Check if GetInputData exited correctly.
454  if(IntDir != 0){
455  std::cout << "ElmerUnitTests Error: GetInputData call failed."
456  << std::endl;
457  result.UpdateResult("ElmerUnitTests:Run", false);
458  return;
459  }
460 
461  //Check if TestDir directory (from GetInputData) exists in current directory
462  if(!IRAD::Sys::FILEEXISTS(TestDir)){
463  std::cout << "ElmerUnitTests Error: Could not find directory, "
464  << TestDir << ", for running tests." << std::endl;
465  result.UpdateResult("ElmerUnitTests:Run", false);
466  return;
467  }
468 
469  //Save original directory name for later
470  OrgDir = IRAD::Sys::CWD();
471 
472  //Change directories to TestDir directory for running
473  IntDir = IRAD::Sys::ChDir(TestDir);
474  if(IntDir == -1){
475  std::cout << "ElmerUnitTests Error: Could not change directories to "
476  << TestDir << "." << std::endl;
477  result.UpdateResult("ElmerUnitTests:Run", false);
478  return;
479  }
480 
481  //load Elmer module**********************************************************
482  //***************************************************************************
483  COM_LOAD_MODULE_STATIC_DYNAMIC( ElmerCSC, "Window1");
484 
485  bool load_unload = true;
486 
487  //Get Winodw handle
488  int h=COM_get_window_handle("Window1");
489  if(h <= 0){
490  std::cout << " After loading, COM_get_window_handle(\"Window1\") returns "
491  << h << std::endl;
492  load_unload=false;
493  std::cout << "ElmerUnitTests Error: Could not get window handle."
494  << "." << std::endl;
495  result.UpdateResult("LoadSolverModule:Works",false);
496  result.UpdateResult("ElmerUnitTests:Run", false);
497  return;
498  }
499  else
500  result.UpdateResult("LoadSolverModule:Works",true);
501 
503  // Get Initialize function handle and call Function
505  int init_handle = COM_get_function_handle("Window1.Initialize");
506  bool init_func = (init_handle > 0);
507  int init_runs = 0;
508  int verb=3;
509  std::cout << "init = " << init_handle << std::endl;
510  if(init_handle){
511  //Call the function
512  COM_call_function(init_handle, &init_runs, &verb);
513  }
514  else{
515  std::cout << "InitializeRuns Error: Could not get function handle."
516  << "." << std::endl;
517  result.UpdateResult("Initialize:Runs", false);
518  return;
519  }
520 
521  //Check if function changed value of runs properly
522  if(init_runs == 1){
523  result.UpdateResult("Initialize:Runs", true);
524  }
525  else{
526  result.UpdateResult("Initialize:Runs", false);
527  ItAllWorks = false;
528  }
529 
531  // Check coordinate values
533  int coord_handle = COM_get_dataitem_handle("Window1.nc");
534  int CoordSize=0;
535  bool coordData = (coord_handle > 0);
536  bool coordCorrect = true;
537  std::cout << "coord_handle = " << coord_handle << std::endl;
538  if(coordData){
539  COM_get_size("Window1.nc",11,&CoordSize);
540  if(CoordSize != 15){
541  std::cout << "ElmerUnitTests Error:"
542  << " Coord array is incorrect size!" << std::endl;
543  ItAllWorks = false;
544  coordCorrect = false;
545  }
546  else{
547  // Get the FSI mesh from the structures solver and print
548  // it out to check
549  double* Coord;
550  COM_get_array("Window1.nc",11,&Coord);
551  std::cout << "Coord:" << std::endl;
552  for(int i=0; i < CoordSize; i++){
553  for(int j=0; j < 3; j++){
554  std::cout << Coord[i*3+j] << " ";
555  if(fabs(CoordCheck[i][j] - Coord[i*3+j]) > 1.0e-12){
556  ItAllWorks = false;
557  coordCorrect = false;
558  }
559  }
560  std::cout << std::endl;
561  }
562  }
563  result.UpdateResult("CoordinateData:Correct", coordCorrect);
564  result.UpdateResult("CoordinateData:Registered", true);
565  }
566  else{
567  result.UpdateResult("CoordinateData:Registered", false);
568  result.UpdateResult("CoordinateData:Correct", false);
569  ItAllWorks = false;
570  }
571 
573  // Check connectivity values
575  bool connCorrect = true;
576  int ConnSize = 0;
577  int* Conn = NULL;
578 
579  // Get the FSI mesh from the structures solver
580  COM_get_array("Window1.:b2:",11,&Conn);
581  if(Conn){
582  // Get the FSI mesh size from the structures solver
583  COM_get_size("Window1.:b2:",11,&ConnSize);
584  if(ConnSize != 14){
585  std::cout << "ElmerUnitTests Error:"
586  << " Conn array is incorrect size!" << std::endl;
587  ItAllWorks = false;
588  connCorrect = false;
589  }
590  else{
591  // check the values
592  std::cout << "Conn:" << std::endl;
593  for(int i=0; i < ConnSize; i++){
594  for(int j=0; j < 2; j++){
595  std::cout << Conn[i*2+j] << " ";
596  if( (ConnCheck[i][j] - Conn[i*2+j]) != 0){
597  ItAllWorks = false;
598  connCorrect = false;
599  }
600  }
601  std::cout << std::endl;
602  }
603  }
604  result.UpdateResult("ConnectivityData:Correct", connCorrect);
605  result.UpdateResult("ConnectivityData:Registered", true);
606  }
607  else{
608  result.UpdateResult("ConnectivityData:Registered", false);
609  result.UpdateResult("ConnectivityData:Correct", false);
610  ItAllWorks = false;
611  }
612 
614  // Check load registration & initialization
616  double* Loads = NULL;
617  int LoadsSize = 0;
618  bool loadsRegistered = true, loadsInitialized = true;
619  // Get the FSI loads from the structures solver
620  COM_get_array("Window1.Loads",11,&Loads);
621  if(Loads){
622  std::cout << "Loads not NULL" << std::endl;
623  // Get the FSI load size from the structures solver
624  COM_get_size("Window1.Loads",11,&LoadsSize);
625  if(LoadsSize != 15){
626  std::cout << "ElmerUnitTests Error:"
627  << " Loads array is incorrect size!" << std::endl;
628  ItAllWorks = false;
629  loadsInitialized = false;
630  }
631  else{
632  // check the values
633  for(int i=0; i < LoadsSize; i++){
634  for(int j=0; j < 3; j++){
635  if(fabs(Loads[i*3 + j]) > 1.0e-12){
636  loadsInitialized = false;
637  ItAllWorks = false;
638  }
639  }
640  }
641  }
642  }
643  else{
644  std::cout << "Loads are NULL" << std::endl;
645  loadsRegistered = false;
646  loadsInitialized = false;
647  ItAllWorks = false;
648  }
649  result.UpdateResult("LoadData:Registered", loadsRegistered);
650  result.UpdateResult("LoadData:Initialized", loadsInitialized);
651 
653  // Get TimeStepper function handle and call Function
655 
656  // Arrays that hold disp data for check *********************************
657  double DispTime1[15][3] =
658  {{ 7.1605980866005031E-002, 3.5788052113870331E-002, 0.0000000000000000},
659  { -6.8871825230548747E-026, -6.7515261027908644E-026, 0.0000000000000000},
660  { 0.16559117138148402 , 6.1512134471618775E-002, 0.0000000000000000},
661  { 0.27105716643234351 , 7.0647177803958988E-002, 0.0000000000000000},
662  { 0.37408733220172607 , 6.6788253467455649E-002, 0.0000000000000000},
663  { 0.46975382688278072 , 5.5232228766620040E-002, 0.0000000000000000},
664  { 0.53059533135003267 , 1.7568173579321143E-002, 0.0000000000000000},
665  { 0.54088718131665003 , -5.0723278288525193E-002, 0.0000000000000000},
666  { 0.49733519851449115 , -0.10431856777439819 , 0.0000000000000000},
667  { 0.42342243323024942 , -0.11544236710979815 , 0.0000000000000000},
668  { 0.32858350010626158 , -9.6940873722311166E-002, 0.0000000000000000},
669  { 0.22913389910789400 , -7.6890455177259009E-002, 0.0000000000000000},
670  { 0.13256597264490513 , -5.4789959945688596E-002, 0.0000000000000000},
671  { 5.4547795662606154E-002, -2.9570884780950012E-002, 0.0000000000000000},
672  { -6.8871825230548747E-026, -6.7515261027908632E-026, 0.0000000000000000}};
673  double DispTime2[15][3] =
674  {{ 7.8382763777475994E-002, 3.7159701956680058E-002, 0.0000000000000000},
675  { -1.3908554346559520E-053, -1.3634598387444821E-053, 0.0000000000000000},
676  { 0.17746729339780631 , 6.3782065644847119E-002, 0.0000000000000000},
677  { 0.28589059231716707 , 7.3724507560836025E-002, 0.0000000000000000},
678  { 0.39007099539893136 , 7.0647599706400666E-002, 0.0000000000000000},
679  { 0.48577572075292708 , 5.9851545424915178E-002, 0.0000000000000000},
680  { 0.54619785916039254 , 2.2562624600359866E-002, 0.0000000000000000},
681  { 0.55515630051911513 , -4.5683794688744256E-002, 0.0000000000000000},
682  { 0.51164185034902454 , -9.8434990773815095E-002, 0.0000000000000000},
683  { 0.43876588136755668 , -0.10966508014917155 , 0.0000000000000000},
684  { 0.34337311330396592 , -9.2057033659364212E-002, 0.0000000000000000},
685  { 0.24185886373003795 , -7.3235312951635573E-002, 0.0000000000000000},
686  { 0.14168683127415216 , -5.2598213602584751E-002, 0.0000000000000000},
687  { 5.9082767678702033E-002, -2.8938645702423191E-002, 0.0000000000000000},
688  { -1.3908554346559520E-053, -1.3634598387444801E-053, 0.0000000000000000}};
689  //*********************************************************************
690  int runs_handle = COM_get_function_handle("Window1.Run");
691  bool runs_func = (runs_handle > 0);
692  bool DispCorrect = true;
693  int runs_runs = 0;
694  double time1 = 8.0;
695  double time2 = 100.0;
696  double* Disp = NULL;
697  int DispSize = 0;
698  COM_get_array("Window1.Displacements",11,&Disp);
699  std::cout << "runs = " << runs_handle << std::endl;
700  if(runs_handle){
701  //Call the run function for Time1
702  if(Loads){
703  std::cout << "Changing load values" << std::endl;
704  for(int i=0; i < LoadsSize; i++){
705  for(int j=0; j < 3; j++){
706  Loads[i*3 + j] = double(i*3 + j);
707  std::cout << Loads[i*3 + j] << " ";
708  }
709  std::cout << std::endl;
710  }
711  }
712  COM_call_function(runs_handle, &runs_runs, &time1);
713  }
714  else{
715  std::cout << "TimeStepperRuns Error: Could not get function handle."
716  << "." << std::endl;
717  result.UpdateResult("TimeStepper:Runs", false);
718  return;
719  }
720 
721  //Check if function changed value of runs properly
722  if(runs_runs > 0){
723  result.UpdateResult("TimeStepper:Runs", true);
724  }
725  else{
726  result.UpdateResult("TimeStepper:Runs", false);
727  ItAllWorks = false;
728  }
729 
730  // Check reigstration of displacement data
731  if (Disp){
732  result.UpdateResult("DisplacementData:Registered", true);
733  // Get the FSI displacement size from the structures solver
734  COM_get_size("Window1.Displacements",11,&DispSize);
735  if(DispSize != 15){
736  std::cout << "ElmerUnitTests Error:"
737  << " Disp array is incorrect size!" << std::endl;
738  ItAllWorks = false;
739  DispCorrect = false;
740  }
741  }
742  else{
743  result.UpdateResult("DisplacementData:Registered", false);
744  DispCorrect = false;
745  ItAllWorks = false;
746  }
747 
748  // Check values of displacements after Run func @ Time1
749  if (Disp && runs_handle && DispCorrect){
750  std::cout << "Checking Displacements Time 1 (" << time1 << ")" << std::endl;
751  for(int i=0; i < DispSize; i++){
752  for(int j=0; j < 3; j++){
753  std::cout << Disp[i*3+j] << " ";
754  if(fabs(DispTime1[i][j] - Disp[i*3+j]) > 1.0e-12){
755  ItAllWorks = false;
756  DispCorrect = false;
757  }
758  }
759  std::cout << std::endl;
760  }
761  //Change the load values again for testing
762  if(Loads){
763  std::cout << "Changing load values" << std::endl;
764  for(int i=0; i < LoadsSize; i++){
765  for(int j=0; j < 3; j++){
766  Loads[i*3 + j] = double(i*3 + j) + 1.0;
767  std::cout << Loads[i*3 + j] << " ";
768  }
769  std::cout << std::endl;
770  }
771  }
772  //Call the run function for Time2
773  int runs_runs2 = 0;
774  COM_call_function(runs_handle, &runs_runs2, &time2);
775  // Check values of displacements after Run func @ Time1
776  std::cout << "Checking Displacements Time 2 (" << time2 << ")" << std::endl;
777  for(int i=0; i < DispSize; i++){
778  for(int j=0; j < 3; j++){
779  std::cout << Disp[i*3+j] << " ";
780  if(fabs(DispTime2[i][j] - Disp[i*3+j]) > 1.0e-12){
781  ItAllWorks = false;
782  DispCorrect = false;
783  }
784  }
785  std::cout << std::endl;
786  }
787  //Check if function changed value of runs properly in Loads function
788  if(runs_runs > 1 && runs_runs2 > 1){
789  result.UpdateResult("TimeLoads:Runs", true);
790  }
791  else{
792  std::cout << "runs_runs = " << runs_runs << std::endl;
793  std::cout << "runs_runs2 = " << runs_runs2 << std::endl;
794  result.UpdateResult("TimeLoads:Runs", false);
795  ItAllWorks = false;
796  }
797  }
798  result.UpdateResult("DisplacementData:Correct", DispCorrect);
799 
800 
802  // Get Finalize function handle and call Function
804  int final_handle = COM_get_function_handle("Window1.Finalize");
805  bool final_func = (final_handle > 0);
806  int final_runs = 0;
807  std::cout << "final = " << final_handle << std::endl;
808  if(final_handle){
809  //Call the function
810  COM_call_function(final_handle, &final_runs);
811  }
812  else{
813  std::cout << "FinalizeRuns Error: Could not get function handle."
814  << "." << std::endl;
815  result.UpdateResult("Finalize:Runs", false);
816  return;
817  }
818 
819  //Check if function changed value of runs properly
820  if(final_runs == 1){
821  result.UpdateResult("Finalize:Runs", true);
822  }
823  else{
824  result.UpdateResult("Finalize:Runs", false);
825  ItAllWorks = false;
826  }
828 
829  //Unload Elmer module********************************************************
830  //***************************************************************************
831  COM_UNLOAD_MODULE_STATIC_DYNAMIC( ElmerCSC, "Window1");
832 
833  //Make sure module unloaded
834  h=COM_get_window_handle("Window1");
835  if(h > 0){
836  std::cout << "After unloading, COM_get_window_handle(\"Window1\") returns "
837  << h << std::endl;
838  load_unload=false;
839  std::cout << "ElmerUnitTests Error: Did not properly unload module."
840  << "." << std::endl;
841  result.UpdateResult("ElmerUnitTests:Run", false);
842  result.UpdateResult("UnloadSolverModule:Works",false);
843  return;
844  }
845  else
846  result.UpdateResult("UnloadSolverModule:Works",true);
847 
848  //Change directories out of TestDir directory back to original directory
849  IntDir = IRAD::Sys::ChDir(OrgDir);
850  if(IntDir == -1){
851  std::cout << "ElmerUnitTests Error: Could not change directories to "
852  << OrgDir << "." << std::endl;
853  result.UpdateResult("ElmerUnitTests:Run", false);
854  return;
855  }
856 
857  result.UpdateResult("ElmerUnitTests:Run", ItAllWorks);
858 
859  }
860 
861 
864 
871  virtual void Test__ElasticBeam3D_LoadFunction(ResultsType &result){
872  std::cout << "Running Test__ElasticBeam3D_LoadFunction" << std::endl;
873 
874  int IntDir;
875  std::string OrgDir, TestDir;
876  bool ItAllWorks = true;
877 
878  // Getting Input data********************************************************
879  //***************************************************************************
880 
881  //Call GetInputData to copy input test data to temp directory for running tests.
882  std::string suffix = "/share/Testing/test_data/ElasticBeam3D_LoadFunction";
883 
884  //Make path for directory to run the test in.
885  TestDir = IRAD::Sys::CWD() + "/ElasticBeam3D_TestData";
886  IntDir = GetInputData(suffix, TestDir);
887 
888  //Check if GetInputData exited correctly.
889  if(IntDir != 0){
890  std::cout << "ElasticBeam3D_LoadFunction Error: GetInputData call failed."
891  << std::endl;
892  result.UpdateResult("ElasticBeam3D_LoadFunction:Runs", false);
893  return;
894  }
895 
896  //Check if TestDir directory (from GetInputData) exists in current directory
897  if(!IRAD::Sys::FILEEXISTS(TestDir)){
898  std::cout << "ElasticBeam3D_LoadFunction Error: Could not find directory, "
899  << TestDir << ", for running tests." << std::endl;
900  result.UpdateResult("ElasticBeam3D_LoadFunction:Runs", false);
901  return;
902  }
903 
904  //Save original directory name for later
905  OrgDir = IRAD::Sys::CWD();
906 
907  //Change directories to TestDir directory for running
908  IntDir = IRAD::Sys::ChDir(TestDir);
909  if(IntDir == -1){
910  std::cout << "ElasticBeam3D_LoadFunction Error: Could not change directories to "
911  << TestDir << "." << std::endl;
912  result.UpdateResult("ElasticBeam3D_LoadFunction:Runs", false);
913  return;
914  }
915 
916  //load Elmer module**********************************************************
917  //***************************************************************************
918  COM_LOAD_MODULE_STATIC_DYNAMIC( ElmerCSC, "Window1");
919 
920  bool load_unload = true;
921 
922  //Get Winodw handle
923  int h=COM_get_window_handle("Window1");
924  if(h <= 0){
925  std::cout << " After loading, COM_get_window_handle(\"Window1\") returns "
926  << h << std::endl;
927  load_unload=false;
928  std::cout << "ElasticBeam3D_LoadFunction Error: Could not get window handle."
929  << "." << std::endl;
930  result.UpdateResult("ElasticBeam3D_LoadFunction:Runs", false);
931  return;
932  }
933 
935  // Get Initialize function handle and call Function
937  int init_handle = COM_get_function_handle("Window1.Initialize");
938  bool init_func = (init_handle > 0);
939  int init_runs = 0;
940  int verb=3;
941  std::cout << "init = " << init_handle << std::endl;
942  if(init_handle){
943  //Call the function
944  COM_call_function(init_handle, &init_runs, &verb);
945  }
946  else{
947  std::cout << "ElasticBeam3D_LoadFunction Error: Could not get function handle."
948  << "." << std::endl;
949  result.UpdateResult("ElasticBeam3D_LoadFunction:Runs", false);
950  return;
951  }
952 
954  // Check load registration & initialization
956  double* Loads = NULL;
957  int LoadsSize = 0;
958  bool loadsRegistered = true, loadsInitialized = true;
959  // Get the FSI mesh from the structures solver
960  COM_get_array("Window1.Loads",11,&Loads);
961  if(Loads){
962  COM_get_size("Window1.Loads",11,&LoadsSize);
963  std::cout << "Loads not NULL" << std::endl;
964  std::cout << "LoadsSize = " << LoadsSize << std::endl;
965  // check the values
966  for(int i=0; i < LoadsSize; i++){
967  for(int j=0; j < 3; j++){
968  if(fabs(Loads[i*3 + j]) > 1.0e-12){
969  std::cout << "Loads were not intialized to 0.0!" << std::endl;
970  result.UpdateResult("ElasticBeam3D_LoadFunction:Runs", false);
971  return;
972  }
973  }
974  }
975  }
976  else{
977  std::cout << "Loads are NULL" << std::endl;
978  result.UpdateResult("ElasticBeam3D_LoadFunction:Runs", false);
979  return;
980  }
981 
983  // Get TimeStepper function handle and call Function
985 
986  int runs_handle = COM_get_function_handle("Window1.Run");
987  bool runs_func = (runs_handle > 0);
988  bool DispCorrect = true;
989  int runs_runs = 0;
990  double time1 = 1.0;
991  double* Disp = NULL;
992  std::cout << "runs = " << runs_handle << std::endl;
993  if(runs_handle){
994  //Call the run function for Time1
995  if(Loads){
996  std::cout << "Changing load values" << std::endl;
997  for(int i=0; i < LoadsSize; i++){
998  Loads[i*3 + 1] = -4.0e5;
999  for(int j=0; j < 3; j++){
1000  std::cout << Loads[i*3 + j] << " ";
1001  }
1002  std::cout << std::endl;
1003  }
1004  }
1005  COM_call_function(runs_handle, &runs_runs, &time1);
1006  }
1007  else{
1008  std::cout << "ElasticBeam3D_LoadFunction Error: Could not get function handle."
1009  << "." << std::endl;
1010  result.UpdateResult("ElasticBeam3D_LoadFunction:Runs", false);
1011  return;
1012  }
1013 
1015  // Get Finalize function handle and call Function
1017  int final_handle = COM_get_function_handle("Window1.Finalize");
1018  bool final_func = (final_handle > 0);
1019  int final_runs = 0;
1020  std::cout << "final = " << final_handle << std::endl;
1021  if(final_handle){
1022  //Call the function
1023  COM_call_function(final_handle, &final_runs);
1024  }
1025  else{
1026  std::cout << "ElasticBeam3D_LoadFunction Error: Could not get function handle."
1027  << "." << std::endl;
1028  result.UpdateResult("ElasticBeam3D_LoadFunction:Runs", false);
1029  return;
1030  }
1031 
1033 
1035  // Compare the output file with an archived output file
1037  std::ifstream Inf, InfComp;
1038  std::stringstream ss;
1039  std::string word, line;
1040 
1041  Inf.open("case.ep");
1042  InfComp.open("case.ep_check");
1043 
1044  std::getline(Inf,line);
1045  std::getline(Inf,line);
1046  std::getline(InfComp,line);
1047  std::getline(InfComp,line);
1048 
1049  bool LoadWorks = true;
1050  int diffReturn = -1;
1051 
1052  diffReturn = streamdiff(Inf, InfComp, &ss);
1053 
1054  if(diffReturn){
1055  std::cout << "ElasticBeam3D_LoadFunction Error: case.ep "
1056  << "case.ep_check differ!" << std::endl;
1057  std::cout << ss.str() << std::endl;
1058  if(ss.str() != " ")
1059  LoadWorks = false;
1060  }
1061 
1062  std::cout << "LoadWorks = " << LoadWorks << std::endl;
1063  result.UpdateResult("ElasticBeam3D_LoadFunction:Works",LoadWorks);
1064 
1065  //Unload Elmer module********************************************************
1066  //***************************************************************************
1067  COM_UNLOAD_MODULE_STATIC_DYNAMIC( ElmerCSC , "Window1");
1068 
1069  //Make sure module unloaded
1070  h=COM_get_window_handle("Window1");
1071  if(h > 0){
1072  std::cout << "After unloading, COM_get_window_handle(\"Window1\") returns "
1073  << h << std::endl;
1074  load_unload=false;
1075  std::cout << "ElasticBeam3D_LoadFunction Error: Did not properly unload module."
1076  << "." << std::endl;
1077  result.UpdateResult("ElasticBeam3D_LoadFunction:Runs", false);
1078  return;
1079  }
1080 
1081  //Change directories out of TestDir directory back to original directory
1082  IntDir = IRAD::Sys::ChDir(OrgDir);
1083  if(IntDir == -1){
1084  std::cout << "ElasticBeam3D_LoadFunction Error: Could not change directories to "
1085  << OrgDir << "." << std::endl;
1086  result.UpdateResult("ElasticBeam3D_LoadFunction:Runs", false);
1087  return;
1088  }
1089 
1090  result.UpdateResult("ElasticBeam3D_LoadFunction:Runs", true);
1091 
1092  }
1095 
1104  virtual void Process(ResultsType &result){
1105  Prologue();
1106  Test__ExampleFunction(result);
1107  Test__TrapezoidQuadrature(result);
1108  Test__MidPointQuadrature(result);
1109  Test__ElmerUnitTests(result);
1110  Epilogue();
1111  }
1112 
1119  virtual void RunTest(const std::string &name,ResultsType &result)
1120  {
1121  Prologue();
1122  if(name == "ExampleFunction")
1123  Test__ExampleFunction(result);
1124  else if(name == "TrapezoidQuadrature")
1125  Test__TrapezoidQuadrature(result);
1126  else if(name == "MidPointQuadrature")
1127  Test__MidPointQuadrature(result);
1128  else if(name == "ElmerUnitTests")
1129  Test__ElmerUnitTests(result);
1130  else if(name == "ElasticBeam3D_LoadFunction")
1132  Epilogue();
1133  }
1134 
1141  virtual void ProcessTests(std::list<std::string> &test_names,ResultsType &result){
1142  Prologue();
1143  std::list<std::string>::iterator tni = test_names.begin();
1144  while(tni != test_names.end())
1145  RunTest(*tni++,result);
1146  Epilogue();
1147  }
1148 
1149 
1150  };
1151 
1156 #ifdef _ELMERMODULEDRIVER_PARALLEL_
1157  template<typename CommType,typename ResultsType>
1168  class ParallelTestingObject : TestingObject<ResultsType>
1169  {
1170  protected:
1171  // Example test fixtures for parallel ElmerModuleDriver testing.
1172  //
1176  CommType _communicator;
1180  std::vector<int> N;
1184  std::string SourceDirPath;
1185  public:
1189  ParallelTestingObject(CommType &incomm) :
1190  TestingObject<ResultsType>(), _communicator(incomm) {};
1191  CommType &GetCommunicator() { return(_communicator); };
1192 
1196  virtual void Epilogue() {};
1197 
1201  void SetSourceDirPath(std::string input){
1202  SourceDirPath = input;
1203  }
1204 
1212  virtual void Prologue(){
1213  for(int i = _communicator.Size();i <= 1000000;i*=2) N.push_back(i);
1214  };
1215 
1222  virtual int GetInputData(std::string sourceDirName, std::string TestDir){
1223  std::string OrgDir;
1224  //Save original working directory for later
1225  OrgDir = IRAD::Sys::CWD();
1226  //Check if data directory exists
1227  if(!IRAD::Sys::FILEEXISTS(sourceDirName)){
1228  std::cout << "GetInputData Error: Could not find data directory, "
1229  << sourceDirName << ". Exiting (fail)." << std::endl;
1230  return -1;
1231  }
1232  std::ifstream Inf;
1233  std::ofstream Ouf;
1234  std::string InFileName;
1235  std::string OutFileName;
1236  int IntDir;
1237  //Create TestDir directory in current directory (if it doesn't
1238  //already exist) to run our tests in.
1239  if(!IRAD::Sys::FILEEXISTS(TestDir)){
1240  IntDir = IRAD::Sys::CreateDirectory(TestDir);
1241  if(IntDir == -1){
1242  std::cout << "GetInputData Error: Could not make directory, "
1243  << TestDir << ". Exiting (fail)." << std::endl;
1244  return -1;
1245  }
1246  }
1247  //Open the input test data directory
1248  IRAD::Sys::Directory SourceDir(sourceDirName);
1249  //Change directories to TestDir directory for running
1250  IntDir = IRAD::Sys::ChDir(TestDir);
1251  if(IntDir == -1){
1252  std::cout << "GetInputData Error: Could not change directories to "
1253  << TestDir << ". Exiting (fail)." << std::endl;
1254  return -1;
1255  }
1256  //Copy input data to TestDir directory for running
1257  for(std::vector<std::string>::iterator it = SourceDir.begin();
1258  it != SourceDir.end(); ++it){
1259  InFileName = sourceDirName + "/" + *it;
1260  OutFileName = IRAD::Sys::CWD() + "/" + *it;
1261  //std::cout << "InFileName = " << InFileName
1262  // << ", OutFileName = " << OutFileName
1263  // << std::endl;
1264  // copy source to distnation recursively
1265  if(IRAD::Sys::ISLINK(InFileName))
1266  // preserve links, don't traverse
1267  int IntDir = IRAD::Sys::SymLink(InFileName, OutFileName);
1268  else if(IRAD::Sys::ISDIR(InFileName)) {
1269  // recursively copy directories
1270  int IntDir = GetInputData(InFileName, OutFileName);
1271  } else {
1272  // copy files, travserse into directories recursively
1273  Inf.open(InFileName.c_str());
1274  Ouf.open(OutFileName.c_str());
1275  Ouf << Inf.rdbuf();
1276  Ouf.close();
1277  Inf.close();
1278  }
1279 
1280  }
1281  //Change directories to back to original directory
1282  IntDir = IRAD::Sys::ChDir(OrgDir);
1283  if(IntDir == -1){
1284  std::cout << "GetInputData Error: Could not change directories to "
1285  << OrgDir << ". Exiting (fail)." << std::endl;
1286  return -1;
1287  }
1288  return 0;
1289  }
1290 
1307  virtual void Test__ParallelTrapezoidQuadrature(ResultsType &result) {
1308  std::ostringstream Ostr;
1309  int fixed_n = 1000000;
1310  int rank = _communicator.Rank();
1311  int nproc = _communicator.Size();
1312  double Ii = 0.0;
1313  bool runs = true;
1314  bool accurate = true;
1315  bool order2 = true;
1316  bool scales = true;
1317  std::vector<double> E;
1318  std::vector<double> times;
1319  for(int i = 1;i <= nproc;i*=nproc){
1320  CommType subcomm;
1321  int color = (rank < i);
1322  _communicator.Split(color,rank,subcomm);
1323  int nproc_color = subcomm.Size();
1324  double time0 = IRAD::Profiler::Time();
1325  if(color){
1326  Ii = 0.0;
1327  for(int j = 0;j < 200;j++){
1328  if(runs){
1329  try {
1331  } catch (...) {
1332  subcomm.SetExit(1);
1333  }
1334  if(subcomm.Check())
1335  runs = false;
1336  }
1337  }
1338  if(runs){
1339  double Itot = 0.0;
1340  subcomm.AllReduce(Ii, Itot,IRAD::Comm::DTDOUBLE, IRAD::Comm::SUMOP);
1341  double error = 0.0;
1342  error = std::abs(Itot - (200*nproc_color));
1343  accurate = (error < 1e-14);
1344  order2 = accurate;
1345  }
1346  }
1347  times.push_back(IRAD::Profiler::Time() - time0);
1348  if(nproc == 1)
1349  break;
1350  }
1351  if(!rank){
1352  double dt = *times.rbegin() - *times.begin();
1353  double percent_change = dt/(*times.begin());
1354  scales = (percent_change < (nproc*.005));
1355  }
1356  result.UpdateResult("ParallelTrapezoidQuadrature:Runs",runs);
1357  result.UpdateResult("ParallelTrapezoidQuadrature:Accurate",accurate);
1358  if(nproc > 1) // only report scaling results when procs are more than 1.
1359  result.UpdateResult("ParallelTrapezoidQuadrature:WeakScaling",scales);
1360  times.resize(0);
1361  if(nproc > 1){ // If running on more than one proc, then do strong scaling test.
1362  for(int i = 1;i <= nproc;i*=nproc){
1363  CommType subcomm;
1364  int color = (rank < i);
1365  _communicator.Split(color,rank,subcomm);
1366  int nproc_color = subcomm.Size();
1367  double time0 = IRAD::Profiler::Time();
1368  if(color){
1369  int npart = *N.rbegin()/nproc_color;
1370  Ii = 0.0;
1371  for(int j = 0;j < 200;j++){
1372  if(runs){
1373  try {
1375  } catch (...) {
1376  subcomm.SetExit(1);
1377  }
1378  if(subcomm.Check())
1379  runs = false;
1380  }
1381  }
1382  if(runs){
1383  double Itot = 0.0;
1384  subcomm.AllReduce(Ii, Itot,IRAD::Comm::DTDOUBLE, IRAD::Comm::SUMOP);
1385  double error = 0.0;
1386  error = std::abs(Itot - (200*nproc_color));
1387  accurate = (error < 1e-14);
1388  order2 = accurate;
1389  }
1390  }
1391  times.push_back(IRAD::Profiler::Time() - time0);
1392  }
1393  if(!rank){
1394  double n_t = (*times.begin())/(*times.rbegin());
1395  double n_p = n_t - nproc;
1396  n_p = std::abs(n_p)/nproc;
1397  scales = (n_p < 2e-1);
1398  }
1399  result.UpdateResult("ParallelTrapezoidQuadrateure:StrongScaling",scales);
1400  }
1401  for(int i = nproc;i <= 1000000;i*=10){
1402  if(runs){
1403  Ii = 0.0;
1404  int n = i/nproc;
1405  try {
1407  } catch (...) {
1408  _communicator.SetExit(1);
1409  }
1410  if(_communicator.Check())
1411  runs = false;
1412  if(runs){
1413  double Itot = 0.0;
1414  _communicator.AllReduce(Ii, Itot,IRAD::Comm::DTDOUBLE, IRAD::Comm::SUMOP);
1415  double error = 0.0;
1416  error = std::abs(Itot - nproc);
1417  E.push_back(error);
1418  }
1419  }
1420  }
1421  int esize = E.size();
1422  for(int i = 0;i < esize-1;i++){
1423  double e = E[i+1]/E[i];
1424  double n1 = .1;
1425  double p = std::log(e)/std::log(n1);
1426  p -= 2;
1427  p = std::abs(p);
1428  if(p > 1e-1){
1429  order2 = false;
1430  }
1431  }
1432  result.UpdateResult("ParallelTrapezoidQuadrature:Order2",order2);
1433  }
1434 
1435 
1452  virtual void Test__ParallelMidPointQuadrature(ResultsType &result) {
1453  std::ostringstream Ostr;
1454  int fixed_n = 1000000;
1455  int rank = _communicator.Rank();
1456  int nproc = _communicator.Size();
1457  double Ii = 0.0;
1458  bool runs = true;
1459  bool accurate = true;
1460  bool order2 = true;
1461  bool scales = true;
1462  std::vector<double> E;
1463  std::vector<double> times;
1464  for(int i = 1;i <= nproc;i*=nproc){
1465  CommType subcomm;
1466  int color = (rank < i);
1467  _communicator.Split(color,rank,subcomm);
1468  int nproc_color = subcomm.Size();
1469  double time0 = IRAD::Profiler::Time();
1470  if(color){
1471  Ii = 0.0;
1472  for(int j = 0;j < 200;j++){
1473  if(runs){
1474  try {
1476  } catch (...) {
1477  subcomm.SetExit(1);
1478  }
1479  if(subcomm.Check())
1480  runs = false;
1481  }
1482  }
1483  if(runs){
1484  double Itot = 0.0;
1485  subcomm.AllReduce(Ii, Itot,IRAD::Comm::DTDOUBLE, IRAD::Comm::SUMOP);
1486  double error = 0.0;
1487  error = std::abs(Itot - (200*nproc_color));
1488  accurate = (error < 1e-14);
1489  order2 = accurate;
1490  }
1491  }
1492  times.push_back(IRAD::Profiler::Time() - time0);
1493  if(nproc == 1)
1494  break;
1495  }
1496  if(!rank){
1497  double dt = *times.rbegin() - *times.begin();
1498  double percent_change = dt/(*times.begin());
1499  scales = (percent_change < (nproc*.005));
1500  // std::cout << "Weak scaling timings:" << std::endl;
1501  // std::vector<double>::iterator ti = weak_times.begin();
1502  // while(ti != weak_times.end()){
1503  // std::cout << ti-weak_times.begin()+1 << " "
1504  // << *ti << std::endl;
1505  // ti++;
1506  // }
1507  }
1508  result.UpdateResult("ParallelMidPointQuadrature:Runs",runs);
1509  result.UpdateResult("ParallelMidPointQuadrature:Accurate",accurate);
1510  if(nproc > 1) // only report scaling results for nproc > 1
1511  result.UpdateResult("ParallelMidPointQuadrature:WeakScaling",scales);
1512  times.resize(0);
1513  if(nproc > 1){ // only do scaling test if nproc > 1
1514  for(int i = 1;i <= nproc;i*=nproc){
1515  CommType subcomm;
1516  int color = (rank < i);
1517  _communicator.Split(color,rank,subcomm);
1518  int nproc_color = subcomm.Size();
1519  double time0 = IRAD::Profiler::Time();
1520  if(color){
1521  int npart = *N.rbegin()/nproc_color;
1522  Ii = 0.0;
1523  for(int j = 0;j < 200;j++){
1524  if(runs){
1525  try {
1527  } catch (...) {
1528  subcomm.SetExit(1);
1529  }
1530  if(subcomm.Check())
1531  runs = false;
1532  }
1533  }
1534  if(runs){
1535  double Itot = 0.0;
1536  subcomm.AllReduce(Ii, Itot,IRAD::Comm::DTDOUBLE, IRAD::Comm::SUMOP);
1537  double error = 0.0;
1538  error = std::abs(Itot - (200*nproc_color));
1539  accurate = (error < 1e-14);
1540  order2 = accurate;
1541  }
1542  }
1543  times.push_back(IRAD::Profiler::Time() - time0);
1544  }
1545  if(!rank){
1546  double n_t = (*times.begin())/(*times.rbegin());
1547  double n_p = n_t - nproc;
1548  n_p = std::abs(n_p)/nproc;
1549  scales = (n_p < 2e-1);
1550  }
1551  result.UpdateResult("ParallelMidPointQuadrateure:StrongScaling",scales);
1552  }
1553  for(int i = nproc;i <= 1000000;i*=10){
1554  if(runs){
1555  Ii = 0.0;
1556  int n = i/nproc;
1557  try {
1559  } catch (...) {
1560  _communicator.SetExit(1);
1561  }
1562  if(_communicator.Check())
1563  runs = false;
1564  if(runs){
1565  double Itot = 0.0;
1566  _communicator.AllReduce(Ii, Itot,IRAD::Comm::DTDOUBLE, IRAD::Comm::SUMOP);
1567  double error = 0.0;
1568  error = std::abs(Itot - nproc);
1569  E.push_back(error);
1570  }
1571  }
1572  }
1573  int esize = E.size();
1574  for(int i = 0;i < esize-1;i++){
1575  double e = E[i+1]/E[i];
1576  double n1 = .1;
1577  double p = std::log(e)/std::log(n1);
1578  p -= 2;
1579  p = std::abs(p);
1580  if(p > 1e-1){
1581  order2 = false;
1582  }
1583  }
1584  result.UpdateResult("ParallelMidPointQuadrature:Order2",order2);
1585  }
1586 
1593  virtual void Test__ParCommunicatorPassToModule(ResultsType &result){
1594  std::cout << "Running Test__ParCommunicatorPassToModule" << std::endl;
1595  bool commSets = false;
1596  bool commSize = false;
1597  bool commPass = false;
1598  int rank = (GetCommunicator()).Rank();
1599  int nProc = (GetCommunicator()).Size();
1600  MPI_Comm comm_check, comm_orig;
1601  // check communicator
1602  comm_orig = (GetCommunicator()).GetCommunicator();
1603  // changing default communicator for COM
1604  COM_set_default_communicator((GetCommunicator()).GetCommunicator());
1605  // loading parallel Elmer module
1606  COM_LOAD_MODULE_STATIC_DYNAMIC( ElmerCSCParallel, "ElmerModule");
1607  // cheking default communicator
1608  COM_get_communicator("ElmerModule", &comm_check);
1609  if (comm_check == comm_orig)
1610  commSets = true;
1611  else
1612  std::cout << "Rank #" << rank << ", "
1613  << "Default communicator for window is not set properly. It supposed to be "
1614  << comm_orig << ", but it is set to " << comm_check << std::endl;
1615  // cheking the number of processors
1616  int* nProcWindow;
1617  COM_get_array("ElmerModule.nProc", 0, &nProcWindow);
1618  if (nProc == *nProcWindow)
1619  commSize = true;
1620  else
1621  std::cout << "Rank #" << rank << ", "
1622  << "Size of the communicator for window is not correct. It supposed to be "
1623  << nProc << ", but it is set to " << *nProcWindow << std::endl;
1624  // cheking communicator
1625  if (commSize && commSets)
1626  commPass = true;
1627  // unloading the module
1628  COM_UNLOAD_MODULE_STATIC_DYNAMIC( ElmerCSCParallel, "ElmerModule");
1629  // setting test flag
1630  result.UpdateResult("ParCommunicatorSetToModule:Works", commSets);
1631  result.UpdateResult("ParCommunicatorSizeToModule:Works", commSets);
1632  result.UpdateResult("ParCommunicatorPassToModule:Works", commPass);
1633  }
1634 
1635 
1642  virtual void Test__ParElmerUnitTests(ResultsType &result){
1643  std::cout << "Running Test__ParElmerUnitTests" << std::endl;
1644 
1645  int IntDir;
1646  std::string OrgDir, TestDir;
1647  int ItAllWorks = 1;
1648  int nproc = _communicator.Size();
1649  int rank = _communicator.Rank();
1650 
1651  // Arrays that old data for check *******************************************
1652  /*
1653  int ConnCheck[14][2] =
1654  { {1,2}, {3,1}, {4,3}, {5,4}, {6,5}, {7,6}, {8,7}, {9,8}, {10,9},
1655  {11,10}, {12,11}, {13,12}, {14,13}, {15,14} };
1656  */
1657 
1659  // Getting Input data
1661 
1662  //Call GetInputData to copy input test data to temp directory for running tests.
1663  std::string sourceDirName = SourceDirPath + "/share/Testing/test_data/ParElasticBeam3D_LoadFunction";
1664  //Make path for directory to run the test in.
1665  TestDir = IRAD::Sys::CWD() + "/ParUnitTestData";
1666  if (rank == 0){
1667  IntDir = GetInputData(sourceDirName, TestDir);
1668  //Check if GetInputData exited correctly.
1669  if(IntDir != 0){
1670  std::cout << "ParElmerUnitTests Error: GetInputData call failed."
1671  << std::endl;
1672  result.UpdateResult("ElmerUnitTests:Run", false);
1673  }
1674  }
1675  _communicator.Barrier();
1676  //Check if TestDir directory (from GetInputData) exists in current directory
1677  if(!IRAD::Sys::FILEEXISTS(TestDir)){
1678  std::cout << "ParElmerUnitTests Error: Could not find directory, "
1679  << TestDir << ", for running tests." << std::endl;
1680  result.UpdateResult("ParElmerUnitTests:Run", false);
1681  return;
1682  }
1683  //Save original directory name for later
1684  OrgDir = IRAD::Sys::CWD();
1685  //Change directories to TestDir directory for running
1686  IntDir = IRAD::Sys::ChDir(TestDir);
1687  if(IntDir == -1){
1688  std::cout << "ElmerUnitTests Error: Could not change directories to "
1689  << TestDir << "." << std::endl;
1690  result.UpdateResult("ElmerUnitTests:Run", false);
1691  return;
1692  }
1693 
1695  //load Elmer module
1697  COM_LOAD_MODULE_STATIC_DYNAMIC( ElmerCSCParallel, "Window1");
1698  bool load_unload = true;
1699 
1700  //Get Winodw handle
1701  int h = COM_get_window_handle("Window1");
1702  if(h <= 0){
1703  std::cout << " After loading, COM_get_window_handle(\"Window1\") returns "
1704  << h << std::endl;
1705  load_unload=false;
1706  std::cout << "ElmerUnitTests Error: Could not get window handle."
1707  << "." << std::endl;
1708  result.UpdateResult("ParLoadSolverModule:Works",false);
1709  result.UpdateResult("ParElmerUnitTests:Run", false);
1710  return;
1711  }
1712  else
1713  result.UpdateResult("ParLoadSolverModule:Works",true);
1714 
1715 
1717  // Get Initialize function handle and call Function
1719  int init_handle = COM_get_function_handle("Window1.Initialize");
1720  bool init_func = (init_handle > 0);
1721  int init_runs = 0;
1722  int verb=3;
1723  if(init_handle){
1724  //Call the function
1725  COM_call_function(init_handle, &init_runs, &verb);
1726  }
1727  else{
1728  std::cout << "InitializeRuns Error: Could not get function handle."
1729  << "." << std::endl;
1730  result.UpdateResult("ParInitialize:Runs", false);
1731  return;
1732  }
1733  //Check if function changed value of runs properly
1734  if(init_runs == 1){
1735  result.UpdateResult("ParInitialize:Runs", true);
1736  }
1737  else{
1738  result.UpdateResult("ParInitialize:Runs", false);
1739  ItAllWorks = 0;
1740  }
1741 
1743  // Check coordinate values
1745  double CoordCheck0[306][3] = {
1746  {0.013875704358900, 0.050000000000000, 0.000000000000000},
1747  {0.000000000000000, 0.050000000000000, 0.000000000000000},
1748  {0.000000000000000, 0.050000000000000, 0.010000000000000},
1749  {0.013875704358900, 0.050000000000000, 0.010000000000000},
1750  {0.033498913650700, 0.050000000000000, 0.000000000000000},
1751  {0.033498913650700, 0.050000000000000, 0.010000000000000},
1752  {0.066501086349300, 0.050000000000000, 0.000000000000000},
1753  {0.066501086349300, 0.050000000000000, 0.010000000000000},
1754  {0.086124295641100, 0.050000000000000, 0.000000000000000},
1755  {0.086124295641100, 0.050000000000000, 0.010000000000000},
1756  {0.100000000000000, 0.050000000000000, 0.000000000000000},
1757  {0.100000000000000, 0.050000000000000, 0.010000000000000},
1758  {0.000000000000000, 0.050000000000000, 0.020000000000000},
1759  {0.013875704358900, 0.050000000000000, 0.020000000000000},
1760  {0.033498913650700, 0.050000000000000, 0.020000000000000},
1761  {0.066501086349300, 0.050000000000000, 0.020000000000000},
1762  {0.086124295641100, 0.050000000000000, 0.020000000000000},
1763  {0.100000000000000, 0.050000000000000, 0.020000000000000},
1764  {0.000000000000000, 0.050000000000000, 0.030000000000000},
1765  {0.013875704358900, 0.050000000000000, 0.030000000000000},
1766  {0.033498913650700, 0.050000000000000, 0.030000000000000},
1767  {0.066501086349300, 0.050000000000000, 0.030000000000000},
1768  {0.086124295641100, 0.050000000000000, 0.030000000000000},
1769  {0.100000000000000, 0.050000000000000, 0.030000000000000},
1770  {0.000000000000000, 0.050000000000000, 0.040000000000000},
1771  {0.013875704358900, 0.050000000000000, 0.040000000000000},
1772  {0.033498913650700, 0.050000000000000, 0.040000000000000},
1773  {0.066501086349300, 0.050000000000000, 0.040000000000000},
1774  {0.086124295641100, 0.050000000000000, 0.040000000000000},
1775  {0.100000000000000, 0.050000000000000, 0.040000000000000},
1776  {0.000000000000000, 0.050000000000000, 0.050000000000000},
1777  {0.013875704358900, 0.050000000000000, 0.050000000000000},
1778  {0.033498913650700, 0.050000000000000, 0.050000000000000},
1779  {0.066501086349300, 0.050000000000000, 0.050000000000000},
1780  {0.086124295641100, 0.050000000000000, 0.050000000000000},
1781  {0.100000000000000, 0.050000000000000, 0.050000000000000},
1782  {0.000000000000000, 0.050000000000000, 0.060000000000000},
1783  {0.013875704358900, 0.050000000000000, 0.060000000000000},
1784  {0.033498913650700, 0.050000000000000, 0.060000000000000},
1785  {0.066501086349300, 0.050000000000000, 0.060000000000000},
1786  {0.086124295641100, 0.050000000000000, 0.060000000000000},
1787  {0.100000000000000, 0.050000000000000, 0.060000000000000},
1788  {0.000000000000000, 0.050000000000000, 0.070000000000000},
1789  {0.013875704358900, 0.050000000000000, 0.070000000000000},
1790  {0.033498913650700, 0.050000000000000, 0.070000000000000},
1791  {0.066501086349300, 0.050000000000000, 0.070000000000000},
1792  {0.086124295641100, 0.050000000000000, 0.070000000000000},
1793  {0.100000000000000, 0.050000000000000, 0.070000000000000},
1794  {0.000000000000000, 0.050000000000000, 0.080000000000000},
1795  {0.013875704358900, 0.050000000000000, 0.080000000000000},
1796  {0.033498913650700, 0.050000000000000, 0.080000000000000},
1797  {0.066501086349300, 0.050000000000000, 0.080000000000000},
1798  {0.086124295641100, 0.050000000000000, 0.080000000000000},
1799  {0.100000000000000, 0.050000000000000, 0.080000000000000},
1800  {0.000000000000000, 0.050000000000000, 0.090000000000000},
1801  {0.013875704358900, 0.050000000000000, 0.090000000000000},
1802  {0.033498913650700, 0.050000000000000, 0.090000000000000},
1803  {0.066501086349300, 0.050000000000000, 0.090000000000000},
1804  {0.086124295641100, 0.050000000000000, 0.090000000000000},
1805  {0.100000000000000, 0.050000000000000, 0.090000000000000},
1806  {0.000000000000000, 0.050000000000000, 0.100000000000000},
1807  {0.013875704358900, 0.050000000000000, 0.100000000000000},
1808  {0.033498913650700, 0.050000000000000, 0.100000000000000},
1809  {0.066501086349300, 0.050000000000000, 0.100000000000000},
1810  {0.086124295641100, 0.050000000000000, 0.100000000000000},
1811  {0.100000000000000, 0.050000000000000, 0.100000000000000},
1812  {0.000000000000000, 0.050000000000000, 0.110000000000000},
1813  {0.013875704358900, 0.050000000000000, 0.110000000000000},
1814  {0.033498913650700, 0.050000000000000, 0.110000000000000},
1815  {0.066501086349300, 0.050000000000000, 0.110000000000000},
1816  {0.086124295641100, 0.050000000000000, 0.110000000000000},
1817  {0.100000000000000, 0.050000000000000, 0.110000000000000},
1818  {0.000000000000000, 0.050000000000000, 0.120000000000000},
1819  {0.013875704358900, 0.050000000000000, 0.120000000000000},
1820  {0.033498913650700, 0.050000000000000, 0.120000000000000},
1821  {0.066501086349300, 0.050000000000000, 0.120000000000000},
1822  {0.086124295641100, 0.050000000000000, 0.120000000000000},
1823  {0.100000000000000, 0.050000000000000, 0.120000000000000},
1824  {0.000000000000000, 0.050000000000000, 0.130000000000000},
1825  {0.013875704358900, 0.050000000000000, 0.130000000000000},
1826  {0.033498913650700, 0.050000000000000, 0.130000000000000},
1827  {0.066501086349300, 0.050000000000000, 0.130000000000000},
1828  {0.086124295641100, 0.050000000000000, 0.130000000000000},
1829  {0.100000000000000, 0.050000000000000, 0.130000000000000},
1830  {0.000000000000000, 0.050000000000000, 0.140000000000000},
1831  {0.013875704358900, 0.050000000000000, 0.140000000000000},
1832  {0.033498913650700, 0.050000000000000, 0.140000000000000},
1833  {0.066501086349300, 0.050000000000000, 0.140000000000000},
1834  {0.086124295641100, 0.050000000000000, 0.140000000000000},
1835  {0.100000000000000, 0.050000000000000, 0.140000000000000},
1836  {0.000000000000000, 0.050000000000000, 0.150000000000000},
1837  {0.013875704358900, 0.050000000000000, 0.150000000000000},
1838  {0.033498913650700, 0.050000000000000, 0.150000000000000},
1839  {0.066501086349300, 0.050000000000000, 0.150000000000000},
1840  {0.086124295641100, 0.050000000000000, 0.150000000000000},
1841  {0.100000000000000, 0.050000000000000, 0.150000000000000},
1842  {0.000000000000000, 0.050000000000000, 0.160000000000000},
1843  {0.013875704358900, 0.050000000000000, 0.160000000000000},
1844  {0.033498913650700, 0.050000000000000, 0.160000000000000},
1845  {0.066501086349300, 0.050000000000000, 0.160000000000000},
1846  {0.086124295641100, 0.050000000000000, 0.160000000000000},
1847  {0.100000000000000, 0.050000000000000, 0.160000000000000},
1848  {0.000000000000000, 0.050000000000000, 0.170000000000000},
1849  {0.013875704358900, 0.050000000000000, 0.170000000000000},
1850  {0.033498913650700, 0.050000000000000, 0.170000000000000},
1851  {0.066501086349300, 0.050000000000000, 0.170000000000000},
1852  {0.086124295641100, 0.050000000000000, 0.170000000000000},
1853  {0.100000000000000, 0.050000000000000, 0.170000000000000},
1854  {0.000000000000000, 0.050000000000000, 0.180000000000000},
1855  {0.013875704358900, 0.050000000000000, 0.180000000000000},
1856  {0.033498913650700, 0.050000000000000, 0.180000000000000},
1857  {0.066501086349300, 0.050000000000000, 0.180000000000000},
1858  {0.086124295641100, 0.050000000000000, 0.180000000000000},
1859  {0.100000000000000, 0.050000000000000, 0.180000000000000},
1860  {0.000000000000000, 0.050000000000000, 0.190000000000000},
1861  {0.013875704358900, 0.050000000000000, 0.190000000000000},
1862  {0.033498913650700, 0.050000000000000, 0.190000000000000},
1863  {0.066501086349300, 0.050000000000000, 0.190000000000000},
1864  {0.086124295641100, 0.050000000000000, 0.190000000000000},
1865  {0.100000000000000, 0.050000000000000, 0.190000000000000},
1866  {0.000000000000000, 0.050000000000000, 0.200000000000000},
1867  {0.013875704358900, 0.050000000000000, 0.200000000000000},
1868  {0.033498913650700, 0.050000000000000, 0.200000000000000},
1869  {0.066501086349300, 0.050000000000000, 0.200000000000000},
1870  {0.086124295641100, 0.050000000000000, 0.200000000000000},
1871  {0.100000000000000, 0.050000000000000, 0.200000000000000},
1872  {0.000000000000000, 0.050000000000000, 0.210000000000000},
1873  {0.013875704358900, 0.050000000000000, 0.210000000000000},
1874  {0.033498913650700, 0.050000000000000, 0.210000000000000},
1875  {0.066501086349300, 0.050000000000000, 0.210000000000000},
1876  {0.086124295641100, 0.050000000000000, 0.210000000000000},
1877  {0.100000000000000, 0.050000000000000, 0.210000000000000},
1878  {0.000000000000000, 0.050000000000000, 0.220000000000000},
1879  {0.013875704358900, 0.050000000000000, 0.220000000000000},
1880  {0.033498913650700, 0.050000000000000, 0.220000000000000},
1881  {0.066501086349300, 0.050000000000000, 0.220000000000000},
1882  {0.086124295641100, 0.050000000000000, 0.220000000000000},
1883  {0.100000000000000, 0.050000000000000, 0.220000000000000},
1884  {0.000000000000000, 0.050000000000000, 0.230000000000000},
1885  {0.013875704358900, 0.050000000000000, 0.230000000000000},
1886  {0.033498913650700, 0.050000000000000, 0.230000000000000},
1887  {0.066501086349300, 0.050000000000000, 0.230000000000000},
1888  {0.086124295641100, 0.050000000000000, 0.230000000000000},
1889  {0.100000000000000, 0.050000000000000, 0.230000000000000},
1890  {0.000000000000000, 0.050000000000000, 0.240000000000000},
1891  {0.013875704358900, 0.050000000000000, 0.240000000000000},
1892  {0.033498913650700, 0.050000000000000, 0.240000000000000},
1893  {0.066501086349300, 0.050000000000000, 0.240000000000000},
1894  {0.086124295641100, 0.050000000000000, 0.240000000000000},
1895  {0.100000000000000, 0.050000000000000, 0.240000000000000},
1896  {0.000000000000000, 0.050000000000000, 0.250000000000000},
1897  {0.013875704358900, 0.050000000000000, 0.250000000000000},
1898  {0.033498913650700, 0.050000000000000, 0.250000000000000},
1899  {0.066501086349300, 0.050000000000000, 0.250000000000000},
1900  {0.086124295641100, 0.050000000000000, 0.250000000000000},
1901  {0.100000000000000, 0.050000000000000, 0.250000000000000},
1902  {0.000000000000000, 0.050000000000000, 0.260000000000000},
1903  {0.013875704358900, 0.050000000000000, 0.260000000000000},
1904  {0.033498913650700, 0.050000000000000, 0.260000000000000},
1905  {0.066501086349300, 0.050000000000000, 0.260000000000000},
1906  {0.086124295641100, 0.050000000000000, 0.260000000000000},
1907  {0.100000000000000, 0.050000000000000, 0.260000000000000},
1908  {0.000000000000000, 0.050000000000000, 0.270000000000000},
1909  {0.013875704358900, 0.050000000000000, 0.270000000000000},
1910  {0.033498913650700, 0.050000000000000, 0.270000000000000},
1911  {0.066501086349300, 0.050000000000000, 0.270000000000000},
1912  {0.086124295641100, 0.050000000000000, 0.270000000000000},
1913  {0.100000000000000, 0.050000000000000, 0.270000000000000},
1914  {0.000000000000000, 0.050000000000000, 0.280000000000000},
1915  {0.013875704358900, 0.050000000000000, 0.280000000000000},
1916  {0.033498913650700, 0.050000000000000, 0.280000000000000},
1917  {0.066501086349300, 0.050000000000000, 0.280000000000000},
1918  {0.086124295641100, 0.050000000000000, 0.280000000000000},
1919  {0.100000000000000, 0.050000000000000, 0.280000000000000},
1920  {0.000000000000000, 0.050000000000000, 0.290000000000000},
1921  {0.013875704358900, 0.050000000000000, 0.290000000000000},
1922  {0.033498913650700, 0.050000000000000, 0.290000000000000},
1923  {0.066501086349300, 0.050000000000000, 0.290000000000000},
1924  {0.086124295641100, 0.050000000000000, 0.290000000000000},
1925  {0.100000000000000, 0.050000000000000, 0.290000000000000},
1926  {0.000000000000000, 0.050000000000000, 0.300000000000000},
1927  {0.013875704358900, 0.050000000000000, 0.300000000000000},
1928  {0.033498913650700, 0.050000000000000, 0.300000000000000},
1929  {0.066501086349300, 0.050000000000000, 0.300000000000000},
1930  {0.086124295641100, 0.050000000000000, 0.300000000000000},
1931  {0.100000000000000, 0.050000000000000, 0.300000000000000},
1932  {0.000000000000000, 0.050000000000000, 0.310000000000000},
1933  {0.013875704358900, 0.050000000000000, 0.310000000000000},
1934  {0.033498913650700, 0.050000000000000, 0.310000000000000},
1935  {0.066501086349300, 0.050000000000000, 0.310000000000000},
1936  {0.086124295641100, 0.050000000000000, 0.310000000000000},
1937  {0.100000000000000, 0.050000000000000, 0.310000000000000},
1938  {0.000000000000000, 0.050000000000000, 0.320000000000000},
1939  {0.013875704358900, 0.050000000000000, 0.320000000000000},
1940  {0.033498913650700, 0.050000000000000, 0.320000000000000},
1941  {0.066501086349300, 0.050000000000000, 0.320000000000000},
1942  {0.086124295641100, 0.050000000000000, 0.320000000000000},
1943  {0.100000000000000, 0.050000000000000, 0.320000000000000},
1944  {0.000000000000000, 0.050000000000000, 0.330000000000000},
1945  {0.013875704358900, 0.050000000000000, 0.330000000000000},
1946  {0.033498913650700, 0.050000000000000, 0.330000000000000},
1947  {0.066501086349300, 0.050000000000000, 0.330000000000000},
1948  {0.086124295641100, 0.050000000000000, 0.330000000000000},
1949  {0.100000000000000, 0.050000000000000, 0.330000000000000},
1950  {0.000000000000000, 0.050000000000000, 0.340000000000000},
1951  {0.013875704358900, 0.050000000000000, 0.340000000000000},
1952  {0.033498913650700, 0.050000000000000, 0.340000000000000},
1953  {0.066501086349300, 0.050000000000000, 0.340000000000000},
1954  {0.086124295641100, 0.050000000000000, 0.340000000000000},
1955  {0.100000000000000, 0.050000000000000, 0.340000000000000},
1956  {0.000000000000000, 0.050000000000000, 0.350000000000000},
1957  {0.013875704358900, 0.050000000000000, 0.350000000000000},
1958  {0.033498913650700, 0.050000000000000, 0.350000000000000},
1959  {0.066501086349300, 0.050000000000000, 0.350000000000000},
1960  {0.086124295641100, 0.050000000000000, 0.350000000000000},
1961  {0.100000000000000, 0.050000000000000, 0.350000000000000},
1962  {0.000000000000000, 0.050000000000000, 0.360000000000000},
1963  {0.013875704358900, 0.050000000000000, 0.360000000000000},
1964  {0.033498913650700, 0.050000000000000, 0.360000000000000},
1965  {0.066501086349300, 0.050000000000000, 0.360000000000000},
1966  {0.086124295641100, 0.050000000000000, 0.360000000000000},
1967  {0.100000000000000, 0.050000000000000, 0.360000000000000},
1968  {0.000000000000000, 0.050000000000000, 0.370000000000000},
1969  {0.013875704358900, 0.050000000000000, 0.370000000000000},
1970  {0.033498913650700, 0.050000000000000, 0.370000000000000},
1971  {0.066501086349300, 0.050000000000000, 0.370000000000000},
1972  {0.086124295641100, 0.050000000000000, 0.370000000000000},
1973  {0.100000000000000, 0.050000000000000, 0.370000000000000},
1974  {0.000000000000000, 0.050000000000000, 0.380000000000000},
1975  {0.013875704358900, 0.050000000000000, 0.380000000000000},
1976  {0.033498913650700, 0.050000000000000, 0.380000000000000},
1977  {0.066501086349300, 0.050000000000000, 0.380000000000000},
1978  {0.086124295641100, 0.050000000000000, 0.380000000000000},
1979  {0.100000000000000, 0.050000000000000, 0.380000000000000},
1980  {0.000000000000000, 0.050000000000000, 0.390000000000000},
1981  {0.013875704358900, 0.050000000000000, 0.390000000000000},
1982  {0.033498913650700, 0.050000000000000, 0.390000000000000},
1983  {0.066501086349300, 0.050000000000000, 0.390000000000000},
1984  {0.086124295641100, 0.050000000000000, 0.390000000000000},
1985  {0.100000000000000, 0.050000000000000, 0.390000000000000},
1986  {0.000000000000000, 0.050000000000000, 0.400000000000000},
1987  {0.013875704358900, 0.050000000000000, 0.400000000000000},
1988  {0.033498913650700, 0.050000000000000, 0.400000000000000},
1989  {0.066501086349300, 0.050000000000000, 0.400000000000000},
1990  {0.086124295641100, 0.050000000000000, 0.400000000000000},
1991  {0.100000000000000, 0.050000000000000, 0.400000000000000},
1992  {0.000000000000000, 0.050000000000000, 0.410000000000000},
1993  {0.013875704358900, 0.050000000000000, 0.410000000000000},
1994  {0.033498913650700, 0.050000000000000, 0.410000000000000},
1995  {0.066501086349300, 0.050000000000000, 0.410000000000000},
1996  {0.086124295641100, 0.050000000000000, 0.410000000000000},
1997  {0.100000000000000, 0.050000000000000, 0.410000000000000},
1998  {0.000000000000000, 0.050000000000000, 0.420000000000000},
1999  {0.013875704358900, 0.050000000000000, 0.420000000000000},
2000  {0.033498913650700, 0.050000000000000, 0.420000000000000},
2001  {0.066501086349300, 0.050000000000000, 0.420000000000000},
2002  {0.086124295641100, 0.050000000000000, 0.420000000000000},
2003  {0.100000000000000, 0.050000000000000, 0.420000000000000},
2004  {0.000000000000000, 0.050000000000000, 0.430000000000000},
2005  {0.013875704358900, 0.050000000000000, 0.430000000000000},
2006  {0.033498913650700, 0.050000000000000, 0.430000000000000},
2007  {0.066501086349300, 0.050000000000000, 0.430000000000000},
2008  {0.086124295641100, 0.050000000000000, 0.430000000000000},
2009  {0.100000000000000, 0.050000000000000, 0.430000000000000},
2010  {0.000000000000000, 0.050000000000000, 0.440000000000000},
2011  {0.013875704358900, 0.050000000000000, 0.440000000000000},
2012  {0.033498913650700, 0.050000000000000, 0.440000000000000},
2013  {0.066501086349300, 0.050000000000000, 0.440000000000000},
2014  {0.086124295641100, 0.050000000000000, 0.440000000000000},
2015  {0.100000000000000, 0.050000000000000, 0.440000000000000},
2016  {0.000000000000000, 0.050000000000000, 0.450000000000000},
2017  {0.013875704358900, 0.050000000000000, 0.450000000000000},
2018  {0.033498913650700, 0.050000000000000, 0.450000000000000},
2019  {0.066501086349300, 0.050000000000000, 0.450000000000000},
2020  {0.086124295641100, 0.050000000000000, 0.450000000000000},
2021  {0.100000000000000, 0.050000000000000, 0.450000000000000},
2022  {0.000000000000000, 0.050000000000000, 0.460000000000000},
2023  {0.013875704358900, 0.050000000000000, 0.460000000000000},
2024  {0.033498913650700, 0.050000000000000, 0.460000000000000},
2025  {0.066501086349300, 0.050000000000000, 0.460000000000000},
2026  {0.086124295641100, 0.050000000000000, 0.460000000000000},
2027  {0.100000000000000, 0.050000000000000, 0.460000000000000},
2028  {0.000000000000000, 0.050000000000000, 0.470000000000000},
2029  {0.013875704358900, 0.050000000000000, 0.470000000000000},
2030  {0.033498913650700, 0.050000000000000, 0.470000000000000},
2031  {0.066501086349300, 0.050000000000000, 0.470000000000000},
2032  {0.086124295641100, 0.050000000000000, 0.470000000000000},
2033  {0.100000000000000, 0.050000000000000, 0.470000000000000},
2034  {0.000000000000000, 0.050000000000000, 0.480000000000000},
2035  {0.013875704358900, 0.050000000000000, 0.480000000000000},
2036  {0.033498913650700, 0.050000000000000, 0.480000000000000},
2037  {0.066501086349300, 0.050000000000000, 0.480000000000000},
2038  {0.086124295641100, 0.050000000000000, 0.480000000000000},
2039  {0.100000000000000, 0.050000000000000, 0.480000000000000},
2040  {0.000000000000000, 0.050000000000000, 0.490000000000000},
2041  {0.013875704358900, 0.050000000000000, 0.490000000000000},
2042  {0.033498913650700, 0.050000000000000, 0.490000000000000},
2043  {0.066501086349300, 0.050000000000000, 0.490000000000000},
2044  {0.086124295641100, 0.050000000000000, 0.490000000000000},
2045  {0.100000000000000, 0.050000000000000, 0.490000000000000},
2046  {0.000000000000000, 0.050000000000000, 0.500000000000000},
2047  {0.013875704358900, 0.050000000000000, 0.500000000000000},
2048  {0.033498913650700, 0.050000000000000, 0.500000000000000},
2049  {0.066501086349300, 0.050000000000000, 0.500000000000000},
2050  {0.086124295641100, 0.050000000000000, 0.500000000000000},
2051  {0.100000000000000, 0.050000000000000, 0.500000000000000} };
2052 
2053  double CoordCheck1[306][3] = {
2054  {0.013875704358900, 0.050000000000000, 0.500000000000000},
2055  {0.000000000000000, 0.050000000000000, 0.500000000000000},
2056  {0.000000000000000, 0.050000000000000, 0.510000000000000},
2057  {0.013875704358900, 0.050000000000000, 0.510000000000000},
2058  {0.033498913650700, 0.050000000000000, 0.500000000000000},
2059  {0.033498913650700, 0.050000000000000, 0.510000000000000},
2060  {0.066501086349300, 0.050000000000000, 0.500000000000000},
2061  {0.066501086349300, 0.050000000000000, 0.510000000000000},
2062  {0.086124295641100, 0.050000000000000, 0.500000000000000},
2063  {0.086124295641100, 0.050000000000000, 0.510000000000000},
2064  {0.100000000000000, 0.050000000000000, 0.500000000000000},
2065  {0.100000000000000, 0.050000000000000, 0.510000000000000},
2066  {0.000000000000000, 0.050000000000000, 0.520000000000000},
2067  {0.013875704358900, 0.050000000000000, 0.520000000000000},
2068  {0.033498913650700, 0.050000000000000, 0.520000000000000},
2069  {0.066501086349300, 0.050000000000000, 0.520000000000000},
2070  {0.086124295641100, 0.050000000000000, 0.520000000000000},
2071  {0.100000000000000, 0.050000000000000, 0.520000000000000},
2072  {0.000000000000000, 0.050000000000000, 0.530000000000000},
2073  {0.013875704358900, 0.050000000000000, 0.530000000000000},
2074  {0.033498913650700, 0.050000000000000, 0.530000000000000},
2075  {0.066501086349300, 0.050000000000000, 0.530000000000000},
2076  {0.086124295641100, 0.050000000000000, 0.530000000000000},
2077  {0.100000000000000, 0.050000000000000, 0.530000000000000},
2078  {0.000000000000000, 0.050000000000000, 0.540000000000000},
2079  {0.013875704358900, 0.050000000000000, 0.540000000000000},
2080  {0.033498913650700, 0.050000000000000, 0.540000000000000},
2081  {0.066501086349300, 0.050000000000000, 0.540000000000000},
2082  {0.086124295641100, 0.050000000000000, 0.540000000000000},
2083  {0.100000000000000, 0.050000000000000, 0.540000000000000},
2084  {0.000000000000000, 0.050000000000000, 0.550000000000000},
2085  {0.013875704358900, 0.050000000000000, 0.550000000000000},
2086  {0.033498913650700, 0.050000000000000, 0.550000000000000},
2087  {0.066501086349300, 0.050000000000000, 0.550000000000000},
2088  {0.086124295641100, 0.050000000000000, 0.550000000000000},
2089  {0.100000000000000, 0.050000000000000, 0.550000000000000},
2090  {0.000000000000000, 0.050000000000000, 0.560000000000000},
2091  {0.013875704358900, 0.050000000000000, 0.560000000000000},
2092  {0.033498913650700, 0.050000000000000, 0.560000000000000},
2093  {0.066501086349300, 0.050000000000000, 0.560000000000000},
2094  {0.086124295641100, 0.050000000000000, 0.560000000000000},
2095  {0.100000000000000, 0.050000000000000, 0.560000000000000},
2096  {0.000000000000000, 0.050000000000000, 0.570000000000000},
2097  {0.013875704358900, 0.050000000000000, 0.570000000000000},
2098  {0.033498913650700, 0.050000000000000, 0.570000000000000},
2099  {0.066501086349300, 0.050000000000000, 0.570000000000000},
2100  {0.086124295641100, 0.050000000000000, 0.570000000000000},
2101  {0.100000000000000, 0.050000000000000, 0.570000000000000},
2102  {0.000000000000000, 0.050000000000000, 0.580000000000000},
2103  {0.013875704358900, 0.050000000000000, 0.580000000000000},
2104  {0.033498913650700, 0.050000000000000, 0.580000000000000},
2105  {0.066501086349300, 0.050000000000000, 0.580000000000000},
2106  {0.086124295641100, 0.050000000000000, 0.580000000000000},
2107  {0.100000000000000, 0.050000000000000, 0.580000000000000},
2108  {0.000000000000000, 0.050000000000000, 0.590000000000000},
2109  {0.013875704358900, 0.050000000000000, 0.590000000000000},
2110  {0.033498913650700, 0.050000000000000, 0.590000000000000},
2111  {0.066501086349300, 0.050000000000000, 0.590000000000000},
2112  {0.086124295641100, 0.050000000000000, 0.590000000000000},
2113  {0.100000000000000, 0.050000000000000, 0.590000000000000},
2114  {0.000000000000000, 0.050000000000000, 0.600000000000000},
2115  {0.013875704358900, 0.050000000000000, 0.600000000000000},
2116  {0.033498913650700, 0.050000000000000, 0.600000000000000},
2117  {0.066501086349300, 0.050000000000000, 0.600000000000000},
2118  {0.086124295641100, 0.050000000000000, 0.600000000000000},
2119  {0.100000000000000, 0.050000000000000, 0.600000000000000},
2120  {0.000000000000000, 0.050000000000000, 0.610000000000000},
2121  {0.013875704358900, 0.050000000000000, 0.610000000000000},
2122  {0.033498913650700, 0.050000000000000, 0.610000000000000},
2123  {0.066501086349300, 0.050000000000000, 0.610000000000000},
2124  {0.086124295641100, 0.050000000000000, 0.610000000000000},
2125  {0.100000000000000, 0.050000000000000, 0.610000000000000},
2126  {0.000000000000000, 0.050000000000000, 0.620000000000000},
2127  {0.013875704358900, 0.050000000000000, 0.620000000000000},
2128  {0.033498913650700, 0.050000000000000, 0.620000000000000},
2129  {0.066501086349300, 0.050000000000000, 0.620000000000000},
2130  {0.086124295641100, 0.050000000000000, 0.620000000000000},
2131  {0.100000000000000, 0.050000000000000, 0.620000000000000},
2132  {0.000000000000000, 0.050000000000000, 0.630000000000000},
2133  {0.013875704358900, 0.050000000000000, 0.630000000000000},
2134  {0.033498913650700, 0.050000000000000, 0.630000000000000},
2135  {0.066501086349300, 0.050000000000000, 0.630000000000000},
2136  {0.086124295641100, 0.050000000000000, 0.630000000000000},
2137  {0.100000000000000, 0.050000000000000, 0.630000000000000},
2138  {0.000000000000000, 0.050000000000000, 0.640000000000000},
2139  {0.013875704358900, 0.050000000000000, 0.640000000000000},
2140  {0.033498913650700, 0.050000000000000, 0.640000000000000},
2141  {0.066501086349300, 0.050000000000000, 0.640000000000000},
2142  {0.086124295641100, 0.050000000000000, 0.640000000000000},
2143  {0.100000000000000, 0.050000000000000, 0.640000000000000},
2144  {0.000000000000000, 0.050000000000000, 0.650000000000000},
2145  {0.013875704358900, 0.050000000000000, 0.650000000000000},
2146  {0.033498913650700, 0.050000000000000, 0.650000000000000},
2147  {0.066501086349300, 0.050000000000000, 0.650000000000000},
2148  {0.086124295641100, 0.050000000000000, 0.650000000000000},
2149  {0.100000000000000, 0.050000000000000, 0.650000000000000},
2150  {0.000000000000000, 0.050000000000000, 0.660000000000000},
2151  {0.013875704358900, 0.050000000000000, 0.660000000000000},
2152  {0.033498913650700, 0.050000000000000, 0.660000000000000},
2153  {0.066501086349300, 0.050000000000000, 0.660000000000000},
2154  {0.086124295641100, 0.050000000000000, 0.660000000000000},
2155  {0.100000000000000, 0.050000000000000, 0.660000000000000},
2156  {0.000000000000000, 0.050000000000000, 0.670000000000000},
2157  {0.013875704358900, 0.050000000000000, 0.670000000000000},
2158  {0.033498913650700, 0.050000000000000, 0.670000000000000},
2159  {0.066501086349300, 0.050000000000000, 0.670000000000000},
2160  {0.086124295641100, 0.050000000000000, 0.670000000000000},
2161  {0.100000000000000, 0.050000000000000, 0.670000000000000},
2162  {0.000000000000000, 0.050000000000000, 0.680000000000000},
2163  {0.013875704358900, 0.050000000000000, 0.680000000000000},
2164  {0.033498913650700, 0.050000000000000, 0.680000000000000},
2165  {0.066501086349300, 0.050000000000000, 0.680000000000000},
2166  {0.086124295641100, 0.050000000000000, 0.680000000000000},
2167  {0.100000000000000, 0.050000000000000, 0.680000000000000},
2168  {0.000000000000000, 0.050000000000000, 0.690000000000000},
2169  {0.013875704358900, 0.050000000000000, 0.690000000000000},
2170  {0.033498913650700, 0.050000000000000, 0.690000000000000},
2171  {0.066501086349300, 0.050000000000000, 0.690000000000000},
2172  {0.086124295641100, 0.050000000000000, 0.690000000000000},
2173  {0.100000000000000, 0.050000000000000, 0.690000000000000},
2174  {0.000000000000000, 0.050000000000000, 0.700000000000000},
2175  {0.013875704358900, 0.050000000000000, 0.700000000000000},
2176  {0.033498913650700, 0.050000000000000, 0.700000000000000},
2177  {0.066501086349300, 0.050000000000000, 0.700000000000000},
2178  {0.086124295641100, 0.050000000000000, 0.700000000000000},
2179  {0.100000000000000, 0.050000000000000, 0.700000000000000},
2180  {0.000000000000000, 0.050000000000000, 0.710000000000000},
2181  {0.013875704358900, 0.050000000000000, 0.710000000000000},
2182  {0.033498913650700, 0.050000000000000, 0.710000000000000},
2183  {0.066501086349300, 0.050000000000000, 0.710000000000000},
2184  {0.086124295641100, 0.050000000000000, 0.710000000000000},
2185  {0.100000000000000, 0.050000000000000, 0.710000000000000},
2186  {0.000000000000000, 0.050000000000000, 0.720000000000000},
2187  {0.013875704358900, 0.050000000000000, 0.720000000000000},
2188  {0.033498913650700, 0.050000000000000, 0.720000000000000},
2189  {0.066501086349300, 0.050000000000000, 0.720000000000000},
2190  {0.086124295641100, 0.050000000000000, 0.720000000000000},
2191  {0.100000000000000, 0.050000000000000, 0.720000000000000},
2192  {0.000000000000000, 0.050000000000000, 0.730000000000000},
2193  {0.013875704358900, 0.050000000000000, 0.730000000000000},
2194  {0.033498913650700, 0.050000000000000, 0.730000000000000},
2195  {0.066501086349300, 0.050000000000000, 0.730000000000000},
2196  {0.086124295641100, 0.050000000000000, 0.730000000000000},
2197  {0.100000000000000, 0.050000000000000, 0.730000000000000},
2198  {0.000000000000000, 0.050000000000000, 0.740000000000000},
2199  {0.013875704358900, 0.050000000000000, 0.740000000000000},
2200  {0.033498913650700, 0.050000000000000, 0.740000000000000},
2201  {0.066501086349300, 0.050000000000000, 0.740000000000000},
2202  {0.086124295641100, 0.050000000000000, 0.740000000000000},
2203  {0.100000000000000, 0.050000000000000, 0.740000000000000},
2204  {0.000000000000000, 0.050000000000000, 0.750000000000000},
2205  {0.013875704358900, 0.050000000000000, 0.750000000000000},
2206  {0.033498913650700, 0.050000000000000, 0.750000000000000},
2207  {0.066501086349300, 0.050000000000000, 0.750000000000000},
2208  {0.086124295641100, 0.050000000000000, 0.750000000000000},
2209  {0.100000000000000, 0.050000000000000, 0.750000000000000},
2210  {0.000000000000000, 0.050000000000000, 0.760000000000000},
2211  {0.013875704358900, 0.050000000000000, 0.760000000000000},
2212  {0.033498913650700, 0.050000000000000, 0.760000000000000},
2213  {0.066501086349300, 0.050000000000000, 0.760000000000000},
2214  {0.086124295641100, 0.050000000000000, 0.760000000000000},
2215  {0.100000000000000, 0.050000000000000, 0.760000000000000},
2216  {0.000000000000000, 0.050000000000000, 0.770000000000000},
2217  {0.013875704358900, 0.050000000000000, 0.770000000000000},
2218  {0.033498913650700, 0.050000000000000, 0.770000000000000},
2219  {0.066501086349300, 0.050000000000000, 0.770000000000000},
2220  {0.086124295641100, 0.050000000000000, 0.770000000000000},
2221  {0.100000000000000, 0.050000000000000, 0.770000000000000},
2222  {0.000000000000000, 0.050000000000000, 0.780000000000000},
2223  {0.013875704358900, 0.050000000000000, 0.780000000000000},
2224  {0.033498913650700, 0.050000000000000, 0.780000000000000},
2225  {0.066501086349300, 0.050000000000000, 0.780000000000000},
2226  {0.086124295641100, 0.050000000000000, 0.780000000000000},
2227  {0.100000000000000, 0.050000000000000, 0.780000000000000},
2228  {0.000000000000000, 0.050000000000000, 0.790000000000000},
2229  {0.013875704358900, 0.050000000000000, 0.790000000000000},
2230  {0.033498913650700, 0.050000000000000, 0.790000000000000},
2231  {0.066501086349300, 0.050000000000000, 0.790000000000000},
2232  {0.086124295641100, 0.050000000000000, 0.790000000000000},
2233  {0.100000000000000, 0.050000000000000, 0.790000000000000},
2234  {0.000000000000000, 0.050000000000000, 0.800000000000000},
2235  {0.013875704358900, 0.050000000000000, 0.800000000000000},
2236  {0.033498913650700, 0.050000000000000, 0.800000000000000},
2237  {0.066501086349300, 0.050000000000000, 0.800000000000000},
2238  {0.086124295641100, 0.050000000000000, 0.800000000000000},
2239  {0.100000000000000, 0.050000000000000, 0.800000000000000},
2240  {0.000000000000000, 0.050000000000000, 0.810000000000000},
2241  {0.013875704358900, 0.050000000000000, 0.810000000000000},
2242  {0.033498913650700, 0.050000000000000, 0.810000000000000},
2243  {0.066501086349300, 0.050000000000000, 0.810000000000000},
2244  {0.086124295641100, 0.050000000000000, 0.810000000000000},
2245  {0.100000000000000, 0.050000000000000, 0.810000000000000},
2246  {0.000000000000000, 0.050000000000000, 0.820000000000000},
2247  {0.013875704358900, 0.050000000000000, 0.820000000000000},
2248  {0.033498913650700, 0.050000000000000, 0.820000000000000},
2249  {0.066501086349300, 0.050000000000000, 0.820000000000000},
2250  {0.086124295641100, 0.050000000000000, 0.820000000000000},
2251  {0.100000000000000, 0.050000000000000, 0.820000000000000},
2252  {0.000000000000000, 0.050000000000000, 0.830000000000000},
2253  {0.013875704358900, 0.050000000000000, 0.830000000000000},
2254  {0.033498913650700, 0.050000000000000, 0.830000000000000},
2255  {0.066501086349300, 0.050000000000000, 0.830000000000000},
2256  {0.086124295641100, 0.050000000000000, 0.830000000000000},
2257  {0.100000000000000, 0.050000000000000, 0.830000000000000},
2258  {0.000000000000000, 0.050000000000000, 0.840000000000000},
2259  {0.013875704358900, 0.050000000000000, 0.840000000000000},
2260  {0.033498913650700, 0.050000000000000, 0.840000000000000},
2261  {0.066501086349300, 0.050000000000000, 0.840000000000000},
2262  {0.086124295641100, 0.050000000000000, 0.840000000000000},
2263  {0.100000000000000, 0.050000000000000, 0.840000000000000},
2264  {0.000000000000000, 0.050000000000000, 0.850000000000000},
2265  {0.013875704358900, 0.050000000000000, 0.850000000000000},
2266  {0.033498913650700, 0.050000000000000, 0.850000000000000},
2267  {0.066501086349300, 0.050000000000000, 0.850000000000000},
2268  {0.086124295641100, 0.050000000000000, 0.850000000000000},
2269  {0.100000000000000, 0.050000000000000, 0.850000000000000},
2270  {0.000000000000000, 0.050000000000000, 0.860000000000000},
2271  {0.013875704358900, 0.050000000000000, 0.860000000000000},
2272  {0.033498913650700, 0.050000000000000, 0.860000000000000},
2273  {0.066501086349300, 0.050000000000000, 0.860000000000000},
2274  {0.086124295641100, 0.050000000000000, 0.860000000000000},
2275  {0.100000000000000, 0.050000000000000, 0.860000000000000},
2276  {0.000000000000000, 0.050000000000000, 0.870000000000000},
2277  {0.013875704358900, 0.050000000000000, 0.870000000000000},
2278  {0.033498913650700, 0.050000000000000, 0.870000000000000},
2279  {0.066501086349300, 0.050000000000000, 0.870000000000000},
2280  {0.086124295641100, 0.050000000000000, 0.870000000000000},
2281  {0.100000000000000, 0.050000000000000, 0.870000000000000},
2282  {0.000000000000000, 0.050000000000000, 0.880000000000000},
2283  {0.013875704358900, 0.050000000000000, 0.880000000000000},
2284  {0.033498913650700, 0.050000000000000, 0.880000000000000},
2285  {0.066501086349300, 0.050000000000000, 0.880000000000000},
2286  {0.086124295641100, 0.050000000000000, 0.880000000000000},
2287  {0.100000000000000, 0.050000000000000, 0.880000000000000},
2288  {0.000000000000000, 0.050000000000000, 0.890000000000000},
2289  {0.013875704358900, 0.050000000000000, 0.890000000000000},
2290  {0.033498913650700, 0.050000000000000, 0.890000000000000},
2291  {0.066501086349300, 0.050000000000000, 0.890000000000000},
2292  {0.086124295641100, 0.050000000000000, 0.890000000000000},
2293  {0.100000000000000, 0.050000000000000, 0.890000000000000},
2294  {0.000000000000000, 0.050000000000000, 0.900000000000000},
2295  {0.013875704358900, 0.050000000000000, 0.900000000000000},
2296  {0.033498913650700, 0.050000000000000, 0.900000000000000},
2297  {0.066501086349300, 0.050000000000000, 0.900000000000000},
2298  {0.086124295641100, 0.050000000000000, 0.900000000000000},
2299  {0.100000000000000, 0.050000000000000, 0.900000000000000},
2300  {0.000000000000000, 0.050000000000000, 0.910000000000000},
2301  {0.013875704358900, 0.050000000000000, 0.910000000000000},
2302  {0.033498913650700, 0.050000000000000, 0.910000000000000},
2303  {0.066501086349300, 0.050000000000000, 0.910000000000000},
2304  {0.086124295641100, 0.050000000000000, 0.910000000000000},
2305  {0.100000000000000, 0.050000000000000, 0.910000000000000},
2306  {0.000000000000000, 0.050000000000000, 0.920000000000000},
2307  {0.013875704358900, 0.050000000000000, 0.920000000000000},
2308  {0.033498913650700, 0.050000000000000, 0.920000000000000},
2309  {0.066501086349300, 0.050000000000000, 0.920000000000000},
2310  {0.086124295641100, 0.050000000000000, 0.920000000000000},
2311  {0.100000000000000, 0.050000000000000, 0.920000000000000},
2312  {0.000000000000000, 0.050000000000000, 0.930000000000000},
2313  {0.013875704358900, 0.050000000000000, 0.930000000000000},
2314  {0.033498913650700, 0.050000000000000, 0.930000000000000},
2315  {0.066501086349300, 0.050000000000000, 0.930000000000000},
2316  {0.086124295641100, 0.050000000000000, 0.930000000000000},
2317  {0.100000000000000, 0.050000000000000, 0.930000000000000},
2318  {0.000000000000000, 0.050000000000000, 0.940000000000000},
2319  {0.013875704358900, 0.050000000000000, 0.940000000000000},
2320  {0.033498913650700, 0.050000000000000, 0.940000000000000},
2321  {0.066501086349300, 0.050000000000000, 0.940000000000000},
2322  {0.086124295641100, 0.050000000000000, 0.940000000000000},
2323  {0.100000000000000, 0.050000000000000, 0.940000000000000},
2324  {0.000000000000000, 0.050000000000000, 0.950000000000000},
2325  {0.013875704358900, 0.050000000000000, 0.950000000000000},
2326  {0.033498913650700, 0.050000000000000, 0.950000000000000},
2327  {0.066501086349300, 0.050000000000000, 0.950000000000000},
2328  {0.086124295641100, 0.050000000000000, 0.950000000000000},
2329  {0.100000000000000, 0.050000000000000, 0.950000000000000},
2330  {0.000000000000000, 0.050000000000000, 0.960000000000000},
2331  {0.013875704358900, 0.050000000000000, 0.960000000000000},
2332  {0.033498913650700, 0.050000000000000, 0.960000000000000},
2333  {0.066501086349300, 0.050000000000000, 0.960000000000000},
2334  {0.086124295641100, 0.050000000000000, 0.960000000000000},
2335  {0.100000000000000, 0.050000000000000, 0.960000000000000},
2336  {0.000000000000000, 0.050000000000000, 0.970000000000000},
2337  {0.013875704358900, 0.050000000000000, 0.970000000000000},
2338  {0.033498913650700, 0.050000000000000, 0.970000000000000},
2339  {0.066501086349300, 0.050000000000000, 0.970000000000000},
2340  {0.086124295641100, 0.050000000000000, 0.970000000000000},
2341  {0.100000000000000, 0.050000000000000, 0.970000000000000},
2342  {0.000000000000000, 0.050000000000000, 0.980000000000000},
2343  {0.013875704358900, 0.050000000000000, 0.980000000000000},
2344  {0.033498913650700, 0.050000000000000, 0.980000000000000},
2345  {0.066501086349300, 0.050000000000000, 0.980000000000000},
2346  {0.086124295641100, 0.050000000000000, 0.980000000000000},
2347  {0.100000000000000, 0.050000000000000, 0.980000000000000},
2348  {0.000000000000000, 0.050000000000000, 0.990000000000000},
2349  {0.013875704358900, 0.050000000000000, 0.990000000000000},
2350  {0.033498913650700, 0.050000000000000, 0.990000000000000},
2351  {0.066501086349300, 0.050000000000000, 0.990000000000000},
2352  {0.086124295641100, 0.050000000000000, 0.990000000000000},
2353  {0.100000000000000, 0.050000000000000, 0.990000000000000},
2354  {0.000000000000000, 0.050000000000000, 1.000000000000000},
2355  {0.013875704358900, 0.050000000000000, 1.000000000000000},
2356  {0.033498913650700, 0.050000000000000, 1.000000000000000},
2357  {0.066501086349300, 0.050000000000000, 1.000000000000000},
2358  {0.086124295641100, 0.050000000000000, 1.000000000000000},
2359  {0.100000000000000, 0.050000000000000, 1.000000000000000} };
2360  int coord_handle = COM_get_dataitem_handle("Window1.nc");
2361  int CoordSize=0;
2362  bool coordData = (coord_handle > 0);
2363  bool coordCorrect = true;
2364  if(coordData){
2365  COM_get_size("Window1.nc",100+rank,&CoordSize);
2366  std::cout << "Rank #" << rank
2367  << ", coord size = " << CoordSize
2368  << std::endl;
2369  if(CoordSize != 306){
2370  std::cout << "ParElmerUnitTests Error:"
2371  << " Coord array is incorrect size!" << std::endl;
2372  ItAllWorks = 0;
2373  coordCorrect = false;
2374  }
2375  else{
2376  // Get the FSI mesh from the structures solver and print
2377  // it out to check
2378 
2379  //std::ofstream Ouf;
2380  //std::stringstream ss;
2381  //std::string str_rank;
2382  //ss << rank;
2383  //ss >> str_rank;
2384  //std::string outFileName = "coords_" + str_rank + ".dat";
2385  //Ouf.open(outFileName.c_str());
2386  double* Coord;
2387  COM_get_array("Window1.nc",100+rank,&Coord);
2388  std::cout << "Checking registered coordinates:" << std::endl;
2389  for(int i=0; i < CoordSize; i++){
2390  //std::cout << "Rank #" << rank << " Point #" << i
2391  // << " --- ";
2392  //Ouf << "{" ;
2393  for(int j=0; j < 3; j++){
2394  //std::cout << std::fixed << std::setprecision(15) << Coord[i*3+j] << " ";
2395  //Ouf << std::fixed << std::setprecision(15) << Coord[i*3+j];
2396  //if (j<2)
2397  // Ouf << ", ";
2398  //else
2399  // Ouf << "}, ";
2400  if (rank == 0) {
2401  if(fabs(CoordCheck0[i][j] - Coord[i*3+j]) > 1.0e-12){
2402  std::cout << "Wrong coordinate for Rank #" << rank
2403  << " Point #" << i
2404  << " Component #" << j
2405  << " check = " << CoordCheck0[i][j]
2406  << " actual = " << Coord[i*3+j]
2407  << std::endl;
2408  ItAllWorks = 0;
2409  coordCorrect = false;
2410  break;
2411  }
2412  } else if (rank == 1) {
2413  if(fabs(CoordCheck1[i][j] - Coord[i*3+j]) > 1.0e-12){
2414  std::cout << "Wrong coordinate for Rank #" << rank
2415  << " Point #" << i
2416  << " Component #" << j
2417  << " check = " << CoordCheck1[i][j]
2418  << " actual = " << Coord[i*3+j]
2419  << std::endl;
2420  ItAllWorks = 0;
2421  coordCorrect = false;
2422  break;
2423  }
2424  }
2425  }
2426  //std::cout << std::endl;
2427  //Ouf << std::endl;
2428  }
2429  //Ouf.close();
2430  }
2431  result.UpdateResult("ParCoordinateData:Correct", coordCorrect);
2432  result.UpdateResult("ParCoordinateData:Registered", true);
2433  }
2434  else{
2435  result.UpdateResult("ParCoordinateData:Registered", false);
2436  result.UpdateResult("ParCoordinateData:Correct", false);
2437  ItAllWorks = 0;
2438  }
2439 
2441  // Check connectivity values
2443  int connCheck[250][4] = {
2444  {1, 2, 3, 4},
2445  {5, 1, 4, 6},
2446  {7, 5, 6, 8},
2447  {9, 7, 8, 10},
2448  {11, 9, 10, 12},
2449  {4, 3, 13, 14},
2450  {6, 4, 14, 15},
2451  {8, 6, 15, 16},
2452  {10, 8, 16, 17},
2453  {12, 10, 17, 18},
2454  {14, 13, 19, 20},
2455  {15, 14, 20, 21},
2456  {16, 15, 21, 22},
2457  {17, 16, 22, 23},
2458  {18, 17, 23, 24},
2459  {20, 19, 25, 26},
2460  {21, 20, 26, 27},
2461  {22, 21, 27, 28},
2462  {23, 22, 28, 29},
2463  {24, 23, 29, 30},
2464  {26, 25, 31, 32},
2465  {27, 26, 32, 33},
2466  {28, 27, 33, 34},
2467  {29, 28, 34, 35},
2468  {30, 29, 35, 36},
2469  {32, 31, 37, 38},
2470  {33, 32, 38, 39},
2471  {34, 33, 39, 40},
2472  {35, 34, 40, 41},
2473  {36, 35, 41, 42},
2474  {38, 37, 43, 44},
2475  {39, 38, 44, 45},
2476  {40, 39, 45, 46},
2477  {41, 40, 46, 47},
2478  {42, 41, 47, 48},
2479  {44, 43, 49, 50},
2480  {45, 44, 50, 51},
2481  {46, 45, 51, 52},
2482  {47, 46, 52, 53},
2483  {48, 47, 53, 54},
2484  {50, 49, 55, 56},
2485  {51, 50, 56, 57},
2486  {52, 51, 57, 58},
2487  {53, 52, 58, 59},
2488  {54, 53, 59, 60},
2489  {56, 55, 61, 62},
2490  {57, 56, 62, 63},
2491  {58, 57, 63, 64},
2492  {59, 58, 64, 65},
2493  {60, 59, 65, 66},
2494  {62, 61, 67, 68},
2495  {63, 62, 68, 69},
2496  {64, 63, 69, 70},
2497  {65, 64, 70, 71},
2498  {66, 65, 71, 72},
2499  {68, 67, 73, 74},
2500  {69, 68, 74, 75},
2501  {70, 69, 75, 76},
2502  {71, 70, 76, 77},
2503  {72, 71, 77, 78},
2504  {74, 73, 79, 80},
2505  {75, 74, 80, 81},
2506  {76, 75, 81, 82},
2507  {77, 76, 82, 83},
2508  {78, 77, 83, 84},
2509  {80, 79, 85, 86},
2510  {81, 80, 86, 87},
2511  {82, 81, 87, 88},
2512  {83, 82, 88, 89},
2513  {84, 83, 89, 90},
2514  {86, 85, 91, 92},
2515  {87, 86, 92, 93},
2516  {88, 87, 93, 94},
2517  {89, 88, 94, 95},
2518  {90, 89, 95, 96},
2519  {92, 91, 97, 98},
2520  {93, 92, 98, 99},
2521  {94, 93, 99, 100},
2522  {95, 94, 100, 101},
2523  {96, 95, 101, 102},
2524  {98, 97, 103, 104},
2525  {99, 98, 104, 105},
2526  {100, 99, 105, 106},
2527  {101, 100, 106, 107},
2528  {102, 101, 107, 108},
2529  {104, 103, 109, 110},
2530  {105, 104, 110, 111},
2531  {106, 105, 111, 112},
2532  {107, 106, 112, 113},
2533  {108, 107, 113, 114},
2534  {110, 109, 115, 116},
2535  {111, 110, 116, 117},
2536  {112, 111, 117, 118},
2537  {113, 112, 118, 119},
2538  {114, 113, 119, 120},
2539  {116, 115, 121, 122},
2540  {117, 116, 122, 123},
2541  {118, 117, 123, 124},
2542  {119, 118, 124, 125},
2543  {120, 119, 125, 126},
2544  {122, 121, 127, 128},
2545  {123, 122, 128, 129},
2546  {124, 123, 129, 130},
2547  {125, 124, 130, 131},
2548  {126, 125, 131, 132},
2549  {128, 127, 133, 134},
2550  {129, 128, 134, 135},
2551  {130, 129, 135, 136},
2552  {131, 130, 136, 137},
2553  {132, 131, 137, 138},
2554  {134, 133, 139, 140},
2555  {135, 134, 140, 141},
2556  {136, 135, 141, 142},
2557  {137, 136, 142, 143},
2558  {138, 137, 143, 144},
2559  {140, 139, 145, 146},
2560  {141, 140, 146, 147},
2561  {142, 141, 147, 148},
2562  {143, 142, 148, 149},
2563  {144, 143, 149, 150},
2564  {146, 145, 151, 152},
2565  {147, 146, 152, 153},
2566  {148, 147, 153, 154},
2567  {149, 148, 154, 155},
2568  {150, 149, 155, 156},
2569  {152, 151, 157, 158},
2570  {153, 152, 158, 159},
2571  {154, 153, 159, 160},
2572  {155, 154, 160, 161},
2573  {156, 155, 161, 162},
2574  {158, 157, 163, 164},
2575  {159, 158, 164, 165},
2576  {160, 159, 165, 166},
2577  {161, 160, 166, 167},
2578  {162, 161, 167, 168},
2579  {164, 163, 169, 170},
2580  {165, 164, 170, 171},
2581  {166, 165, 171, 172},
2582  {167, 166, 172, 173},
2583  {168, 167, 173, 174},
2584  {170, 169, 175, 176},
2585  {171, 170, 176, 177},
2586  {172, 171, 177, 178},
2587  {173, 172, 178, 179},
2588  {174, 173, 179, 180},
2589  {176, 175, 181, 182},
2590  {177, 176, 182, 183},
2591  {178, 177, 183, 184},
2592  {179, 178, 184, 185},
2593  {180, 179, 185, 186},
2594  {182, 181, 187, 188},
2595  {183, 182, 188, 189},
2596  {184, 183, 189, 190},
2597  {185, 184, 190, 191},
2598  {186, 185, 191, 192},
2599  {188, 187, 193, 194},
2600  {189, 188, 194, 195},
2601  {190, 189, 195, 196},
2602  {191, 190, 196, 197},
2603  {192, 191, 197, 198},
2604  {194, 193, 199, 200},
2605  {195, 194, 200, 201},
2606  {196, 195, 201, 202},
2607  {197, 196, 202, 203},
2608  {198, 197, 203, 204},
2609  {200, 199, 205, 206},
2610  {201, 200, 206, 207},
2611  {202, 201, 207, 208},
2612  {203, 202, 208, 209},
2613  {204, 203, 209, 210},
2614  {206, 205, 211, 212},
2615  {207, 206, 212, 213},
2616  {208, 207, 213, 214},
2617  {209, 208, 214, 215},
2618  {210, 209, 215, 216},
2619  {212, 211, 217, 218},
2620  {213, 212, 218, 219},
2621  {214, 213, 219, 220},
2622  {215, 214, 220, 221},
2623  {216, 215, 221, 222},
2624  {218, 217, 223, 224},
2625  {219, 218, 224, 225},
2626  {220, 219, 225, 226},
2627  {221, 220, 226, 227},
2628  {222, 221, 227, 228},
2629  {224, 223, 229, 230},
2630  {225, 224, 230, 231},
2631  {226, 225, 231, 232},
2632  {227, 226, 232, 233},
2633  {228, 227, 233, 234},
2634  {230, 229, 235, 236},
2635  {231, 230, 236, 237},
2636  {232, 231, 237, 238},
2637  {233, 232, 238, 239},
2638  {234, 233, 239, 240},
2639  {236, 235, 241, 242},
2640  {237, 236, 242, 243},
2641  {238, 237, 243, 244},
2642  {239, 238, 244, 245},
2643  {240, 239, 245, 246},
2644  {242, 241, 247, 248},
2645  {243, 242, 248, 249},
2646  {244, 243, 249, 250},
2647  {245, 244, 250, 251},
2648  {246, 245, 251, 252},
2649  {248, 247, 253, 254},
2650  {249, 248, 254, 255},
2651  {250, 249, 255, 256},
2652  {251, 250, 256, 257},
2653  {252, 251, 257, 258},
2654  {254, 253, 259, 260},
2655  {255, 254, 260, 261},
2656  {256, 255, 261, 262},
2657  {257, 256, 262, 263},
2658  {258, 257, 263, 264},
2659  {260, 259, 265, 266},
2660  {261, 260, 266, 267},
2661  {262, 261, 267, 268},
2662  {263, 262, 268, 269},
2663  {264, 263, 269, 270},
2664  {266, 265, 271, 272},
2665  {267, 266, 272, 273},
2666  {268, 267, 273, 274},
2667  {269, 268, 274, 275},
2668  {270, 269, 275, 276},
2669  {272, 271, 277, 278},
2670  {273, 272, 278, 279},
2671  {274, 273, 279, 280},
2672  {275, 274, 280, 281},
2673  {276, 275, 281, 282},
2674  {278, 277, 283, 284},
2675  {279, 278, 284, 285},
2676  {280, 279, 285, 286},
2677  {281, 280, 286, 287},
2678  {282, 281, 287, 288},
2679  {284, 283, 289, 290},
2680  {285, 284, 290, 291},
2681  {286, 285, 291, 292},
2682  {287, 286, 292, 293},
2683  {288, 287, 293, 294},
2684  {290, 289, 295, 296},
2685  {291, 290, 296, 297},
2686  {292, 291, 297, 298},
2687  {293, 292, 298, 299},
2688  {294, 293, 299, 300},
2689  {296, 295, 301, 302},
2690  {297, 296, 302, 303},
2691  {298, 297, 303, 304},
2692  {299, 298, 304, 305},
2693  {300, 299, 305, 306} };
2694  bool connCorrect = true;
2695  int ConnSize = 0;
2696  int* Conn = NULL;
2697 
2698  // Get the FSI mesh from the structures solver
2699  COM_get_array("Window1.:q4:", 100+rank, &Conn);
2700  if(Conn){
2701  // Get the FSI mesh size from the structures solver
2702  COM_get_size("Window1.:q4:", 100+rank, &ConnSize);
2703  std::cout << "Rank #" << rank
2704  << ", ConnSize = " << ConnSize << std::endl;
2705  if(ConnSize != 250){
2706  std::cout << "ParElmerUnitTests Error:"
2707  << " Conn array is incorrect size!" << std::endl;
2708  ItAllWorks = 0;
2709  connCorrect = false;
2710  }
2711  else{
2712  //std::ofstream Ouf;
2713  //std::stringstream ss;
2714  //std::string str_rank;
2715  //ss << rank;
2716  //ss >> str_rank;
2717  //std::string outFileName = "conn_" + str_rank + ".dat";
2718  //Ouf.open(outFileName.c_str());
2719  // check the values
2720  std::cout << "Element connectivity check:" << std::endl;
2721  for(int i=0; i < ConnSize; i++){
2722  //std::cout << "Rank #" << rank << ", Element #" << i
2723  // << " --- ";
2724  //Ouf << "{";
2725  for(int j=0; j < 4; j++){
2726  //std::cout << Conn[i*4+j] << " ";
2727  //Ouf << Conn[i*4+j];
2728  //if (j<3)
2729  // Ouf << ", ";
2730  //else
2731  // Ouf << "},";
2732  if( (connCheck[i][j] - Conn[i*4+j]) != 0){
2733  ItAllWorks = 0;
2734  connCorrect = false;
2735  std::cout << "Rank #" << rank
2736  << ", Connectivity error for element #"
2737  << i << std::endl;
2738  break;
2739  }
2740  }
2741  //std::cout << std::endl;
2742  //Ouf << std::endl;
2743  }
2744  //Ouf.close();
2745  }
2746  result.UpdateResult("ParConnectivityData:Correct", connCorrect);
2747  result.UpdateResult("ParConnectivityData:Registered", true);
2748  }
2749  else{
2750  result.UpdateResult("ParConnectivityData:Registered", false);
2751  result.UpdateResult("ParConnectivityData:Correct", false);
2752  ItAllWorks = 0;
2753  }
2754 
2756  // Check load registration & initialization
2758  double* Loads = NULL;
2759  int LoadsSize = 0;
2760  int loadsRegistered = 1;
2761  int loadsInitialized = 1;
2762  // Get the FSI loads from the structures solver
2763  COM_get_array("Window1.Loads",100+rank,&Loads);
2764  if(Loads){
2765  // Get the FSI load size from the structures solver
2766  COM_get_size("Window1.Loads",100+rank,&LoadsSize);
2767  if(LoadsSize != 306){
2768  std::cout << "ParElmerUnitTests Error:"
2769  << " Loads array is incorrect size!" << std::endl;
2770  ItAllWorks = 0;
2771  loadsInitialized = 0;
2772  } else {
2773  // check the values
2774  for(int i=0; i < LoadsSize; i++){
2775  for(int j=0; j < 3; j++){
2776  if(fabs(Loads[i*3 + j]) > 1.0e-12){
2777  loadsInitialized = 0;
2778  ItAllWorks = 0;
2779  }
2780  }
2781  }
2782  }
2783  }
2784  else{
2785  std::cout << "Loads are NULL" << std::endl;
2786  loadsRegistered = 0;
2787  loadsInitialized = 0;
2788  ItAllWorks = 0;
2789  }
2790  int globalLoadsReg = 0;
2791  _communicator.Reduce(loadsRegistered, globalLoadsReg, IRAD::Comm::DTINT, IRAD::Comm::PRODOP, 0);
2792  _communicator.BroadCast(globalLoadsReg, 0);
2793  _communicator.Barrier();
2794  result.UpdateResult("ParLoadData:Registered", globalLoadsReg);
2795  int globalLoadsInit = 0;
2796  _communicator.Reduce(loadsInitialized, globalLoadsInit, IRAD::Comm::DTINT, IRAD::Comm::PRODOP, 0);
2797  _communicator.BroadCast(globalLoadsInit, 0);
2798  result.UpdateResult("ParLoadData:Initialized", globalLoadsInit);
2799 
2800 
2802  // Get TimeStepper function handle and call Function
2804  // Arrays that hold disp data for check *********************************
2805  double dispCheck0[306][3] = {
2806  {8.89791e-29, 5.79913e-29, 7.46431e-29},
2807  {1.28823e-28, 8.9512e-29, 1.11686e-28},
2808  {-9.12997e-10, 2.61913e-10, -9.67976e-10},
2809  {-4.88536e-10, 5.71438e-10, -8.47714e-10},
2810  {7.9991e-29, 4.67047e-29, 5.88094e-29},
2811  {-1.79416e-10, 7.91904e-10, -9.64027e-10},
2812  {7.9991e-29, 4.85741e-29, 5.88094e-29},
2813  {1.79416e-10, 7.91904e-10, -9.64027e-10},
2814  {8.89791e-29, 5.79913e-29, 7.26265e-29},
2815  {4.88536e-10, 5.71438e-10, -8.47714e-10},
2816  {1.28823e-28, 8.9512e-29, 1.11686e-28},
2817  {9.12997e-10, 2.61913e-10, -9.67976e-10},
2818  {-1.30674e-09, 5.53139e-10, -2.00149e-09},
2819  {-8.29688e-10, 1.12277e-09, -1.88002e-09},
2820  {-3.09652e-10, 1.48967e-09, -1.97899e-09},
2821  {3.09652e-10, 1.48967e-09, -1.97899e-09},
2822  {8.29688e-10, 1.12277e-09, -1.88002e-09},
2823  {1.30674e-09, 5.53139e-10, -2.00149e-09},
2824  {-1.53588e-09, 1.4023e-09, -3.03066e-09},
2825  {-1.02256e-09, 2.09415e-09, -2.94963e-09},
2826  {-4.06122e-10, 2.58669e-09, -3.01403e-09},
2827  {4.06122e-10, 2.58669e-09, -3.01403e-09},
2828  {1.02256e-09, 2.09415e-09, -2.94963e-09},
2829  {1.53588e-09, 1.4023e-09, -3.03066e-09},
2830  {-1.65194e-09, 2.74524e-09, -4.06398e-09},
2831  {-1.1312e-09, 3.50194e-09, -4.01856e-09},
2832  {-4.64648e-10, 4.07848e-09, -4.05812e-09},
2833  {4.64648e-10, 4.07848e-09, -4.05812e-09},
2834  {1.1312e-09, 3.50194e-09, -4.01856e-09},
2835  {1.65194e-09, 2.74524e-09, -4.06398e-09},
2836  {-1.7077e-09, 4.55432e-09, -5.08993e-09},
2837  {-1.18805e-09, 5.34468e-09, -5.06867e-09},
2838  {-4.97736e-10, 5.97431e-09, -5.09189e-09},
2839  {4.97736e-10, 5.97431e-09, -5.09189e-09},
2840  {1.18805e-09, 5.34468e-09, -5.06867e-09},
2841  {1.7077e-09, 4.55432e-09, -5.08993e-09},
2842  {-1.72838e-09, 6.80444e-09, -6.10479e-09},
2843  {-1.21386e-09, 7.61027e-09, -6.09826e-09},
2844  {-5.14516e-10, 8.27047e-09, -6.11064e-09},
2845  {5.14516e-10, 8.27047e-09, -6.11064e-09},
2846  {1.21386e-09, 7.61027e-09, -6.09826e-09},
2847  {1.72838e-09, 6.80444e-09, -6.10479e-09},
2848  {-1.72783e-09, 9.47846e-09, -7.10481e-09},
2849  {-1.22065e-09, 1.02882e-08, -7.10703e-09},
2850  {-5.21091e-10, 1.09635e-08, -7.11194e-09},
2851  {5.21091e-10, 1.09635e-08, -7.11194e-09},
2852  {1.22065e-09, 1.02882e-08, -7.10703e-09},
2853  {1.72783e-09, 9.47846e-09, -7.10481e-09},
2854  {-1.71411e-09, 1.25622e-08, -8.08747e-09},
2855  {-1.21557e-09, 1.33683e-08, -8.09489e-09},
2856  {-5.21259e-10, 1.40483e-08, -8.09459e-09},
2857  {5.21259e-10, 1.40483e-08, -8.09459e-09},
2858  {1.21557e-09, 1.33683e-08, -8.09489e-09},
2859  {1.71411e-09, 1.25622e-08, -8.08747e-09},
2860  {-1.69212e-09, 1.60435e-08, -9.05132e-09},
2861  {-1.20299e-09, 1.68411e-08, -9.06183e-09},
2862  {-5.17366e-10, 1.7519e-08, -9.05791e-09},
2863  {5.17366e-10, 1.7519e-08, -9.05791e-09},
2864  {1.20299e-09, 1.68411e-08, -9.06183e-09},
2865  {1.69212e-09, 1.60435e-08, -9.05132e-09},
2866  {-1.66494e-09, 1.99114e-08, -9.99557e-09},
2867  {-1.18565e-09, 2.06974e-08, -1.00079e-08},
2868  {-5.10887e-10, 2.13687e-08, -1.00015e-08},
2869  {5.10887e-10, 2.13687e-08, -1.00015e-08},
2870  {1.18565e-09, 2.06974e-08, -1.00079e-08},
2871  {1.66494e-09, 1.99114e-08, -9.99557e-09},
2872  {-1.63455e-09, 2.41559e-08, -1.09199e-08},
2873  {-1.16531e-09, 2.49284e-08, -1.09333e-08},
2874  {-5.02763e-10, 2.55902e-08, -1.09253e-08},
2875  {5.02763e-10, 2.55902e-08, -1.09253e-08},
2876  {1.16531e-09, 2.49284e-08, -1.09333e-08},
2877  {1.63455e-09, 2.41559e-08, -1.09199e-08},
2878  {-1.6022e-09, 2.87677e-08, -1.18241e-08},
2879  {-1.14311e-09, 2.95254e-08, -1.18382e-08},
2880  {-4.93606e-10, 3.01759e-08, -1.1829e-08},
2881  {4.93606e-10, 3.01759e-08, -1.1829e-08},
2882  {1.14311e-09, 2.95254e-08, -1.18382e-08},
2883  {1.6022e-09, 2.87677e-08, -1.18241e-08},
2884  {-1.56872e-09, 3.37379e-08, -1.27083e-08},
2885  {-1.11979e-09, 3.44802e-08, -1.27228e-08},
2886  {-4.83813e-10, 3.51182e-08, -1.27129e-08},
2887  {4.83813e-10, 3.51182e-08, -1.27129e-08},
2888  {1.11979e-09, 3.44802e-08, -1.27228e-08},
2889  {1.56872e-09, 3.37379e-08, -1.27083e-08},
2890  {-1.53464e-09, 3.90581e-08, -1.35726e-08},
2891  {-1.09584e-09, 3.97844e-08, -1.35872e-08},
2892  {-4.73647e-10, 4.04093e-08, -1.3577e-08},
2893  {4.73647e-10, 4.04093e-08, -1.3577e-08},
2894  {1.09584e-09, 3.97844e-08, -1.35872e-08},
2895  {1.53464e-09, 3.90581e-08, -1.35726e-08},
2896  {-1.50031e-09, 4.47198e-08, -1.44172e-08},
2897  {-1.07157e-09, 4.543e-08, -1.44318e-08},
2898  {-4.63281e-10, 4.60415e-08, -1.44213e-08},
2899  {4.63281e-10, 4.60415e-08, -1.44213e-08},
2900  {1.07157e-09, 4.543e-08, -1.44318e-08},
2901  {1.50031e-09, 4.47198e-08, -1.44172e-08},
2902  {-1.46597e-09, 5.0715e-08, -1.52422e-08},
2903  {-1.04721e-09, 5.14091e-08, -1.52568e-08},
2904  {-4.52828e-10, 5.20069e-08, -1.52462e-08},
2905  {4.52828e-10, 5.20069e-08, -1.52462e-08},
2906  {1.04721e-09, 5.14091e-08, -1.52568e-08},
2907  {1.46597e-09, 5.0715e-08, -1.52422e-08},
2908  {-1.43176e-09, 5.70357e-08, -1.60478e-08},
2909  {-1.02288e-09, 5.77137e-08, -1.60623e-08},
2910  {-4.42362e-10, 5.82978e-08, -1.60517e-08},
2911  {4.42362e-10, 5.82978e-08, -1.60517e-08},
2912  {1.02288e-09, 5.77137e-08, -1.60623e-08},
2913  {1.43176e-09, 5.70357e-08, -1.60478e-08},
2914  {-1.39779e-09, 6.36743e-08, -1.68343e-08},
2915  {-9.98685e-10, 6.43362e-08, -1.68487e-08},
2916  {-4.31933e-10, 6.49065e-08, -1.68381e-08},
2917  {4.31933e-10, 6.49065e-08, -1.68381e-08},
2918  {9.98685e-10, 6.43362e-08, -1.68487e-08},
2919  {1.39779e-09, 6.36743e-08, -1.68343e-08},
2920  {-1.3641e-09, 7.06229e-08, -1.76019e-08},
2921  {-9.74672e-10, 7.12689e-08, -1.76161e-08},
2922  {-4.21572e-10, 7.18256e-08, -1.76056e-08},
2923  {4.21572e-10, 7.18256e-08, -1.76056e-08},
2924  {9.74672e-10, 7.12689e-08, -1.76161e-08},
2925  {1.3641e-09, 7.06229e-08, -1.76019e-08},
2926  {-1.33076e-09, 7.7874e-08, -1.83507e-08},
2927  {-9.50883e-10, 7.85043e-08, -1.83649e-08},
2928  {-4.113e-10, 7.90475e-08, -1.83544e-08},
2929  {4.113e-10, 7.90475e-08, -1.83544e-08},
2930  {9.50883e-10, 7.85043e-08, -1.83649e-08},
2931  {1.33076e-09, 7.7874e-08, -1.83507e-08},
2932  {-1.29778e-09, 8.54202e-08, -1.90811e-08},
2933  {-9.27345e-10, 8.60348e-08, -1.90951e-08},
2934  {-4.0113e-10, 8.65646e-08, -1.90848e-08},
2935  {4.0113e-10, 8.65646e-08, -1.90848e-08},
2936  {9.27345e-10, 8.60348e-08, -1.90951e-08},
2937  {1.29778e-09, 8.54202e-08, -1.90811e-08},
2938  {-1.26519e-09, 9.32541e-08, -1.97933e-08},
2939  {-9.04073e-10, 9.38533e-08, -1.98071e-08},
2940  {-3.91073e-10, 9.43699e-08, -1.97969e-08},
2941  {3.91073e-10, 9.43699e-08, -1.97969e-08},
2942  {9.04073e-10, 9.38533e-08, -1.98071e-08},
2943  {1.26519e-09, 9.32541e-08, -1.97933e-08},
2944  {-1.23299e-09, 1.01368e-07, -2.04874e-08},
2945  {-8.81079e-10, 1.01952e-07, -2.05011e-08},
2946  {-3.81134e-10, 1.02456e-07, -2.0491e-08},
2947  {3.81134e-10, 1.02456e-07, -2.0491e-08},
2948  {8.81079e-10, 1.01952e-07, -2.05011e-08},
2949  {1.23299e-09, 1.01368e-07, -2.04874e-08},
2950  {-1.20119e-09, 1.09756e-07, -2.11638e-08},
2951  {-8.58368e-10, 1.10325e-07, -2.11772e-08},
2952  {-3.71315e-10, 1.10815e-07, -2.11673e-08},
2953  {3.71315e-10, 1.10815e-07, -2.11673e-08},
2954  {8.58368e-10, 1.10325e-07, -2.11772e-08},
2955  {1.20119e-09, 1.09756e-07, -2.11638e-08},
2956  {-1.16979e-09, 1.1841e-07, -2.18226e-08},
2957  {-8.35946e-10, 1.18964e-07, -2.18359e-08},
2958  {-3.61621e-10, 1.19442e-07, -2.1826e-08},
2959  {3.61621e-10, 1.19442e-07, -2.1826e-08},
2960  {8.35946e-10, 1.18964e-07, -2.18359e-08},
2961  {1.16979e-09, 1.1841e-07, -2.18226e-08},
2962  {-1.13881e-09, 1.27323e-07, -2.24641e-08},
2963  {-8.13816e-10, 1.27862e-07, -2.24772e-08},
2964  {-3.52052e-10, 1.28327e-07, -2.24675e-08},
2965  {3.52052e-10, 1.28327e-07, -2.24675e-08},
2966  {8.13816e-10, 1.27862e-07, -2.24772e-08},
2967  {1.13881e-09, 1.27323e-07, -2.24641e-08},
2968  {-1.10824e-09, 1.36488e-07, -2.30885e-08},
2969  {-7.91979e-10, 1.37013e-07, -2.31014e-08},
2970  {-3.4261e-10, 1.37466e-07, -2.30918e-08},
2971  {3.4261e-10, 1.37466e-07, -2.30918e-08},
2972  {7.91979e-10, 1.37013e-07, -2.31014e-08},
2973  {1.10824e-09, 1.36488e-07, -2.30885e-08},
2974  {-1.07808e-09, 1.45899e-07, -2.3696e-08},
2975  {-7.70437e-10, 1.4641e-07, -2.37087e-08},
2976  {-3.33295e-10, 1.4685e-07, -2.36993e-08},
2977  {3.33295e-10, 1.4685e-07, -2.36993e-08},
2978  {7.70437e-10, 1.4641e-07, -2.37087e-08},
2979  {1.07808e-09, 1.45899e-07, -2.3696e-08},
2980  {-1.04834e-09, 1.55549e-07, -2.42869e-08},
2981  {-7.49191e-10, 1.56045e-07, -2.42995e-08},
2982  {-3.24108e-10, 1.56474e-07, -2.42901e-08},
2983  {3.24108e-10, 1.56474e-07, -2.42901e-08},
2984  {7.49191e-10, 1.56045e-07, -2.42995e-08},
2985  {1.04834e-09, 1.55549e-07, -2.42869e-08},
2986  {-1.01901e-09, 1.65431e-07, -2.48614e-08},
2987  {-7.28241e-10, 1.65913e-07, -2.48738e-08},
2988  {-3.15048e-10, 1.6633e-07, -2.48646e-08},
2989  {3.15048e-10, 1.6633e-07, -2.48646e-08},
2990  {7.28241e-10, 1.65913e-07, -2.48738e-08},
2991  {1.01901e-09, 1.65431e-07, -2.48614e-08},
2992  {-9.90099e-10, 1.75538e-07, -2.54197e-08},
2993  {-7.07588e-10, 1.76007e-07, -2.54319e-08},
2994  {-3.06117e-10, 1.76412e-07, -2.54228e-08},
2995  {3.06117e-10, 1.76412e-07, -2.54228e-08},
2996  {7.07588e-10, 1.76007e-07, -2.54319e-08},
2997  {9.90099e-10, 1.75538e-07, -2.54197e-08},
2998  {-9.61602e-10, 1.85865e-07, -2.59621e-08},
2999  {-6.87231e-10, 1.86321e-07, -2.59741e-08},
3000  {-2.97314e-10, 1.86714e-07, -2.59652e-08},
3001  {2.97314e-10, 1.86714e-07, -2.59652e-08},
3002  {6.87231e-10, 1.86321e-07, -2.59741e-08},
3003  {9.61602e-10, 1.85865e-07, -2.59621e-08},
3004  {-9.33521e-10, 1.96405e-07, -2.64887e-08},
3005  {-6.67171e-10, 1.96847e-07, -2.65006e-08},
3006  {-2.8864e-10, 1.97229e-07, -2.64918e-08},
3007  {2.8864e-10, 1.97229e-07, -2.64918e-08},
3008  {6.67171e-10, 1.96847e-07, -2.65006e-08},
3009  {9.33521e-10, 1.96405e-07, -2.64887e-08},
3010  {-9.05856e-10, 2.07152e-07, -2.69999e-08},
3011  {-6.47409e-10, 2.07581e-07, -2.70116e-08},
3012  {-2.80093e-10, 2.07951e-07, -2.70029e-08},
3013  {2.80093e-10, 2.07951e-07, -2.70029e-08},
3014  {6.47409e-10, 2.07581e-07, -2.70116e-08},
3015  {9.05856e-10, 2.07152e-07, -2.69999e-08},
3016  {-8.78606e-10, 2.18099e-07, -2.74959e-08},
3017  {-6.27943e-10, 2.18515e-07, -2.75074e-08},
3018  {-2.71676e-10, 2.18874e-07, -2.74989e-08},
3019  {2.71676e-10, 2.18874e-07, -2.74989e-08},
3020  {6.27943e-10, 2.18515e-07, -2.75074e-08},
3021  {8.78606e-10, 2.18099e-07, -2.74959e-08},
3022  {-8.51773e-10, 2.29241e-07, -2.79768e-08},
3023  {-6.08774e-10, 2.29644e-07, -2.79882e-08},
3024  {-2.63387e-10, 2.29993e-07, -2.79797e-08},
3025  {2.63387e-10, 2.29993e-07, -2.79797e-08},
3026  {6.08774e-10, 2.29644e-07, -2.79882e-08},
3027  {8.51773e-10, 2.29241e-07, -2.79768e-08},
3028  {-8.25355e-10, 2.40571e-07, -2.8443e-08},
3029  {-5.89903e-10, 2.40962e-07, -2.84541e-08},
3030  {-2.55226e-10, 2.413e-07, -2.84458e-08},
3031  {2.55226e-10, 2.413e-07, -2.84458e-08},
3032  {5.89903e-10, 2.40962e-07, -2.84541e-08},
3033  {8.25355e-10, 2.40571e-07, -2.8443e-08},
3034  {-7.99353e-10, 2.52084e-07, -2.88946e-08},
3035  {-5.71329e-10, 2.52463e-07, -2.89056e-08},
3036  {-2.47194e-10, 2.5279e-07, -2.88974e-08},
3037  {2.47194e-10, 2.5279e-07, -2.88974e-08},
3038  {5.71329e-10, 2.52463e-07, -2.89056e-08},
3039  {7.99353e-10, 2.52084e-07, -2.88946e-08},
3040  {-7.73768e-10, 2.63774e-07, -2.93319e-08},
3041  {-5.53052e-10, 2.64141e-07, -2.93427e-08},
3042  {-2.3929e-10, 2.64457e-07, -2.93346e-08},
3043  {2.3929e-10, 2.64457e-07, -2.93346e-08},
3044  {5.53052e-10, 2.64141e-07, -2.93427e-08},
3045  {7.73768e-10, 2.63774e-07, -2.93319e-08},
3046  {-7.48598e-10, 2.75635e-07, -2.9755e-08},
3047  {-5.35072e-10, 2.7599e-07, -2.97657e-08},
3048  {-2.31515e-10, 2.76296e-07, -2.97578e-08},
3049  {2.31515e-10, 2.76296e-07, -2.97578e-08},
3050  {5.35072e-10, 2.7599e-07, -2.97657e-08},
3051  {7.48598e-10, 2.75635e-07, -2.9755e-08},
3052  {-7.23845e-10, 2.87662e-07, -3.01644e-08},
3053  {-5.17389e-10, 2.88005e-07, -3.01748e-08},
3054  {-2.23868e-10, 2.88301e-07, -3.01671e-08},
3055  {2.23868e-10, 2.88301e-07, -3.01671e-08},
3056  {5.17389e-10, 2.88005e-07, -3.01748e-08},
3057  {7.23845e-10, 2.87662e-07, -3.01644e-08},
3058  {-6.99507e-10, 2.99849e-07, -3.05601e-08},
3059  {-5.00003e-10, 3.00181e-07, -3.05703e-08},
3060  {-2.1635e-10, 3.00467e-07, -3.05627e-08},
3061  {2.1635e-10, 3.00467e-07, -3.05627e-08},
3062  {5.00003e-10, 3.00181e-07, -3.05703e-08},
3063  {6.99507e-10, 2.99849e-07, -3.05601e-08},
3064  {-6.75585e-10, 3.12191e-07, -3.09424e-08},
3065  {-4.82915e-10, 3.12511e-07, -3.09525e-08},
3066  {-2.0896e-10, 3.12788e-07, -3.0945e-08},
3067  {2.0896e-10, 3.12788e-07, -3.0945e-08},
3068  {4.82915e-10, 3.12511e-07, -3.09525e-08},
3069  {6.75585e-10, 3.12191e-07, -3.09424e-08},
3070  {-6.5208e-10, 3.24682e-07, -3.13115e-08},
3071  {-4.66124e-10, 3.24991e-07, -3.13214e-08},
3072  {-2.01699e-10, 3.25258e-07, -3.1314e-08},
3073  {2.01699e-10, 3.25258e-07, -3.1314e-08},
3074  {4.66124e-10, 3.24991e-07, -3.13214e-08},
3075  {6.5208e-10, 3.24682e-07, -3.13115e-08},
3076  {-6.2899e-10, 3.37318e-07, -3.16677e-08},
3077  {-4.4963e-10, 3.37616e-07, -3.16774e-08},
3078  {-1.94566e-10, 3.37873e-07, -3.16702e-08},
3079  {1.94566e-10, 3.37873e-07, -3.16702e-08},
3080  {4.4963e-10, 3.37616e-07, -3.16774e-08},
3081  {6.2899e-10, 3.37318e-07, -3.16677e-08},
3082  {-6.06317e-10, 3.50092e-07, -3.20112e-08},
3083  {-4.33433e-10, 3.5038e-07, -3.20207e-08},
3084  {-1.87562e-10, 3.50628e-07, -3.20136e-08},
3085  {1.87562e-10, 3.50628e-07, -3.20136e-08},
3086  {4.33433e-10, 3.5038e-07, -3.20207e-08},
3087  {6.06317e-10, 3.50092e-07, -3.20112e-08},
3088  {-5.8406e-10, 3.63001e-07, -3.23422e-08},
3089  {-4.17534e-10, 3.63278e-07, -3.23516e-08},
3090  {-1.80687e-10, 3.63517e-07, -3.23446e-08},
3091  {1.80687e-10, 3.63517e-07, -3.23446e-08},
3092  {4.17534e-10, 3.63278e-07, -3.23516e-08},
3093  {5.8406e-10, 3.63001e-07, -3.23422e-08},
3094  {-5.62218e-10, 3.76038e-07, -3.2661e-08},
3095  {-4.01931e-10, 3.76305e-07, -3.26702e-08},
3096  {-1.7394e-10, 3.76535e-07, -3.26633e-08},
3097  {1.7394e-10, 3.76535e-07, -3.26633e-08},
3098  {4.01931e-10, 3.76305e-07, -3.26702e-08},
3099  {5.62218e-10, 3.76038e-07, -3.2661e-08},
3100  {-5.40793e-10, 3.892e-07, -3.29677e-08},
3101  {-3.86626e-10, 3.89457e-07, -3.29768e-08},
3102  {-1.67321e-10, 3.89678e-07, -3.297e-08},
3103  {1.67321e-10, 3.89678e-07, -3.297e-08},
3104  {3.86626e-10, 3.89457e-07, -3.29768e-08},
3105  {5.40793e-10, 3.892e-07, -3.29677e-08},
3106  {-5.19783e-10, 4.02482e-07, -3.32627e-08},
3107  {-3.71618e-10, 4.02728e-07, -3.32716e-08},
3108  {-1.60831e-10, 4.02941e-07, -3.3265e-08},
3109  {1.60831e-10, 4.02941e-07, -3.3265e-08},
3110  {3.71618e-10, 4.02728e-07, -3.32716e-08},
3111  {5.19783e-10, 4.02482e-07, -3.32627e-08} };
3112 
3113  double dispCheck1[306][3] = {
3114  {-3.71618e-10, 4.02728e-07, -3.32716e-08},
3115  {-5.19783e-10, 4.02482e-07, -3.32627e-08},
3116  {-4.9919e-10, 4.15878e-07, -3.35461e-08},
3117  {-3.56907e-10, 4.16115e-07, -3.35548e-08},
3118  {-1.60831e-10, 4.02941e-07, -3.3265e-08},
3119  {-1.5447e-10, 4.16319e-07, -3.35484e-08},
3120  {1.60831e-10, 4.02941e-07, -3.3265e-08},
3121  {1.5447e-10, 4.16319e-07, -3.35484e-08},
3122  {3.71618e-10, 4.02728e-07, -3.32716e-08},
3123  {3.56907e-10, 4.16115e-07, -3.35548e-08},
3124  {5.19783e-10, 4.02482e-07, -3.32627e-08},
3125  {4.9919e-10, 4.15878e-07, -3.35461e-08},
3126  {-4.79013e-10, 4.29385e-07, -3.38182e-08},
3127  {-3.42493e-10, 4.29612e-07, -3.38267e-08},
3128  {-1.48236e-10, 4.29808e-07, -3.38204e-08},
3129  {1.48237e-10, 4.29808e-07, -3.38204e-08},
3130  {3.42493e-10, 4.29612e-07, -3.38267e-08},
3131  {4.79013e-10, 4.29385e-07, -3.38182e-08},
3132  {-4.59251e-10, 4.42997e-07, -3.40793e-08},
3133  {-3.28377e-10, 4.43215e-07, -3.40876e-08},
3134  {-1.42132e-10, 4.43403e-07, -3.40814e-08},
3135  {1.42132e-10, 4.43403e-07, -3.40814e-08},
3136  {3.28377e-10, 4.43215e-07, -3.40876e-08},
3137  {4.59251e-10, 4.42997e-07, -3.40793e-08},
3138  {-4.39906e-10, 4.56711e-07, -3.43294e-08},
3139  {-3.14557e-10, 4.56919e-07, -3.43376e-08},
3140  {-1.36156e-10, 4.571e-07, -3.43315e-08},
3141  {1.36156e-10, 4.571e-07, -3.43315e-08},
3142  {3.14558e-10, 4.56919e-07, -3.43376e-08},
3143  {4.39906e-10, 4.56711e-07, -3.43294e-08},
3144  {-4.20977e-10, 4.70522e-07, -3.4569e-08},
3145  {-3.01035e-10, 4.70721e-07, -3.45769e-08},
3146  {-1.30309e-10, 4.70894e-07, -3.4571e-08},
3147  {1.30309e-10, 4.70894e-07, -3.4571e-08},
3148  {3.01035e-10, 4.70721e-07, -3.45769e-08},
3149  {4.20977e-10, 4.70522e-07, -3.4569e-08},
3150  {-4.02464e-10, 4.84425e-07, -3.47981e-08},
3151  {-2.8781e-10, 4.84616e-07, -3.48059e-08},
3152  {-1.2459e-10, 4.84781e-07, -3.48001e-08},
3153  {1.2459e-10, 4.84781e-07, -3.48001e-08},
3154  {2.8781e-10, 4.84616e-07, -3.48059e-08},
3155  {4.02464e-10, 4.84425e-07, -3.47981e-08},
3156  {-3.84367e-10, 4.98418e-07, -3.50171e-08},
3157  {-2.74883e-10, 4.986e-07, -3.50247e-08},
3158  {-1.18999e-10, 4.98758e-07, -3.5019e-08},
3159  {1.18999e-10, 4.98758e-07, -3.5019e-08},
3160  {2.74883e-10, 4.986e-07, -3.50247e-08},
3161  {3.84367e-10, 4.98418e-07, -3.50171e-08},
3162  {-3.66685e-10, 5.12495e-07, -3.52261e-08},
3163  {-2.62252e-10, 5.12669e-07, -3.52336e-08},
3164  {-1.13537e-10, 5.12819e-07, -3.5228e-08},
3165  {1.13537e-10, 5.12819e-07, -3.5228e-08},
3166  {2.62252e-10, 5.12669e-07, -3.52336e-08},
3167  {3.66686e-10, 5.12495e-07, -3.52261e-08},
3168  {-3.4942e-10, 5.26653e-07, -3.54255e-08},
3169  {-2.49919e-10, 5.26819e-07, -3.54327e-08},
3170  {-1.08204e-10, 5.26962e-07, -3.54273e-08},
3171  {1.08204e-10, 5.26962e-07, -3.54273e-08},
3172  {2.49919e-10, 5.26819e-07, -3.54327e-08},
3173  {3.4942e-10, 5.26653e-07, -3.54255e-08},
3174  {-3.32571e-10, 5.40888e-07, -3.56153e-08},
3175  {-2.37883e-10, 5.41046e-07, -3.56224e-08},
3176  {-1.02999e-10, 5.41183e-07, -3.56172e-08},
3177  {1.02999e-10, 5.41183e-07, -3.56172e-08},
3178  {2.37883e-10, 5.41046e-07, -3.56224e-08},
3179  {3.32571e-10, 5.40888e-07, -3.56153e-08},
3180  {-3.16138e-10, 5.55196e-07, -3.5796e-08},
3181  {-2.26144e-10, 5.55347e-07, -3.58029e-08},
3182  {-9.79225e-11, 5.55476e-07, -3.57978e-08},
3183  {9.79225e-11, 5.55476e-07, -3.57978e-08},
3184  {2.26144e-10, 5.55347e-07, -3.58029e-08},
3185  {3.16138e-10, 5.55196e-07, -3.5796e-08},
3186  {-3.00121e-10, 5.69574e-07, -3.59676e-08},
3187  {-2.14702e-10, 5.69717e-07, -3.59743e-08},
3188  {-9.29746e-11, 5.6984e-07, -3.59693e-08},
3189  {9.29747e-11, 5.6984e-07, -3.59693e-08},
3190  {2.14702e-10, 5.69717e-07, -3.59743e-08},
3191  {3.00121e-10, 5.69574e-07, -3.59676e-08},
3192  {-2.8452e-10, 5.84018e-07, -3.61304e-08},
3193  {-2.03557e-10, 5.84154e-07, -3.6137e-08},
3194  {-8.81553e-11, 5.8427e-07, -3.61321e-08},
3195  {8.81553e-11, 5.8427e-07, -3.61321e-08},
3196  {2.03557e-10, 5.84154e-07, -3.6137e-08},
3197  {2.8452e-10, 5.84018e-07, -3.61304e-08},
3198  {-2.69335e-10, 5.98525e-07, -3.62847e-08},
3199  {-1.9271e-10, 5.98653e-07, -3.62911e-08},
3200  {-8.34645e-11, 5.98764e-07, -3.62864e-08},
3201  {8.34645e-11, 5.98764e-07, -3.62864e-08},
3202  {1.9271e-10, 5.98653e-07, -3.62911e-08},
3203  {2.69335e-10, 5.98525e-07, -3.62847e-08},
3204  {-2.54566e-10, 6.13091e-07, -3.64307e-08},
3205  {-1.8216e-10, 6.13212e-07, -3.64369e-08},
3206  {-7.89022e-11, 6.13316e-07, -3.64323e-08},
3207  {7.89022e-11, 6.13316e-07, -3.64323e-08},
3208  {1.8216e-10, 6.13212e-07, -3.64369e-08},
3209  {2.54566e-10, 6.13091e-07, -3.64307e-08},
3210  {-2.40213e-10, 6.27712e-07, -3.65686e-08},
3211  {-1.71907e-10, 6.27827e-07, -3.65747e-08},
3212  {-7.44684e-11, 6.27925e-07, -3.65702e-08},
3213  {7.44684e-11, 6.27925e-07, -3.65702e-08},
3214  {1.71907e-10, 6.27827e-07, -3.65747e-08},
3215  {2.40213e-10, 6.27712e-07, -3.65686e-08},
3216  {-2.26276e-10, 6.42387e-07, -3.66987e-08},
3217  {-1.61951e-10, 6.42495e-07, -3.67045e-08},
3218  {-7.01631e-11, 6.42588e-07, -3.67002e-08},
3219  {7.01631e-11, 6.42588e-07, -3.67002e-08},
3220  {1.61951e-10, 6.42495e-07, -3.67045e-08},
3221  {2.26276e-10, 6.42387e-07, -3.66987e-08},
3222  {-2.12756e-10, 6.57111e-07, -3.68211e-08},
3223  {-1.52292e-10, 6.57212e-07, -3.68268e-08},
3224  {-6.59863e-11, 6.573e-07, -3.68226e-08},
3225  {6.59863e-11, 6.573e-07, -3.68226e-08},
3226  {1.52292e-10, 6.57212e-07, -3.68268e-08},
3227  {2.12756e-10, 6.57111e-07, -3.68211e-08},
3228  {-1.99651e-10, 6.71882e-07, -3.69361e-08},
3229  {-1.42931e-10, 6.71977e-07, -3.69416e-08},
3230  {-6.19381e-11, 6.72059e-07, -3.69375e-08},
3231  {6.19381e-11, 6.72059e-07, -3.69375e-08},
3232  {1.42931e-10, 6.71977e-07, -3.69416e-08},
3233  {1.99651e-10, 6.71882e-07, -3.69361e-08},
3234  {-1.86962e-10, 6.86696e-07, -3.7044e-08},
3235  {-1.33867e-10, 6.86785e-07, -3.70493e-08},
3236  {-5.80183e-11, 6.86862e-07, -3.70454e-08},
3237  {5.80183e-11, 6.86862e-07, -3.70454e-08},
3238  {1.33867e-10, 6.86785e-07, -3.70493e-08},
3239  {1.86962e-10, 6.86696e-07, -3.7044e-08},
3240  {-1.74689e-10, 7.01552e-07, -3.71449e-08},
3241  {-1.25099e-10, 7.01635e-07, -3.71501e-08},
3242  {-5.42271e-11, 7.01707e-07, -3.71462e-08},
3243  {5.42271e-11, 7.01707e-07, -3.71462e-08},
3244  {1.25099e-10, 7.01635e-07, -3.71501e-08},
3245  {1.74689e-10, 7.01552e-07, -3.71449e-08},
3246  {-1.62832e-10, 7.16445e-07, -3.72392e-08},
3247  {-1.1663e-10, 7.16523e-07, -3.72441e-08},
3248  {-5.05644e-11, 7.1659e-07, -3.72404e-08},
3249  {5.05644e-11, 7.1659e-07, -3.72404e-08},
3250  {1.1663e-10, 7.16523e-07, -3.72441e-08},
3251  {1.62832e-10, 7.16445e-07, -3.72392e-08},
3252  {-1.51392e-10, 7.31374e-07, -3.73269e-08},
3253  {-1.08457e-10, 7.31446e-07, -3.73317e-08},
3254  {-4.70302e-11, 7.31509e-07, -3.73282e-08},
3255  {4.70302e-11, 7.31509e-07, -3.73282e-08},
3256  {1.08457e-10, 7.31446e-07, -3.73317e-08},
3257  {1.51392e-10, 7.31374e-07, -3.73269e-08},
3258  {-1.40367e-10, 7.46336e-07, -3.74085e-08},
3259  {-1.00581e-10, 7.46403e-07, -3.74131e-08},
3260  {-4.36245e-11, 7.46462e-07, -3.74097e-08},
3261  {4.36246e-11, 7.46462e-07, -3.74097e-08},
3262  {1.00581e-10, 7.46403e-07, -3.74131e-08},
3263  {1.40367e-10, 7.46336e-07, -3.74085e-08},
3264  {-1.29758e-10, 7.61329e-07, -3.7484e-08},
3265  {-9.3003e-11, 7.61391e-07, -3.74884e-08},
3266  {-4.03474e-11, 7.61445e-07, -3.74851e-08},
3267  {4.03474e-11, 7.61445e-07, -3.74851e-08},
3268  {9.3003e-11, 7.61391e-07, -3.74884e-08},
3269  {1.29758e-10, 7.61329e-07, -3.7484e-08},
3270  {-1.19565e-10, 7.7635e-07, -3.75537e-08},
3271  {-8.57219e-11, 7.76407e-07, -3.7558e-08},
3272  {-3.71987e-11, 7.76457e-07, -3.75548e-08},
3273  {3.71988e-11, 7.76457e-07, -3.75548e-08},
3274  {8.57219e-11, 7.76407e-07, -3.7558e-08},
3275  {1.19566e-10, 7.7635e-07, -3.75537e-08},
3276  {-1.09789e-10, 7.91397e-07, -3.7618e-08},
3277  {-7.87379e-11, 7.91449e-07, -3.7622e-08},
3278  {-3.41786e-11, 7.91495e-07, -3.7619e-08},
3279  {3.41786e-11, 7.91495e-07, -3.7619e-08},
3280  {7.8738e-11, 7.91449e-07, -3.7622e-08},
3281  {1.09789e-10, 7.91397e-07, -3.7618e-08},
3282  {-1.00428e-10, 8.06468e-07, -3.76769e-08},
3283  {-7.20512e-11, 8.06516e-07, -3.76807e-08},
3284  {-3.1287e-11, 8.06557e-07, -3.76779e-08},
3285  {3.1287e-11, 8.06557e-07, -3.76779e-08},
3286  {7.20512e-11, 8.06516e-07, -3.76807e-08},
3287  {1.00428e-10, 8.06468e-07, -3.76769e-08},
3288  {-9.14837e-11, 8.2156e-07, -3.77307e-08},
3289  {-6.56616e-11, 8.21604e-07, -3.77344e-08},
3290  {-2.85239e-11, 8.21642e-07, -3.77316e-08},
3291  {2.85239e-11, 8.21642e-07, -3.77316e-08},
3292  {6.56616e-11, 8.21604e-07, -3.77344e-08},
3293  {9.14837e-11, 8.2156e-07, -3.77307e-08},
3294  {-8.29551e-11, 8.36672e-07, -3.77796e-08},
3295  {-5.95692e-11, 8.36712e-07, -3.77832e-08},
3296  {-2.58893e-11, 8.36746e-07, -3.77805e-08},
3297  {2.58894e-11, 8.36746e-07, -3.77805e-08},
3298  {5.95693e-11, 8.36712e-07, -3.77832e-08},
3299  {8.29552e-11, 8.36672e-07, -3.77796e-08},
3300  {-7.48426e-11, 8.51802e-07, -3.7824e-08},
3301  {-5.37741e-11, 8.51838e-07, -3.78273e-08},
3302  {-2.33833e-11, 8.51869e-07, -3.78248e-08},
3303  {2.33833e-11, 8.51869e-07, -3.78248e-08},
3304  {5.37741e-11, 8.51838e-07, -3.78273e-08},
3305  {7.48426e-11, 8.51802e-07, -3.7824e-08},
3306  {-6.71461e-11, 8.66948e-07, -3.78639e-08},
3307  {-4.82761e-11, 8.6698e-07, -3.78671e-08},
3308  {-2.10057e-11, 8.67008e-07, -3.78647e-08},
3309  {2.10058e-11, 8.67008e-07, -3.78647e-08},
3310  {4.82761e-11, 8.6698e-07, -3.78671e-08},
3311  {6.71462e-11, 8.66948e-07, -3.78639e-08},
3312  {-5.98657e-11, 8.82108e-07, -3.78997e-08},
3313  {-4.30753e-11, 8.82137e-07, -3.79027e-08},
3314  {-1.87567e-11, 8.82162e-07, -3.79005e-08},
3315  {1.87568e-11, 8.82162e-07, -3.79005e-08},
3316  {4.30753e-11, 8.82137e-07, -3.79027e-08},
3317  {5.98657e-11, 8.82108e-07, -3.78997e-08},
3318  {-5.30012e-11, 8.97281e-07, -3.79316e-08},
3319  {-3.81717e-11, 8.97306e-07, -3.79344e-08},
3320  {-1.66362e-11, 8.97329e-07, -3.79323e-08},
3321  {1.66363e-11, 8.97329e-07, -3.79323e-08},
3322  {3.81717e-11, 8.97306e-07, -3.79344e-08},
3323  {5.30013e-11, 8.97281e-07, -3.79316e-08},
3324  {-4.65529e-11, 9.12465e-07, -3.79598e-08},
3325  {-3.35653e-11, 9.12487e-07, -3.79624e-08},
3326  {-1.46442e-11, 9.12507e-07, -3.79604e-08},
3327  {1.46443e-11, 9.12507e-07, -3.79604e-08},
3328  {3.35653e-11, 9.12487e-07, -3.79624e-08},
3329  {4.65529e-11, 9.12465e-07, -3.79598e-08},
3330  {-4.05205e-11, 9.27658e-07, -3.79845e-08},
3331  {-2.92561e-11, 9.27678e-07, -3.79869e-08},
3332  {-1.27808e-11, 9.27696e-07, -3.79851e-08},
3333  {1.27808e-11, 9.27696e-07, -3.79851e-08},
3334  {2.92561e-11, 9.27678e-07, -3.79869e-08},
3335  {4.05206e-11, 9.27658e-07, -3.79845e-08},
3336  {-3.49043e-11, 9.42861e-07, -3.80059e-08},
3337  {-2.52441e-11, 9.42878e-07, -3.80082e-08},
3338  {-1.10459e-11, 9.42893e-07, -3.80065e-08},
3339  {1.10459e-11, 9.42893e-07, -3.80065e-08},
3340  {2.52441e-11, 9.42878e-07, -3.80082e-08},
3341  {3.49043e-11, 9.42861e-07, -3.80059e-08},
3342  {-2.97041e-11, 9.5807e-07, -3.80244e-08},
3343  {-2.15294e-11, 9.58084e-07, -3.80265e-08},
3344  {-9.43949e-12, 9.58098e-07, -3.8025e-08},
3345  {9.43952e-12, 9.58098e-07, -3.8025e-08},
3346  {2.15294e-11, 9.58084e-07, -3.80265e-08},
3347  {2.97041e-11, 9.5807e-07, -3.80244e-08},
3348  {-2.492e-11, 9.73285e-07, -3.80401e-08},
3349  {-1.81119e-11, 9.73297e-07, -3.80421e-08},
3350  {-7.96169e-12, 9.73309e-07, -3.80406e-08},
3351  {7.96172e-12, 9.73309e-07, -3.80406e-08},
3352  {1.8112e-11, 9.73297e-07, -3.80421e-08},
3353  {2.492e-11, 9.73285e-07, -3.80401e-08},
3354  {-2.05521e-11, 9.88505e-07, -3.80533e-08},
3355  {-1.49918e-11, 9.88516e-07, -3.8055e-08},
3356  {-6.61251e-12, 9.88525e-07, -3.80537e-08},
3357  {6.61254e-12, 9.88525e-07, -3.80537e-08},
3358  {1.49919e-11, 9.88516e-07, -3.8055e-08},
3359  {2.05521e-11, 9.88505e-07, -3.80533e-08},
3360  {-1.66005e-11, 1.00373e-06, -3.80641e-08},
3361  {-1.21692e-11, 1.00374e-06, -3.80657e-08},
3362  {-5.39202e-12, 1.00375e-06, -3.80645e-08},
3363  {5.39205e-12, 1.00375e-06, -3.80645e-08},
3364  {1.21693e-11, 1.00374e-06, -3.80657e-08},
3365  {1.66006e-11, 1.00373e-06, -3.80641e-08},
3366  {-1.30655e-11, 1.01896e-06, -3.80729e-08},
3367  {-9.64438e-12, 1.01896e-06, -3.80743e-08},
3368  {-4.30039e-12, 1.01897e-06, -3.80732e-08},
3369  {4.30042e-12, 1.01897e-06, -3.80732e-08},
3370  {9.64441e-12, 1.01896e-06, -3.80743e-08},
3371  {1.30655e-11, 1.01896e-06, -3.80729e-08},
3372  {-9.94721e-12, 1.03419e-06, -3.80798e-08},
3373  {-7.41765e-12, 1.03419e-06, -3.8081e-08},
3374  {-3.33787e-12, 1.0342e-06, -3.80801e-08},
3375  {3.3379e-12, 1.0342e-06, -3.80801e-08},
3376  {7.41768e-12, 1.03419e-06, -3.8081e-08},
3377  {9.94724e-12, 1.03419e-06, -3.80798e-08},
3378  {-7.24624e-12, 1.04942e-06, -3.80851e-08},
3379  {-5.48971e-12, 1.04942e-06, -3.80862e-08},
3380  {-2.50485e-12, 1.04943e-06, -3.80854e-08},
3381  {2.50488e-12, 1.04943e-06, -3.80854e-08},
3382  {5.48975e-12, 1.04942e-06, -3.80862e-08},
3383  {7.24627e-12, 1.04942e-06, -3.80851e-08},
3384  {-4.96318e-12, 1.06465e-06, -3.8089e-08},
3385  {-3.8615e-12, 1.06465e-06, -3.80899e-08},
3386  {-1.80185e-12, 1.06466e-06, -3.80893e-08},
3387  {1.80188e-12, 1.06466e-06, -3.80893e-08},
3388  {3.86153e-12, 1.06465e-06, -3.80899e-08},
3389  {4.96321e-12, 1.06465e-06, -3.8089e-08},
3390  {-3.09882e-12, 1.07988e-06, -3.80918e-08},
3391  {-2.53409e-12, 1.07988e-06, -3.80925e-08},
3392  {-1.22916e-12, 1.07989e-06, -3.8092e-08},
3393  {1.2292e-12, 1.07989e-06, -3.8092e-08},
3394  {2.53413e-12, 1.07988e-06, -3.80925e-08},
3395  {3.09886e-12, 1.07988e-06, -3.80918e-08},
3396  {-1.65404e-12, 1.09511e-06, -3.80936e-08},
3397  {-1.50768e-12, 1.09512e-06, -3.80941e-08},
3398  {-7.85584e-13, 1.09512e-06, -3.80938e-08},
3399  {7.85617e-13, 1.09512e-06, -3.80938e-08},
3400  {1.50772e-12, 1.09512e-06, -3.80941e-08},
3401  {1.65407e-12, 1.09511e-06, -3.80936e-08},
3402  {-6.29428e-13, 1.11035e-06, -3.80946e-08},
3403  {-7.76853e-13, 1.11035e-06, -3.80951e-08},
3404  {-4.65364e-13, 1.11035e-06, -3.80949e-08},
3405  {4.65397e-13, 1.11035e-06, -3.80949e-08},
3406  {7.76886e-13, 1.11035e-06, -3.80951e-08},
3407  {6.29461e-13, 1.11035e-06, -3.80946e-08},
3408  {-3.35459e-15, 1.12558e-06, -3.80952e-08},
3409  {-3.14262e-13, 1.12558e-06, -3.80956e-08},
3410  {-2.57658e-13, 1.12558e-06, -3.80957e-08},
3411  {2.57692e-13, 1.12558e-06, -3.80957e-08},
3412  {3.14296e-13, 1.12558e-06, -3.80956e-08},
3413  {3.38831e-15, 1.12558e-06, -3.80952e-08},
3414  {3.77179e-13, 1.14081e-06, -3.80957e-08},
3415  {-6.03705e-14, 1.14081e-06, -3.80961e-08},
3416  {-1.69333e-13, 1.14081e-06, -3.80962e-08},
3417  {1.69367e-13, 1.14081e-06, -3.80962e-08},
3418  {6.04047e-14, 1.14081e-06, -3.80961e-08},
3419  {-3.77144e-13, 1.14081e-06, -3.80957e-08} };
3420  //*********************************************************************
3421  int runs_handle = COM_get_function_handle("Window1.Run");
3422  bool runs_func = (runs_handle > 0);
3423  bool DispCorrect = true;
3424  int runs_runs = 0;
3425  double time1 = 1.0;
3426  double* Disp = NULL;
3427  int DispSize = 0;
3428  COM_get_array("Window1.Displacements", 100+rank, &Disp);
3429  std::cout << "runs = " << runs_handle << std::endl;
3430  if(runs_handle){
3431  //Call the run function for Time1
3432  if(Loads){
3433  std::cout << "Changing load values" << std::endl;
3434  for(int i=0; i < LoadsSize; i++){
3435  std::cout << "Rank #" << rank
3436  << ", Point #" << i
3437  << " ---- ";
3438  for(int j=1; j < 2; j++){
3439  Loads[i*3 + j] = 1.0;//double(i*3 + j) + 300*3*rank;
3440  std::cout << Loads[i*3 + j] << " ";
3441  }
3442  std::cout << std::endl;
3443  }
3444  }
3445  COM_call_function(runs_handle, &runs_runs, &time1);
3446  } else {
3447  std::cout << "ParTimeStepperRuns Error: Could not get function handle."
3448  << "." << std::endl;
3449  result.UpdateResult("ParTimeStepper:Runs", false);
3450  return;
3451  }
3452 
3453  //Check if function changed value of runs properly
3454  if(runs_runs > 0){
3455  result.UpdateResult("ParTimeStepper:Runs", true);
3456  } else {
3457  result.UpdateResult("ParTimeStepper:Runs", false);
3458  ItAllWorks = 0;
3459  }
3460 
3461  // Check reigstration of displacement data
3462  if (Disp){
3463  result.UpdateResult("ParDisplacementData:Registered", true);
3464  // Get the FSI displacement size from the structures solver
3465  COM_get_size("Window1.Displacements", 100+rank, &DispSize);
3466  if(DispSize != 306){
3467  std::cout << "ParElmerUnitTests Error:"
3468  << " Disp array is incorrect size!" << std::endl;
3469  ItAllWorks = 0;
3470  DispCorrect = false;
3471  }
3472  } else {
3473  result.UpdateResult("ParDisplacementData:Registered", false);
3474  DispCorrect = false;
3475  ItAllWorks = 0;
3476  }
3477 
3478  // Check values of displacements after Run func @ Time1
3479  if (Disp && runs_handle && DispCorrect){
3480  //std::ofstream Ouf;
3481  //std::stringstream ss;
3482  //std::string str_rank;
3483  //ss << rank;
3484  //ss >> str_rank;
3485  //std::string outFileName = "disp_" + str_rank + ".dat";
3486  //Ouf.open(outFileName.c_str());
3487  std::cout << "Checking Displacements for time = " << time1 << std::endl;
3488  for(int i=0; i < DispSize; i++){
3489  //std::cout << "Rank #" << rank << ", Point #" << i
3490  // << " --- ";
3491  //Ouf << "{";
3492  for(int j=0; j < 3; j++){
3493  //std::cout << Disp[i*3+j] << " ";
3494  //Ouf << Disp[i*3+j];
3495  //if (j < 2)
3496  // Ouf << ", ";
3497  //else
3498  // Ouf << "},";
3499  if (rank==0) {
3500  if(fabs(dispCheck0[i][j] - Disp[i*3+j]) > 1.0e-10){
3501  std::cout << "Rank #" << rank
3502  << ", Wrong displacements for point #" << i
3503  << " component #" << j
3504  << ", check = " << dispCheck0[i][j]
3505  << " actual = " << Disp[i*3+j]
3506  << " diff = " << fabs(dispCheck0[i][j] - Disp[i*3+j])
3507  << std::endl;
3508  ItAllWorks = 0;
3509  DispCorrect = false;
3510  break;
3511  }
3512  } else if (rank==1) {
3513  if(fabs(dispCheck1[i][j] - Disp[i*3+j]) > 1.0e-10){
3514  std::cout << "Rank #" << rank
3515  << ", Wrong displacements for point #" << i
3516  << " component #" << j
3517  << ", check = " << dispCheck1[i][j]
3518  << " actual = " << Disp[i*3+j]
3519  << " diff = " << fabs(dispCheck1[i][j] - Disp[i*3+j])
3520  << std::endl;
3521  ItAllWorks = 0;
3522  DispCorrect = false;
3523  break;
3524  }
3525  }
3526  }
3527  //std::cout << std::endl;
3528  //Ouf << std::endl;
3529  }
3530  //Ouf.close();
3531  }
3532  // gathering each process results to root
3533  bool globalDispCorrect = 0;
3534  _communicator.Reduce(DispCorrect, globalDispCorrect, IRAD::Comm::DTINT, IRAD::Comm::PRODOP, 0);
3535  _communicator.BroadCast(globalDispCorrect, 0);
3536  result.UpdateResult("ParDisplacementData:Correct", globalDispCorrect);
3537 
3538 
3540  // Get Finalize function handle and call Function
3542  int final_handle = COM_get_function_handle("Window1.Finalize");
3543  bool final_func = (final_handle > 0);
3544  int final_runs = 0;
3545  if(final_handle){
3546  //Call the function
3547  COM_call_function(final_handle, &final_runs);
3548  }
3549  else{
3550  std::cout << "ParFinalizeRuns Error: Could not get function handle."
3551  << "." << std::endl;
3552  result.UpdateResult("ParFinalize:Runs", false);
3553  return;
3554  }
3555 
3556  //Check if function changed value of runs properly
3557  if(final_runs == 1){
3558  result.UpdateResult("ParFinalize:Runs", true);
3559  }
3560  else{
3561  result.UpdateResult("ParFinalize:Runs", false);
3562  ItAllWorks = 0;
3563  }
3564 
3566  //Unload Elmer module
3568  COM_UNLOAD_MODULE_STATIC_DYNAMIC( ElmerCSCParallel, "Window1");
3569 
3570  //Make sure module unloaded
3571  h=COM_get_window_handle("Window1");
3572  if(h > 0){
3573  std::cout << "After unloading, COM_get_window_handle(\"Window1\") returns "
3574  << h << std::endl;
3575  load_unload=false;
3576  std::cout << "ParElmerUnitTests Error: Did not properly unload module."
3577  << "." << std::endl;
3578  result.UpdateResult("ParElmerUnitTests:Run", false);
3579  result.UpdateResult("ParUnloadSolverModule:Works",false);
3580  return;
3581  }
3582  else
3583  result.UpdateResult("ParUnloadSolverModule:Works",true);
3584 
3585  //Change directories out of TestDir directory back to original directory
3586  IntDir = IRAD::Sys::ChDir(OrgDir);
3587  if(IntDir == -1){
3588  std::cout << "ParElmerUnitTests Error: Could not change directories to "
3589  << OrgDir << "." << std::endl;
3590  result.UpdateResult("ParElmerUnitTests:Run", false);
3591  return;
3592  }
3593 
3594  // gathering each process results to root
3595  int globalItAllWorks = 0;
3596  _communicator.Reduce(ItAllWorks, globalItAllWorks, IRAD::Comm::DTINT, IRAD::Comm::PRODOP, 0);
3597  _communicator.BroadCast(globalItAllWorks, 0);
3598  std::cout << "Rank #" << rank
3599  << ", local ItAllWorks = " << ItAllWorks
3600  << " globalItAllWorks = " << globalItAllWorks
3601  << std::endl;
3602  result.UpdateResult("ParElmerUnitTests:Run", globalItAllWorks);
3603  }
3604 
3605 
3614  virtual void Process(ResultsType &result){
3615  Prologue();
3616  Test__ParallelTrapezoidQuadrature(result);
3617  Test__ParallelMidPointQuadrature(result);
3618  Test__ParCommunicatorPassToModule(result);
3619  Test__ParElmerUnitTests(result);
3620  Epilogue();
3621  }
3622 
3629  virtual void RunTest(const std::string &name,ResultsType &result)
3630  {
3631  if(name == "ParallelTrapezoidQuadrature")
3632  Test__ParallelTrapezoidQuadrature(result);
3633  if(name == "ParallelMidPointQuadrature")
3634  Test__ParallelMidPointQuadrature(result);
3635  if(name == "ParCommunicatorPassToModule")
3636  Test__ParCommunicatorPassToModule(result);
3637  if(name == "ParElmerUnitTest")
3638  Test__ParElmerUnitTests(result);
3639  }
3640 
3647  virtual void ProcessTests(std::list<std::string> &test_names,ResultsType &result){
3648  Prologue();
3649  std::list<std::string>::iterator tni = test_names.begin();
3650  while(tni != test_names.end())
3651  RunTest(*tni++,result);
3652  Epilogue();
3653  }
3654 
3655 
3656  };
3657 #endif
3658 };
3659 #endif
virtual void Test__ExampleFunction(ResultsType &result)
Test for ElmerModuleDriver::ExampleFunction.
virtual void RunTest(const std::string &name, ResultsType &result)
Runs a test specified by name.
double TrapezoidQuadrature(double(*f)(double), double x0, double xn, int n)
Integrates f with composite trapezoid rule.
std::vector< int > N
A set of values for testing quadrature methods.
std::string SourceDirPath
The string for the testing source directory.
virtual void Test__ElasticBeam3D_LoadFunction(ResultsType &result)
void SetSourceDirPath(std::string input)
Sets the string value of the testing source directory.
virtual void ProcessTests(std::list< std::string > &test_names, ResultsType &result)
Runs a list of tests specified by name.
std::string ExampleFunction(const std::string &instring)
Example function for ElmerModuleDriver (this is a brief description).
int streamdiff(std::istream &stream1, std::istream &stream2, std::stringstream *ss=NULL)
Function to compare two files.
Project-specific testing object.
double F2(double x)
Simple test function fixture returns .
std::string ExampleTestFixture
A sample string test fixture.
virtual void Epilogue()
Tears down the testing fixtures if needed.
IRAD::Util::TestResults TestResults
Project-specific test results type.
virtual void Test__MidPointQuadrature(ResultsType &result)
Test for ElmerModuleDriver::MidPointQuadrature.
COM_EXTERN_MODULE(OpenFoamFSI)
virtual int GetInputData(std::string suffix, std::string TestDir)
Function to copy input data from source testing directory for use in unit tests.
IRAD::Util::TestingObject< ResultsType > TestingObjectBaseType
IRAD::Comm::CommunicatorObject CommType
Convenience typedef for CommunicatorObject.
double MidPointQuadrature(double(*f)(double), double x0, double xn, int n)
Integrates f with composite midpoint rule.
virtual void Test__ElmerUnitTests(ResultsType &result)
double F1(double x)
Simple test function fixture returns .
virtual void Process(ResultsType &result)
double F2(double x)
Simple test function fixture returns .
virtual void Test__TrapezoidQuadrature(ResultsType &result)
Test for ElmerModuleDriver::TrapezoidQuadrature.
IRAD::Util::TestResults TestResults
Project-specific test results type.
double F1(double x)
Simple test function fixture returns .
virtual void Prologue()
Sets up the data fixtures for the tests.