From: Wolfgang Bangerth Date: Mon, 27 Apr 1998 09:30:49 +0000 (+0000) Subject: Small changes. Use Makefile template for each directory. X-Git-Tag: v8.0.0~23056 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db7bb9652821d44eaea3b4f76b586eae855b3ddc;p=dealii.git Small changes. Use Makefile template for each directory. git-svn-id: https://svn.dealii.org/trunk@198 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/Attic/examples/Makefile b/deal.II/deal.II/Attic/examples/Makefile index fb4b0f3c29..f170a75f13 100644 --- a/deal.II/deal.II/Attic/examples/Makefile +++ b/deal.II/deal.II/Attic/examples/Makefile @@ -1,103 +1,29 @@ # $Id$ -CXX=c++ -INCLUDE = -I../include -I../../lac/include -I../../base/include -CXXFLAGS.g= -DDEBUG -g -Wall -W -pedantic -Wconversion \ - -Winline -Woverloaded-virtual -fno-rtti -fno-exceptions -CXXFLAGS =-O3 -Wuninitialized -finline-functions -ffast-math \ - -funroll-loops -felide-constructors -fnonnull-objects \ - -fno-rtti -fno-exceptions +# list the directories we want to visit +subdirs = grid/ dof/ poisson/ convergence/ error-estimation/ -LIBPATH = -L../lib -L../../lac/lib -LIBFILES.g= ../lib/libbasic.g.a ../lib/libgrid.g.a \ - ../lib/libfe.g.a ../lib/libnumerics.g.a \ - ../../lac/lib/liblac.g.a -LIBFILES = $(LIBFILES.g:.g.a=.a) -LIBS.g = $(LIBPATH) -lgrid.g -lfe.g -lnumerics.g -llac.g -lbasic.g -LIBS = $(LIBS.g:.g=) +# define lists of targets: for each directory we produce a target name +# for compilation, running and cleaning by appending the action to +# the directory name (replacing the slash by ".action") +compile = $(subdirs:/=.compile) +run = $(subdirs:/=.run) +clean = $(subdirs:/=.clean) +# define global targets which are to be excuted in every subdirectory +compile: $(compile) +run : $(run) +# for cleaning up: do this also for the present directory +clean : $(clean) + rm -f *~ -ifeq ($(shell uname),Linux) -CXX = /home/wolf/bin/gcc-2.8.1/bin/c++ -endif -ifeq ($(shell uname),SunOS) -CXX = /usr/local/gcc/gcc-2.8.1/bin/c++ -endif +# define the action of the targets for the specific subdirectories +$(compile) : + cd $(@:.compile=) ; make -cc-files = grid/grid_test.cc dof/dof_test.cc poisson/poisson.cc \ - convergence/convergence.cc error-estimation/error-estimation -o-files = $(cc-files:.cc=.o) -h-files = $(wildcard ../include/*.h) +$(run) : + cd $(@:.run=) ; make run -examples: $(cc-files:.cc=) - -%.o : %.cc - @echo ================= Compiling $< - @$(CXX) $(CXXFLAGS.g) $(INCLUDE) -o $@ -g -c $< - -grid/grid_test: grid/grid_test.o $(LIBFILES) - @echo ================= Linking $@ - @$(CXX) $(CXXFLAGS) -o $@ $< $(LIBS.g) - -dof/dof_test: dof/dof_test.o $(LIBFILES.g) - @echo ================= Linking $@ - @$(CXX) $(CXXFLAGS.g) -o $@ $< $(LIBS.g) -lg++ - -poisson/poisson: - @cd poisson ; make - -convergence/convergence: convergence/convergence.o $(LIBFILES.g) - @echo ================= Linking $@ - @$(CXX) $(CXXFLAGS.g) -o $@ $< $(LIBS) ../../mia/control.o - -error-estimation/error-estimation: error-estimation/error-estimation.o $(LIBFILES.g) - @echo ================= Linking $@ - @$(CXX) $(CXXFLAGS.g) -o $@ $< $(LIBS) ../../mia/control.o - - -run: run_grid_test run_dof_test run_poisson_test run_convergence_test run_error_test - -run_grid_test: - cd grid ; grid_test 4 ; mv grid.1 grid.4 - cd grid ; grid_test 3 ; mv grid.1 grid.3 - cd grid ; grid_test 2 ; mv grid.1 grid.2 - cd grid ; grid_test 1 - cd grid ; gnuplot make_ps - -run_dof_test: - cd dof ; dof_test dof_test.prm - cd dof ; gnuplot make_ps - -run_poisson_test: - cd poisson ; make run - -run_convergence_test: - cd convergence ; convergence - cd convergence ; gnuplot make_ps - -run_error_test: - cd error-estimation ; error-estimation - cd error-estimation ; gnuplot make_ps - -clean: - cd grid ; rm -f grid.[1234] *.eps *.o *~ grid_test - cd dof ; rm -f grid.* sparsity.* *.o *~ dof_test - cd poisson ; make clean - cd convergence ; rm -f *.o convergence *~ *.eps gnuplot.* - cd error-estimation ; rm -f *.o error-estimation *~ *.eps gnuplot.* - - -.PHONY: run run_grid_test run_dof_test run_poisson_test run_convergence_test run_error_test clean - - -#Rule to generate the dependency file. This file is -#automagically remade whenever needed, i.e. whenever -#one of the cc-/h-files changed. Make detects whether -#to remake this file upon inclusion at the bottom -#of this file. -Makefile.dep: $(cc-files) $(h-files) - @echo ================= Making $@ - @$(CXX) $(INCLUDE) -M $(cc-files) > Makefile.dep - -include Makefile.dep +$(clean) : + cd $(@:.clean=) ; make clean diff --git a/deal.II/deal.II/Attic/examples/convergence/Makefile b/deal.II/deal.II/Attic/examples/convergence/Makefile index e69de29bb2..e61c79cd79 100644 --- a/deal.II/deal.II/Attic/examples/convergence/Makefile +++ b/deal.II/deal.II/Attic/examples/convergence/Makefile @@ -0,0 +1,136 @@ +# $Id$ +# Author: Wolfgang Bangerth, 1998 + +# Template for makefiles for the examples subdirectory. In principle, +# everything should be done automatically if you set the target file +# here correctly: +target = convergence + +# All dependencies between files should be updated by the included +# file Makefile.dep if necessary. Object files are compiled into +# the archives ./Obj.a and ./Obj.g.a. By default, the debug version +# is used to link. It you don't like that, change the following +# variable to "off" +debug-mode = on + +# If you want your program to be linked with extra object or library +# files, specify them here: +user-libs = ../../../mia/control.o + +# To run the program, use "make run"; to give parameters to the program, +# give the parameters to the following variable: +run-parameters = + +# To execute additional action apart from running the program, fill +# in this list: +additional-run-action = gnuplot make_ps + +# To specify which files are to be deleted by "make clean" (apart from +# the usual ones: object files, executables, backups, etc), fill in the +# following list +delete-files = gnuplot* *.eps + + + + +############################################################################### +# Internals + +CXX = c++ +INCLUDE = -I../../include -I../../../lac/include \ + -I../../../base/include -I../../../mia/include +CXXFLAGS.g= -DDEBUG -g -Wall -W -pedantic -Wconversion \ + -Winline -Woverloaded-virtual -fno-rtti -fno-exceptions \ + $(INCLUDE) +CXXFLAGS =-O3 -Wuninitialized -finline-functions -ffast-math \ + -funroll-loops -felide-constructors -fnonnull-objects \ + -fno-rtti -fno-exceptions $(INCLUDE) + + +# if on specific systems, change compiler path +ifeq ($(shell uname),Linux) +CXX = /home/wolf/bin/gcc-2.8.1/bin/c++ +endif + +ifeq ($(shell uname),SunOS) +CXX = /usr/local/gcc/gcc-2.8.1/bin/c++ +endif + + +# get lists of files we need +cc-files = $(wildcard *.cc) +o-files = $(cc-files:.cc=.o) +go-files = $(cc-files:.cc=.go) +h-files = $(wildcard *.h) +lib-h-files = $(wildcard ../../include/*/*.h) + +# list of libraries needed to link with +libs = ./Obj.a $(wildcard ../../lib/lib*.a) ../../../lac/lib/liblac.a +libs.g = ./Obj.g.a $(wildcard ../../lib/lib*.g.a) ../../../lac/lib/liblac.g.a + + +# check whether we use debug mode or not +ifeq ($(debug-mode),on) +libraries = $(libs.g) +flags = $(CXXFLAGS.g) +endif + +ifeq ($(debug-mode),off) +libraries = $(libs) +flags = $(CXXFLAGS) +endif + + + +# make rule for the target +$(target) : $(libraries) + @echo ============================ Linking $@ + @$(CXX) $(flags) -o $@ $(libraries) -lg++ $(user-libs) + +# rule how to run the program +run: $(target) + $(target) $(run-parameters) + $(additional-run-action) + + +# rule to make object files +%.go : %.cc + @echo ============================ Compiling with debugging information: $< + @echo $(CXX) ... -c $< -o $@ + @$(CXX) $(CXXFLAGS.g) -c $< -o $@ +%.o : %.cc + @echo ============================ Compiling with optimization: $< + @echo $(CXX) ... -c $< -o $@ + @$(CXX) $(CXXFLAGS) -c $< -o $@ + + +# rules which files the libraries depend upon +Obj.a: ./Obj.a($(o-files)) +Obj.g.a: ./Obj.g.a($(go-files)) + + +clean: + rm -f *.o *.go *~ Makefile.dep Obj.a Obj.g.a $(target) $(delete-files) + + + +.PHONY: clean + + +#Rule to generate the dependency file. This file is +#automagically remade whenever needed, i.e. whenever +#one of the cc-/h-files changed. Make detects whether +#to remake this file upon inclusion at the bottom +#of this file. +# +#use perl to generate rules for the .go files as well +#as to make rules not for tria.o and the like, but +#rather for libnumerics.a(tria.o) +Makefile.dep: $(cc-files) $(h-files) $(lib-h-files) + @echo ============================ Remaking Makefile + @perl ../../Make_dep.pl ./Obj $(INCLUDE) $(cc-files) \ + > Makefile.dep + + +include Makefile.dep + diff --git a/deal.II/deal.II/Attic/examples/convergence/convergence.cc b/deal.II/deal.II/Attic/examples/convergence/convergence.cc index ecea08cec3..daeaafbf60 100644 --- a/deal.II/deal.II/Attic/examples/convergence/convergence.cc +++ b/deal.II/deal.II/Attic/examples/convergence/convergence.cc @@ -251,8 +251,8 @@ void PoissonProblem::run (const unsigned int level) { n_dofs.push_back (dof->n_dofs()); cout << " Assembling matrices..." << endl; - UpdateFields update_flags = UpdateFields(update_q_points | update_gradients | - update_jacobians | update_JxW_values); + UpdateFlags update_flags = UpdateFlags(update_q_points | update_gradients | + update_jacobians | update_JxW_values); ProblemBase::DirichletBC dirichlet_bc; dirichlet_bc[0] = boundary_values; diff --git a/deal.II/deal.II/Attic/examples/dof/Makefile b/deal.II/deal.II/Attic/examples/dof/Makefile index e69de29bb2..27d3fa5778 100644 --- a/deal.II/deal.II/Attic/examples/dof/Makefile +++ b/deal.II/deal.II/Attic/examples/dof/Makefile @@ -0,0 +1,136 @@ +# $Id$ +# Author: Wolfgang Bangerth, 1998 + +# Template for makefiles for the examples subdirectory. In principle, +# everything should be done automatically if you set the target file +# here correctly: +target = dof_test + +# All dependencies between files should be updated by the included +# file Makefile.dep if necessary. Object files are compiled into +# the archives ./Obj.a and ./Obj.g.a. By default, the debug version +# is used to link. It you don't like that, change the following +# variable to "off" +debug-mode = on + +# If you want your program to be linked with extra object or library +# files, specify them here: +user-libs = + +# To run the program, use "make run"; to give parameters to the program, +# give the parameters to the following variable: +run-parameters = $(target).prm + +# To execute additional action apart from running the program, fill +# in this list: +additional-run-action = gnuplot make_ps + +# To specify which files are to be deleted by "make clean" (apart from +# the usual ones: object files, executables, backups, etc), fill in the +# following list +delete-files = grid* sparsity* *.eps + + + + +############################################################################### +# Internals + +CXX = c++ +INCLUDE = -I../../include -I../../../lac/include \ + -I../../../base/include -I../../../mia/include +CXXFLAGS.g= -DDEBUG -g -Wall -W -pedantic -Wconversion \ + -Winline -Woverloaded-virtual -fno-rtti -fno-exceptions \ + $(INCLUDE) +CXXFLAGS =-O3 -Wuninitialized -finline-functions -ffast-math \ + -funroll-loops -felide-constructors -fnonnull-objects \ + -fno-rtti -fno-exceptions $(INCLUDE) + + +# if on specific systems, change compiler path +ifeq ($(shell uname),Linux) +CXX = /home/wolf/bin/gcc-2.8.1/bin/c++ +endif + +ifeq ($(shell uname),SunOS) +CXX = /usr/local/gcc/gcc-2.8.1/bin/c++ +endif + + +# get lists of files we need +cc-files = $(wildcard *.cc) +o-files = $(cc-files:.cc=.o) +go-files = $(cc-files:.cc=.go) +h-files = $(wildcard *.h) +lib-h-files = $(wildcard ../../include/*/*.h) + +# list of libraries needed to link with +libs = ./Obj.a $(wildcard ../../lib/lib*.a) ../../../lac/lib/liblac.a +libs.g = ./Obj.g.a $(wildcard ../../lib/lib*.g.a) ../../../lac/lib/liblac.g.a + + +# check whether we use debug mode or not +ifeq ($(debug-mode),on) +libraries = $(libs.g) +flags = $(CXXFLAGS.g) +endif + +ifeq ($(debug-mode),off) +libraries = $(libs) +flags = $(CXXFLAGS) +endif + + + +# make rule for the target +$(target) : $(libraries) + @echo ============================ Linking $@ + @$(CXX) $(flags) -o $@ $(libraries) -lg++ $(user-libs) + +# rule how to run the program +run: $(target) + $(target) $(run-parameters) + $(additional-run-action) + + +# rule to make object files +%.go : %.cc + @echo ============================ Compiling with debugging information: $< + @echo $(CXX) ... -c $< -o $@ + @$(CXX) $(CXXFLAGS.g) -c $< -o $@ +%.o : %.cc + @echo ============================ Compiling with optimization: $< + @echo $(CXX) ... -c $< -o $@ + @$(CXX) $(CXXFLAGS) -c $< -o $@ + + +# rules which files the libraries depend upon +Obj.a: ./Obj.a($(o-files)) +Obj.g.a: ./Obj.g.a($(go-files)) + + +clean: + rm -f *.o *.go *~ Makefile.dep Obj.a Obj.g.a $(target) $(delete-files) + + + +.PHONY: clean + + +#Rule to generate the dependency file. This file is +#automagically remade whenever needed, i.e. whenever +#one of the cc-/h-files changed. Make detects whether +#to remake this file upon inclusion at the bottom +#of this file. +# +#use perl to generate rules for the .go files as well +#as to make rules not for tria.o and the like, but +#rather for libnumerics.a(tria.o) +Makefile.dep: $(cc-files) $(h-files) $(lib-h-files) + @echo ============================ Remaking Makefile + @perl ../../Make_dep.pl ./Obj $(INCLUDE) $(cc-files) \ + > Makefile.dep + + +include Makefile.dep + diff --git a/deal.II/deal.II/Attic/examples/dof/dof_test.cc b/deal.II/deal.II/Attic/examples/dof/dof_test.cc index c49075b912..254ba9a5ec 100644 --- a/deal.II/deal.II/Attic/examples/dof/dof_test.cc +++ b/deal.II/deal.II/Attic/examples/dof/dof_test.cc @@ -245,7 +245,7 @@ void TestCases::run (ParameterHandler &prm) { cout << " Distributing degrees of freedom..." << endl; - FEQuadratic fe; + FELinear fe; dof->distribute_dofs (fe); cout << " Renumbering degrees of freedom..." << endl; diff --git a/deal.II/deal.II/Attic/examples/error-estimation/Makefile b/deal.II/deal.II/Attic/examples/error-estimation/Makefile index e69de29bb2..a8d321929c 100644 --- a/deal.II/deal.II/Attic/examples/error-estimation/Makefile +++ b/deal.II/deal.II/Attic/examples/error-estimation/Makefile @@ -0,0 +1,136 @@ +# $Id$ +# Author: Wolfgang Bangerth, 1998 + +# Template for makefiles for the examples subdirectory. In principle, +# everything should be done automatically if you set the target file +# here correctly: +target = error-estimation + +# All dependencies between files should be updated by the included +# file Makefile.dep if necessary. Object files are compiled into +# the archives ./Obj.a and ./Obj.g.a. By default, the debug version +# is used to link. It you don't like that, change the following +# variable to "off" +debug-mode = on + +# If you want your program to be linked with extra object or library +# files, specify them here: +user-libs = ../../../mia/control.o + +# To run the program, use "make run"; to give parameters to the program, +# give the parameters to the following variable: +run-parameters = + +# To execute additional action apart from running the program, fill +# in this list: +additional-run-action = + +# To specify which files are to be deleted by "make clean" (apart from +# the usual ones: object files, executables, backups, etc), fill in the +# following list +delete-files = gnuplot* + + + + +############################################################################### +# Internals + +CXX = c++ +INCLUDE = -I../../include -I../../../lac/include \ + -I../../../base/include -I../../../mia/include +CXXFLAGS.g= -DDEBUG -g -Wall -W -pedantic -Wconversion \ + -Winline -Woverloaded-virtual -fno-rtti -fno-exceptions \ + $(INCLUDE) +CXXFLAGS =-O3 -Wuninitialized -finline-functions -ffast-math \ + -funroll-loops -felide-constructors -fnonnull-objects \ + -fno-rtti -fno-exceptions $(INCLUDE) + + +# if on specific systems, change compiler path +ifeq ($(shell uname),Linux) +CXX = /home/wolf/bin/gcc-2.8.1/bin/c++ +endif + +ifeq ($(shell uname),SunOS) +CXX = /usr/local/gcc/gcc-2.8.1/bin/c++ +endif + + +# get lists of files we need +cc-files = $(wildcard *.cc) +o-files = $(cc-files:.cc=.o) +go-files = $(cc-files:.cc=.go) +h-files = $(wildcard *.h) +lib-h-files = $(wildcard ../../include/*/*.h) + +# list of libraries needed to link with +libs = ./Obj.a $(wildcard ../../lib/lib*.a) ../../../lac/lib/liblac.a +libs.g = ./Obj.g.a $(wildcard ../../lib/lib*.g.a) ../../../lac/lib/liblac.g.a + + +# check whether we use debug mode or not +ifeq ($(debug-mode),on) +libraries = $(libs.g) +flags = $(CXXFLAGS.g) +endif + +ifeq ($(debug-mode),off) +libraries = $(libs) +flags = $(CXXFLAGS) +endif + + + +# make rule for the target +$(target) : $(libraries) + @echo ============================ Linking $@ + @$(CXX) $(flags) -o $@ $(libraries) -lg++ $(user-libs) + +# rule how to run the program +run: $(target) + $(target) $(run-parameters) + $(additional-run-action) + + +# rule to make object files +%.go : %.cc + @echo ============================ Compiling with debugging information: $< + @echo $(CXX) ... -c $< -o $@ + @$(CXX) $(CXXFLAGS.g) -c $< -o $@ +%.o : %.cc + @echo ============================ Compiling with optimization: $< + @echo $(CXX) ... -c $< -o $@ + @$(CXX) $(CXXFLAGS) -c $< -o $@ + + +# rules which files the libraries depend upon +Obj.a: ./Obj.a($(o-files)) +Obj.g.a: ./Obj.g.a($(go-files)) + + +clean: + rm -f *.o *.go *~ Makefile.dep Obj.a Obj.g.a $(target) $(delete-files) + + + +.PHONY: clean + + +#Rule to generate the dependency file. This file is +#automagically remade whenever needed, i.e. whenever +#one of the cc-/h-files changed. Make detects whether +#to remake this file upon inclusion at the bottom +#of this file. +# +#use perl to generate rules for the .go files as well +#as to make rules not for tria.o and the like, but +#rather for libnumerics.a(tria.o) +Makefile.dep: $(cc-files) $(h-files) $(lib-h-files) + @echo ============================ Remaking Makefile + @perl ../../Make_dep.pl ./Obj $(INCLUDE) $(cc-files) \ + > Makefile.dep + + +include Makefile.dep + diff --git a/deal.II/deal.II/Attic/examples/error-estimation/error-estimation.cc b/deal.II/deal.II/Attic/examples/error-estimation/error-estimation.cc index 5ea362273f..1d43aeb913 100644 --- a/deal.II/deal.II/Attic/examples/error-estimation/error-estimation.cc +++ b/deal.II/deal.II/Attic/examples/error-estimation/error-estimation.cc @@ -252,8 +252,8 @@ void PoissonProblem::run (const unsigned int level) { n_dofs.push_back (dof->n_dofs()); cout << " Assembling matrices..." << endl; - UpdateFields update_flags = UpdateFields(update_q_points | update_gradients | - update_jacobians | update_JxW_values); + UpdateFlags update_flags = UpdateFlags(update_q_points | update_gradients | + update_jacobians | update_JxW_values); ProblemBase::DirichletBC dirichlet_bc; dirichlet_bc[0] = boundary_values; diff --git a/deal.II/deal.II/Attic/examples/grid/Makefile b/deal.II/deal.II/Attic/examples/grid/Makefile index e69de29bb2..7d9c8ede0e 100644 --- a/deal.II/deal.II/Attic/examples/grid/Makefile +++ b/deal.II/deal.II/Attic/examples/grid/Makefile @@ -0,0 +1,136 @@ +# $Id$ +# Author: Wolfgang Bangerth, 1998 + +# Template for makefiles for the examples subdirectory. In principle, +# everything should be done automatically if you set the target file +# here correctly: +target = grid_test + +# All dependencies between files should be updated by the included +# file Makefile.dep if necessary. Object files are compiled into +# the archives ./Obj.a and ./Obj.g.a. By default, the debug version +# is used to link. It you don't like that, change the following +# variable to "off" +debug-mode = on + +# If you want your program to be linked with extra object or library +# files, specify them here: +user-libs = + +# To run the program, use "make run"; to give parameters to the program, +# give the parameters to the following variable: +run-parameters = 1 + +# To execute additional action apart from running the program, fill +# in this list: +additional-run-action = grid_test 2 ; grid_test 3 ; grid_test 4 ; gnuplot make_ps + +# To specify which files are to be deleted by "make clean" (apart from +# the usual ones: object files, executables, backups, etc), fill in the +# following list +delete-files = grid.? *.eps + + + + +############################################################################### +# Internals + +CXX = c++ +INCLUDE = -I../../include -I../../../lac/include \ + -I../../../base/include -I../../../mia/include +CXXFLAGS.g= -DDEBUG -g -Wall -W -pedantic -Wconversion \ + -Winline -Woverloaded-virtual -fno-rtti -fno-exceptions \ + $(INCLUDE) +CXXFLAGS =-O3 -Wuninitialized -finline-functions -ffast-math \ + -funroll-loops -felide-constructors -fnonnull-objects \ + -fno-rtti -fno-exceptions $(INCLUDE) + + +# if on specific systems, change compiler path +ifeq ($(shell uname),Linux) +CXX = /home/wolf/bin/gcc-2.8.1/bin/c++ +endif + +ifeq ($(shell uname),SunOS) +CXX = /usr/local/gcc/gcc-2.8.1/bin/c++ +endif + + +# get lists of files we need +cc-files = $(wildcard *.cc) +o-files = $(cc-files:.cc=.o) +go-files = $(cc-files:.cc=.go) +h-files = $(wildcard *.h) +lib-h-files = $(wildcard ../../include/*/*.h) + +# list of libraries needed to link with +libs = ./Obj.a $(wildcard ../../lib/lib*.a) ../../../lac/lib/liblac.a +libs.g = ./Obj.g.a $(wildcard ../../lib/lib*.g.a) ../../../lac/lib/liblac.g.a + + +# check whether we use debug mode or not +ifeq ($(debug-mode),on) +libraries = $(libs.g) +flags = $(CXXFLAGS.g) +endif + +ifeq ($(debug-mode),off) +libraries = $(libs) +flags = $(CXXFLAGS) +endif + + + +# make rule for the target +$(target) : $(libraries) + @echo ============================ Linking $@ + @$(CXX) $(flags) -o $@ $(libraries) -lg++ $(user-libs) + +# rule how to run the program +run: $(target) + $(target) $(run-parameters) + $(additional-run-action) + + +# rule to make object files +%.go : %.cc + @echo ============================ Compiling with debugging information: $< + @echo $(CXX) ... -c $< -o $@ + @$(CXX) $(CXXFLAGS.g) -c $< -o $@ +%.o : %.cc + @echo ============================ Compiling with optimization: $< + @echo $(CXX) ... -c $< -o $@ + @$(CXX) $(CXXFLAGS) -c $< -o $@ + + +# rules which files the libraries depend upon +Obj.a: ./Obj.a($(o-files)) +Obj.g.a: ./Obj.g.a($(go-files)) + + +clean: + rm -f *.o *.go *~ Makefile.dep Obj.a Obj.g.a $(target) $(delete-files) + + + +.PHONY: clean + + +#Rule to generate the dependency file. This file is +#automagically remade whenever needed, i.e. whenever +#one of the cc-/h-files changed. Make detects whether +#to remake this file upon inclusion at the bottom +#of this file. +# +#use perl to generate rules for the .go files as well +#as to make rules not for tria.o and the like, but +#rather for libnumerics.a(tria.o) +Makefile.dep: $(cc-files) $(h-files) $(lib-h-files) + @echo ============================ Remaking Makefile + @perl ../../Make_dep.pl ./Obj $(INCLUDE) $(cc-files) \ + > Makefile.dep + + +include Makefile.dep + diff --git a/deal.II/deal.II/Attic/examples/grid/grid_test.cc b/deal.II/deal.II/Attic/examples/grid/grid_test.cc index b2ab9eb7c8..a42dd5937d 100644 --- a/deal.II/deal.II/Attic/examples/grid/grid_test.cc +++ b/deal.II/deal.II/Attic/examples/grid/grid_test.cc @@ -3,11 +3,11 @@ #include #include #include +#include +#include #include -#include -extern "C" { -# include -} +#include + // 1: continuous refinement of the unit square always in the middle @@ -182,7 +182,10 @@ void test (const int test_case, const Point &) { // output the grid - ofstream out("grid.1"); + string filename("grid."); + filename += ('0'+test_case); + + ofstream out(filename.c_str()); tria.print_gnuplot (out); cout << " Total number of cells = " << tria.n_cells() << endl diff --git a/deal.II/deal.II/Attic/examples/poisson/Makefile b/deal.II/deal.II/Attic/examples/poisson/Makefile index 44ea89487b..c76bce9865 100644 --- a/deal.II/deal.II/Attic/examples/poisson/Makefile +++ b/deal.II/deal.II/Attic/examples/poisson/Makefile @@ -1,4 +1,40 @@ # $Id$ +# Author: Wolfgang Bangerth, 1998 + +# Template for makefiles for the examples subdirectory. In principle, +# everything should be done automatically if you set the target file +# here correctly: +target = poisson + +# All dependencies between files should be updated by the included +# file Makefile.dep if necessary. Object files are compiled into +# the archives ./Obj.a and ./Obj.g.a. By default, the debug version +# is used to link. It you don't like that, change the following +# variable to "off" +debug-mode = on + +# If you want your program to be linked with extra object or library +# files, specify them here: +user-libs = ../../../mia/control.o + +# To run the program, use "make run"; to give parameters to the program, +# give the parameters to the following variable: +run-parameters = $(target).prm + +# To execute additional action apart from running the program, fill +# in this list: +additional-run-action = gnuplot make_ps + +# To specify which files are to be deleted by "make clean" (apart from +# the usual ones: object files, executables, backups, etc), fill in the +# following list +delete-files = gnuplot* *.eps + + + + +############################################################################### +# Internals CXX = c++ INCLUDE = -I../../include -I../../../lac/include \ @@ -10,6 +46,8 @@ CXXFLAGS =-O3 -Wuninitialized -finline-functions -ffast-math \ -funroll-loops -felide-constructors -fnonnull-objects \ -fno-rtti -fno-exceptions $(INCLUDE) + +# if on specific systems, change compiler path ifeq ($(shell uname),Linux) CXX = /home/wolf/bin/gcc-2.8.1/bin/c++ endif @@ -18,46 +56,81 @@ ifeq ($(shell uname),SunOS) CXX = /usr/local/gcc/gcc-2.8.1/bin/c++ endif -LIBPATH = -L../../lib -L../../../lac/lib -LIBFILES.g= ../../lib/libbasic.g.a ../../lib/libgrid.g.a \ - ../../lib/libfe.g.a ../../lib/libnumerics.g.a \ - ../../../lac/lib/liblac.g.a -LIBFILES = $(LIBFILES.g:.g.a=.a) -LIBS.g = $(LIBPATH) -lbasic.g -lgrid.g -lfe.g -lnumerics.g -llac.g -LIBS = $(LIBS.g:.g=) +# get lists of files we need +cc-files = $(wildcard *.cc) +o-files = $(cc-files:.cc=.o) +go-files = $(cc-files:.cc=.go) +h-files = $(wildcard *.h) +lib-h-files = $(wildcard ../../include/*/*.h) -cc-files = $(wildcard *.cc) -o-files = $(cc-files:.cc=.o) -go-files = $(cc-files:.cc=.go) -h-files = $(wildcard ../include/*/*.h) +# list of libraries needed to link with +libs = ./Obj.a $(wildcard ../../lib/lib*.a) ../../../lac/lib/liblac.a +libs.g = ./Obj.g.a $(wildcard ../../lib/lib*.g.a) ../../../lac/lib/liblac.g.a +# check whether we use debug mode or not +ifeq ($(debug-mode),on) +libraries = $(libs.g) +flags = $(CXXFLAGS.g) +endif + +ifeq ($(debug-mode),off) +libraries = $(libs) +flags = $(CXXFLAGS) +endif + + + +# make rule for the target +$(target) : $(libraries) + @echo ============================ Linking $@ + @$(CXX) $(flags) -o $@ $(libraries) -lg++ $(user-libs) + +# rule how to run the program +run: $(target) + $(target) $(run-parameters) + $(additional-run-action) -%.go : %.cc poisson.h +# rule to make object files +%.go : %.cc @echo ============================ Compiling with debugging information: $< @echo $(CXX) ... -c $< -o $@ @$(CXX) $(CXXFLAGS.g) -c $< -o $@ -%.o : %.cc poisson.h +%.o : %.cc @echo ============================ Compiling with optimization: $< @echo $(CXX) ... -c $< -o $@ @$(CXX) $(CXXFLAGS) -c $< -o $@ -poisson: $(go-files) $(LIBFILES.g) - @echo ============================ Linking poisson - @$(CXX) -g $(CXXFLAGS.g) $(go-files) -o $@ ../../../mia/control.o $(LIBS.g) -lg++ +# rules which files the libraries depend upon +Obj.a: ./Obj.a($(o-files)) +Obj.g.a: ./Obj.g.a($(go-files)) -run: poisson - poisson poisson.prm - gnuplot make_ps +clean: + rm -f *.o *.go *~ Makefile.dep Obj.a Obj.g.a $(target) $(delete-files) -clean: - rm -f *.o *.go *~ poisson gnuplot.* *.eps + +.PHONY: clean + + +#Rule to generate the dependency file. This file is +#automagically remade whenever needed, i.e. whenever +#one of the cc-/h-files changed. Make detects whether +#to remake this file upon inclusion at the bottom +#of this file. +# +#use perl to generate rules for the .go files as well +#as to make rules not for tria.o and the like, but +#rather for libnumerics.a(tria.o) +Makefile.dep: $(cc-files) $(h-files) $(lib-h-files) + @echo ============================ Remaking Makefile + @perl ../../Make_dep.pl ./Obj $(INCLUDE) $(cc-files) \ + > Makefile.dep +include Makefile.dep -.PHONY: run clean diff --git a/deal.II/deal.II/Attic/examples/poisson/poisson.h b/deal.II/deal.II/Attic/examples/poisson/poisson.h index 74224e3837..5c5b53a00c 100644 --- a/deal.II/deal.II/Attic/examples/poisson/poisson.h +++ b/deal.II/deal.II/Attic/examples/poisson/poisson.h @@ -86,6 +86,8 @@ class PoissonProblem : public ProblemBase, Function *rhs; Function *boundary_values; + + Boundary *boundary; }; diff --git a/deal.II/deal.II/Attic/examples/poisson/problem.cc b/deal.II/deal.II/Attic/examples/poisson/problem.cc index 553a0c36cd..ed039acba3 100644 --- a/deal.II/deal.II/Attic/examples/poisson/problem.cc +++ b/deal.II/deal.II/Attic/examples/poisson/problem.cc @@ -152,7 +152,7 @@ double RHSPoly::operator () (const Point &p) const { template PoissonProblem::PoissonProblem () : - tria(0), dof(0), rhs(0), boundary_values(0) {}; + tria(0), dof(0), rhs(0), boundary_values(0), boundary(0) {}; @@ -181,6 +181,12 @@ void PoissonProblem::clear () { boundary_values = 0; }; + if (boundary != 0) + { + delete boundary; + boundary = 0; + }; + ProblemBase::clear (); }; @@ -245,6 +251,8 @@ bool PoissonProblem::make_grid (ParameterHandler &prm) { switch (test_case) { case 1: + boundary = new StraightBoundary(); + tria->set_boundary (boundary); make_zoom_in_grid (); break; case 2: @@ -252,26 +260,32 @@ bool PoissonProblem::make_grid (ParameterHandler &prm) { // unit radius { static const Point origin; - static const HyperBallBoundary boundary(origin, 1.); + boundary = new HyperBallBoundary(origin, 1.); tria->create_hyper_ball (origin, 1.); - tria->set_boundary (&boundary); + tria->set_boundary (boundary); break; }; case 3: // set the boundary function { - static const CurvedLine boundary; + boundary = new CurvedLine(); tria->create_hypercube (); - tria->set_boundary (&boundary); + tria->set_boundary (boundary); break; }; case 4: + boundary = new StraightBoundary(); + tria->set_boundary (boundary); make_random_grid (); break; case 5: + boundary = new StraightBoundary(); + tria->set_boundary (boundary); tria->create_hypercube (); break; case 6: + boundary = new StraightBoundary(); + tria->set_boundary (boundary); tria->create_hypercube (); tria->refine_global (1); for (unsigned int i=0; i<5; ++i) @@ -282,6 +296,8 @@ bool PoissonProblem::make_grid (ParameterHandler &prm) { }; break; case 7: + boundary = new StraightBoundary(); + tria->set_boundary (boundary); tria->create_hyper_L (); break; default: @@ -432,10 +448,12 @@ void PoissonProblem::run (ParameterHandler &prm) { cout << dof->n_dofs() << " degrees of freedom." << endl; cout << " Assembling matrices..." << endl; - UpdateFields update_flags = UpdateFields(update_gradients | update_JxW_values); ProblemBase::DirichletBC dirichlet_bc; dirichlet_bc[0] = boundary_values; - assemble (equation, quadrature, fe, update_flags, dirichlet_bc); + assemble (equation, quadrature, fe, + UpdateFlags(update_gradients | update_JxW_values | + update_jacobians | update_q_points), + dirichlet_bc, *boundary); cout << " Solving..." << endl; solve (); diff --git a/tests/big-tests/Makefile b/tests/big-tests/Makefile index fb4b0f3c29..f170a75f13 100644 --- a/tests/big-tests/Makefile +++ b/tests/big-tests/Makefile @@ -1,103 +1,29 @@ # $Id$ -CXX=c++ -INCLUDE = -I../include -I../../lac/include -I../../base/include -CXXFLAGS.g= -DDEBUG -g -Wall -W -pedantic -Wconversion \ - -Winline -Woverloaded-virtual -fno-rtti -fno-exceptions -CXXFLAGS =-O3 -Wuninitialized -finline-functions -ffast-math \ - -funroll-loops -felide-constructors -fnonnull-objects \ - -fno-rtti -fno-exceptions +# list the directories we want to visit +subdirs = grid/ dof/ poisson/ convergence/ error-estimation/ -LIBPATH = -L../lib -L../../lac/lib -LIBFILES.g= ../lib/libbasic.g.a ../lib/libgrid.g.a \ - ../lib/libfe.g.a ../lib/libnumerics.g.a \ - ../../lac/lib/liblac.g.a -LIBFILES = $(LIBFILES.g:.g.a=.a) -LIBS.g = $(LIBPATH) -lgrid.g -lfe.g -lnumerics.g -llac.g -lbasic.g -LIBS = $(LIBS.g:.g=) +# define lists of targets: for each directory we produce a target name +# for compilation, running and cleaning by appending the action to +# the directory name (replacing the slash by ".action") +compile = $(subdirs:/=.compile) +run = $(subdirs:/=.run) +clean = $(subdirs:/=.clean) +# define global targets which are to be excuted in every subdirectory +compile: $(compile) +run : $(run) +# for cleaning up: do this also for the present directory +clean : $(clean) + rm -f *~ -ifeq ($(shell uname),Linux) -CXX = /home/wolf/bin/gcc-2.8.1/bin/c++ -endif -ifeq ($(shell uname),SunOS) -CXX = /usr/local/gcc/gcc-2.8.1/bin/c++ -endif +# define the action of the targets for the specific subdirectories +$(compile) : + cd $(@:.compile=) ; make -cc-files = grid/grid_test.cc dof/dof_test.cc poisson/poisson.cc \ - convergence/convergence.cc error-estimation/error-estimation -o-files = $(cc-files:.cc=.o) -h-files = $(wildcard ../include/*.h) +$(run) : + cd $(@:.run=) ; make run -examples: $(cc-files:.cc=) - -%.o : %.cc - @echo ================= Compiling $< - @$(CXX) $(CXXFLAGS.g) $(INCLUDE) -o $@ -g -c $< - -grid/grid_test: grid/grid_test.o $(LIBFILES) - @echo ================= Linking $@ - @$(CXX) $(CXXFLAGS) -o $@ $< $(LIBS.g) - -dof/dof_test: dof/dof_test.o $(LIBFILES.g) - @echo ================= Linking $@ - @$(CXX) $(CXXFLAGS.g) -o $@ $< $(LIBS.g) -lg++ - -poisson/poisson: - @cd poisson ; make - -convergence/convergence: convergence/convergence.o $(LIBFILES.g) - @echo ================= Linking $@ - @$(CXX) $(CXXFLAGS.g) -o $@ $< $(LIBS) ../../mia/control.o - -error-estimation/error-estimation: error-estimation/error-estimation.o $(LIBFILES.g) - @echo ================= Linking $@ - @$(CXX) $(CXXFLAGS.g) -o $@ $< $(LIBS) ../../mia/control.o - - -run: run_grid_test run_dof_test run_poisson_test run_convergence_test run_error_test - -run_grid_test: - cd grid ; grid_test 4 ; mv grid.1 grid.4 - cd grid ; grid_test 3 ; mv grid.1 grid.3 - cd grid ; grid_test 2 ; mv grid.1 grid.2 - cd grid ; grid_test 1 - cd grid ; gnuplot make_ps - -run_dof_test: - cd dof ; dof_test dof_test.prm - cd dof ; gnuplot make_ps - -run_poisson_test: - cd poisson ; make run - -run_convergence_test: - cd convergence ; convergence - cd convergence ; gnuplot make_ps - -run_error_test: - cd error-estimation ; error-estimation - cd error-estimation ; gnuplot make_ps - -clean: - cd grid ; rm -f grid.[1234] *.eps *.o *~ grid_test - cd dof ; rm -f grid.* sparsity.* *.o *~ dof_test - cd poisson ; make clean - cd convergence ; rm -f *.o convergence *~ *.eps gnuplot.* - cd error-estimation ; rm -f *.o error-estimation *~ *.eps gnuplot.* - - -.PHONY: run run_grid_test run_dof_test run_poisson_test run_convergence_test run_error_test clean - - -#Rule to generate the dependency file. This file is -#automagically remade whenever needed, i.e. whenever -#one of the cc-/h-files changed. Make detects whether -#to remake this file upon inclusion at the bottom -#of this file. -Makefile.dep: $(cc-files) $(h-files) - @echo ================= Making $@ - @$(CXX) $(INCLUDE) -M $(cc-files) > Makefile.dep - -include Makefile.dep +$(clean) : + cd $(@:.clean=) ; make clean diff --git a/tests/big-tests/convergence/Makefile b/tests/big-tests/convergence/Makefile index e69de29bb2..e61c79cd79 100644 --- a/tests/big-tests/convergence/Makefile +++ b/tests/big-tests/convergence/Makefile @@ -0,0 +1,136 @@ +# $Id$ +# Author: Wolfgang Bangerth, 1998 + +# Template for makefiles for the examples subdirectory. In principle, +# everything should be done automatically if you set the target file +# here correctly: +target = convergence + +# All dependencies between files should be updated by the included +# file Makefile.dep if necessary. Object files are compiled into +# the archives ./Obj.a and ./Obj.g.a. By default, the debug version +# is used to link. It you don't like that, change the following +# variable to "off" +debug-mode = on + +# If you want your program to be linked with extra object or library +# files, specify them here: +user-libs = ../../../mia/control.o + +# To run the program, use "make run"; to give parameters to the program, +# give the parameters to the following variable: +run-parameters = + +# To execute additional action apart from running the program, fill +# in this list: +additional-run-action = gnuplot make_ps + +# To specify which files are to be deleted by "make clean" (apart from +# the usual ones: object files, executables, backups, etc), fill in the +# following list +delete-files = gnuplot* *.eps + + + + +############################################################################### +# Internals + +CXX = c++ +INCLUDE = -I../../include -I../../../lac/include \ + -I../../../base/include -I../../../mia/include +CXXFLAGS.g= -DDEBUG -g -Wall -W -pedantic -Wconversion \ + -Winline -Woverloaded-virtual -fno-rtti -fno-exceptions \ + $(INCLUDE) +CXXFLAGS =-O3 -Wuninitialized -finline-functions -ffast-math \ + -funroll-loops -felide-constructors -fnonnull-objects \ + -fno-rtti -fno-exceptions $(INCLUDE) + + +# if on specific systems, change compiler path +ifeq ($(shell uname),Linux) +CXX = /home/wolf/bin/gcc-2.8.1/bin/c++ +endif + +ifeq ($(shell uname),SunOS) +CXX = /usr/local/gcc/gcc-2.8.1/bin/c++ +endif + + +# get lists of files we need +cc-files = $(wildcard *.cc) +o-files = $(cc-files:.cc=.o) +go-files = $(cc-files:.cc=.go) +h-files = $(wildcard *.h) +lib-h-files = $(wildcard ../../include/*/*.h) + +# list of libraries needed to link with +libs = ./Obj.a $(wildcard ../../lib/lib*.a) ../../../lac/lib/liblac.a +libs.g = ./Obj.g.a $(wildcard ../../lib/lib*.g.a) ../../../lac/lib/liblac.g.a + + +# check whether we use debug mode or not +ifeq ($(debug-mode),on) +libraries = $(libs.g) +flags = $(CXXFLAGS.g) +endif + +ifeq ($(debug-mode),off) +libraries = $(libs) +flags = $(CXXFLAGS) +endif + + + +# make rule for the target +$(target) : $(libraries) + @echo ============================ Linking $@ + @$(CXX) $(flags) -o $@ $(libraries) -lg++ $(user-libs) + +# rule how to run the program +run: $(target) + $(target) $(run-parameters) + $(additional-run-action) + + +# rule to make object files +%.go : %.cc + @echo ============================ Compiling with debugging information: $< + @echo $(CXX) ... -c $< -o $@ + @$(CXX) $(CXXFLAGS.g) -c $< -o $@ +%.o : %.cc + @echo ============================ Compiling with optimization: $< + @echo $(CXX) ... -c $< -o $@ + @$(CXX) $(CXXFLAGS) -c $< -o $@ + + +# rules which files the libraries depend upon +Obj.a: ./Obj.a($(o-files)) +Obj.g.a: ./Obj.g.a($(go-files)) + + +clean: + rm -f *.o *.go *~ Makefile.dep Obj.a Obj.g.a $(target) $(delete-files) + + + +.PHONY: clean + + +#Rule to generate the dependency file. This file is +#automagically remade whenever needed, i.e. whenever +#one of the cc-/h-files changed. Make detects whether +#to remake this file upon inclusion at the bottom +#of this file. +# +#use perl to generate rules for the .go files as well +#as to make rules not for tria.o and the like, but +#rather for libnumerics.a(tria.o) +Makefile.dep: $(cc-files) $(h-files) $(lib-h-files) + @echo ============================ Remaking Makefile + @perl ../../Make_dep.pl ./Obj $(INCLUDE) $(cc-files) \ + > Makefile.dep + + +include Makefile.dep + diff --git a/tests/big-tests/convergence/convergence.cc b/tests/big-tests/convergence/convergence.cc index ecea08cec3..daeaafbf60 100644 --- a/tests/big-tests/convergence/convergence.cc +++ b/tests/big-tests/convergence/convergence.cc @@ -251,8 +251,8 @@ void PoissonProblem::run (const unsigned int level) { n_dofs.push_back (dof->n_dofs()); cout << " Assembling matrices..." << endl; - UpdateFields update_flags = UpdateFields(update_q_points | update_gradients | - update_jacobians | update_JxW_values); + UpdateFlags update_flags = UpdateFlags(update_q_points | update_gradients | + update_jacobians | update_JxW_values); ProblemBase::DirichletBC dirichlet_bc; dirichlet_bc[0] = boundary_values; diff --git a/tests/big-tests/dof/Makefile b/tests/big-tests/dof/Makefile index e69de29bb2..27d3fa5778 100644 --- a/tests/big-tests/dof/Makefile +++ b/tests/big-tests/dof/Makefile @@ -0,0 +1,136 @@ +# $Id$ +# Author: Wolfgang Bangerth, 1998 + +# Template for makefiles for the examples subdirectory. In principle, +# everything should be done automatically if you set the target file +# here correctly: +target = dof_test + +# All dependencies between files should be updated by the included +# file Makefile.dep if necessary. Object files are compiled into +# the archives ./Obj.a and ./Obj.g.a. By default, the debug version +# is used to link. It you don't like that, change the following +# variable to "off" +debug-mode = on + +# If you want your program to be linked with extra object or library +# files, specify them here: +user-libs = + +# To run the program, use "make run"; to give parameters to the program, +# give the parameters to the following variable: +run-parameters = $(target).prm + +# To execute additional action apart from running the program, fill +# in this list: +additional-run-action = gnuplot make_ps + +# To specify which files are to be deleted by "make clean" (apart from +# the usual ones: object files, executables, backups, etc), fill in the +# following list +delete-files = grid* sparsity* *.eps + + + + +############################################################################### +# Internals + +CXX = c++ +INCLUDE = -I../../include -I../../../lac/include \ + -I../../../base/include -I../../../mia/include +CXXFLAGS.g= -DDEBUG -g -Wall -W -pedantic -Wconversion \ + -Winline -Woverloaded-virtual -fno-rtti -fno-exceptions \ + $(INCLUDE) +CXXFLAGS =-O3 -Wuninitialized -finline-functions -ffast-math \ + -funroll-loops -felide-constructors -fnonnull-objects \ + -fno-rtti -fno-exceptions $(INCLUDE) + + +# if on specific systems, change compiler path +ifeq ($(shell uname),Linux) +CXX = /home/wolf/bin/gcc-2.8.1/bin/c++ +endif + +ifeq ($(shell uname),SunOS) +CXX = /usr/local/gcc/gcc-2.8.1/bin/c++ +endif + + +# get lists of files we need +cc-files = $(wildcard *.cc) +o-files = $(cc-files:.cc=.o) +go-files = $(cc-files:.cc=.go) +h-files = $(wildcard *.h) +lib-h-files = $(wildcard ../../include/*/*.h) + +# list of libraries needed to link with +libs = ./Obj.a $(wildcard ../../lib/lib*.a) ../../../lac/lib/liblac.a +libs.g = ./Obj.g.a $(wildcard ../../lib/lib*.g.a) ../../../lac/lib/liblac.g.a + + +# check whether we use debug mode or not +ifeq ($(debug-mode),on) +libraries = $(libs.g) +flags = $(CXXFLAGS.g) +endif + +ifeq ($(debug-mode),off) +libraries = $(libs) +flags = $(CXXFLAGS) +endif + + + +# make rule for the target +$(target) : $(libraries) + @echo ============================ Linking $@ + @$(CXX) $(flags) -o $@ $(libraries) -lg++ $(user-libs) + +# rule how to run the program +run: $(target) + $(target) $(run-parameters) + $(additional-run-action) + + +# rule to make object files +%.go : %.cc + @echo ============================ Compiling with debugging information: $< + @echo $(CXX) ... -c $< -o $@ + @$(CXX) $(CXXFLAGS.g) -c $< -o $@ +%.o : %.cc + @echo ============================ Compiling with optimization: $< + @echo $(CXX) ... -c $< -o $@ + @$(CXX) $(CXXFLAGS) -c $< -o $@ + + +# rules which files the libraries depend upon +Obj.a: ./Obj.a($(o-files)) +Obj.g.a: ./Obj.g.a($(go-files)) + + +clean: + rm -f *.o *.go *~ Makefile.dep Obj.a Obj.g.a $(target) $(delete-files) + + + +.PHONY: clean + + +#Rule to generate the dependency file. This file is +#automagically remade whenever needed, i.e. whenever +#one of the cc-/h-files changed. Make detects whether +#to remake this file upon inclusion at the bottom +#of this file. +# +#use perl to generate rules for the .go files as well +#as to make rules not for tria.o and the like, but +#rather for libnumerics.a(tria.o) +Makefile.dep: $(cc-files) $(h-files) $(lib-h-files) + @echo ============================ Remaking Makefile + @perl ../../Make_dep.pl ./Obj $(INCLUDE) $(cc-files) \ + > Makefile.dep + + +include Makefile.dep + diff --git a/tests/big-tests/dof/dof_test.cc b/tests/big-tests/dof/dof_test.cc index c49075b912..254ba9a5ec 100644 --- a/tests/big-tests/dof/dof_test.cc +++ b/tests/big-tests/dof/dof_test.cc @@ -245,7 +245,7 @@ void TestCases::run (ParameterHandler &prm) { cout << " Distributing degrees of freedom..." << endl; - FEQuadratic fe; + FELinear fe; dof->distribute_dofs (fe); cout << " Renumbering degrees of freedom..." << endl; diff --git a/tests/big-tests/error-estimation/Makefile b/tests/big-tests/error-estimation/Makefile index e69de29bb2..a8d321929c 100644 --- a/tests/big-tests/error-estimation/Makefile +++ b/tests/big-tests/error-estimation/Makefile @@ -0,0 +1,136 @@ +# $Id$ +# Author: Wolfgang Bangerth, 1998 + +# Template for makefiles for the examples subdirectory. In principle, +# everything should be done automatically if you set the target file +# here correctly: +target = error-estimation + +# All dependencies between files should be updated by the included +# file Makefile.dep if necessary. Object files are compiled into +# the archives ./Obj.a and ./Obj.g.a. By default, the debug version +# is used to link. It you don't like that, change the following +# variable to "off" +debug-mode = on + +# If you want your program to be linked with extra object or library +# files, specify them here: +user-libs = ../../../mia/control.o + +# To run the program, use "make run"; to give parameters to the program, +# give the parameters to the following variable: +run-parameters = + +# To execute additional action apart from running the program, fill +# in this list: +additional-run-action = + +# To specify which files are to be deleted by "make clean" (apart from +# the usual ones: object files, executables, backups, etc), fill in the +# following list +delete-files = gnuplot* + + + + +############################################################################### +# Internals + +CXX = c++ +INCLUDE = -I../../include -I../../../lac/include \ + -I../../../base/include -I../../../mia/include +CXXFLAGS.g= -DDEBUG -g -Wall -W -pedantic -Wconversion \ + -Winline -Woverloaded-virtual -fno-rtti -fno-exceptions \ + $(INCLUDE) +CXXFLAGS =-O3 -Wuninitialized -finline-functions -ffast-math \ + -funroll-loops -felide-constructors -fnonnull-objects \ + -fno-rtti -fno-exceptions $(INCLUDE) + + +# if on specific systems, change compiler path +ifeq ($(shell uname),Linux) +CXX = /home/wolf/bin/gcc-2.8.1/bin/c++ +endif + +ifeq ($(shell uname),SunOS) +CXX = /usr/local/gcc/gcc-2.8.1/bin/c++ +endif + + +# get lists of files we need +cc-files = $(wildcard *.cc) +o-files = $(cc-files:.cc=.o) +go-files = $(cc-files:.cc=.go) +h-files = $(wildcard *.h) +lib-h-files = $(wildcard ../../include/*/*.h) + +# list of libraries needed to link with +libs = ./Obj.a $(wildcard ../../lib/lib*.a) ../../../lac/lib/liblac.a +libs.g = ./Obj.g.a $(wildcard ../../lib/lib*.g.a) ../../../lac/lib/liblac.g.a + + +# check whether we use debug mode or not +ifeq ($(debug-mode),on) +libraries = $(libs.g) +flags = $(CXXFLAGS.g) +endif + +ifeq ($(debug-mode),off) +libraries = $(libs) +flags = $(CXXFLAGS) +endif + + + +# make rule for the target +$(target) : $(libraries) + @echo ============================ Linking $@ + @$(CXX) $(flags) -o $@ $(libraries) -lg++ $(user-libs) + +# rule how to run the program +run: $(target) + $(target) $(run-parameters) + $(additional-run-action) + + +# rule to make object files +%.go : %.cc + @echo ============================ Compiling with debugging information: $< + @echo $(CXX) ... -c $< -o $@ + @$(CXX) $(CXXFLAGS.g) -c $< -o $@ +%.o : %.cc + @echo ============================ Compiling with optimization: $< + @echo $(CXX) ... -c $< -o $@ + @$(CXX) $(CXXFLAGS) -c $< -o $@ + + +# rules which files the libraries depend upon +Obj.a: ./Obj.a($(o-files)) +Obj.g.a: ./Obj.g.a($(go-files)) + + +clean: + rm -f *.o *.go *~ Makefile.dep Obj.a Obj.g.a $(target) $(delete-files) + + + +.PHONY: clean + + +#Rule to generate the dependency file. This file is +#automagically remade whenever needed, i.e. whenever +#one of the cc-/h-files changed. Make detects whether +#to remake this file upon inclusion at the bottom +#of this file. +# +#use perl to generate rules for the .go files as well +#as to make rules not for tria.o and the like, but +#rather for libnumerics.a(tria.o) +Makefile.dep: $(cc-files) $(h-files) $(lib-h-files) + @echo ============================ Remaking Makefile + @perl ../../Make_dep.pl ./Obj $(INCLUDE) $(cc-files) \ + > Makefile.dep + + +include Makefile.dep + diff --git a/tests/big-tests/error-estimation/error-estimation.cc b/tests/big-tests/error-estimation/error-estimation.cc index 5ea362273f..1d43aeb913 100644 --- a/tests/big-tests/error-estimation/error-estimation.cc +++ b/tests/big-tests/error-estimation/error-estimation.cc @@ -252,8 +252,8 @@ void PoissonProblem::run (const unsigned int level) { n_dofs.push_back (dof->n_dofs()); cout << " Assembling matrices..." << endl; - UpdateFields update_flags = UpdateFields(update_q_points | update_gradients | - update_jacobians | update_JxW_values); + UpdateFlags update_flags = UpdateFlags(update_q_points | update_gradients | + update_jacobians | update_JxW_values); ProblemBase::DirichletBC dirichlet_bc; dirichlet_bc[0] = boundary_values; diff --git a/tests/big-tests/grid/Makefile b/tests/big-tests/grid/Makefile index e69de29bb2..7d9c8ede0e 100644 --- a/tests/big-tests/grid/Makefile +++ b/tests/big-tests/grid/Makefile @@ -0,0 +1,136 @@ +# $Id$ +# Author: Wolfgang Bangerth, 1998 + +# Template for makefiles for the examples subdirectory. In principle, +# everything should be done automatically if you set the target file +# here correctly: +target = grid_test + +# All dependencies between files should be updated by the included +# file Makefile.dep if necessary. Object files are compiled into +# the archives ./Obj.a and ./Obj.g.a. By default, the debug version +# is used to link. It you don't like that, change the following +# variable to "off" +debug-mode = on + +# If you want your program to be linked with extra object or library +# files, specify them here: +user-libs = + +# To run the program, use "make run"; to give parameters to the program, +# give the parameters to the following variable: +run-parameters = 1 + +# To execute additional action apart from running the program, fill +# in this list: +additional-run-action = grid_test 2 ; grid_test 3 ; grid_test 4 ; gnuplot make_ps + +# To specify which files are to be deleted by "make clean" (apart from +# the usual ones: object files, executables, backups, etc), fill in the +# following list +delete-files = grid.? *.eps + + + + +############################################################################### +# Internals + +CXX = c++ +INCLUDE = -I../../include -I../../../lac/include \ + -I../../../base/include -I../../../mia/include +CXXFLAGS.g= -DDEBUG -g -Wall -W -pedantic -Wconversion \ + -Winline -Woverloaded-virtual -fno-rtti -fno-exceptions \ + $(INCLUDE) +CXXFLAGS =-O3 -Wuninitialized -finline-functions -ffast-math \ + -funroll-loops -felide-constructors -fnonnull-objects \ + -fno-rtti -fno-exceptions $(INCLUDE) + + +# if on specific systems, change compiler path +ifeq ($(shell uname),Linux) +CXX = /home/wolf/bin/gcc-2.8.1/bin/c++ +endif + +ifeq ($(shell uname),SunOS) +CXX = /usr/local/gcc/gcc-2.8.1/bin/c++ +endif + + +# get lists of files we need +cc-files = $(wildcard *.cc) +o-files = $(cc-files:.cc=.o) +go-files = $(cc-files:.cc=.go) +h-files = $(wildcard *.h) +lib-h-files = $(wildcard ../../include/*/*.h) + +# list of libraries needed to link with +libs = ./Obj.a $(wildcard ../../lib/lib*.a) ../../../lac/lib/liblac.a +libs.g = ./Obj.g.a $(wildcard ../../lib/lib*.g.a) ../../../lac/lib/liblac.g.a + + +# check whether we use debug mode or not +ifeq ($(debug-mode),on) +libraries = $(libs.g) +flags = $(CXXFLAGS.g) +endif + +ifeq ($(debug-mode),off) +libraries = $(libs) +flags = $(CXXFLAGS) +endif + + + +# make rule for the target +$(target) : $(libraries) + @echo ============================ Linking $@ + @$(CXX) $(flags) -o $@ $(libraries) -lg++ $(user-libs) + +# rule how to run the program +run: $(target) + $(target) $(run-parameters) + $(additional-run-action) + + +# rule to make object files +%.go : %.cc + @echo ============================ Compiling with debugging information: $< + @echo $(CXX) ... -c $< -o $@ + @$(CXX) $(CXXFLAGS.g) -c $< -o $@ +%.o : %.cc + @echo ============================ Compiling with optimization: $< + @echo $(CXX) ... -c $< -o $@ + @$(CXX) $(CXXFLAGS) -c $< -o $@ + + +# rules which files the libraries depend upon +Obj.a: ./Obj.a($(o-files)) +Obj.g.a: ./Obj.g.a($(go-files)) + + +clean: + rm -f *.o *.go *~ Makefile.dep Obj.a Obj.g.a $(target) $(delete-files) + + + +.PHONY: clean + + +#Rule to generate the dependency file. This file is +#automagically remade whenever needed, i.e. whenever +#one of the cc-/h-files changed. Make detects whether +#to remake this file upon inclusion at the bottom +#of this file. +# +#use perl to generate rules for the .go files as well +#as to make rules not for tria.o and the like, but +#rather for libnumerics.a(tria.o) +Makefile.dep: $(cc-files) $(h-files) $(lib-h-files) + @echo ============================ Remaking Makefile + @perl ../../Make_dep.pl ./Obj $(INCLUDE) $(cc-files) \ + > Makefile.dep + + +include Makefile.dep + diff --git a/tests/big-tests/grid/grid_test.cc b/tests/big-tests/grid/grid_test.cc index b2ab9eb7c8..a42dd5937d 100644 --- a/tests/big-tests/grid/grid_test.cc +++ b/tests/big-tests/grid/grid_test.cc @@ -3,11 +3,11 @@ #include #include #include +#include +#include #include -#include -extern "C" { -# include -} +#include + // 1: continuous refinement of the unit square always in the middle @@ -182,7 +182,10 @@ void test (const int test_case, const Point &) { // output the grid - ofstream out("grid.1"); + string filename("grid."); + filename += ('0'+test_case); + + ofstream out(filename.c_str()); tria.print_gnuplot (out); cout << " Total number of cells = " << tria.n_cells() << endl diff --git a/tests/big-tests/poisson/Makefile b/tests/big-tests/poisson/Makefile index 44ea89487b..c76bce9865 100644 --- a/tests/big-tests/poisson/Makefile +++ b/tests/big-tests/poisson/Makefile @@ -1,4 +1,40 @@ # $Id$ +# Author: Wolfgang Bangerth, 1998 + +# Template for makefiles for the examples subdirectory. In principle, +# everything should be done automatically if you set the target file +# here correctly: +target = poisson + +# All dependencies between files should be updated by the included +# file Makefile.dep if necessary. Object files are compiled into +# the archives ./Obj.a and ./Obj.g.a. By default, the debug version +# is used to link. It you don't like that, change the following +# variable to "off" +debug-mode = on + +# If you want your program to be linked with extra object or library +# files, specify them here: +user-libs = ../../../mia/control.o + +# To run the program, use "make run"; to give parameters to the program, +# give the parameters to the following variable: +run-parameters = $(target).prm + +# To execute additional action apart from running the program, fill +# in this list: +additional-run-action = gnuplot make_ps + +# To specify which files are to be deleted by "make clean" (apart from +# the usual ones: object files, executables, backups, etc), fill in the +# following list +delete-files = gnuplot* *.eps + + + + +############################################################################### +# Internals CXX = c++ INCLUDE = -I../../include -I../../../lac/include \ @@ -10,6 +46,8 @@ CXXFLAGS =-O3 -Wuninitialized -finline-functions -ffast-math \ -funroll-loops -felide-constructors -fnonnull-objects \ -fno-rtti -fno-exceptions $(INCLUDE) + +# if on specific systems, change compiler path ifeq ($(shell uname),Linux) CXX = /home/wolf/bin/gcc-2.8.1/bin/c++ endif @@ -18,46 +56,81 @@ ifeq ($(shell uname),SunOS) CXX = /usr/local/gcc/gcc-2.8.1/bin/c++ endif -LIBPATH = -L../../lib -L../../../lac/lib -LIBFILES.g= ../../lib/libbasic.g.a ../../lib/libgrid.g.a \ - ../../lib/libfe.g.a ../../lib/libnumerics.g.a \ - ../../../lac/lib/liblac.g.a -LIBFILES = $(LIBFILES.g:.g.a=.a) -LIBS.g = $(LIBPATH) -lbasic.g -lgrid.g -lfe.g -lnumerics.g -llac.g -LIBS = $(LIBS.g:.g=) +# get lists of files we need +cc-files = $(wildcard *.cc) +o-files = $(cc-files:.cc=.o) +go-files = $(cc-files:.cc=.go) +h-files = $(wildcard *.h) +lib-h-files = $(wildcard ../../include/*/*.h) -cc-files = $(wildcard *.cc) -o-files = $(cc-files:.cc=.o) -go-files = $(cc-files:.cc=.go) -h-files = $(wildcard ../include/*/*.h) +# list of libraries needed to link with +libs = ./Obj.a $(wildcard ../../lib/lib*.a) ../../../lac/lib/liblac.a +libs.g = ./Obj.g.a $(wildcard ../../lib/lib*.g.a) ../../../lac/lib/liblac.g.a +# check whether we use debug mode or not +ifeq ($(debug-mode),on) +libraries = $(libs.g) +flags = $(CXXFLAGS.g) +endif + +ifeq ($(debug-mode),off) +libraries = $(libs) +flags = $(CXXFLAGS) +endif + + + +# make rule for the target +$(target) : $(libraries) + @echo ============================ Linking $@ + @$(CXX) $(flags) -o $@ $(libraries) -lg++ $(user-libs) + +# rule how to run the program +run: $(target) + $(target) $(run-parameters) + $(additional-run-action) -%.go : %.cc poisson.h +# rule to make object files +%.go : %.cc @echo ============================ Compiling with debugging information: $< @echo $(CXX) ... -c $< -o $@ @$(CXX) $(CXXFLAGS.g) -c $< -o $@ -%.o : %.cc poisson.h +%.o : %.cc @echo ============================ Compiling with optimization: $< @echo $(CXX) ... -c $< -o $@ @$(CXX) $(CXXFLAGS) -c $< -o $@ -poisson: $(go-files) $(LIBFILES.g) - @echo ============================ Linking poisson - @$(CXX) -g $(CXXFLAGS.g) $(go-files) -o $@ ../../../mia/control.o $(LIBS.g) -lg++ +# rules which files the libraries depend upon +Obj.a: ./Obj.a($(o-files)) +Obj.g.a: ./Obj.g.a($(go-files)) -run: poisson - poisson poisson.prm - gnuplot make_ps +clean: + rm -f *.o *.go *~ Makefile.dep Obj.a Obj.g.a $(target) $(delete-files) -clean: - rm -f *.o *.go *~ poisson gnuplot.* *.eps + +.PHONY: clean + + +#Rule to generate the dependency file. This file is +#automagically remade whenever needed, i.e. whenever +#one of the cc-/h-files changed. Make detects whether +#to remake this file upon inclusion at the bottom +#of this file. +# +#use perl to generate rules for the .go files as well +#as to make rules not for tria.o and the like, but +#rather for libnumerics.a(tria.o) +Makefile.dep: $(cc-files) $(h-files) $(lib-h-files) + @echo ============================ Remaking Makefile + @perl ../../Make_dep.pl ./Obj $(INCLUDE) $(cc-files) \ + > Makefile.dep +include Makefile.dep -.PHONY: run clean diff --git a/tests/big-tests/poisson/poisson.h b/tests/big-tests/poisson/poisson.h index 74224e3837..5c5b53a00c 100644 --- a/tests/big-tests/poisson/poisson.h +++ b/tests/big-tests/poisson/poisson.h @@ -86,6 +86,8 @@ class PoissonProblem : public ProblemBase, Function *rhs; Function *boundary_values; + + Boundary *boundary; }; diff --git a/tests/big-tests/poisson/problem.cc b/tests/big-tests/poisson/problem.cc index 553a0c36cd..ed039acba3 100644 --- a/tests/big-tests/poisson/problem.cc +++ b/tests/big-tests/poisson/problem.cc @@ -152,7 +152,7 @@ double RHSPoly::operator () (const Point &p) const { template PoissonProblem::PoissonProblem () : - tria(0), dof(0), rhs(0), boundary_values(0) {}; + tria(0), dof(0), rhs(0), boundary_values(0), boundary(0) {}; @@ -181,6 +181,12 @@ void PoissonProblem::clear () { boundary_values = 0; }; + if (boundary != 0) + { + delete boundary; + boundary = 0; + }; + ProblemBase::clear (); }; @@ -245,6 +251,8 @@ bool PoissonProblem::make_grid (ParameterHandler &prm) { switch (test_case) { case 1: + boundary = new StraightBoundary(); + tria->set_boundary (boundary); make_zoom_in_grid (); break; case 2: @@ -252,26 +260,32 @@ bool PoissonProblem::make_grid (ParameterHandler &prm) { // unit radius { static const Point origin; - static const HyperBallBoundary boundary(origin, 1.); + boundary = new HyperBallBoundary(origin, 1.); tria->create_hyper_ball (origin, 1.); - tria->set_boundary (&boundary); + tria->set_boundary (boundary); break; }; case 3: // set the boundary function { - static const CurvedLine boundary; + boundary = new CurvedLine(); tria->create_hypercube (); - tria->set_boundary (&boundary); + tria->set_boundary (boundary); break; }; case 4: + boundary = new StraightBoundary(); + tria->set_boundary (boundary); make_random_grid (); break; case 5: + boundary = new StraightBoundary(); + tria->set_boundary (boundary); tria->create_hypercube (); break; case 6: + boundary = new StraightBoundary(); + tria->set_boundary (boundary); tria->create_hypercube (); tria->refine_global (1); for (unsigned int i=0; i<5; ++i) @@ -282,6 +296,8 @@ bool PoissonProblem::make_grid (ParameterHandler &prm) { }; break; case 7: + boundary = new StraightBoundary(); + tria->set_boundary (boundary); tria->create_hyper_L (); break; default: @@ -432,10 +448,12 @@ void PoissonProblem::run (ParameterHandler &prm) { cout << dof->n_dofs() << " degrees of freedom." << endl; cout << " Assembling matrices..." << endl; - UpdateFields update_flags = UpdateFields(update_gradients | update_JxW_values); ProblemBase::DirichletBC dirichlet_bc; dirichlet_bc[0] = boundary_values; - assemble (equation, quadrature, fe, update_flags, dirichlet_bc); + assemble (equation, quadrature, fe, + UpdateFlags(update_gradients | update_JxW_values | + update_jacobians | update_q_points), + dirichlet_bc, *boundary); cout << " Solving..." << endl; solve ();