Commit accf0746 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Refactoring test functions for SDF.

parent cf0ef449
Loading
Loading
Loading
Loading

examples/CMakeLists.txt~

deleted100755 → 0
+0 −6
Original line number Diff line number Diff line
add_subdirectory( heat-equation )
add_subdirectory( navier-stokes )
#add_subdirectory( mean-curvature-flow )
#add_subdirectory( hamilton-jacobi )
#add_subdirectory( hamilton-jacobi-parallel )
add_subdirectory( fast-sweeping )
+0 −41
Original line number Diff line number Diff line
TNL_VERSION=0.1
TNL_INSTALL_DIR=${HOME}/local/lib
TNL_INCLUDE_DIR=${HOME}/local/include/tnl-${TNL_VERSION}

TARGET = hamiltonJacobiParallelSolver
#CONFIG_FILE = $(TARGET).cfg.desc
INSTALL_DIR = ${HOME}/local
CXX = g++
CUDA_CXX = nvcc
OMP_FLAGS = -DHAVE_OPENMP -fopenmp
CXX_FLAGS = -std=gnu++0x -I$(TNL_INCLUDE_DIR) -O3 $(OMP_FLAGS) -DDEBUG
LD_FLAGS = -L$(TNL_INSTALL_DIR) -ltnl-0.1 -lgomp

SOURCES = main.cpp
HEADERS = 
OBJECTS = main.o
DIST = $(SOURCES) Makefile

all: $(TARGET)
clean: 
	rm -f $(OBJECTS)
	rm -f $(TARGET)-conf.h	

dist: $(DIST)
	tar zcvf $(TARGET).tgz $(DIST) 

install: $(TARGET)
	cp $(TARGET) $(INSTALL_DIR)/bin
	cp $(CONFIG_FILE) $(INSTALL_DIR)/share

uninstall: $(TARGET)
	rm -f $(INSTALL_DIR)/bin/$(TARGET) 
	rm -f $(CONFIG_FILE) $(INSTALL_DIR)/share

$(TARGET): $(OBJECTS)
	$(CUDA_CXX) -o $(TARGET) $(OBJECTS) $(LD_FLAGS)

%.o: %.cpp $(HEADERS)
	$(CXX) -c -o $@ $(CXX_FLAGS) $<

+0 −64
Original line number Diff line number Diff line
#!/bin/bash

#GRID_SIZES="0897"
#GRID_SIZES="0449"
GRID_SIZES="1793"

dimensions=2

size=2

time=3

for grid_size in $GRID_SIZES;

do

	rm -r grid-${grid_size}
   	mkdir grid-${grid_size}
   	cd grid-${grid_size}

	tnl-grid-setup --dimensions $dimensions \
	               --origin-x -1.0 \
	               --origin-y -1.0 \
	               --origin-z -1.0 \
	               --proportions-x $size \
	               --proportions-y $size \
	               --proportions-z $size \
	               --size-x ${grid_size} \
	               --size-y ${grid_size} \
	               --size-z ${grid_size}

	tnl-init --test-function sdf-para \
		     --offset 0.25 \
	             --output-file init.tnl \
		     --final-time 0.0 \
		     --snapshot-period 0.1 \


	tnl-init --test-function sdf-para-sdf \
		     --offset 0.25 \
	             --output-file sdf.tnl \
		     --final-time 0.0 \
		     --snapshot-period 0.1

	hamilton-jacobi-parallel --initial-condition init.tnl \
	              --cfl-condition 1.0e-1 \
		      	  --mesh mesh.tnl \
		     	  --initial-tau 1.0e-3 \
		      	  --epsilon 1.0 \
	        	  --delta 0.0 \
	       	      --stop-time $time \
		          --scheme godunov \
		          --subgrid-size 8

        tnl-diff --mesh mesh.tnl --mode sequence --input-files sdf.tnl u-00001.tnl --write-difference yes --output-file ../${grid_size}.diff
	
	cd ..

done


./tnl-err2eoc-2.py --format txt --size $size *.diff

              
+0 −41
Original line number Diff line number Diff line
TNL_VERSION=0.1
TNL_INSTALL_DIR=${HOME}/local/lib
TNL_INCLUDE_DIR=${HOME}/local/include/tnl-${TNL_VERSION}

TARGET = hamiltonJacobiParallelSolver
#CONFIG_FILE = $(TARGET).cfg.desc
INSTALL_DIR = ${HOME}/local
CXX = g++
CUDA_CXX = nvcc
OMP_FLAGS = -DHAVE_OPENMP -fopenmp
CXX_FLAGS = -std=gnu++0x -I$(TNL_INCLUDE_DIR) -O3 $(OMP_FLAGS) -DDEBUG
LD_FLAGS = -L$(TNL_INSTALL_DIR) -ltnl-0.1 -lgomp

SOURCES = main.cpp
HEADERS = 
OBJECTS = main.o
DIST = $(SOURCES) Makefile

all: $(TARGET)
clean: 
	rm -f $(OBJECTS)
	rm -f $(TARGET)-conf.h	

dist: $(DIST)
	tar zcvf $(TARGET).tgz $(DIST) 

install: $(TARGET)
	cp $(TARGET) $(INSTALL_DIR)/bin
	cp $(CONFIG_FILE) $(INSTALL_DIR)/share

uninstall: $(TARGET)
	rm -f $(INSTALL_DIR)/bin/$(TARGET) 
	rm -f $(CONFIG_FILE) $(INSTALL_DIR)/share

$(TARGET): $(OBJECTS)
	$(CUDA_CXX) -o $(TARGET) $(OBJECTS) $(LD_FLAGS)

%.o: %.cpp $(HEADERS)
	$(CXX) -c -o $@ $(CXX_FLAGS) $<

+0 −64
Original line number Diff line number Diff line
#!/bin/bash

#GRID_SIZES="0897"
#GRID_SIZES="0449"
GRID_SIZES="1793"

dimensions=2

size=2

time=3

for grid_size in $GRID_SIZES;

do

	rm -r grid-${grid_size}
   	mkdir grid-${grid_size}
   	cd grid-${grid_size}

	tnl-grid-setup --dimensions $dimensions \
	               --origin-x -1.0 \
	               --origin-y -1.0 \
	               --origin-z -1.0 \
	               --proportions-x $size \
	               --proportions-y $size \
	               --proportions-z $size \
	               --size-x ${grid_size} \
	               --size-y ${grid_size} \
	               --size-z ${grid_size}

	tnl-init --test-function sdf-para \
		     --offset 0.25 \
	             --output-file init.tnl \
		     --final-time 0.0 \
		     --snapshot-period 0.1 \


	tnl-init --test-function sdf-para-sdf \
		     --offset 0.25 \
	             --output-file sdf.tnl \
		     --final-time 0.0 \
		     --snapshot-period 0.1

	hamilton-jacobi-parallel --initial-condition init.tnl \
	              --cfl-condition 1.0e-1 \
		      	  --mesh mesh.tnl \
		     	  --initial-tau 1.0e-3 \
		      	  --epsilon 1.0 \
	        	  --delta 0.0 \
	       	      --stop-time $time \
		          --scheme godunov \
		          --subgrid-size 8

        tnl-diff --mesh mesh.tnl --mode sequence --input-files sdf.tnl u-00001.tnl --write-difference yes --output-file ../${grid_size}.diff
	
	cd ..

done


./tnl-err2eoc-2.py --format txt --size $size *.diff

              
Loading