Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xiaojing modify cases mergetomaster #428

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tests/user_examples/test_2d_membrane/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ SET(BUILD_INPUT_PATH "${EXECUTABLE_OUTPUT_PATH}/input")
SET(BUILD_RELOAD_PATH "${EXECUTABLE_OUTPUT_PATH}/reload")

file(MAKE_DIRECTORY ${BUILD_INPUT_PATH})
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${BUILD_INPUT_PATH})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/regression_test_tool/ DESTINATION ${BUILD_INPUT_PATH})


add_executable(${PROJECT_NAME})
aux_source_directory(. DIR_SRCS)
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
true
6
5
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# !/usr/bin/env python3
import os
import sys

path = os.path.abspath('../../../../../PythonScriptStore/RegressionTest')
sys.path.append(path)
from regression_test_base_tool import SphinxsysRegressionTest

"""
case name: test_2d_membrane
"""

case_name = "test_2d_membrane"
body_name = "MembraneObserver"
parameter_name = "Position"

number_of_run_times = 0
converged = 0
sphinxsys = SphinxsysRegressionTest(case_name, body_name, parameter_name)


while True:
print("Now start a new run......")
sphinxsys.run_case()
number_of_run_times += 1
converged = sphinxsys.read_dat_file()
print("Please note: This is the", number_of_run_times, "run!")
if number_of_run_times <= 200:
if converged == "true":
print("The tested parameters of all variables are converged, and the run will stop here!")
break
elif converged != "true":
print("The tested parameters of", sphinxsys.sphinxsys_parameter_name, "are not converged!")
continue
else:
print("It's too many runs but still not converged, please try again!")
break

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions tests/user_examples/test_2d_stretching/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ SET(BUILD_INPUT_PATH "${EXECUTABLE_OUTPUT_PATH}/input")
SET(BUILD_RELOAD_PATH "${EXECUTABLE_OUTPUT_PATH}/reload")



file(MAKE_DIRECTORY ${BUILD_INPUT_PATH})
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${BUILD_INPUT_PATH})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/regression_test_tool/ DESTINATION ${BUILD_INPUT_PATH})

aux_source_directory(. DIR_SRCS)
ADD_EXECUTABLE(${PROJECT_NAME} ${DIR_SRCS})

target_link_libraries(${PROJECT_NAME} sphinxsys_2d GTest::gtest GTest::gtest_main)
target_link_libraries(${PROJECT_NAME} extra_sources_2d)

set_target_properties(${PROJECT_NAME} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${EXECUTABLE_OUTPUT_PATH}")


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<dtw_distance>
<DTWDistance Position_0="0.002808566813393816" />
</dtw_distance>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
true
7
4
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# !/usr/bin/env python3
import os
import sys

path = os.path.abspath('../../../../../PythonScriptStore/RegressionTest')
sys.path.append(path)
from regression_test_base_tool import SphinxsysRegressionTest

"""
case name: test_2d_stretching
"""

case_name = "test_2d_stretching"
body_name = "BeamObserver"
parameter_name = "Position"

number_of_run_times = 0
converged = 0
sphinxsys = SphinxsysRegressionTest(case_name, body_name, parameter_name)


while True:
print("Now start a new run......")
sphinxsys.run_particle_relaxation()
sphinxsys.run_case_with_reload()
number_of_run_times += 1
converged = sphinxsys.read_dat_file()
print("Please note: This is the", number_of_run_times, "run!")
if number_of_run_times <= 200:
if converged == "true":
print("The tested parameters of all variables are converged, and the run will stop here!")
break
elif converged != "true":
print("The tested parameters of", sphinxsys.sphinxsys_parameter_name, "are not converged!")
continue
else:
print("It's too many runs but still not converged, please try again!")
break
Loading