Skip to content

Commit b4b0d3e

Browse files
authored
Merge pull request #7 from MatMechLab/devel
Devel
2 parents 44ac0e8 + dc1bf68 commit b4b0d3e

391 files changed

Lines changed: 198081 additions & 94830 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/main.yml

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -72,27 +72,27 @@ jobs:
7272
run: |
7373
cd temp
7474
ls -l
75-
curl -L -O https://download.open-mpi.org/release/open-mpi/v5.0/openmpi-5.0.1.tar.gz
75+
curl -L -O https://download.open-mpi.org/release/open-mpi/v5.0/openmpi-5.0.6.tar.gz
7676
echo "******************************************************"
77-
echo "*** Openmpi 5.0.1 has been downloaded !"
77+
echo "*** Openmpi 5.0.6 has been downloaded !"
7878
echo "******************************************************"
7979
ls -l
8080
- name: compile and install openmpi
8181
run: |
8282
echo "******************************************************"
83-
echo "*** Start to compile openmpi-5.0.1"
83+
echo "*** Start to compile openmpi-5.0.6"
8484
echo "******************************************************"
8585
cd temp
86-
tar -xf openmpi-5.0.1.tar.gz
87-
cd openmpi-5.0.1
86+
tar -xf openmpi-5.0.6.tar.gz
87+
cd openmpi-5.0.6
8888
./configure --prefix=/home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/AsFemLibs/openmpi
89-
make -j8
89+
make -j2
9090
echo "******************************************************"
91-
echo "*** Make -j8 is done for openmpi-5.0.1"
91+
echo "*** Make -j2 is done for openmpi-5.0.6"
9292
echo "******************************************************"
9393
make install
9494
echo "******************************************************"
95-
echo "*** Make install is done for openmpi-5.0.1"
95+
echo "*** Make install is done for openmpi-5.0.6"
9696
echo "******************************************************"
9797
- name: check openmpi version
9898
run: |
@@ -102,18 +102,20 @@ jobs:
102102
./mpicc --version
103103
./mpicxx --version
104104
./mpirun --version
105+
echo "*** Now we check the mpirun"
106+
./mpirun -np 1 echo "Hi"
105107
echo "******************************************************"
106-
- name: downlaod PETSc
108+
- name: download PETSc
107109
run: |
108110
echo "******************************************************"
109111
echo "*** download petsc"
110112
echo "******************************************************"
111113
cd /home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/temp
112-
curl -L -O https://web.cels.anl.gov/projects/petsc/download/release-snapshots/petsc-lite-3.20.2.tar.gz
113-
tar -xf petsc-lite-3.20.2.tar.gz
114+
curl -L -O https://web.cels.anl.gov/projects/petsc/download/release-snapshots/petsc-lite-3.22.2.tar.gz
115+
tar -xf petsc-lite-3.22.2.tar.gz
114116
- name: compile and install PETSc
115117
run: |
116-
cd /home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/temp/petsc-3.20.2
118+
cd /home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/temp/petsc-3.22.2
117119
echo "******************************************************"
118120
echo "*** Configure petsc ..."
119121
echo "******************************************************"
@@ -137,11 +139,11 @@ jobs:
137139
echo "******************************************************"
138140
echo "*** Make petsc ..."
139141
echo "******************************************************"
140-
make PETSC_DIR=/home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/temp/petsc-3.20.2 PETSC_ARCH=arch-linux-c-opt all
142+
make PETSC_DIR=/home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/temp/petsc-3.22.2 PETSC_ARCH=arch-linux-c-opt all
141143
echo "******************************************************"
142144
echo "*** Install petsc ..."
143145
echo "******************************************************"
144-
make PETSC_DIR=/home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/temp/petsc-3.20.2 PETSC_ARCH=arch-linux-c-opt install
146+
make PETSC_DIR=/home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/temp/petsc-3.22.2 PETSC_ARCH=arch-linux-c-opt install
145147
- name: compile AsFem
146148
run: |
147149
cd /home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}
@@ -165,7 +167,7 @@ jobs:
165167
echo "*********************************************************************"
166168
echo "*** Make AsFem"
167169
echo "*********************************************************************"
168-
make -j8
170+
make -j2
169171
echo "*********************************************************************"
170172
echo "*** AsFem has been successuflly installed !"
171173
echo "*********************************************************************"
@@ -190,7 +192,25 @@ jobs:
190192
export FPATH=$mpi/include:$FPATH
191193
export MANPATH=$mpi/share/man:$MANPATH
192194
export LD_LIBRARY_PATH=$mpi/lib:$LD_LIBRARY_PATH
193-
python3 scripts/AutoTest.py -n 2
195+
python3 scripts/AutoTest.py -n 1
196+
- name: run step2-2d with single cpu
197+
run: |
198+
cd /home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/examples/tutorial
199+
ls
200+
export MPI_DIR=/home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/AsFemLibs/openmpi
201+
export PATH=$PATH:$MPI_DIR/bin
202+
export CC=$MPI_DIR/bin/mpicc
203+
export CXX=$MPI_DIR/bin/mpicxx
204+
export F90=$MPI_DIR/bin/mpif90
205+
export F77=$MPI_DIR/bin/mpif77
206+
export OMP_NUM_THREADS=1
207+
export PETSC_DIR=/home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/AsFemLibs/petsc
208+
export C_INCLUDE_PATH=$mpi/include:$C_INCLUDE_PATH
209+
export CPLUS_INCLUDE_PATH=$mpi/include:$CPLUS_INCLUDE_PATH
210+
export FPATH=$mpi/include:$FPATH
211+
export MANPATH=$mpi/share/man:$MANPATH
212+
export LD_LIBRARY_PATH=$mpi/lib:$LD_LIBRARY_PATH
213+
mpirun -np 1 /home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/bin/asfem -i step2-2d.json
194214
- name: run step2-2d in parallel
195215
run: |
196216
cd /home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/examples/tutorial
@@ -208,7 +228,7 @@ jobs:
208228
export FPATH=$mpi/include:$FPATH
209229
export MANPATH=$mpi/share/man:$MANPATH
210230
export LD_LIBRARY_PATH=$mpi/lib:$LD_LIBRARY_PATH
211-
mpirun -np 2 /home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/bin/asfem -i step2-2d.json
231+
mpirun -np 1 /home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/bin/asfem -i step2-2d.json
212232
- name: run step2-3d in parallel
213233
run: |
214234
cd /home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/examples/tutorial
@@ -226,7 +246,7 @@ jobs:
226246
export FPATH=$mpi/include:$FPATH
227247
export MANPATH=$mpi/share/man:$MANPATH
228248
export LD_LIBRARY_PATH=$mpi/lib:$LD_LIBRARY_PATH
229-
mpirun -np 2 /home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/bin/asfem -i step2-3d.json
249+
mpirun -np 1 /home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/bin/asfem -i step2-3d.json
230250
- name: run step3-2d in parallel
231251
run: |
232252
cd /home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/examples/tutorial
@@ -239,7 +259,7 @@ jobs:
239259
export FPATH=$mpi/include:$FPATH
240260
export MANPATH=$mpi/share/man:$MANPATH
241261
export LD_LIBRARY_PATH=$mpi/lib:$LD_LIBRARY_PATH
242-
mpirun -np 2 /home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/bin/asfem -i step3-2d.json
262+
mpirun -np 1 /home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/bin/asfem -i step3-2d.json
243263
- name: clean all folders and files
244264
run: |
245265
rm -rf temp

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ __pycache__/
1313
.vscode/
1414
build/
1515

