1d_fd_simple_shear

continuum model for granular flows with pore-pressure dynamics
git clone git://src.adamsgaard.dk/1d_fd_simple_shear
Log | Files | Refs | README | LICENSE

commit eed6e94cd9af2c67920a537b5b2dd9fa41cf5378
parent 657806c88cfce423b62f3386881c2ce52407f615
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Tue, 10 Dec 2019 20:18:45 +0100

Prepare structure for sister program with analytical solution

Diffstat:
Rmain.c -> 1d_fd_simple_shear.c | 0
MMakefile | 45++++++++++++++++++++++++++-------------------
Rmain.c -> max_depth_simple_shear.c | 0
3 files changed, 26 insertions(+), 19 deletions(-)

diff --git a/main.c b/1d_fd_simple_shear.c diff --git a/Makefile b/Makefile @@ -1,38 +1,45 @@ CFLAGS = -std=c99 -pedantic -Wall -O3 LDFLAGS = -lm -SRC = arrays.c fluid.c main.c simulation.c -OBJ = $(SRC:.c=.o) HDR = arrays.h fluid.h parameter_defaults.h simulation.h -BIN = ./1d_fd_simple_shear +BIN = 1d_fd_simple_shear max_depth_simple_shear PREFIX ?= /usr/local INSTALL ?= install STRIP ?= strip -default: $(BIN) +default: ${BIN} -$(BIN): $(OBJ) $(HDR) - $(CC) $(LDFLAGS) $(OBJ) -o $@ +.o: + ${CC} ${LDFLAGS} -o $@ ${LIBS} -install: $(BIN) - $(STRIP) $(BIN) - $(INSTALL) -m 0755 -d $(DESTDIR)$(PREFIX)/bin - $(INSTALL) -m 0755 $(BIN) $(DESTDIR)$(PREFIX)/bin +.c.o: + ${CC} ${CFLAGS} -c $< + +1d_fd_simple_shear: 1d_fd_simple_shear.o arrays.o fluid.o simulation.o ${HDR} + ${CC} ${LDFLAGS} 1d_fd_simple_shear.o arrays.o fluid.o simulation.o -o $@ + +max_depth_simple_shear: max_depth_simple_shear.o arrays.o fluid.o simulation.o ${HDR} + ${CC} ${LDFLAGS} max_depth_simple_shear.o arrays.o fluid.o simulation.o -o $@ + +install: ${BIN} + ${STRIP} ${BIN} + ${INSTALL} -m 0755 -d ${DESTDIR}${PREFIX}/bin + ${INSTALL} -m 0755 ${BIN} ${DESTDIR}${PREFIX}/bin uninstall: - rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN) + rm -f ${DESTDIR}${PREFIX}/bin/${BIN} watch: - echo $(SRC) $(HDR) | tr ' ' '\n' | entr -s 'make && ./1d_fd_simple_shear' + echo ${SRC} ${HDR} | tr ' ' '\n' | entr -s 'make && ./1d_fd_simple_shear' -test: $(BIN) +test: ${BIN} make -C test/ -memtest: $(BIN) - valgrind --error-exitcode=1 --leak-check=full $(BIN) -h - valgrind --error-exitcode=1 --leak-check=full $(BIN) - valgrind --error-exitcode=1 --leak-check=full $(BIN) -F - valgrind --error-exitcode=1 --leak-check=full $(BIN) -F \ +memtest: 1d_fd_simple_shear + valgrind --error-exitcode=1 --leak-check=full 1d_fd_simple_shear -h + valgrind --error-exitcode=1 --leak-check=full 1d_fd_simple_shear + valgrind --error-exitcode=1 --leak-check=full 1d_fd_simple_shear -F + valgrind --error-exitcode=1 --leak-check=full 1d_fd_simple_shear -F \ --fluid-pressure-top 50e3 \ --fluid-pressure-ampl 50e3 \ --fluid-pressure-freq $(echo "1/3600" | bc -l) \ @@ -41,6 +48,6 @@ memtest: $(BIN) clean: rm -f *.txt rm -f *.o - rm -f 1d_fd_simple_shear + rm -f ${BIN} .PHONY: default install uninstall watch test memtest clean diff --git a/main.c b/max_depth_simple_shear.c