Skip to content

Commit

Permalink
[refactor]
Browse files Browse the repository at this point in the history
  • Loading branch information
mohd-afeef-badri committed Jan 15, 2025
1 parent a111ed5 commit 50f6694
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
25 changes: 18 additions & 7 deletions acoustics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,34 @@ add_executable(Acoustics

arcane_generate_axl(Fem)
arcane_add_arcane_libraries_to_target(Acoustics)

target_include_directories(Acoustics PUBLIC . ${CMAKE_CURRENT_BINARY_DIR})
configure_file(Acoustics.config ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.sub.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.sub.hypre.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(${MSH_DIR}/sub.msh ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)

file(COPY "tests/" DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
# Copy the check files in the binary directory
file(COPY "check" DESTINATION ${CMAKE_CURRENT_BINARY_DIR})

# Copy the inputs folder containing the arc files
file(COPY "inputs" DESTINATION ${CMAKE_CURRENT_BINARY_DIR})

# Copy the mesh files into meshes directory
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/meshes)
set(MESH_FILES
sub.msh
)
foreach(MESH_FILE IN LISTS MESH_FILES)
file(COPY ${MSH_DIR}/${MESH_FILE} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/meshes)
endforeach()

target_link_libraries(Acoustics PUBLIC FemUtils)

enable_testing()

add_test(NAME [Acoustics]2D_submarine COMMAND Acoustics Test.sub.arc)
add_test(NAME [Acoustics]2D_submarine COMMAND Acoustics inputs/sub.arc)

if(FEMUTILS_HAS_SOLVER_BACKEND_HYPRE)
add_test(NAME [Acoustics]2D_submarine_hypre COMMAND Acoustics Test.sub.hypre.arc)
add_test(NAME [Acoustics]2D_submarine_hypre COMMAND Acoustics inputs/sub.hypre.arc)
if(FEMUTILS_HAS_PARALLEL_SOLVER AND MPIEXEC_EXECUTABLE)
add_test(NAME [Acoustics]2D_submarine_hypre_2pe COMMAND ${MPIEXEC_EXECUTABLE} -n 2 ./Acoustics Test.sub.hypre.arc)
add_test(NAME [Acoustics]2D_submarine_hypre_2p COMMAND ${MPIEXEC_EXECUTABLE} -n 2 ./Acoustics inputs/sub.hypre.arc)
endif()
endif()
File renamed without changes.
4 changes: 2 additions & 2 deletions acoustics/Test.sub.arc → acoustics/inputs/sub.arc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
-->
<meshes>
<mesh>
<filename>sub.msh</filename>
<filename>meshes/sub.msh</filename>
</mesh>
</meshes>

Expand All @@ -47,7 +47,7 @@
</neumann>
</boundary-conditions>
<linear-system name="SequentialBasicLinearSystem" />
<result-file>sub_2D.txt</result-file>
<result-file>check/sub_2D.txt</result-file>
</fem>

<!--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
-->
<meshes>
<mesh>
<filename>sub.msh</filename>
<filename>meshes/sub.msh</filename>
</mesh>
</meshes>

Expand All @@ -51,7 +51,7 @@
<solver-method>bicgstab</solver-method>
<epsilon>1e-8</epsilon>
</linear-system>
<result-file>sub_2D.txt</result-file>
<result-file>check/sub_2D.txt</result-file>
</fem>

<!--
Expand Down

0 comments on commit 50f6694

Please sign in to comment.