Skip to content

Commit

Permalink
modify cmake and add an shell script for case creation
Browse files Browse the repository at this point in the history
  • Loading branch information
fangjian authored and fangjian committed Dec 7, 2023
1 parent f2b5496 commit 7c48496
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 7 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${PROJECT_BINARY_DIR}/opt" CACHE PATH "..." FORCE)
endif()


# Add support for CMAKE_DEPENDENT_OPTION
INCLUDE(CMakeDependentOption)
INCLUDE(CMakeParseArguments)
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ FC=h5pfc
SRCDIR = /mnt/d/ASTR/astr/src ./user_define_module
OBJDIR = obj
BINDIR = bin
CTRDIR = /home/fangjian/opt/cantera-2.5.1
CTRDIR = cma

FCFLAGS= -O3 -fbounds-check -fallow-argument-mismatch

# OPTIONS1 = -fcheck=all
OPTIONS2 = -J $(OBJDIR)
OPTIONS3 = -DHDF5
OPTIONS3 = -DHDF5s
# OPTIONS4 = -DCOMB -I$(CTRDIR)/include/cantera
# OMP = -fopenacc

Expand All @@ -31,7 +31,7 @@ VPATH = $(SRCDIR):$(OBJDIR)
srs= strings.F90 fdnn.F90 singleton.F90 commtype.F90 stlaio.F90 constdef.F90 tecio.F90 \
vtkio.F90 interp.F90 commvar.F90 utility.F90 thermchem.F90 commarray.F90 fludyna.F90 \
parallel.F90 hdf5io.F90 cmdefne.F90 commfunc.F90 commcal.F90 models.F90 statistic.F90 \
userdefine.F90 bc.F90 readwrite.F90 geom.F90 ibmethod.F90 gridgeneration.F90 \
userdefine.F90 bc.F90 readwrite.F90 geom.F90 ibmethod.F90 gridgeneration.F90 \
riemann.F90 comsolver.F90 solver.F90 pp.F90 initialisation.F90 mainloop.F90 test.F90 \
astr.F90

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ By default ASTR solves equations under non-dimensional form, unless the chemstry

create a case folder, e.g.
mkdir test_case
cd test_case
sh path_to_the_source/script/astr.case.creater #create a new case

cmake path_to_the_source
cmake --build ./ or make
cmake --install ./ or make install
Expand Down
11 changes: 11 additions & 0 deletions script/astr.case.creater
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

echo ' this is to create a new ASTR case'

mkdir -p ./user_define_module

echo ' ASTR PATH:'$apath

cp -v $apath/user_define_module/userdefine.F90 ./user_define_module/

cp -rv $apath/examples/Taylor_Green_Vortex_2D/datin ./
11 changes: 9 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@

message(STATUS "CMAKE_SOURCE_DIR: ${CMAKE_SOURCE_DIR}")
message(STATUS "PROJECT_BINARY_DIR: ${PROJECT_BINARY_DIR}")

# message(STATUS "the local path: ${PROJECT_BINARY_DIR}")

set(UDF_SRC ${PROJECT_BINARY_DIR}/user_define_module)
file(GLOB UDF_SOURCE_FILES ${UDF_SRC}/*.F90)

message(STATUS "UDF path: ${UDF_SRC}")

add_executable(astr
astr.F90
bc.F90
Expand Down Expand Up @@ -36,9 +42,10 @@ add_executable(astr
tecio.F90
test.F90
thermchem.F90
userdefine.F90
${UDF_SOURCE_FILES}
utility.F90
vtkio.F90)

target_link_libraries(astr)
if (MPI_FOUND)
target_link_libraries(astr PRIVATE MPI::MPI_Fortran)
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,20 @@ end subroutine udf_flowinit
!+-------------------------------------------------------------------+
!
!+-------------------------------------------------------------------+
!| This subroutine is to collect statistics. |
!+-------------------------------------------------------------------+
!| CHANGE RECORD |
!| ------------- |
!| 09-Nov-2023: created by Jian Fang @ Appleton |
!+-------------------------------------------------------------------+
subroutine udf_meanflow
!
end subroutine udf_meanflow
!+-------------------------------------------------------------------+
!| The end of the subroutine udf_meanflow. |
!+-------------------------------------------------------------------+
!!
!+-------------------------------------------------------------------+
!| This subroutine is to generate grid. |
!+-------------------------------------------------------------------+
!| CHANGE RECORD |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,20 @@ end subroutine udf_flowinit
!+-------------------------------------------------------------------+
!
!+-------------------------------------------------------------------+
!| This subroutine is to collect statistics. |
!+-------------------------------------------------------------------+
!| CHANGE RECORD |
!| ------------- |
!| 09-Nov-2023: created by Jian Fang @ Appleton |
!+-------------------------------------------------------------------+
subroutine udf_meanflow
!
end subroutine udf_meanflow
!+-------------------------------------------------------------------+
!| The end of the subroutine udf_meanflow. |
!+-------------------------------------------------------------------+
!!
!+-------------------------------------------------------------------+
!| This subroutine is to generate grid. |
!+-------------------------------------------------------------------+
!| CHANGE RECORD |
Expand Down
13 changes: 13 additions & 0 deletions user_define_module/userdefine.F90
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,19 @@ end subroutine udf_write
!| The end of the subroutine udf_write. |
!+-------------------------------------------------------------------+
!
!+-------------------------------------------------------------------+
!| This subroutine is to collect statistics. |
!+-------------------------------------------------------------------+
!| CHANGE RECORD |
!| ------------- |
!| 09-Nov-2023: created by Jian Fang @ Appleton |
!+-------------------------------------------------------------------+
subroutine udf_meanflow
!
end subroutine udf_meanflow
!+-------------------------------------------------------------------+
!| The end of the subroutine udf_meanflow. |
!+-------------------------------------------------------------------+
end module userdefine
!+---------------------------------------------------------------------+
!| The end of the module userdefine. |
Expand Down

0 comments on commit 7c48496

Please sign in to comment.