544 std::cout <<
"Running Test__ModuleFunctionStepFluid" << std::endl;
547 COM_LOAD_MODULE_STATIC_DYNAMIC(OpenFoamFSI,
"OFModule");
553 std::string suffix =
"/share/Testing/test_data/HronTurekFsi";
555 std::string testDir = IRAD::Sys::CWD() +
"/UnitTestDataStepTest";
557 std::string fluidDir = testDir +
"/fluid";
558 std::string OrgDir = IRAD::Sys::CWD();
559 IntDir = IRAD::Sys::ChDir(fluidDir);
564 dummy2[0] =
const_cast<char *
>(std::string(
"StepFluid").c_str());
567 int initHandle = COM_get_function_handle(
"OFModule.InitFoam");
568 COM_call_function(initHandle, &dummy1, &dummy2, &verb);
573 COM_get_panes(
"OFModule", &numPanes, &paneList);
576 int pane = paneList[0];
579 int status = COM_get_status(
"OFModule.time", pane);
580 bool timeStatus =
false;
582 std::cout <<
"ModuleFunctionStepFluid Error: time not a valid DataItem."
583 <<
"status = " << status << std::endl;
584 result.UpdateResult(
"TimeData:Registered",
false);
590 status = COM_get_status(
"OFModule.endTime", pane);
592 std::cout <<
"ModuleFunctionStepFluid Error: endTime not a valid DataItem."
593 <<
"status = " << status << std::endl;
594 result.UpdateResult(
"TimeData:Registered",
false);
597 timeStatus = timeStatus &&
true;
599 result.UpdateResult(
"TimeData:Registered", timeStatus);
602 COM_get_array(
"OFModule.time", pane, &time);
603 double* endTime=NULL;
604 COM_get_array(
"OFModule.endTime", pane, &endTime);
607 double testTime = 0.;
608 double testEndTime = 5.e-3;
609 double toler = 1.e-9;
610 if(*time - testTime < toler && *endTime - testEndTime < toler)
613 std::cout <<
"ModuleFunctionStepFluid Error: time or endTime initialized incorrectly"
615 std::cout <<
" time = " << *time <<
" expected " << testTime << std::endl;
616 std::cout <<
" endTime = " << *endTime <<
" expected " << testEndTime << std::endl;
618 result.UpdateResult(
"TimeData:Correct",works);
622 int stepHandle = COM_get_function_handle(
"OFModule.StepFluid");
626 std::cout <<
"ModuleFunctionStepFluid Error: Could not get function handle."
628 result.UpdateResult(
"StepFluidFunction:Exists",
false);
631 result.UpdateResult(
"StepFluidFunction:Exists",works);
635 COM_call_function(stepHandle);
641 if(*time - testTime < toler )
644 std::cout <<
"ModuleFunctionStepFluid Error: time did not increment"
646 std::cout <<
" time = " << *time <<
"expected " << testTime << std::endl;
648 result.UpdateResult(
"StepFluidFunction:Steps",works);
651 IntDir = IRAD::Sys::ChDir(OrgDir);
653 COM_UNLOAD_MODULE_STATIC_DYNAMIC(OpenFoamFSI,
"OFModule");
virtual int GetInputData(std::string sourceDir, std::string destDir)
Function to copy input data from source testing directory for use in unit tests.
std::string SourceDirPath
The string for the testing source directory.