16+
# for clion config
17+
cmake-build-debug/
18+
.idea/
19+
1620
# for asfem
1721
bin/
1822
*.vtu

CMakeLists.txt

Lines changed: 57 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
cmake_minimum_required(VERSION 3.21.0)
2-
project(AsFem)
2+
project(AsFem2)
33

44
set(CMAKE_CXX_STANDARD 17)
55

66
###############################################
77
### Set your PETSc/MPI path here or bashrc ###
8-
### The only things to modify is the ###
8+
### The only things to modify are the ###
99
### following two lines(PETSC/MPI_DIR) ###
1010
###############################################
1111
SET(WINDOWS "False" CACHE STRING "WINDOWS")
@@ -75,7 +75,13 @@ elseif(UNIX)
7575
if(NOT PETSC_LIB)
7676
message(FATAL_ERROR " PETSc lib dir can\'t be found!")
7777
endif()
78-
message(" PETSc include dir is: ${PETSC_DIR}/include")
78+
find_library(METIS_LIB NAMES metis HINTS ${PETSC_DIR}/lib ${PETSC_DIR}/lib64)
79+
# ###
80+
# if(NOT METIS_LIB)
81+
# message(FATAL_ERROR " METIS lib dir can\'t be found!")
82+
# endif()
83+
# message(" METIS library is: ${METIS_LIB}")
84+
# link_libraries("${METIS_LIB}")
7985
else()
8086
message (WARNING "PETSc location (PETSC_DIR) is not defined in your PATH, AsFem will try to use the default one installed in your system. If your PETSC_DIR path is not correct, please modifiy PETSC_INC and PETSC_LIB in your CMakeList.txt")
8187
find_path(PETSC_INC NAMES petsc.h
@@ -96,10 +102,54 @@ elseif(UNIX)
96102
message(" PETSc include dir is: ${PETSC_INC}")
97103
include_directories("${PETSC_INC}")
98104
endif()
105+
message(" PETSC include dir is: ${PETSC_DIR}/include")
99106
message(" PETSc library dir is: ${PETSC_LIB}")
100107
link_directories("${PETSC_LIB}")
101108
endif()
102109

110+
#############################################################
111+
### ENV setup for the METIS package ###
112+
### You should install the GKlib and METIS package ###
113+
#############################################################
114+
# ### for GKlib
115+
# if(EXISTS $ENV{GKLIB_DIR})
116+
# set(GKLIB_DIR $ENV{GKLIB_DIR})
117+
# message("GKLib dir is: ${GKLIB_DIR}")
118+
# find_library(GKLIB NAMES GKlib HINTS ${GKLIB_DIR}/lib ${GKLIB_DIR}/lib64)
119+
# if(NOT GKLIB)
120+
# message(FATAL_ERROR "GKLib dir can\'t be found!")
121+
# endif()
122+
# message(" GKLib include dir is: ${GKLIB_DIR}/include")
123+
# message(" GKLib library dir is: ${GKLIB}")
124+
# include_directories("${GKLIB_DIR}/include")
125+
# link_libraries("${GKLIB}")
126+
# else()
127+
# message (WARNING "GKLib location (GKLIB_DIR) is not defined in your PATH, AsFem will try to use the default one installed in your system. If your GKLib path is not correct, please modifiy GKLIB_DIR in your CMakeList.txt")
128+
# set(GKLIB_DIR "/home/by/Programs/toolkits/gcc13/GKlib")
129+
# message(" GKLib include dir is: ${GKLIB_DIR}/include")
130+
# message(" GKLib library dir is: ${GKLIB_DIR}/lib/libGKlib.a")
131+
# include_directories("${GKLIB_DIR}/include")
132+
# link_libraries("${GKLIB_DIR}/lib/libGKlib.a")
133+
# endif ()
134+
# ## for METIS
135+
# if(EXISTS $ENV{METIS_DIR})
136+
# set(METIS_DIR $ENV{METIS_DIR})
137+
# message("METIS dir is: ${METIS_DIR}")
138+
# find_library(METIS_LIB NAMES metis HINTS ${METIS_DIR}/lib ${METIS_DIR}/lib64)
139+
# if(NOT METIS_LIB)
140+
# message(FATAL_ERROR " METIS lib can\'t be found!")
141+
# endif()
142+
# message(" METIS include dir is: ${METIS_DIR}/include")
143+
# message(" METIS library dir is: ${METIS_LIB}")
144+
# include_directories("${METIS_DIR}/include")
145+
# link_libraries("${METIS_LIB}")
146+
# else()
147+
# message (WARNING "METIS location (METIS_DIR) is not defined in your PATH, AsFem will try to use the default one installed in your system. If your METIS_DIR path is not correct, please modifiy METIS_DIR_DIR in your CMakeList.txt")
148+
# set(METIS_DIR "/home/by/Programs/toolkits/gcc13/METIS")
149+
# set(METIS_LIB "/home/by/Programs/toolkits/gcc13/METIS/lib/libmetis.so")
150+
# include_directories("${METIS_DIR}/include")
151+
# link_libraries("${METIS_LIB}")
152+
# endif ()
103153

104154
###############################################
105155
# For external packages ###
@@ -148,7 +198,7 @@ elseif(MSVC)
148198
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GL /openmp")
149199
endif()
150200

151-
message("AsFem will be compiled in ${CMAKE_BUILD_TYPE} mode !")
201+
message("AsFem2 will be compiled in ${CMAKE_BUILD_TYPE} mode !")
152202
message("CXX compiler options are: ${CMAKE_CXX_FLAGS}")
153203
message("The executable file 'asfem' will be generated in ${CMAKE_CURRENT_SOURCE_DIR}/bin folder")
154204
###############################################
@@ -160,10 +210,10 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
160210
include(SourceCode.cmake)
161211

162212
##################################################
163-
add_executable(asfem ${inc} ${src})
213+
add_executable(asfem2 ${inc} ${src})
164214

165-
target_link_libraries(asfem PUBLIC ${MPI_LIB})
166-
target_link_libraries(asfem PUBLIC ${PETSC_LIB})
215+
# target_link_libraries(asfem ${MPI_LIB} ${PETSC_LIB} ${METIS_LIB} ${GKLIB})
216+
target_link_libraries(asfem2 ${MPI_LIB} ${PETSC_LIB})
167217

168218
###############################################
169219
### set LTO for asfem ###

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ Additional documentation and details about AsFem are available on its [homepage]
5757
# Author
5858
[Yang Bai](https://yangbai90.github.io/)
5959

60+
[MMLab members](https://www.x-mol.com/groups/matmechlab/people)
61+
62+
# Funding
63+
This project is supported by:
64+
65+
- Start up fund of the Great Bay University
66+
- General Program of Guangdong Natural Science Foundation, 2025-2027
67+
- Youth Program of the National Natural Science Foundation of China, 2025-2027
68+
6069

6170
# Citation
6271
```

0 commit comments

Comments
 (0)