-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (50 loc) · 1.6 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
include local_config.mk
include settings/parameters.mk
#Compiling parameters
CXX = mpic++
FLAGS = -std=c++11 -O3 $(MFEM_FLAGS) $(PETSC_INC) $(SUNDIALS_INC)
RUN = mpirun -np $(PROCCESORS) ./
SOURCES = $(wildcard code/*.cpp)
DEPENDENCIES = $(SOURCES:code/%.cpp=.objects/%.o)
.PHONY: all main mesh graph clean oclean
all: results/mesh.msh main
main: main.x
@echo -e 'Running program ... \n'
@python3 settings/eutectic.py
@$(RUN)$< --mesh results/mesh.msh \
-R $(R) -Z $(Z) -R_in $(RIn) \
-dt $(DT) -t_f $(T_FI) -v_s $(VIS) \
-ref $(REF) -o $(ORDER) \
-abstol_c $(ABST_C) -reltol_c $(RELT_C) -iter_c $(ITER_C) \
-abstol_s $(ABST_S) -reltol_s $(RELT_S) -eps $(EPSILON) \
-q $(Q) -nl $(Nl) -nh $(Nh) \
-Ti $(Ti) -To $(To) -Tn $(Tn) \
-Si $(Si) -So $(So) -Sn $(Sn)
@echo -e '\nDone!\n'
mesh: results/mesh.msh
@echo 'Mesh created.'
graph:
ifeq ($(SHARE_DIR), NULL)
@echo 'No share directory.'
else
@echo -e 'Moving graphs ... \c'
@rm -rf $(SHARE_DIR)/brinicle
@cp -r results/graph $(SHARE_DIR)/brinicle
@echo -e 'Done!'
endif
main.x: $(DEPENDENCIES)
@echo -e 'Compiling' $@ '... \c'
@$(CXX) $(FLAGS) $^ $(MFEM_LIBS) -o $@
@echo -e 'Done!\n'
.objects/%.o: code/%.cpp
@echo -e 'Building' $@ '... \c'
@$(CXX) $(FLAGS) -c $< $(MFEM_LIBS) -o $@
@echo -e 'Done!\n'
results/mesh.msh: settings/parameters.mk
@echo -e 'Generating mesh ... \c'
@$(GMSH_INSTALL)gmsh $(SCRIPT) -setnumber R $$(( $(R)/$(RIn) )) -setnumber Z $$(( $(Z)/$(RIn) )) -setnumber r 1 -format msh2 -o results/mesh.msh -3 > /dev/null
@echo -e 'Done!\n'
clean:
@rm -rf *.x results/graph/*
oclean:
@rm -rf .objects/*.o