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
virtual void Test__ElmerStructures ( ResultsType &  result)
inlinevirtual

Run an initialization check to make sure that the ElmerStructures are running as they should.

Definition at line 726 of file ElmerFoamFSITest.H.

References TestingObject< ResultsType >::componentInterfaceNames, elmeragent::Initialize(), elmeragent::returnNodeCoords(), TestingObject< ResultsType >::Test__fsiCouplerAgentsInitialize(), TestingObject< ResultsType >::TeststructuresAgent, and TestingObject< ResultsType >::verblevel.

Referenced by TestingObject< ResultsType >::Process(), and TestingObject< ResultsType >::RunTest().

726  {
727  bool works = true;
728 
729  std::cout << "Initalizing Structure..." << std::endl;
732  std::cout << "Initialization Completed!" << std::endl;
733 
734  //Make sure the initializing doesn't return an error
735  if (initresult != 0){
736  std::cout << "structuresAgent->Initialize returns error. " <<
737  "Refer to ElmerAgent.H for more information. " << std::endl;
738  works = false;
739  }
740 
741  //Test to make sure the node coordinates are populated
742  //More of an exercise to make sure the data is loaded correctly
743  //face coordinates are not in use currently
744  std::vector<double> nodecoordinates(TeststructuresAgent->returnNodeCoords());
745  std::cout << "Node size is: " << nodecoordinates.size() << std::endl;
746  if (nodecoordinates.size() < 0){
747  std::cout << "There is a problem with obtaining the nodecoordinate data" <<
748  "Refer to ElmerAgent.H for more information. " << std::endl;
749  works = false;
750  }
751 
752  double arr[306] = {0.1, 0.1, 0, 0, 0.1, 0, 0, 0.1, 0.02, 0.1, 0.1, 0.02, 0, 0.1, 0.04, 0.1, 0.1, 0.04, 0, 0.1, 0.06, 0.1, 0.1, 0.06, 0, 0.1, 0.08, 0.1, 0.1, 0.08, 0, 0.1, 0.1, 0.1, 0.1, 0.1, 0, 0.1, 0.12, 0.1, 0.1, 0.12, 0, 0.1, 0.14, 0.1, 0.1, 0.14, 0, 0.1, 0.16, 0.1, 0.1, 0.16, 0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 0.1, 0.9, 0, 0.1, 0.92, 0.1, 0.1, 0.92, 0, 0.1, 0.94, 0.1, 0.1, 0.94, 0, 0.1, 0.96, 0.1, 0.1, 0.96, 0, 0.1, 0.98, 0.1, 0.1, 0.98, 0, 0.1, 1, 0.1, 0.1, 1};
753 
754  for (int i = 0; i < 306; i++){
755  if (arr[i] != nodecoordinates.at(i)){
756  std::cout << "Node Coordinate Inconsistencies." << std::endl;
757  works = false;
758  break;
759  }
760  }
761  result.UpdateResult("ElmerStructures:Works",works);
762  delete TeststructuresAgent;
763  }
int verblevel
track verbosity level for tests
virtual std::vector< double > returnNodeCoords()
Definition: ElmerAgent.H:92
virtual int Initialize(const std::string &interfaceName, int verblevel=1)
Definition: ElmerAgent.H:10
virtual void Test__fsiCouplerAgentsInitialize()
Initalize function for the fsiCoupler and agents.
std::vector< std::string > componentInterfaceNames
solidagent * TeststructuresAgent
For use with the ElmerStructure and OpenFoamFluids tests.

Here is the call graph for this function:

Here is the caller graph for this function: